@enablerr-ui/detail 0.2.644 → 0.2.645

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","@enablerr-ui/auth","@enablerr-ui/task"],(function(e){"use strict";var t,n,i,o,r,l,s,a,c,d,u,m;return{setters:[function(e){t=e.Storage,n=e.Request,i=e.task_notification,o=e.currentRoles,r=e.TextArea,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){m=e.taskClipboard}],execute:function(){e("version","0.2.644");const f=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(" · "))),p=e=>{try{return new Date(e).toLocaleString()}catch{return e}},$=e=>e?"(ja)":"(nein)",h=(e,t)=>{const n={...t};return(e.display?.reduce(((t,i)=>{let[o,r]=i.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=>"boolean"==typeof n[e]?$(n[e]):f(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")},g=(e,t)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)??""}catch{return""}};function v(){}function y(e){return e()}function w(){return Object.create(null)}function b(e){e.forEach(y)}function x(e){return"function"==typeof e}function k(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function I(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return v;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){return null==e?"":e}function _(e,t){e.appendChild(t)}function C(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode.removeChild(e)}function q(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function N(e){return document.createElement(e)}function L(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function F(e){return document.createTextNode(e)}function E(){return F(" ")}function D(){return F("")}function z(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function T(e){return function(t){return t.preventDefault(),e.call(this,t)}}function A(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function B(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function V(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function O(e,t){e.value=null==t?"":t}function M(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function W(e,t,n){e.classList[n?"add":"remove"](t)}let R;function P(e){R=e}function H(){if(!R)throw new Error("Function called outside component initialization");return R}function Q(e){H().$$.on_mount.push(e)}function Y(e){H().$$.on_destroy.push(e)}function G(){const e=H();return(t,n)=>{const i=e.$$.callbacks[t];if(i){const o=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);i.slice().forEach((t=>{t.call(e,o)}))}}}function U(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const J=[],K=[],Z=[],X=[],ee=Promise.resolve();let te=!1;function ne(){te||(te=!0,ee.then(ae))}function ie(){return ne(),ee}function oe(e){Z.push(e)}function re(e){X.push(e)}let le=!1;const se=new Set;function ae(){if(!le){le=!0;do{for(let e=0;e<J.length;e+=1){const t=J[e];P(t),ce(t.$$)}for(P(null),J.length=0;K.length;)K.pop()();for(let e=0;e<Z.length;e+=1){const t=Z[e];se.has(t)||(se.add(t),t())}Z.length=0}while(J.length);for(;X.length;)X.pop()();te=!1,le=!1,se.clear()}}function ce(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(oe)}}const de=new Set;let ue;function me(){ue={r:0,c:[],p:ue}}function fe(){ue.r||b(ue.c),ue=ue.p}function pe(e,t){e&&e.i&&(de.delete(e),e.i(t))}function $e(e,t,n,i){if(e&&e.o){if(de.has(e))return;de.add(e),ue&&ue.c.push((()=>{de.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function he(e,t){const n=t.token={};function i(e,i,o,r){if(t.token!==n)return;t.resolved=r;let l=t.ctx;void 0!==o&&(l=l.slice(),l[o]=r);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==i&&e&&(me(),$e(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),fe())})):t.block.d(1),s.c(),pe(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[i]=s),a&&ae()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=H();if(e.then((e=>{P(n),i(t.then,1,t.value,e),P(null)}),(e=>{if(P(n),i(t.catch,2,t.error,e),P(null),!t.hasCatch)throw e})),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,e),!0;t.resolved=e}var o}function ge(e,t,n){const i=t.slice(),{resolved:o}=e;e.current===e.then&&(i[e.value]=o),e.current===e.catch&&(i[e.error]=o),e.block.p(i,n)}const ve="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ye(e,t){$e(e,1,1,(()=>{t.delete(e.key)}))}function we(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function be(e){e&&e.c()}function xe(e,t,n,i){const{fragment:o,on_mount:r,on_destroy:l,after_update:s}=e.$$;o&&o.m(t,n),i||oe((()=>{const t=r.map(y).filter(x);l?l.push(...t):b(t),e.$$.on_mount=[]})),s.forEach(oe)}function ke(e,t){const n=e.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ie(e,t,n,i,o,r,l=[-1]){const s=R;P(e);const a=e.$$={fragment:null,ctx:null,props:r,update:v,not_equal:o,bound:w(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:w(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...i)=>{const r=i.length?i[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]&&(J.push(e),ne(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,b(a.before_update),a.fragment=!!i&&i(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(j)}else a.fragment&&a.fragment.c();t.intro&&pe(e.$$.fragment),xe(e,t.target,t.anchor,t.customElement),ae()}P(s)}class Se{$destroy(){ke(this,1),this.$destroy=v}$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 _e(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("polyline"),o=L("line"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"points","8 12 12 16 16 12"),B(o,"x1","12"),B(o,"y1","8"),B(o,"x2","12"),B(o,"y2","16"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-arrow-down-circle "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-arrow-down-circle "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Ce(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class je extends Se{constructor(e){super(),Ie(this,e,Ce,_e,k,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),B(i,"points","22 4 12 14.01 9 11.01"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-check-circle "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-check-circle "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ne(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Le extends Se{constructor(e){super(),Ie(this,e,Ne,qe,k,{size:0,strokeWidth:1,class:2})}}function Fe(e){let t,n,i;return{c(){t=L("svg"),n=L("path"),B(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",i="feather feather-command "+e[2])},m(e,i){C(e,t,i),_(t,n)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-command "+e[2])&&B(t,"class",i)},i:v,o:v,d(e){e&&j(t)}}}function Ee(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class De extends Se{constructor(e){super(),Ie(this,e,Ee,Fe,k,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,i,o;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),B(n,"points","9 10 4 15 9 20"),B(i,"d","M20 4v7a4 4 0 0 1-4 4H4"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-corner-down-left "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-corner-down-left "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Te(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ae extends Se{constructor(e){super(),Ie(this,e,Te,ze,k,{size:0,strokeWidth:1,class:2})}}function Be(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("line"),o=L("line"),B(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),B(i,"x1","18"),B(i,"y1","9"),B(i,"x2","12"),B(i,"y2","15"),B(o,"x1","12"),B(o,"y1","9"),B(o,"x2","18"),B(o,"y2","15"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-delete "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Ve(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Oe extends Se{constructor(e){super(),Ie(this,e,Ve,Be,k,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),o=L("line"),B(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),B(i,"points","15 3 21 3 21 9"),B(o,"x1","10"),B(o,"y1","14"),B(o,"x2","21"),B(o,"y2","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-external-link "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-external-link "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function We(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Re extends Se{constructor(e){super(),Ie(this,e,We,Me,k,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("line"),o=L("path"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"x1","2"),B(i,"y1","12"),B(i,"x2","22"),B(i,"y2","12"),B(o,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-globe "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-globe "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function He(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Qe extends Se{constructor(e){super(),Ie(this,e,He,Pe,k,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,i,o,r,l,s,a;return{c(){t=L("svg"),n=L("line"),i=L("line"),o=L("line"),r=L("line"),l=L("line"),s=L("line"),B(n,"x1","8"),B(n,"y1","6"),B(n,"x2","21"),B(n,"y2","6"),B(i,"x1","8"),B(i,"y1","12"),B(i,"x2","21"),B(i,"y2","12"),B(o,"x1","8"),B(o,"y1","18"),B(o,"x2","21"),B(o,"y2","18"),B(r,"x1","3"),B(r,"y1","6"),B(r,"x2","3.01"),B(r,"y2","6"),B(l,"x1","3"),B(l,"y1","12"),B(l,"x2","3.01"),B(l,"y2","12"),B(s,"x1","3"),B(s,"y1","18"),B(s,"x2","3.01"),B(s,"y2","18"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",a="feather feather-list "+e[2])},m(e,a){C(e,t,a),_(t,n),_(t,i),_(t,o),_(t,r),_(t,l),_(t,s)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&a!==(a="feather feather-list "+e[2])&&B(t,"class",a)},i:v,o:v,d(e){e&&j(t)}}}function Ge(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ue extends Se{constructor(e){super(),Ie(this,e,Ge,Ye,k,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),B(i,"points","22,6 12,13 2,6"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-mail "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-mail "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ke(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ze extends Se{constructor(e){super(),Ie(this,e,Ke,Je,k,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("circle"),B(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),B(i,"cx","12"),B(i,"cy","10"),B(i,"r","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-map-pin "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-map-pin "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function et(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class tt extends Se{constructor(e){super(),Ie(this,e,et,Xe,k,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("line"),o=L("path"),B(n,"points","23 7 23 1 17 1"),B(i,"x1","16"),B(i,"y1","8"),B(i,"x2","23"),B(i,"y2","1"),B(o,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-phone-outgoing "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-phone-outgoing "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function it(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class ot extends Se{constructor(e){super(),Ie(this,e,it,nt,k,{size:0,strokeWidth:1,class:2})}}function rt(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),o=L("rect"),B(n,"points","6 9 6 2 18 2 18 9"),B(i,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),B(o,"x","6"),B(o,"y","14"),B(o,"width","12"),B(o,"height","8"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-printer "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-printer "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function lt(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class st extends Se{constructor(e){super(),Ie(this,e,lt,rt,k,{size:0,strokeWidth:1,class:2})}}function at(e){let t,n,i,o;return{c(){t=L("svg"),n=L("circle"),i=L("line"),B(n,"cx","11"),B(n,"cy","11"),B(n,"r","8"),B(i,"x1","21"),B(i,"y1","21"),B(i,"x2","16.65"),B(i,"y2","16.65"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-search "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-search "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function ct(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class dt extends Se{constructor(e){super(),Ie(this,e,ct,at,k,{size:0,strokeWidth:1,class:2})}}const{document:ut}=ve;function mt(e){e[45]=e[46].items}function ft(e,t,n){const i=e.slice();return i[47]=t[n],i[49]=n,i}function pt(e,t,n){const i=e.slice();return i[50]=t[n],i}function $t(e,t,n){const i=e.slice();return i[50]=t[n],i}function ht(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function gt(e){let t,n,i,o,r,l;mt(e);let s=e[5]?.length&&vt(e),a=e[45]?.length&&wt(e),c=e[5]?.length&&kt(e);return{c(){s&&s.c(),t=E(),n=N("div"),i=N("table"),a&&a.c(),o=E(),r=N("tbody"),c&&c.c(),B(i,"striped",""),B(i,"class","svelte-v0ogws"),B(n,"class","eList svelte-v0ogws")},m(e,d){s&&s.m(e,d),C(e,t,d),C(e,n,d),_(n,i),a&&a.m(i,null),_(i,o),_(i,r),c&&c.m(r,null),l=!0},p(e,n){mt(e),e[5]?.length?s?(s.p(e,n),32&n[0]&&pe(s,1)):(s=vt(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[45]?.length?a?a.p(e,n):(a=wt(e),a.c(),a.m(i,o)):a&&(a.d(1),a=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&pe(c,1)):(c=kt(e),c.c(),pe(c,1),c.m(r,null)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe())},i(e){l||(pe(s),pe(c),l=!0)},o(e){$e(s),$e(c),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),a&&a.d(),c&&c.d()}}}function vt(e){let t,n,i,o,r,l,s,a,c,d,u,m=e[6]&&yt(e);function f(t){e[29](t)}let p={id:e[10]};return void 0!==e[3]&&(p.value=e[3]),o=new e[8]({props:p}),K.push((()=>we(o,"value",f))),o.$on("input",e[14]),a=new Oe({props:{size:"18"}}),{c(){m&&m.c(),t=E(),n=N("div"),i=F("Suchen: "),be(o.$$.fragment),l=E(),s=N("span"),be(a.$$.fragment),B(s,"class","feather pointer svelte-v0ogws"),M(n,"margin-bottom","1em"),M(n,"position","relative")},m(r,f){m&&m.m(r,f),C(r,t,f),C(r,n,f),_(n,i),xe(o,n,null),_(n,l),_(n,s),xe(a,s,null),c=!0,d||(u=z(s,"click",e[16]),d=!0)},p(e,n){e[6]?m?64&n[0]&&pe(m,1):(m=yt(e),m.c(),pe(m,1),m.m(t.parentNode,t)):m&&(me(),$e(m,1,1,(()=>{m=null})),fe());const i={};!r&&8&n[0]&&(r=!0,i.value=e[3],re((()=>r=!1))),o.$set(i)},i(e){c||(pe(m),pe(o.$$.fragment,e),pe(a.$$.fragment,e),c=!0)},o(e){$e(m),$e(o.$$.fragment,e),$e(a.$$.fragment,e),c=!1},d(e){m&&m.d(e),e&&j(t),e&&j(n),ke(o),ke(a),d=!1,u()}}}function yt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function wt(e){let t,n,i,o=e[4]&&e[0]&&bt(),r=e[45],l=[];for(let t=0;t<r.length;t+=1)l[t]=xt($t(e,r,t));return{c(){t=N("thead"),n=N("tr"),o&&o.c(),i=E();for(let e=0;e<l.length;e+=1)l[e].c();B(n,"class","svelte-v0ogws"),B(t,"class","svelte-v0ogws")},m(e,r){C(e,t,r),_(t,n),o&&o.m(n,null),_(n,i);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=bt(),o.c(),o.m(n,i)):o&&(o.d(1),o=null),8196&t[0]){let i;for(r=e[45],i=0;i<r.length;i+=1){const o=$t(e,r,i);l[i]?l[i].p(o,t):(l[i]=xt(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),o&&o.d(),q(l,e)}}}function bt(e){let t;return{c(){t=N("th"),B(t,"class","svelte-v0ogws")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function xt(e){let t,n,i=e[50]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,t){4&t[0]&&i!==(i=e[50]?.designation+"")&&V(n,i)},d(e){e&&j(t)}}}function kt(e){let t,n,i=[],o=new Map,r=e[5];const l=e=>e[47]._id;for(let t=0;t<r.length;t+=1){let n=ft(e,r,t),s=l(n);o.set(s,i[t]=Ct(s,n))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,o){for(let t=0;t<i.length;t+=1)i[t].m(e,o);C(e,t,o),n=!0},p(e,n){178239&n[0]&&(r=e[5],me(),i=function(e,t,n,i,o,r,l,s,a,c,d,u){let m=e.length,f=r.length,p=m;const $={};for(;p--;)$[e[p].key]=p;const h=[],g=new Map,v=new Map;for(p=f;p--;){const e=u(o,r,p),s=n(e);let a=l.get(s);a?i&&a.p(e,t):(a=c(s,e),a.c()),g.set(s,h[p]=a),s in $&&v.set(s,Math.abs(p-$[s]))}const y=new Set,w=new Set;function b(e){pe(e,1),e.m(s,d),l.set(e.key,e),d=e.first,f--}for(;m&&f;){const t=h[f-1],n=e[m-1],i=t.key,o=n.key;t===n?(d=t.first,m--,f--):g.has(o)?!l.has(i)||y.has(i)?b(t):w.has(o)?m--:v.get(i)>v.get(o)?(w.add(i),b(t)):(y.add(o),m--):(a(n,l),m--)}for(;m--;){const t=e[m];g.has(t.key)||a(t,l)}for(;f;)b(h[f-1]);return h}(i,n,l,1,e,r,o,t.parentNode,ye,Ct,t,ft),fe())},i(e){if(!n){for(let e=0;e<r.length;e+=1)pe(i[e]);n=!0}},o(e){for(let e=0;e<i.length;e+=1)$e(i[e]);n=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&j(t)}}}function It(e){let t,n,i,o,r,l,s=e[4]&&e[0]&&St(e),a=e[45],c=[];for(let t=0;t<a.length;t+=1)c[t]=_t(pt(e,a,t));return{c(){t=N("tr"),s&&s.c(),n=E();for(let e=0;e<c.length;e+=1)c[e].c();i=E(),B(t,"class","pointer svelte-v0ogws"),W(t,"active",e[47]._id===e[1])},m(a,d){C(a,t,d),s&&s.m(t,null),_(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);_(t,i),o=!0,r||(l=z(t,"click",A((function(){x(e[12](e[47],e[49]))&&e[12](e[47],e[49]).apply(this,arguments)}))),r=!0)},p(o,r){if((e=o)[4]&&e[0]?s?(s.p(e,r),17&r[0]&&pe(s,1)):(s=St(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),10276&r[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=pt(e,a,n);c[n]?c[n].p(o,r):(c[n]=_t(o),c[n].c(),c[n].m(t,i))}for(;n<c.length;n+=1)c[n].d(1);c.length=a.length}34&r[0]&&W(t,"active",e[47]._id===e[1])},i(e){o||(pe(s),o=!0)},o(e){$e(s),o=!1},d(e){e&&j(t),s&&s.d(),q(c,e),r=!1,l()}}}function St(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=N("td"),be(n.$$.fragment),B(t,"class","editRow svelte-v0ogws"),M(t,"color","#326173")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",A((function(){x(e[17](e[47]))&&e[17](e[47]).apply(this,arguments)}))),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function _t(e){let t,n,i,o=e[11](e[47],e[50])+"";return{c(){t=N("td"),n=F(o),B(t,"class",i=S(e[50].type)+" svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,r){36&r[0]&&o!==(o=e[11](e[47],e[50])+"")&&V(n,o),4&r[0]&&i!==(i=S(e[50].type)+" svelte-v0ogws")&&B(t,"class",i)},d(e){e&&j(t)}}}function Ct(e,t){let n,i,o,r=t[15](t[47],t[45],t[3]),l=r&&It(t);return{key:e,first:null,c(){n=D(),l&&l.c(),i=D(),this.first=n},m(e,t){C(e,n,t),l&&l.m(e,t),C(e,i,t),o=!0},p(e,n){t=e,44&n[0]&&(r=t[15](t[47],t[45],t[3])),r?l?(l.p(t,n),44&n[0]&&pe(l,1)):(l=It(t),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe())},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(n),l&&l.d(e),e&&j(i)}}}function jt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function qt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:jt,then:gt,catch:ht,value:46,blocks:[,,,]};return he(n=e[2]&&e[13](),o),{c(){t=D(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,4&i[0]&&n!==(n=e[2]&&e[13]())&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}const Nt=e("getDisplayItems",((e,t,n)=>{if(!e)return;let i=[];return e.forEach((e=>{if("_total"===e)return void i.push({name:"_total",designation:"Betrag",type:"number"});const[o,r]=e.split(".");let l=t.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));l&&(l={...l},l.name=`${o}_${r}`,n=n.map((e=>(e[o]&&(e[l.name]=e["_"+o]?e["_"+o][r]:e[o][r]),e)))),l||(l=t.items.find((e=>e.name===o))),i.find((e=>e?.name===o))||i.push(l)})),i.length?i:t.items}));function Lt(e,o,r){let l;let s=JSON.parse(t.getItem("Locale")).id;const a=G(),{Loading:d,TextField:m}=c,{currentTasks:p}=u;I(e,p,(e=>r(33,l=e)));let h,g,v,y,{inputList:w}=o,{eventId:b}=o,{prevEventId:x}=o,{className:k}=o,{rowId:S}=o,{filterForReady:_=!1}=o,{refStatus:C}=o,{showEdit:j=!1}=o,{praefix:q=""}=o,{selectionFields:N=!1}=o,{deList:L}=o,{stopAggregation:F=!1}=o,{inputSearch:E=""}=o,D=!0,z=E,T=k+Math.floor(9e3*Math.random()+1e3).toString()+"search",A=!1,B=!0;const V=(e,t)=>{if(!t)return;let n=e[t.name];if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&t.name.split("_").length>1){const[i,o]=t.name.split("_");try{n=e[i][0][o],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n=Number(n)?n.toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||0,maximumFractionDigits:t.decimals||0}):""),"number"===t.type?n:"boolean"==typeof n?$(n):f(e[`_${t.name}`]||n||"")},O=n.getSchemaByClass(k),M=async(e,t)=>{if(C)return r(18,C=[].concat(C)),e.filter((e=>!!C.find((t=>e._task.status===t))));if("Information"===t.state.task)return e;if(x){const t=await n.getEvent(x);if("report"===t?.output?.type)return e;if(t?.input?.class?.length&&t.input.class[0].name===k)return"Information"===t.state.task?e.filter((e=>"Closed"!==e._task.status)):e.filter((e=>"Ready"===e._task.status))}return e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status))},W=(e,t)=>{if(e){const n="string"==typeof e?e:Object.keys(e)[0],i=new Intl.Collator(s,{numeric:!0});return t.sort(((e,t)=>i.compare(e[n],t[n])))}return t},R=async e=>{let t,i=0;B=!1;const o=e=>new Promise((t=>setTimeout(t,e)));for(;i++<200&&!F&&!(t=await P(e));)await o(500);r(6,A=!1),F&&n.readTasksByAggregationId(e,!0),t&&(r(5,v=W(g.displaySort,t.data)),window.setTimeout((()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),B=!0}),100))},P=async e=>await n.readTasksByAggregationId(e),H=async(e,t,n,i)=>{const{value:o,refClass:r}=i,[l,s]=n.split("."),a=o?.get(q),c=a&&await va(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let i=e?.find((e=>e._id===n[t]))||{};i={...i};for(const e in i)n[e]&&(i[e]=n[e]);for(const e in n)n[e]&&(i[e]=n[e]);return ha(r+i._id.toString(),i),i})):e};Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(T)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await O;e.eventId===t.id&&(ya(t.class,e.eventId),r(2,D=!r(2,D=!1)))}));return e.$$set=e=>{"inputList"in e&&r(20,w=e.inputList),"eventId"in e&&r(21,b=e.eventId),"prevEventId"in e&&r(22,x=e.prevEventId),"className"in e&&r(23,k=e.className),"rowId"in e&&r(1,S=e.rowId),"filterForReady"in e&&r(24,_=e.filterForReady),"refStatus"in e&&r(18,C=e.refStatus),"showEdit"in e&&r(0,j=e.showEdit),"praefix"in e&&r(25,q=e.praefix),"selectionFields"in e&&r(26,N=e.selectionFields),"deList"in e&&r(27,L=e.deList),"stopAggregation"in e&&r(19,F=e.stopAggregation),"inputSearch"in e&&r(28,E=e.inputSearch)},[j,S,D,z,h,v,A,d,m,p,T,V,(e,t)=>n=>{r(19,F=!0);const i=B?e:y[t];a("choose",{row:i})},async()=>{g=await O,r(4,h=(e=>!l?.length||!!l.find((t=>t===e)))(g.id)),r(5,v=y=W(g.displaySort,w||await pa(g.class,g.id))),500===v?.length&&(r(6,A=!0),n.getTasksList(g.id,!1,!0).then((({aggregationId:e})=>R(e))));let e,t=!1,i="";const o=N&&N?.find((e=>g.class===e.refClass.split(":")[0])),s=o?.value?.get&&o.value.get(q);if(s){const[l,a]=o.refClass.split(":");g.class===l&&r(5,v=await H(v,l,a,o)),t=o.parentClass?.find((e=>"quantity"===e.name)),i=o.className,e=await n.getCountedSection(i,a.split(".")[0],s,l,"quantity")}r(0,j&&=!o),o||!_&&!C||r(5,v=await M(v,g));const{display:c}=g;let d=Nt(c,g,v);return!j&&t?(d=d.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),r(5,v=v.map((t=>{const n=e.find((e=>e._id===t._id));return n&&(t.ist=n.quantity.$numberDecimal),t}))),e.map((e=>{if(!v.find((t=>t._id===e._id))){const t=y.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,v.push(t)}})),a("init",v)):L&&r(5,v=v.filter((e=>!L.find((t=>t._id===e._id))))),{items:d}},({detail:{value:e}})=>{r(3,z=e)},(e,t,n)=>{if(!n)return!0;n=n.toLowerCase();let i=!1;for(const o of t){const t=V(e,o).toLowerCase();!i&&t.includes(n)&&(i=!0)}return i},()=>{r(3,z="")},e=>{window.open(`/task/${e._task.event}/${e._task._id}/task?view=standalone`,"_blank")},C,F,w,b,x,k,_,q,N,L,E,function(e){z=e,r(3,z)}]}class Ft extends Se{constructor(e){var t;super(),ut.getElementById("svelte-v0ogws-style")||((t=N("style")).id="svelte-v0ogws-style",t.textContent=".feather.svelte-v0ogws.svelte-v0ogws{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-v0ogws.svelte-v0ogws{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-v0ogws .editRow.svelte-v0ogws{width:1em}.eList.svelte-v0ogws table.svelte-v0ogws{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-v0ogws table thead.svelte-v0ogws{position:sticky;top:0;background:#326173;color:white}.eList.svelte-v0ogws table thead tr.svelte-v0ogws{height:2.3em}.eList.svelte-v0ogws table tbody tr.svelte-v0ogws{height:2.75em !important}th.svelte-v0ogws.svelte-v0ogws,td.svelte-v0ogws.svelte-v0ogws{padding-left:0.4em;padding-right:0.4em}td.number.svelte-v0ogws.svelte-v0ogws{text-align:end}tr.pointer.svelte-v0ogws.svelte-v0ogws:hover{background-color:#DAE1E5}tr.active.svelte-v0ogws.svelte-v0ogws{color:#326173;background-color:#fcebd5}",_(ut.head,t)),Ie(this,e,Lt,qt,k,{inputList:20,eventId:21,prevEventId:22,className:23,rowId:1,filterForReady:24,refStatus:18,showEdit:0,praefix:25,selectionFields:26,deList:27,stopAggregation:19,inputSearch:28},[-1,-1])}}function Et(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Dt(e){let t,n,i=e[41]&&zt(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[41]?i?(i.p(e,n),8&n[0]&&pe(i,1)):(i=zt(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function zt(e){let t,n;return t=new e[21]({props:{title:e[16]?"Auswahl":e[0],class:"eList "+(e[14]?"form":""),$$slots:{default:[Ht]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};65537&n[0]&&(i.title=e[16]?"Auswahl":e[0]),16384&n[0]&&(i.class="eList "+(e[14]?"form":"")),2097150&n[0]|2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Tt(e){let t,n;return t=new ba({props:{schema:e[2],recID:e[1],readonly:e[15]}}),t.$on("choose",(function(){x(e[30](e[41]))&&e[30](e[41]).apply(this,arguments)})),t.$on("back",e[27]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};4&i[0]&&(o.schema=e[2]),2&i[0]&&(o.recID=e[1]),32768&i[0]&&(o.readonly=e[15]),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function At(e){let t,n,i,o,r,l,s;t=new e[22]({props:{text:e[16]?"Zusätzliche Auswahl":""}});const a=[Vt,Bt],c=[];function d(e,t){return e[16]?0:1}return i=d(e),o=c[i]=a[i](e),l=new Ft({props:{inputSearch:e[12],eventId:e[2].id,className:e[2].class,prevEventId:e[11],filterForReady:e[4],refStatus:e[5],praefix:e[6],selectionFields:e[7],rowId:e[1],deList:e[9],stopAggregation:e[20],showEdit:e[8]}}),l.$on("edit",e[31]),l.$on("choose",e[34]),l.$on("init",e[32]),{c(){be(t.$$.fragment),n=E(),o.c(),r=E(),be(l.$$.fragment)},m(e,o){xe(t,e,o),C(e,n,o),c[i].m(e,o),C(e,r,o),xe(l,e,o),s=!0},p(e,n){const s={};65536&n[0]&&(s.text=e[16]?"Zusätzliche Auswahl":""),t.$set(s);let u=i;i=d(e),i===u?c[i].p(e,n):(me(),$e(c[u],1,1,(()=>{c[u]=null})),fe(),o=c[i],o?o.p(e,n):(o=c[i]=a[i](e),o.c()),pe(o,1),o.m(r.parentNode,r));const m={};4096&n[0]&&(m.inputSearch=e[12]),4&n[0]&&(m.eventId=e[2].id),4&n[0]&&(m.className=e[2].class),2048&n[0]&&(m.prevEventId=e[11]),16&n[0]&&(m.filterForReady=e[4]),32&n[0]&&(m.refStatus=e[5]),64&n[0]&&(m.praefix=e[6]),128&n[0]&&(m.selectionFields=e[7]),2&n[0]&&(m.rowId=e[1]),512&n[0]&&(m.deList=e[9]),1048576&n[0]&&(m.stopAggregation=e[20]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(pe(t.$$.fragment,e),pe(o),pe(l.$$.fragment,e),s=!0)},o(e){$e(t.$$.fragment,e),$e(o),$e(l.$$.fragment,e),s=!1},d(e){ke(t,e),e&&j(n),c[i].d(e),e&&j(r),ke(l,e)}}}function Bt(e){let t,n,i,o;n=new e[23]({props:{outline:!0,$$slots:{default:[Ot]},$$scope:{ctx:e}}}),n.$on("click",e[28]);let r=e[25]&&e[10]&&Mt(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),r&&r.c(),B(t,"class","form--buttons svelte-jb5mrh")},m(e,l){C(e,t,l),xe(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};2048&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[25]&&e[10]?r?(r.p(e,i),1024&i[0]&&pe(r,1)):(r=Mt(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),ke(n),r&&r.d()}}}function Vt(e){let t,n,i,o,r,l,s=e[19]&&Rt(e);return i=new e[23]({props:{outline:!0,$$slots:{default:[Pt]},$$scope:{ctx:e}}}),i.$on("click",e[28]),r=new e[22]({props:{text:"Liste aus "+e[13]}}),{c(){s&&s.c(),t=E(),n=N("div"),be(i.$$.fragment),o=E(),be(r.$$.fragment),B(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),C(e,t,a),C(e,n,a),xe(i,n,null),C(e,o,a),xe(r,e,a),l=!0},p(e,n){e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=Rt(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe());const o={};2048&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o);const l={};8192&n[0]&&(l.text="Liste aus "+e[13]),r.$set(l)},i(e){l||(pe(s),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),ke(i),e&&j(o),ke(r,e)}}}function Ot(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Mt(e){let t,n;return t=new e[23]({props:{filled:!0,$$slots:{default:[Wt]},$$scope:{ctx:e}}}),t.$on("click",e[29]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Wt(e){let t;return{c(){t=F("Neu")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Rt(e){let t,n;return t=new Zl({props:{item:e[17],record:{_id:"",[e[17].name]:""},noForm:"true",classId:"sel_"+e[17].name,eventId:e[18],required:!1,hidden:!1,readonly:!1,deList:e[19]}}),t.$on("notify",e[33]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};131072&n[0]&&(i.item=e[17]),131072&n[0]&&(i.record={_id:"",[e[17].name]:""}),131072&n[0]&&(i.classId="sel_"+e[17].name),262144&n[0]&&(i.eventId=e[18]),524288&n[0]&&(i.deList=e[19]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Pt(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ht(e){let t,n,i,o;const r=[At,Tt],l=[];function s(e,t){return e[41].length&&!e[14]?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Qt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Yt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Qt,then:Dt,catch:Et,value:41,blocks:[,,,]};return he(n=e[26](e[3]),o),{c(){t=D(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,8&i[0]&&n!==(n=e[26](e[3]))&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}function Gt(e,t,i){let o;const{Dialog:r,Divider:l,Button:s}=c,a=G(),{currentTasks:d}=u;I(e,d,(e=>i(37,o=e)));let{title:m}=t,{schema:f}=t,{recID:p}=t,{isOpening:$=!0}=t,{filterForReady:h=!1}=t,{refStatus:g}=t,{praefix:v=""}=t,{selectionFields:y=!1}=t,{showEdit:w=!0}=t,{deList:b}=t,{newAllowed:x=!0}=t,{prevEventId:k}=t,{inputSearch:S}=t,_=f.id;f.class;let C,j,q,N,L,F,E,D="",z=!1,T=!1;m??=f.identity.designation;const A=!o?.length||o.find((e=>e===_));return e.$$set=e=>{"title"in e&&i(0,m=e.title),"schema"in e&&i(2,f=e.schema),"recID"in e&&i(1,p=e.recID),"isOpening"in e&&i(3,$=e.isOpening),"filterForReady"in e&&i(4,h=e.filterForReady),"refStatus"in e&&i(5,g=e.refStatus),"praefix"in e&&i(6,v=e.praefix),"selectionFields"in e&&i(7,y=e.selectionFields),"showEdit"in e&&i(8,w=e.showEdit),"deList"in e&&i(9,b=e.deList),"newAllowed"in e&&i(10,x=e.newAllowed),"prevEventId"in e&&i(11,k=e.prevEventId),"inputSearch"in e&&i(12,S=e.inputSearch)},[m,p,f,$,h,g,v,y,w,b,x,k,S,D,z,C,q,L,F,E,T,r,l,s,d,A,async e=>{if(!e)return!1;const t=await pa(f.class,f.id);if(j=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),i(16,q=j?.value?.get&&j.value.get(v)),q){N=j.refClass;const[e,t]=N.split(":"),[o]=t.split(".");i(17,L=j.parentClass.find((t=>t.name===e)));const r=await n.getSchemaByClass(L.refClass);i(18,F=r.id),i(13,D=j.parentClass.find((e=>e.name===o)).designation)}return t},()=>{i(14,z=!1),p||a("back"),w||a("back")},()=>{i(20,T=!0),i(14,z=!1),a("back")},()=>{i(20,T=!0),i(1,p=!1),i(15,C=!1),i(14,z=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,i]=t.split(".");let o=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));if(o){e[`${n}_${i}`]=e[n][i]}})),a("choose",{row:e})},({detail:e})=>{i(15,C=!!e._task.visum||"Closed"===e._task.status),i(1,p=e._docId),i(14,z=!0)},({detail:e})=>{q&&i(19,E=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){U(e,t)}]}class Ut extends Se{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=N("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}",_(document.head,t)),Ie(this,e,Gt,Yt,k,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11,inputSearch:12},[-1,-1])}}const{document:Jt}=ve;function Kt(e){e[27]=e[29].list,e[28]=e[29].items}function Zt(e,t,n){const i=e.slice();return i[30]=t[n],i}function Xt(e,t,n){const i=e.slice();return i[33]=t[n],i}function en(e,t,n){const i=e.slice();return i[33]=t[n],i}function tn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function nn(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Kt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[on]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Oe({props:{size:"18"}});let b=e[28]?.length&&function(e){let t,n,i,o,r=e[28],l=[];for(let t=0;t<r.length;t+=1)l[t]=rn(en(e,r,t));return{c(){t=N("thead"),n=N("tr"),i=N("th"),o=E();for(let e=0;e<l.length;e+=1)l[e].c();B(i,"class","svelte-14hcfjl"),B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,r){C(e,t,r),_(t,n),_(n,i),_(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(r=e[28],i=0;i<r.length;i+=1){const o=en(e,r,i);l[i]?l[i].p(o,t):(l[i]=rn(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),q(l,e)}}}(e),x=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=an(Zt(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(44547&n[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const r=Zt(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=an(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),o=N("div"),r=F("Suchen: "),be(l.$$.fragment),a=E(),c=N("span"),be(d.$$.fragment),u=E(),m=N("div"),f=N("table"),b&&b.c(),p=E(),$=N("tbody"),x&&x.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),xe(n,t,null),C(s,i,y),C(s,o,y),_(o,r),xe(l,o,null),_(o,a),_(o,c),xe(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Kt(e);const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[28]?.length&&b.p(e,t),e[27]?.length&&x.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),pe(x),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),$e(x),h=!1},d(e){e&&j(t),ke(n),e&&j(i),e&&j(o),ke(l),ke(d),e&&j(u),e&&j(m),b&&b.d(),x&&x.d(),g=!1,v()}}}function on(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function rn(e){let t,n,i=e[33]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function ln(e){let t,n,i,o,r,l,s,a;i=new Re({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=sn(Xt(e,c,t));return{c(){t=N("tr"),n=N("td"),be(i.$$.fragment),o=E();for(let e=0;e<d.length;e+=1)d[e].c();r=E(),B(n,"class","editRow svelte-14hcfjl"),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[30]._id===e[0])},m(c,u){C(c,t,u),_(t,n),xe(i,n,null),_(t,o);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,r),l=!0,s||(a=z(n,"click",e[15](e[30])),s=!0)},p(n,i){if(e=n,3584&i[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const o=Xt(e,c,n);d[n]?d[n].p(o,i):(d[n]=sn(o),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&i[0]&&W(t,"active",e[30]._id===e[0])},i(e){l||(pe(i.$$.fragment,e),l=!0)},o(e){$e(i.$$.fragment,e),l=!1},d(e){e&&j(t),ke(i),q(d,e),s=!1,a()}}}function sn(e){let t,n,i,o,r=e[9](e[30],e[33])+"";return{c(){t=N("td"),n=F(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[30]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function an(e){let t,n,i=e[13](e[30],e[28],e[1]),o=i&&ln(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){2&n[0]&&(i=e[13](e[30],e[28],e[1])),i?o?(o.p(e,n),2&n[0]&&pe(o,1)):(o=ln(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function cn(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function dn(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:cn,then:nn,catch:tn,value:29,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function un(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[dn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};3&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function mn(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{classId:p}=t,{className:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,x="",k=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(h);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(k)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&ya(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(16,m=e.item),"classId"in e&&o(17,p=e.classId),"className"in e&&o(18,h=e.className),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(19,v=e.viewName),"viewValue"in e&&o(20,y=e.viewValue),"recordId"in e&&o(21,w=e.recordId),"filter"in e&&o(22,b=e.filter)},[g,x,r,l,s,a,d,u,k,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S;let t=[];if(m.lookup){const e="."+p+"#"+m.lookup,i=document.querySelector(e),o=i?.value||w;if(o){const e=await va(m.lookup,o);if(e){const i=e[m.name]?.map((e=>e[m.name]));i&&(t=await n.getSectionView(m.name,{_id:{$in:i}},!0))}}}else{const i="."+p+"#"+v.split(":")[0],o=document.querySelector(i);let r={[v]:o?.value||w};if(m.refItem){const e="."+p+"#"+m.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[m.refItem]:t.value},{[m.refItem]:{$exists:!0,$eq:""}}]};r={...r,...e}}}catch{}}r[v]&&(t=await n.getSectionView(e.class,r,!0)),b&&(t=t.filter((e=>e._id!=b)))}const i=e.display;return{list:t,items:Nt(i,e,t)}},({detail:{value:e}})=>{o(1,x=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,x="")},e=>async()=>{const t=await n.getTaskByDocId(e._id),i=`/task/${t.event}/${t._id}/task?view=standalone`;window.open(i)},m,p,h,v,y,w,b,()=>r("back"),function(e){x=e,o(1,x)}]}class fn extends Se{constructor(e){var t;super(),Jt.getElementById("svelte-14hcfjl-style")||((t=N("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Jt.head,t)),Ie(this,e,mn,un,k,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:pn}=ve;function $n(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function hn(e){let t,n,i=e[58]&&function(e){let t,n,i,o,l,s,a,c,d,u,m,f,p,$,h,g,v,y,w;function b(t){e[45](t)}function x(t){e[46](t)}let k={class:"full-width",id:e[28],rows:"1",required:e[1],disabled:e[3],placeholder:e[29],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[2]&&(k.value=e[2]);void 0!==e[23]&&(k.overwrite=e[23]);n=new r({props:k}),K.push((()=>we(n,"value",b))),K.push((()=>we(n,"overwrite",x))),n.$on("click",e[31]()),n.$on("onFocus",e[31](e[28]));const I=[vn,gn],q=[];function L(e,t){return!e[3]||e[14]?0:e[20]&&e[0]?1:-1}~(s=L(e))&&(a=q[s]=I[s](e));let F=(!e[3]||e[14]||e[15])&&yn(e);function T(t){e[47](t)}let A={class:"tModal",noClickaway:!0,$$slots:{default:[kn]},$$scope:{ctx:e}};void 0!==e[17]&&(A.open=e[17]);p=new e[25]({props:A}),K.push((()=>we(p,"open",T)));let V=e[18]&&In(e);return{c(){t=N("div"),be(n.$$.fragment),l=E(),a&&a.c(),c=E(),d=N("input"),m=E(),F&&F.c(),f=E(),be(p.$$.fragment),h=E(),V&&V.c(),g=D(),B(d,"class",u=S(e[7]||e[8])+" svelte-jox15l"),B(d,"id",e[5]),B(d,"name",e[5]),d.value=e[0],d.hidden=!0,M(t,"position","relative")},m(i,o){C(i,t,o),xe(n,t,null),_(t,l),~s&&q[s].m(t,null),_(t,c),_(t,d),_(t,m),F&&F.m(t,null),C(i,f,o),xe(p,i,o),C(i,h,o),V&&V.m(i,o),C(i,g,o),v=!0,y||(w=z(t,"keydown",e[32]),y=!0)},p(e,r){const l={};2&r[0]&&(l.required=e[1]),8&r[0]&&(l.disabled=e[3]),!i&&4&r[0]&&(i=!0,l.value=e[2],re((()=>i=!1))),!o&&8388608&r[0]&&(o=!0,l.overwrite=e[23],re((()=>o=!1))),n.$set(l);let m=s;s=L(e),s===m?~s&&q[s].p(e,r):(a&&(me(),$e(q[m],1,1,(()=>{q[m]=null})),fe()),~s?(a=q[s],a?a.p(e,r):(a=q[s]=I[s](e),a.c()),pe(a,1),a.m(t,c)):a=null),(!v||384&r[0]&&u!==(u=S(e[7]||e[8])+" svelte-jox15l"))&&B(d,"class",u),(!v||32&r[0])&&B(d,"id",e[5]),(!v||32&r[0])&&B(d,"name",e[5]),(!v||1&r[0]&&d.value!==e[0])&&(d.value=e[0]),!e[3]||e[14]||e[15]?F?(F.p(e,r),49160&r[0]&&pe(F,1)):(F=yn(e),F.c(),pe(F,1),F.m(t,null)):F&&(me(),$e(F,1,1,(()=>{F=null})),fe());const f={};6504273&r[0]|268435456&r[1]&&(f.$$scope={dirty:r,ctx:e}),!$&&131072&r[0]&&($=!0,f.open=e[17],re((()=>$=!1))),p.$set(f),e[18]?V?(V.p(e,r),262144&r[0]&&pe(V,1)):(V=In(e),V.c(),pe(V,1),V.m(g.parentNode,g)):V&&(me(),$e(V,1,1,(()=>{V=null})),fe())},i(e){v||(pe(n.$$.fragment,e),pe(a),pe(F),pe(p.$$.fragment,e),pe(V),v=!0)},o(e){$e(n.$$.fragment,e),$e(a),$e(F),$e(p.$$.fragment,e),$e(V),v=!1},d(e){e&&j(t),ke(n),~s&&q[s].d(),F&&F.d(),e&&j(f),ke(p,e),e&&j(h),V&&V.d(e),e&&j(g),y=!1,w()}}}(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[58]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function gn(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[37]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function vn(e){let t,n,i,o,r;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=[z(t,"click",e[31](!0)),z(t,"choose",e[34])],o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,b(r)}}}function yn(e){let t,n,i,o,r;return n=new Oe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-jox15l")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[36]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function wn(e){let t,n,i,o;const r=[xn,bn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function bn(e){let t,n;return t=new Ut({props:{title:e[6].designation,newAllowed:e[21],prevEventId:e[9],schema:e[16],recID:e[0],isOpening:e[17],filterForReady:e[22],refStatus:e[6].refStatus,selectionFields:e[12],deList:e[13],praefix:e[11],inputSearch:e[33]()}}),t.$on("choose",e[34]),t.$on("back",e[35]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.title=e[6].designation),2097152&n[0]&&(i.newAllowed=e[21]),512&n[0]&&(i.prevEventId=e[9]),65536&n[0]&&(i.schema=e[16]),1&n[0]&&(i.recID=e[0]),131072&n[0]&&(i.isOpening=e[17]),4194304&n[0]&&(i.filterForReady=e[22]),64&n[0]&&(i.refStatus=e[6].refStatus),4096&n[0]&&(i.selectionFields=e[12]),8192&n[0]&&(i.deList=e[13]),2048&n[0]&&(i.praefix=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function xn(e){let t,n;return t=new fn({props:{item:e[6],className:e[16].class,classId:e[8],rowId:e[0],recordId:e[10],viewName:e[4],viewValue:""}}),t.$on("choose",e[34]),t.$on("back",e[35]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.item=e[6]),65536&n[0]&&(i.className=e[16].class),256&n[0]&&(i.classId=e[8]),1&n[0]&&(i.rowId=e[0]),1024&n[0]&&(i.recordId=e[10]),16&n[0]&&(i.viewName=e[4]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function kn(e){let t,n,i=e[17]&&wn(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[17]?i?(i.p(e,n),131072&n[0]&&pe(i,1)):(i=wn(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function In(e){let t,n,i;function o(t){e[48](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[_n]},$$scope:{ctx:e}};return void 0!==e[18]&&(r.open=e[18]),t=new e[25]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};589825&i[0]|268435456&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&262144&i[0]&&(n=!0,o.open=e[18],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Sn(e){let t,n;return t=new ba({props:{schema:e[16],recID:e[0],readonly:!0}}),t.$on("back",e[35]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};65536&n[0]&&(i.schema=e[16]),1&n[0]&&(i.recID=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function _n(e){let t,n;return t=new e[24]({props:{title:e[19],$$slots:{default:[Sn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};524288&n[0]&&(i.title=e[19]),65537&n[0]|268435456&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Cn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function jn(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Cn,then:hn,catch:$n,value:58,blocks:[,,,]};return he(e[30](),i),{c(){t=D(),i.block.c()},m(e,o){C(e,t,o),i.block.m(e,i.anchor=o),i.mount=()=>t.parentNode,i.anchor=t,n=!0},p(t,n){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(e),i.token=null,i=null}}}function qn(e,t,i){let r,l,s;I(e,o,(e=>i(44,r=e)));const a=G(),{Dialog:d,Modal:m}=c,{currentTasks:f,loggedIn:p}=u;I(e,f,(e=>i(50,l=e))),I(e,p,(e=>i(51,s=e)));let{id:$}=t,{item:g}=t,{value:v=""}=t,{desc:y=""}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:x}=t,{recordId:k}=t,{withRefValue:S=!1}=t,{refValue:_=""}=t,{required:C}=t,{disabled:j}=t,{readonly:q}=t,{praefix:N}=t,{selectionFields:L}=t,{formnovalidate:F}=t,{selection:E}=t,{deList:D}=t,{isTemplate:z}=t,{noList:T=!1}=t,{multi:A=!1}=t;const B="comment_"+$;let V,O,M,W,R,P,H=!1,Q=!0,Y=!0,U=!0;q||=k&&g.asInput,j||=q,!E&&g.selection&&1===g.selection.split(":").length&&(E=g.selection);const J=q||j||g.lookup||E&&!g.constraint?"":"Suchbegriff ⏎",K=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},Z=e=>{e&&(i(2,y=h(M,e)),a("setRefDesc",y.split(" •")[0]),a("change",{value:v,description:y}),a("task",{row:e,eventId:M.id}))},X=()=>{i(17,H=!1),i(18,V=!1)};return e.$$set=e=>{"id"in e&&i(5,$=e.id),"item"in e&&i(6,g=e.item),"value"in e&&i(0,v=e.value),"desc"in e&&i(2,y=e.desc),"noForm"in e&&i(7,w=e.noForm),"classId"in e&&i(8,b=e.classId),"eventId"in e&&i(9,x=e.eventId),"recordId"in e&&i(10,k=e.recordId),"withRefValue"in e&&i(38,S=e.withRefValue),"refValue"in e&&i(39,_=e.refValue),"required"in e&&i(1,C=e.required),"disabled"in e&&i(3,j=e.disabled),"readonly"in e&&i(40,q=e.readonly),"praefix"in e&&i(11,N=e.praefix),"selectionFields"in e&&i(12,L=e.selectionFields),"formnovalidate"in e&&i(41,F=e.formnovalidate),"selection"in e&&i(4,E=e.selection),"deList"in e&&i(13,D=e.deList),"isTemplate"in e&&i(14,z=e.isTemplate),"noList"in e&&i(42,T=e.noList),"multi"in e&&i(15,A=e.multi)},e.$$.update=()=>{if(2&e.$$.dirty[0]|1024&e.$$.dirty[1]&&i(1,C=C&&!F),384&e.$$.dirty[1]&&S&&i(0,v=_),65601&e.$$.dirty[0]|2048&e.$$.dirty[1]&&v&&M&&Promise.resolve($a(g.refClass,M.id,v,!!g.lookup||T)).then(Z),65&e.$$.dirty[0]|12288&e.$$.dirty[1]&&v&&W&&g.name===W.input?.at(0)&&W.inputLookup?.length){const{domain:e}=W.inputLookup[0]||{};"user"===e&&(r.some((e=>W.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0))}65537&e.$$.dirty[0]&&!v&&M&&Z({})},[v,C,y,j,E,$,g,w,b,x,k,N,L,D,z,A,M,H,V,O,R,Q,Y,U,d,m,f,p,B,J,async()=>{try{const e=await n.getEvent(x);if(P="report"===e.output.type,i(22,Y=!g.asInput),i(21,Q=e.output?.class[0].name!==g.refClass),i(16,M=await n.getSchemaByClass(g.refClass)),K(M),i(20,R=(e=>!l?.length||!!l.find((t=>t===e)))(M.id)),i(43,W=await n.getSchema(x)),x&&k&&v&&!j&&W.input?.find((e=>e===g.refClass))&&i(3,j=!0),g.properties?.query?.lookup){const{domain:e,value:t}=g.properties.query.lookup;if("user"===e){const e=s.user,o={[t]:e},l=await n.getSectionView(g.refClass,o);if(l?.length){const[{_id:e}]=l;e&&(i(39,_=e),i(38,S=!0))}r.some((e=>M.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0)}}return i(19,O=M.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if(!0===e&&i(17,H=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(g.lookup||E&&!g.constraint||v)&&i(17,H=!0)},e=>{13==e.which&&(e.preventDefault(),i(17,H=!0))},()=>{if(v)return"";const e=document.getElementById(B);return e?.value||""},({detail:e})=>{i(0,v=e.row._id),X()},X,()=>{(P||R)&&(A?a("change",{value:v,delete:!0}):(i(0,v=""),i(2,y=""),i(23,U=!0),a("change",{value:v,description:y}),a("task",{row:{_task:{event:M.id,_id:!1}}})))},async()=>{if(!v)return;const e=await $a(g.refClass,M.id,v);if(!e._task)return;const t=e._task.task_id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},S,_,q,F,T,W,r,function(e){y=e,i(2,y)},function(e){U=e,i(23,U)},function(e){H=e,i(17,H)},function(e){V=e,i(18,V)}]}class Nn extends Se{constructor(e){var t;super(),pn.getElementById("svelte-jox15l-style")||((t=N("style")).id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",_(pn.head,t)),Ie(this,e,qn,jn,k,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:38,refValue:39,required:1,disabled:3,readonly:40,praefix:11,selectionFields:12,formnovalidate:41,selection:4,deList:13,isTemplate:14,noList:42,multi:15},[-1,-1])}}function Ln(e,t,n){const i=e.slice();return i[35]=t[n],i[37]=n,i}function Fn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function En(e){let t,n;return t=new e[16]({props:{outline:!0,$$slots:{default:[zn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8191&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Dn(e){let t,n;return t=new Nn({props:{classId:e[6],eventId:e[7],required:e[9],disabled:e[1],formnovalidate:e[12],readonly:e[10],id:e[2]+"."+e[37],item:e[3],desc:e[4],value:e[35],noForm:e[5],praefix:e[11],recordId:e[8],multi:!0}}),t.$on("change",e[23]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.classId=e[6]),128&n[0]&&(i.eventId=e[7]),512&n[0]&&(i.required=e[9]),2&n[0]&&(i.disabled=e[1]),4096&n[0]&&(i.formnovalidate=e[12]),1024&n[0]&&(i.readonly=e[10]),4&n[0]&&(i.id=e[2]+"."+e[37]),8&n[0]&&(i.item=e[3]),16&n[0]&&(i.desc=e[4]),1&n[0]&&(i.value=e[35]),32&n[0]&&(i.noForm=e[5]),2048&n[0]&&(i.praefix=e[11]),256&n[0]&&(i.recordId=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function zn(e){let t,n,i,o,r,l,s;n=new Ue({props:{size:"18"}});let a=e[0],c=[];for(let t=0;t<a.length;t+=1)c[t]=Dn(Ln(e,a,t));const d=e=>$e(c[e],1,1,(()=>{c[e]=null}));return{c(){t=N("span"),be(n.$$.fragment),i=E();for(let e=0;e<c.length;e+=1)c[e].c();o=D(),B(t,"class","feather pointer")},m(a,d){C(a,t,d),xe(n,t,null),C(a,i,d);for(let e=0;e<c.length;e+=1)c[e].m(a,d);C(a,o,d),r=!0,l||(s=z(t,"click",(function(){x(e[21](e[0]))&&e[21](e[0]).apply(this,arguments)})),l=!0)},p(t,n){if(e=t,8396799&n[0]){let t;for(a=e[0],t=0;t<a.length;t+=1){const i=Ln(e,a,t);c[t]?(c[t].p(i,n),pe(c[t],1)):(c[t]=Dn(i),c[t].c(),pe(c[t],1),c[t].m(o.parentNode,o))}for(me(),t=a.length;t<c.length;t+=1)d(t);fe()}},i(e){if(!r){pe(n.$$.fragment,e);for(let e=0;e<a.length;e+=1)pe(c[e]);r=!0}},o(e){$e(n.$$.fragment,e),c=c.filter(Boolean);for(let e=0;e<c.length;e+=1)$e(c[e]);r=!1},d(e){e&&j(t),ke(n),e&&j(i),q(c,e),e&&j(o),l=!1,s()}}}function Tn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function An(e){let t,n;return t=new e[18]({props:{title:e[14].designation,class:"eList",$$slots:{default:[Vn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};16384&n[0]&&(i.title=e[14].designation),49480&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bn(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Vn(e){let t,n,i,o,r;return n=new e[19]({props:{outline:!0,$$slots:{default:[Bn]},$$scope:{ctx:e}}}),n.$on("click",e[24]),o=new Ft({props:{item:e[3],className:e[14].class,classId:e[6],rowId:e[15],recordId:e[8]}}),o.$on("choose",e[22]),o.$on("back",e[24]),{c(){t=N("div"),be(n.$$.fragment),i=E(),be(o.$$.fragment),B(t,"class","form--buttons")},m(e,l){C(e,t,l),xe(n,t,null),C(e,i,l),xe(o,e,l),r=!0},p(e,t){const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const r={};8&t[0]&&(r.item=e[3]),16384&t[0]&&(r.className=e[14].class),64&t[0]&&(r.classId=e[6]),32768&t[0]&&(r.rowId=e[15]),256&t[0]&&(r.recordId=e[8]),o.$set(r)},i(e){r||(pe(n.$$.fragment,e),pe(o.$$.fragment,e),r=!0)},o(e){$e(n.$$.fragment,e),$e(o.$$.fragment,e),r=!1},d(e){e&&j(t),ke(n),e&&j(i),ke(o,e)}}}function On(e){let t,n,i=e[13]&&An(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[13]?i?(i.p(e,n),8192&n[0]&&pe(i,1)):(i=An(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Mn(e){let t,n,i,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Tn,then:En,catch:Fn,value:34,blocks:[,,,]};function l(t){e[32](t)}he(e[20](),r);let s={class:"tModal",noClickaway:!0,$$slots:{default:[On]},$$scope:{ctx:e}};return void 0!==e[13]&&(s.open=e[13]),n=new e[17]({props:s}),K.push((()=>we(n,"open",l))),{c(){r.block.c(),t=E(),be(n.$$.fragment)},m(e,i){r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,C(e,t,i),xe(n,e,i),o=!0},p(t,o){ge(r,e=t,o);const l={};57672&o[0]|128&o[1]&&(l.$$scope={dirty:o,ctx:e}),!i&&8192&o[0]&&(i=!0,l.open=e[13],re((()=>i=!1))),n.$set(l)},i(e){o||(pe(r.block),pe(n.$$.fragment,e),o=!0)},o(e){for(let e=0;e<3;e+=1){$e(r.blocks[e])}$e(n.$$.fragment,e),o=!1},d(e){r.block.d(e),r.token=null,r=null,e&&j(t),ke(n,e)}}}function Wn(e,t,i){const o=G(),{Card:r,Modal:l,Dialog:s,Button:a}=c;let d,u,{id:m}=t,{item:f}=t,{values:p=[]}=t,{desc:$=""}=t,{noForm:h=!1}=t,{classId:g}=t,{eventId:v}=t,{recordId:y}=t,{withRefValue:w=!1}=t,{refValue:b=""}=t,{required:x}=t,{disabled:k}=t,{readonly:I}=t,{praefix:S}=t,{selectionFields:_}=t,{formnovalidate:C}=t,{selection:j}=t,{deList:q}=t,{isTemplate:N}=t,{noList:L=!1}=t,F=!1;k=!0;const E=()=>{i(13,F=!1)};return e.$$set=e=>{"id"in e&&i(2,m=e.id),"item"in e&&i(3,f=e.item),"values"in e&&i(0,p=e.values),"desc"in e&&i(4,$=e.desc),"noForm"in e&&i(5,h=e.noForm),"classId"in e&&i(6,g=e.classId),"eventId"in e&&i(7,v=e.eventId),"recordId"in e&&i(8,y=e.recordId),"withRefValue"in e&&i(25,w=e.withRefValue),"refValue"in e&&i(26,b=e.refValue),"required"in e&&i(9,x=e.required),"disabled"in e&&i(1,k=e.disabled),"readonly"in e&&i(10,I=e.readonly),"praefix"in e&&i(11,S=e.praefix),"selectionFields"in e&&i(27,_=e.selectionFields),"formnovalidate"in e&&i(12,C=e.formnovalidate),"selection"in e&&i(28,j=e.selection),"deList"in e&&i(29,q=e.deList),"isTemplate"in e&&i(30,N=e.isTemplate),"noList"in e&&i(31,L=e.noList)},[p,k,m,f,$,h,g,v,y,x,I,S,C,F,d,u,r,l,s,a,async()=>{i(14,d=await n.getSchemaByClass(f.refClass))},e=>()=>{i(13,F=!0),i(15,u=e)},({detail:e})=>{const t=e.row._id;p.find((e=>e===t))||i(0,p=p.concat(e.row._id)),E()},({detail:e})=>{e.delete&&i(0,p=p.filter((t=>t!==e.value))),e.value=p,o("change",e)},E,w,b,_,j,q,N,L,function(e){F=e,i(13,F)}]}class Rn extends Se{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=N("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",_(document.head,t)),Ie(this,e,Wn,Mn,k,{id:2,item:3,values:0,desc:4,noForm:5,classId:6,eventId:7,recordId:8,withRefValue:25,refValue:26,required:9,disabled:1,readonly:10,praefix:11,selectionFields:27,formnovalidate:12,selection:28,deList:29,isTemplate:30,noList:31},[-1,-1])}}const Pn=/\d+/g,Hn=/%[HMSpPdmyY%]/g;function Qn(e,t,n){const i=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===e)return null;const r=t.split(Hn);let l=0,s=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,l))return n;if(l+=c.length,l===e.length){if(s!==t.length)return n;break}if("%"!==t[s+c.length])break;if(s+=c.length+1,"%"===t[s]){if("%"!==e[l])return n;l++}else if("p"===t[s].toLowerCase()){const t=e.substr(l,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{Pn.lastIndex=l;const r=Pn.exec(e);if(null==r)return n;switch(t[s]){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*i+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}l+=r[0].length}s++}return isNaN(a.valueOf())?n:a}function Yn(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Gn}=ve;function Un(e,t,n){const i=e.slice();return i[17]=t[n],i}function Jn(e,t,n){const i=e.slice();return i[20]=t[n],i}function Kn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Zn(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=ei(Jn(e,p,t));const h=e=>$e($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&ti(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[ii]},$$scope:{ctx:e}}}),a.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[oi]},$$scope:{ctx:e}}}),{c(){t=N("form"),n=N("input"),o=E();for(let e=0;e<$.length;e+=1)$[e].c();r=E(),g&&g.c(),l=E(),s=N("div"),be(a.$$.fragment),c=E(),be(d.$$.fragment),B(n,"class",S(e[6])+" svelte-1phofh5"),B(n,"name","_id"),B(n,"type","hidden"),n.value=i=e[1]._id||"",B(t,"class","fTask svelte-1phofh5"),B(t,"id",e[6]),B(s,"class","form--buttons svelte-1phofh5")},m(i,p){C(i,t,p),_(t,n),_(t,o);for(let e=0;e<$.length;e+=1)$[e].m(t,null);_(t,r),g&&g.m(t,null),C(i,l,p),C(i,s,p),xe(a,s,null),_(s,c),xe(d,s,null),u=!0,m||(f=[z(t,"keydown",e[8]),z(t,"submit",T(e[10]))],m=!0)},p(e,o){if((!u||2&o&&i!==(i=e[1]._id||""))&&(n.value=i),75&o){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const i=Jn(e,p,n);$[n]?($[n].p(i,o),pe($[n],1)):($[n]=ei(i),$[n].c(),pe($[n],1),$[n].m(t,r))}for(me(),n=p.length;n<$.length;n+=1)h(n);fe()}e[0].list?g?(g.p(e,o),1&o&&pe(g,1)):(g=ti(e),g.c(),pe(g,1),g.m(t,null)):g&&(me(),$e(g,1,1,(()=>{g=null})),fe());const l={};8388608&o&&(l.$$scope={dirty:o,ctx:e}),a.$set(l);const s={};4&o&&(s.disabled=e[2]),8388608&o&&(s.$$scope={dirty:o,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)pe($[e]);pe(g),pe(a.$$.fragment,e),pe(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)$e($[e]);$e(g),$e(a.$$.fragment,e),$e(d.$$.fragment,e),u=!1},d(e){e&&j(t),q($,e),g&&g.d(),e&&j(l),e&&j(s),ke(a),ke(d),m=!1,b(f)}}}function Xn(e){let t,n;return t=new Zl({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.item=e[20]),1&n&&(i.selection=e[20].selection),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),1&n&&(i.eventId=e[0].id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ei(e){let t,n,i=si(!0,e[20]),o=i&&Xn(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){1&n&&(i=si(!0,e[20])),i?o?(o.p(e,n),1&n&&pe(o,1)):(o=Xn(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function ti(e){let t,n,i=e[0].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=ni(Un(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(75&n){let l;for(i=e[0].list,l=0;l<i.length;l+=1){const r=Un(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ni(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function ni(e){let t,n,i,o;return t=new e[4]({props:{text:e[17].designation}}),i=new yi({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment)},m(e,r){xe(t,e,r),C(e,n,r),xe(i,e,r),o=!0},p(e,n){const o={};1&n&&(o.text=e[17].designation),t.$set(o);const r={};1&n&&(r.list=e[17]),1&n&&(r.eventId=e[0].id),1&n&&(r.schema=e[17].item),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){ke(t,e),e&&j(n),ke(i,e)}}}function ii(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function oi(e){let t;return{c(){t=F("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ri(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function li(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:ri,then:Zn,catch:Kn,value:16,blocks:[,,,]};return he(e[7](),o),{c(){t=E(),n=N("section"),o.block.c(),Gn.title="Vorgaben",B(n,"class","sTask svelte-1phofh5")},m(e,r){C(e,t,r),C(e,n,r),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,i=!0},p(t,[n]){ge(o,e=t,n)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),e&&j(n),o.block.d(),o.token=null,o=null}}}const si=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function ai(e,i,r){let a,d,u;I(e,s,(e=>r(11,d=e))),I(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(t.getItem("Locale"));let{schema:h}=i,{record:g}=i,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const w=()=>window.history.back(),b=(e,t,n=!1)=>{const i=t.id,o=e.find((e=>e.name===i));let r=t.value;if(!n&&o&&o.properties?.multi&&(r=g[i]),r&&o&&o.type.startsWith("date"))try{return Qn(r,"%d.%m.%Y").toISOString()}catch{return new Date(r).toISOString()}if(o&&"boolean"===o.type&&(r=!!t.checked),o&&"number"===o.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{r=Number(r.replace(e,".")).toString()}catch{}}return r};return e.$$set=e=>{"schema"in e&&r(0,h=e.schema),"record"in e&&r(1,g=e.record)},e.$$.update=()=>{4&e.$$.dirty&&r(3,a=y)},[h,g,y,a,m,f,v,async()=>{const e=await n.getEvent(h.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&r(2,y=!0),d.role?.length&&h.authorization?.length){const e=h.authorization.some((e=>u?.find((t=>t===e.role&&"edit"===e.activity))));r(2,y||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},w,async e=>{const t={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const n=e.id||e.name;if(n)if(n.includes(".")){const[i,o]=n.split("."),r=h.list.find((e=>e.name===i));t[n]=b(r.item,e)}else t[n]=b(h.items,e)})),await n.saveTemplate(h.class,t),l.success("Die Vorgaben wurden gespeichert.",2e3),w()}]}const{document:ci}=ve;function di(e,t,n){const i=e.slice();return i[28]=t[n],i}function ui(e){let t,n;return t=new Zl({props:{classId:e[2],item:e[28],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4],required:e[5],currency:e[8]}}),t.$on("notify",e[14]),t.$on("defPrep",e[16]),t.$on("task",e[21]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),2&n[0]&&(i.item=e[28]),2&n[0]&&(i.listName=e[1].name),8&n[0]&&(i.eventId=e[3]),1&n[0]&&(i.record=e[0]),16&n[0]&&(i.disabled=e[4]),32&n[0]&&(i.required=e[5]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function mi(e){let t,n,i=si(e[7],e[28]),o=i&&ui(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){130&n[0]&&(i=si(e[7],e[28])),i?o?(o.p(e,n),130&n[0]&&pe(o,1)):(o=ui(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function fi(e){let t,n,i,o=e[1].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=mi(di(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));return{c(){t=N("div");for(let e=0;e<r.length;e+=1)r[e].c();B(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){C(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);i=!0},p(e,s){if(82367&s[0]){let n;for(o=e[1].item,n=0;n<o.length;n+=1){const i=di(e,o,n);r[n]?(r[n].p(i,s),pe(r[n],1)):(r[n]=mi(i),r[n].c(),pe(r[n],1),r[n].m(t,null))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}(!i||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&B(t,"id",n)},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);i=!1},d(e){e&&j(t),q(r,e)}}}function pi(e){let t,n,i=e[13](e[9])+"";return{c(){t=N("span"),n=F(i)},m(e,i){C(e,t,i),_(t,n)},p(e,t){512&t[0]&&i!==(i=e[13](e[9])+"")&&V(n,i)},d(e){e&&j(t)}}}function $i(e){let t,n,i;return n=new e[10]({props:{$$slots:{default:[pi]},$$scope:{ctx:e}}}),n.$on("click",(function(){x(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=N("div"),be(n.$$.fragment),B(t,"class","accordion svelte-148ktt9"),B(t,"slot","handle")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(t,i){e=t;const o={};512&i[0]|1&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function hi(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[$i,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[fi,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.open=e[6]),134218687&n[0]|1&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function gi(e){let t,n,i;return n=new e[11]({props:{$$slots:{default:[hi]},$$scope:{ctx:e}}}),{c(){t=N("div"),be(n.$$.fragment),B(t,"class","formList")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,t){const i={};1023&t[0]|1&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function vi(e,t,i){const{Button:o,Accordion:r,AccordionSection:l}=c;let{list:s}=t,{schema:a}=t,{record:d}=t,{classId:u}=t,{eventId:m}=t,{disabled:h}=t,{required:g}=t,{open:v=!1}=t,{template:y={}}=t,{isTemplate:w=!1}=t,{currency:b}=t,{update:x=!1}=t,k=new Map;const I={};let S=d[s.name]||{};d[s.name]=S;const _=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),C=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&i(1,s=e.list),"schema"in e&&i(18,a=e.schema),"record"in e&&i(0,d=e.record),"classId"in e&&i(2,u=e.classId),"eventId"in e&&i(3,m=e.eventId),"disabled"in e&&i(4,h=e.disabled),"required"in e&&i(5,g=e.required),"open"in e&&i(6,v=e.open),"template"in e&&i(19,y=e.template),"isTemplate"in e&&i(7,w=e.isTemplate),"currency"in e&&i(8,b=e.currency),"update"in e&&i(20,x=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&x&&d&&i(9,S=d[s.name]||{})},[d,s,u,m,h,g,v,w,b,S,o,r,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format&&"html"!==t.properties?.format)).map((t=>"object"===t.type?_(t.name):"boolean"===t.type?$(e[t.name]):"date"===t.type?f(e[t.name]):"datetime"===t.type?p(e[t.name]):e[t.name])).filter((e=>!!e)).join(" • ")||"+",({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;e.desc&&(I[n]=e.desc);const o=d[t];i(0,d[t]={...o,[n]:e.value},d),i(9,S=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&i(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,o=document.querySelector(n);ie().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(C)})).then((()=>o.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:t,value:i}})=>{if(k.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===className+"."+s.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&k.set(e,r[0])},()=>{setTimeout((()=>{Array.from(k).forEach((([e,t])=>{d[s.name][e]||i(0,d[s.name][e]=t._id,d)}))}),500)},a,y,x,function(t){U(e,t)}]}class yi extends Se{constructor(e){var t;super(),ci.getElementById("svelte-148ktt9-style")||((t=N("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}}",_(ci.head,t)),Ie(this,e,vi,gi,k,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:wi}=ve;function bi(e){e[0]=e[23].list,e[22]=e[23].items}function xi(e,t,n){const i=e.slice();return i[24]=t[n],i}function ki(e,t,n){const i=e.slice();return i[27]=t[n],i}function Ii(e,t,n){const i=e.slice();return i[27]=t[n],i}function Si(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function _i(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}bi(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Ci]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Oe({props:{size:"18"}});let b=e[22]?.length&&function(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=ji(Ii(e,i,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[22],r=0;r<i.length;r+=1){const l=Ii(e,i,r);o[r]?o[r].p(l,t):(o[r]=ji(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),q(o,e)}}}(e),x=e[0]?.length&&function(e){let t,n=e[0],i=[];for(let t=0;t<n.length;t+=1)i[t]=Li(xi(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11778&o[0]){let r;for(n=e[0],r=0;r<n.length;r+=1){const l=xi(e,n,r);i[r]?i[r].p(l,o):(i[r]=Li(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){q(i,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),o=N("div"),r=F("Suchen: "),be(l.$$.fragment),a=E(),c=N("span"),be(d.$$.fragment),u=E(),m=N("div"),f=N("table"),b&&b.c(),p=E(),$=N("tbody"),x&&x.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),xe(n,t,null),C(s,i,y),C(s,o,y),_(o,r),xe(l,o,null),_(o,a),_(o,c),xe(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){bi(e);const i={};2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[22]?.length&&b.p(e,t),e[0]?.length&&x.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),ke(n),e&&j(i),e&&j(o),ke(l),ke(d),e&&j(u),e&&j(m),b&&b.d(),x&&x.d(),g=!1,v()}}}function Ci(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ji(e){let t,n,i=e[27]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function qi(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=Ni(ki(e,i,t));return{c(){t=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=E(),B(t,"class","pointer svelte-14hcfjl")},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[22],l=0;l<i.length;l+=1){const s=ki(e,i,l);o[l]?o[l].p(s,r):(o[l]=Ni(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}},d(e){e&&j(t),q(o,e)}}}function Ni(e){let t,n,i,o,r=e[9](e[24],e[27])+"";return{c(){t=N("td"),n=F(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[24]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function Li(e){let t,n=e[13](e[24],e[22],e[1]),i=n&&qi(e);return{c(){i&&i.c(),t=D()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[24],e[22],e[1])),n?i?i.p(e,o):(i=qi(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function Fi(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ei(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Fi,then:_i,catch:Si,value:23,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function Di(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Ei]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2&n[0]|2&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function zi(e,t,i){const o=G(),{Dialog:r,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=t,{className:m}=t,{classId:p}=t,{list:h}=t,g="",v=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},w=n.getSchemaByClass(m);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(v)?.focus()}),200)}));return e.$$set=e=>{"item"in e&&i(15,u=e.item),"className"in e&&i(16,m=e.className),"classId"in e&&i(17,p=e.classId),"list"in e&&i(0,h=e.list)},[h,g,o,r,l,s,a,d,v,y,e=>()=>o("choose",{row:e}),async()=>{const e=await w,t=e.display;let n=Nt(t,e,h);return{list:h,items:n}},({detail:{value:e}})=>{i(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(y(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,g="")},u,m,p,()=>o("back"),function(e){g=e,i(1,g)}]}class Ti extends Se{constructor(e){var t;super(),wi.getElementById("svelte-14hcfjl-style")||((t=N("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(wi.head,t)),Ie(this,e,zi,Di,k,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:Ai}=ve;function Bi(e,t,n){const i=e.slice();return i[11]=t[n],i}function Vi(e,t,n){const i=e.slice();return i[3]=t[n],i}function Oi(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Mi(e){let t,n,i,o=e[7].items,r=[];for(let t=0;t<o.length;t+=1)r[t]=Qi(Vi(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));let s=e[7].list&&Yi(e);return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=E(),s&&s.c(),n=D()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);C(e,t,o),s&&s.m(e,o),C(e,n,o),i=!0},p(e,i){if(5161959&i[0]){let n;for(o=e[7].items,n=0;n<o.length;n+=1){const l=Vi(e,o,n);r[n]?(r[n].p(l,i),pe(r[n],1)):(r[n]=Qi(l),r[n].c(),pe(r[n],1),r[n].m(t.parentNode,t))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}e[7].list?s?(s.p(e,i),128&i[0]&&pe(s,1)):(s=Yi(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);pe(s),i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);$e(s),i=!1},d(e){q(r,e),e&&j(t),s&&s.d(e),e&&j(n)}}}function Wi(e){let t,n,i,o;const r=[Pi,Ri],l=[];function s(e,t){return e[3].name!==e[14]||e[15]?"lookup"!==e[3].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=D()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function Ri(e){let t,n;return t=new Zl({props:{classId:e[8],item:e[3],record:e[6],disabled:e[3].name===e[14]&&e[15]||e[0],eventId:e[5],currency:e[2],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};256&n[0]&&(i.classId=e[8]),128&n[0]&&(i.item=e[3]),64&n[0]&&(i.record=e[6]),129&n[0]&&(i.disabled=e[3].name===e[14]&&e[15]||e[0]),32&n[0]&&(i.eventId=e[5]),4&n[0]&&(i.currency=e[2]),512&n[0]&&(i.changeValue=e[9]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Pi(e){let t,n,i,o;n=new Zl({props:{classId:e[8],item:e[3],record:e[6],disabled:e[0]||!!e[1],required:!0,eventId:e[5],currency:e[2],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]);let r=e[1]&&Hi(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),r&&r.c(),M(t,"padding-top",".25em"),M(t,"background-color","lightyellow"),M(t,"position","relative")},m(e,l){C(e,t,l),xe(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};256&i[0]&&(o.classId=e[8]),128&i[0]&&(o.item=e[3]),64&i[0]&&(o.record=e[6]),3&i[0]&&(o.disabled=e[0]||!!e[1]),32&i[0]&&(o.eventId=e[5]),4&i[0]&&(o.currency=e[2]),512&i[0]&&(o.changeValue=e[9]),n.$set(o),e[1]?r?(r.p(e,i),2&i[0]&&pe(r,1)):(r=Hi(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),ke(n),r&&r.d()}}}function Hi(e){let t,n,i,o,r;return n=new Oe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[22]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function Qi(e){let t,n,i="list"!==e[3].type&&Wi(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[3].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=Wi(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Yi(e){let t,n,i=e[7].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Ui(Bi(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(485&n[0]){let l;for(i=e[7].list,l=0;l<i.length;l+=1){const r=Bi(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Ui(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function Gi(e){let t,n,i,o;return t=new e[12]({props:{text:e[11].designation}}),i=new yi({props:{classId:e[8],list:e[11],eventId:e[5],schema:e[11].item,record:e[6],disabled:e[0],currency:e[2],update:!0}}),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment)},m(e,r){xe(t,e,r),C(e,n,r),xe(i,e,r),o=!0},p(e,n){const o={};128&n[0]&&(o.text=e[11].designation),t.$set(o);const r={};256&n[0]&&(r.classId=e[8]),128&n[0]&&(r.list=e[11]),32&n[0]&&(r.eventId=e[5]),128&n[0]&&(r.schema=e[11].item),64&n[0]&&(r.record=e[6]),1&n[0]&&(r.disabled=e[0]),4&n[0]&&(r.currency=e[2]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){ke(t,e),e&&j(n),ke(i,e)}}}function Ui(e){let t,n,i="array"!==e[11].type&&Gi(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"array"!==e[11].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=Gi(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Ji(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ki(e){let t,n;return t=new Ti({props:{item:e[3],className:e[4],classId:e[8],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8&n[0]&&(i.item=e[3]),16&n[0]&&(i.className=e[4]),256&n[0]&&(i.classId=e[8]),2048&n[0]&&(i.list=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Zi(e){let t,n,i=e[10]&&Ki(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[10]?i?(i.p(e,n),1024&n[0]&&pe(i,1)):(i=Ki(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Xi(e){let t,n,i,o,r,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Ji,then:Mi,catch:Oi,value:52,blocks:[,,,]};function a(t){e[28](t)}he(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Zi]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),o=new e[13]({props:c}),K.push((()=>we(o,"open",a))),{c(){s.block.c(),t=E(),be(n.$$.fragment),i=E(),be(o.$$.fragment)},m(e,r){s.block.m(e,s.anchor=r),s.mount=()=>t.parentNode,s.anchor=t,C(e,t,r),xe(n,e,r),C(e,i,r),xe(o,e,r),l=!0},p(t,n){ge(s,e=t,n);const i={};3352&n[0]|67108864&n[1]&&(i.$$scope={dirty:n,ctx:e}),!r&&1024&n[0]&&(r=!0,i.open=e[10],re((()=>r=!1))),o.$set(i)},i(e){l||(pe(s.block),pe(n.$$.fragment,e),pe(o.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){$e(s.blocks[e])}$e(n.$$.fragment,e),$e(o.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&j(t),ke(n,e),e&&j(i),ke(o,e)}}}function eo(e,t,i){const{Divider:o,FormField:r,Modal:l}=c,s=G();let a,d,u,m,f,{required:p}=t,{disabled:$}=t,{readonly:h}=t,{id:g}=t,{item:v}=t,{value:y}=t,{refValue:w}=t,{currency:b}=t,x={},k=[],I=[],S={},_=new Map,C=!1,j="";const q=v.checkOn,N=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");k.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))},F=()=>{a.items.filter((e=>e.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.lookup})})),a.items.filter((e=>e.properties?.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}))},E=async e=>{const t=k.filter((t=>t.refObj===e));if(t?.length){i(9,S={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:l}=e;if(!n)break;let s,a,c=!o&&x[n];const u=x[n];u&&o&&(c=(await va(n,u))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==l&&"readonly"!==l||(l="required"===l?l:"disabled",setTimeout((()=>{s=`#${d} .form-field.${t} .field textarea`,a=document.querySelector(s),a||(s=`#${d} .form-field.${t} .field input`,a=document.querySelector(s)),a&&c&&a.setAttribute(l,""),a&&!c&&a.removeAttribute(l)}),0)),"hidden"===l&&(s=`#${d} .form-field.${t}`,a=document.querySelector(s),a?.classList?.toggle("hidden",!!c),c&&i(9,S[t]="",S))}}};Q((()=>{D()}));const D=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(d))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of k)e.add(t.refObj||u);Array.from(e).forEach((e=>E(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(_).forEach((([e,t])=>{x[e]||i(6,x[e]=t._id,x)}))}),250)},T=async e=>{if(!e.value)return void B();const t={[e.itemName]:{$regex:`(?i)${e.value}`}},o=await n.getSectionView(u,t);o?.length?(i(11,j=o),i(10,C=!0)):(i(1,y=""),i(23,w=""),s("setRefValue",w))},A=()=>{i(10,C=!1)},B=()=>{i(1,y=""),i(23,w=y),i(6,x={}),s("setRefValue",w)};return e.$$set=e=>{"required"in e&&i(24,p=e.required),"disabled"in e&&i(0,$=e.disabled),"readonly"in e&&i(25,h=e.readonly),"id"in e&&i(26,g=e.id),"item"in e&&i(3,v=e.item),"value"in e&&i(1,y=e.value),"refValue"in e&&i(23,w=e.refValue),"currency"in e&&i(2,b=e.currency)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&i(0,$=$||h),134217840&e.$$.dirty[0]&&x&&s("safeReference",{record:x,class:u,event:m,taskId:f})},[$,y,b,v,u,m,x,a,d,S,C,j,o,l,q,N,async()=>{try{if(y){const e=await n.getTask(v.refClass,y);delete e._task,i(6,x=e),i(27,f=(await n.getTaskByDocId(e._id))._id)}else i(6,x={})}catch{}return i(7,a=await n.getSchemaByClass(v.refClass)),i(8,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),i(4,u=a.class),a.identity.designation,i(5,m=a.id),["readonly","hidden","required"].map(L),F(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(i(6,x[t]=n,x),t===q)return T(e);E(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:t,lookup:o,view:r}=e,[l]=o.split(":"),s=(await n.getSectionView(l,{[r]:{$in:t}})).map((e=>e._id));for(const e of a.input.slice(1)){i(6,x[e]=[],x);const t=await n.getSchemaByClass(e);t.id;let o=await n.getTasks(t.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),o?.length){const t=o.map((e=>e._id)),r=await n.getSectionView(e,{_id:{$in:t}});for(const t of r)t[e]=t._id;i(6,x[e]=r,x)}}},async({detail:{className:e,itemName:t,value:i}})=>{if(_.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===u))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&_.set(e,r[0])},async({detail:e})=>{const t=await n.getSectionView(u,{_id:e.row._id});t?.length&&(i(1,y=t[0]._id),i(23,w=y),s("setRefValue",w),i(6,x=t[0])),A()},A,B,w,p,h,g,f,function(e){C=e,i(10,C)}]}class to extends Se{constructor(e){var t;super(),Ai.getElementById("svelte-16mo2c-style")||((t=N("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",_(Ai.head,t)),Ie(this,e,eo,Xi,k,{required:24,disabled:0,readonly:25,id:26,item:3,value:1,refValue:23,currency:2},[-1,-1])}}function no(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=N("span"),n=F(e[4]),B(t,"class","item")},m(e,i){C(e,t,i),_(t,n)},p(e,t){16&t[0]&&V(n,e[4])},d(e){e&&j(t)}}}(e);return{c(){n&&n.c(),t=D()},m(e,i){n&&n.m(e,i),C(e,t,i)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&j(t)}}}function io(e){let t,n,i;return n=new e[9]({props:{withItem:!0,itemLeft:!0,lang:e[10].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[8],step:e[12],pattern:e[6],placeholder:e[13],readonly:e[7],disabled:e[3],required:e[5],$$slots:{default:[no]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=N("div"),be(n.$$.fragment),M(t,"position","relative"),M(t,"max-width","10em")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,t){const i={};6&t[0]&&(i.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(i.id=e[0]),1&t[0]&&(i.name=e[0]),256&t[0]&&(i.value=e[8]),64&t[0]&&(i.pattern=e[6]),128&t[0]&&(i.readonly=e[7]),8&t[0]&&(i.disabled=e[3]),32&t[0]&&(i.required=e[5]),16&t[0]|2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function oo(e,n,i){let o;const r=G(),{TextField:l}=c;let{id:s}=n,{item:a}=n,{value:d}=n,{noForm:u=!1}=n,{classId:m}=n,{disabled:f}=n,{formnovalidate:p}=n,{currency:$}=n,{praefix:h}=n,{notifyList:g}=n;const v=JSON.parse(t.getItem("Locale")),y=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),w=Number("1.1").toLocaleString(v.id).substring(1,2),{properties:b={}}=a;let{min:x,max:k,step:I,pattern:S,decimals:_=0,unit:C="",placeholder:j,hint:q,readonly:N,negative:L,required:F=!1}=b;N=!0===N||void 0;S||(S=_?`[0-9]+([${w}][0-9]{1,${_}})?`:"[0-9]*"),L&&(S="-?"+S);return e.$$set=e=>{"id"in e&&i(0,s=e.id),"item"in e&&i(16,a=e.item),"value"in e&&i(17,d=e.value),"noForm"in e&&i(1,u=e.noForm),"classId"in e&&i(2,m=e.classId),"disabled"in e&&i(3,f=e.disabled),"formnovalidate"in e&&i(18,p=e.formnovalidate),"currency"in e&&i(4,$=e.currency),"praefix"in e&&i(19,h=e.praefix),"notifyList"in e&&i(20,g=e.notifyList)},e.$$.update=()=>{262176&e.$$.dirty[0]&&i(5,F=F&&!p),131072&e.$$.dirty[0]&&i(8,o=Number(d.toString().replace(w,".")).toFixed(_).toString().replace(".",w)),1048576&e.$$.dirty[0]&&(async e=>{if(void 0===h)return;const t=a.properties?.value?.formula;"$multiply"===t?.operator&&r("formula",{item:a})})()},[s,u,m,f,$,F,S,N,o,l,v,y,I,j,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{N||Number(d.toString().replace(w,"."))||i(8,o="")},a,d,p,h,g]}class ro extends Se{constructor(e){super(),Ie(this,e,oo,io,k,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4,praefix:19,notifyList:20},[-1,-1])}}const{document:lo}=ve;function so(e){e[33]=e[35].list,e[34]=e[35].items}function ao(e,t,n){const i=e.slice();return i[36]=t[n],i[38]=n,i}function co(e,t,n){const i=e.slice();return i[39]=t[n],i[41]=n,i}function uo(e,t,n){const i=e.slice();return i[39]=t[n],i}function mo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function fo(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v,y;so(e),n=new e[8]({props:{outline:!0,$$slots:{default:[po]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let w=!e[1]&&$o(e);function b(t){e[31](t)}let x={id:e[11]};void 0!==e[2]&&(x.value=e[2]),s=new e[6]({props:x}),K.push((()=>we(s,"value",b))),s.$on("input",e[14]),u=new Oe({props:{size:"18"}});let k=e[34]?.length&&function(e){let t,n,i,o,r=!e[1]&&go(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=vo(uo(e,l,t));return{c(){t=N("thead"),n=N("tr"),r&&r.c(),i=E();for(let e=0;e<s.length;e+=1)s[e].c();B(n,"class","svelte-1m010ne"),B(t,"class","svelte-1m010ne")},m(e,l){C(e,t,l),_(t,n),r&&r.m(n,null),_(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null);o=!0},p(e,t){if(e[1]?r&&(me(),$e(r,1,1,(()=>{r=null})),fe()):r?(r.p(e,t),2&t[0]&&pe(r,1)):(r=go(e),r.c(),pe(r,1),r.m(n,i)),8192&t[0]){let i;for(l=e[34],i=0;i<l.length;i+=1){const o=uo(e,l,i);s[i]?s[i].p(o,t):(s[i]=vo(o),s[i].c(),s[i].m(n,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=l.length}},i(e){o||(pe(r),o=!0)},o(e){$e(r),o=!1},d(e){e&&j(t),r&&r.d(),q(s,e)}}}(e),I=e[33]?.length&&function(e){let t,n,i=e[33],o=[];for(let t=0;t<i.length;t+=1)o[t]=ko(ao(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(569359&n[0]){let l;for(i=e[33],l=0;l<i.length;l+=1){const r=ao(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ko(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),w&&w.c(),o=E(),r=N("div"),l=F("Suchen: "),be(s.$$.fragment),c=E(),d=N("span"),be(u.$$.fragment),m=E(),f=N("div"),p=N("table"),k&&k.c(),$=E(),h=N("tbody"),I&&I.c(),B(t,"class","form--buttons svelte-1m010ne"),B(d,"class","feather pointer svelte-1m010ne"),M(r,"margin-bottom","1em"),M(r,"position","relative"),B(p,"striped",""),B(p,"class","svelte-1m010ne"),B(f,"class","eList svelte-1m010ne")},m(a,b){C(a,t,b),xe(n,t,null),_(t,i),w&&w.m(t,null),C(a,o,b),C(a,r,b),_(r,l),xe(s,r,null),_(r,c),_(r,d),xe(u,d,null),C(a,m,b),C(a,f,b),_(f,p),k&&k.m(p,null),_(p,$),_(p,h),I&&I.m(h,null),g=!0,v||(y=z(d,"click",e[16]),v=!0)},p(e,i){so(e);const o={};8192&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[1]?w&&(me(),$e(w,1,1,(()=>{w=null})),fe()):w?(w.p(e,i),2&i[0]&&pe(w,1)):(w=$o(e),w.c(),pe(w,1),w.m(t,null));const r={};!a&&4&i[0]&&(a=!0,r.value=e[2],re((()=>a=!1))),s.$set(r),e[34]?.length&&k.p(e,i),e[33]?.length&&I.p(e,i)},i(e){g||(pe(n.$$.fragment,e),pe(w),pe(s.$$.fragment,e),pe(u.$$.fragment,e),pe(k),pe(I),g=!0)},o(e){$e(n.$$.fragment,e),$e(w),$e(s.$$.fragment,e),$e(u.$$.fragment,e),$e(k),$e(I),g=!1},d(e){e&&j(t),ke(n),w&&w.d(),e&&j(o),e&&j(r),ke(s),ke(u),e&&j(m),e&&j(f),k&&k.d(),I&&I.d(),v=!1,y()}}}function po(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function $o(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[ho]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ho(e){let t;return{c(){t=F("Bestätigen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function go(e){let t,n,i,o,r;return n=new Le({props:{size:"20"}}),{c(){t=N("th"),be(n.$$.fragment),B(t,"class","svelte-1m010ne")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[18](e[33])),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function vo(e){let t,n,i=e[39]+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function yo(e){let t,n,i,o,r,l,s,a=e[0],c=bo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=xo(co(e,d,t));return{c(){t=N("tr"),c.c(),n=E();for(let e=0;e<u.length;e+=1)u[e].c();i=E(),B(t,"style",o=e[1]?"cursor: default;":"cursor: zoom-in;"),B(t,"title","übernimmt den Wert direkt"),B(t,"class","svelte-1m010ne"),W(t,"active",e[0].includes(e[36]))},m(o,a){C(o,t,a),c.m(t,null),_(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);_(t,i),r=!0,l||(s=z(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&k(a,a=e[0])?(me(),$e(c,1,1,v),fe(),c=bo(e),c.c(),pe(c),c.m(t,n)):c.p(e,s),8200&s[0]){let n;for(d=e[34],n=0;n<d.length;n+=1){const o=co(e,d,n);u[n]?u[n].p(o,s):(u[n]=xo(o),u[n].c(),u[n].m(t,i))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!r||2&s[0]&&o!==(o=e[1]?"cursor: default;":"cursor: zoom-in;"))&&B(t,"style",o),8193&s[0]&&W(t,"active",e[0].includes(e[36]))},i(e){r||(pe(c),r=!0)},o(e){$e(c),r=!1},d(e){e&&j(t),c.d(e),q(u,e),l=!1,s()}}}function wo(e){let t,n,i;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=N("td"),be(n.$$.fragment),B(t,"title","Wählt den Wert aus"),B(t,"class","svelte-1m010ne")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,t){const i={};1&t[0]&&(i.checked=e[0].includes(e[36])),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function bo(e){let t,n,i=!e[1]&&wo(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[1]?i&&(me(),$e(i,1,1,(()=>{i=null})),fe()):i?(i.p(e,n),2&n[0]&&pe(i,1)):(i=wo(e),i.c(),pe(i,1),i.m(t.parentNode,t))},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function xo(e){let t,n,i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=N("td"),n=F(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p(e,t){8&t[0]&&i!==(i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&V(n,i)},d(e){e&&j(t)}}}function ko(e){let t,n,i=e[15](e[36],e[2]),o=i&&yo(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){4&n[0]&&(i=e[15](e[36],e[2])),i?o?(o.p(e,n),4&n[0]&&pe(o,1)):(o=yo(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function Io(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function So(e){let t,n,i,o;t=new e[9]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Io,then:fo,catch:mo,value:35,blocks:[,,,]};return he(e[13](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function _o(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[So]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};15&n[0]|8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Co(e,t,i){const o=G(),{Loading:r,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=t,{id:f}=t,{selection:p}=t,{refDoc:$}=t,{tableName:h}=t,{idName:g}=t,{target:v}=t,{view:y}=t,{unique:w}=t,{uniqueView:b}=t,{status:x}=t,{single:k}=t;p||=[];let I="",S=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",_=[];const C=h+g+v+"checkbox",j=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&i(21,m=e.classId),"id"in e&&i(22,f=e.id),"selection"in e&&i(0,p=e.selection),"refDoc"in e&&i(23,$=e.refDoc),"tableName"in e&&i(24,h=e.tableName),"idName"in e&&i(25,g=e.idName),"target"in e&&i(20,v=e.target),"view"in e&&i(26,y=e.view),"unique"in e&&i(27,w=e.unique),"uniqueView"in e&&i(28,b=e.uniqueView),"status"in e&&i(29,x=e.status),"single"in e&&i(1,k=e.single)},[p,k,I,_,o,r,l,s,a,d,u,S,C,async()=>{let e=[],t=[],o={};if(i(3,_=[]),g)if(y){if(f){const t=m.split("-")[1].slice(0,-4),i="input."+m+"[name='_id']",r=document.querySelector(i).value;o={[g]:f},x&&(o.$or=[{status:!0},{[t]:r}]),e=await n.getSectionView(h,o),e=e.sort(((e,n)=>{const i=e=>(e[t]||"z").toString()+e[v];return j(i(e),i(n))}))}}else b?f&&(o={[g]:f,status:!0},Object.entries(b).map((([e,n])=>{n?.length&&(o[e]={$in:n}),t.push(e)})),e=await n.getSectionView(h,o),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})),i(3,_=e.map((e=>{const n=[e[v]];return t.map((t=>n.push(e[t]))),n})))):w?(e=await n.getSection(h,g,f,w),e=e.sort(((e,t)=>j(e,t)))):(e=await n.getSection(h,g,f,!1,x),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})));else o={},f&&!Array.isArray(f)&&(o._id=f),e=await n.getSectionView(h,o);const r=await n.getSchemaByClass(h),l=[];if($){const t=r.items[0].name,n=r.items[1].name,o=r.list[0].name,l=e.find((e=>e[t]===$));e=l?l[o]:[],i(20,v=n)}e.map((e=>{let t=e[v];if(t||h!==v||(i(20,v=r.items[0].name),t=e[v]),Array.isArray(t))for(const e of t){let t=e;"string"!=typeof e&&(t=Array.from(Object.values(e)).filter((e=>!!e&&24!==e?.length)).join(", ")),l.push(t||[])}else l.push(t||[])}));const s=r.items.find((e=>e.name===v))?.designation;return t=t.map((e=>r.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...t]}},({detail:{value:e}})=>{i(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{i(2,I="")},e=>()=>{const t=document.getElementsByName(C),n=[];t.forEach(((t,i)=>{t.checked&&n.push(e[+t.attributes.data.value])})),o("choose",{list:n})},e=>()=>{document.getElementsByName(C).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(k?o("choose",{list:[].concat(e)}):(i(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),o("choose",{list:p})))},v,m,f,$,h,g,y,w,b,x,()=>o("back"),function(e){I=e,i(2,I)}]}class jo extends Se{constructor(e){var t;super(),lo.getElementById("svelte-1m010ne-style")||((t=N("style")).id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",_(lo.head,t)),Ie(this,e,Co,_o,k,{classId:21,id:22,selection:0,refDoc:23,tableName:24,idName:25,target:20,view:26,unique:27,uniqueView:28,status:29,single:1},[-1,-1])}}const{document:qo}=ve;function No(e){let t,n,i,o,r,l=e[7].length+"";return{c(){t=N("span"),n=F("("),i=F(l),o=F(")"),B(t,"class",r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&V(i,l),2&n[0]&&r!==(r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&B(t,"class",r)},d(e){e&&j(t)}}}function Lo(e){let t;return{c(){t=N("div"),B(t,"class","load-more-options"),B(t,"slot","load-more-options-message")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Fo(e){let t,n,i,o;const r=[zo,Do,Eo],l=[];function s(e,t){return!e[16].single&&e[7]?.length?0:e[17]?1:e[14]&&e[16].view&&e[16].maxItem?2:-1}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=D()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function Eo(e){let t,n,i,o,r;return n=new je({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"title","Übernehmen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[26]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function Do(e){let t,n,i,o,r;return n=new De({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"title",e[17].title||"Generieren"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[25]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function zo(e){let t,n,i,o,r;return n=new Oe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"title","Löschen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[27]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function To(e){let t,n,i;function o(t){e[37](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[Ao]},$$scope:{ctx:e}};return void 0!==e[10]&&(r.open=e[10]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};53&i[0]|32768&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&1024&i[0]&&(n=!0,o.open=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Ao(e){let t,n;return t=new jo({props:{classId:e[2],selection:e[0],refDoc:e[19],view:e[15],status:e[18],unique:e[16].unique&&e[4].name,uniqueView:e[16].view&&{[e[16].view]:e[5][e[16].view]},id:e[5][e[21]||e[20]],tableName:e[20],idName:e[21],target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),1&n[0]&&(i.selection=e[0]),16&n[0]&&(i.unique=e[16].unique&&e[4].name),32&n[0]&&(i.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(i.id=e[5][e[21]||e[20]]),16&n[0]&&(i.target=e[4].name),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bo(e){let t,n,i,o,r,l,s,a,c,d=!e[16].single&&e[7]?.length&&No(e);function u(t){e[35](t)}function m(t){e[36](t)}let f={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:Vo,minSearchLength:"3",$$slots:{"load-more-options-message":[Lo]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),i=new e[12]({props:f}),K.push((()=>we(i,"selection",u))),K.push((()=>we(i,"maxOptions",m))),i.$on("change",e[22]);let p=!e[1]&&Fo(e),$=e[10]&&To(e);return{c(){t=N("div"),d&&d.c(),n=E(),be(i.$$.fragment),l=E(),p&&p.c(),s=E(),$&&$.c(),a=D(),M(t,"position","relative")},m(e,o){C(e,t,o),d&&d.m(t,null),_(t,n),xe(i,t,null),_(t,l),p&&p.m(t,null),C(e,s,o),$&&$.m(e,o),C(e,a,o),c=!0},p(e,l){!e[16].single&&e[7]?.length?d?d.p(e,l):(d=No(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const s={};8&l[0]&&(s.id=e[3]),8&l[0]&&(s.name=e[3]),8&l[0]&&(s.class=e[3]),2&l[0]&&(s.disabled=e[1]),64&l[0]&&(s.required=e[6]),256&l[0]&&(s.placeholder=e[8]),32768&l[1]&&(s.$$scope={dirty:l,ctx:e}),!o&&128&l[0]&&(o=!0,s.selection=e[7],re((()=>o=!1))),!r&&512&l[0]&&(r=!0,s.maxOptions=e[9],re((()=>r=!1))),i.$set(s),e[1]?p&&(me(),$e(p,1,1,(()=>{p=null})),fe()):p?(p.p(e,l),2&l[0]&&pe(p,1)):(p=Fo(e),p.c(),pe(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&pe($,1)):($=To(e),$.c(),pe($,1),$.m(a.parentNode,a)):$&&(me(),$e($,1,1,(()=>{$=null})),fe())},i(e){c||(pe(i.$$.fragment,e),pe(p),pe($),c=!0)},o(e){$e(i.$$.fragment,e),$e(p),$e($),c=!1},d(e){e&&j(t),d&&d.d(),ke(i),p&&p.d(),e&&j(s),$&&$.d(e),e&&j(a)}}}async function*Vo(e){yield[{name:e}]}function Oo(e,t,i){const o=G(),{Modal:r,Autocomplete:l}=c;let{classId:s}=t,{id:a}=t,{item:d}=t,{record:u}=t,{value:m}=t,{noForm:f=!1}=t,{disabled:p}=t,{formnovalidate:$}=t,{numberInput:h}=t,{praefix:g}=t,{toDelete:v}=t,{reqQuantity:y}=t,{notifyList:w}=t;const{properties:b={}}=d;let{placeholder:x,hint:k,readonly:I,required:S=!1,lookup:_="",view:C=!1,multi:j,max:q=1e3,generate:N=!1,status:L=!0,refDoc:F}=b;const[E,D]=_.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(x="");Q((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&_&&e.addEventListener("focus",A)}));const A=()=>{if(_){document.getElementById(a).blur();const e=y||q;(j.unique||T.length<e)&&i(10,z=!0)}},B=()=>{i(10,z&&=!1)},V=({detail:e})=>{i(7,T=e.list.map((e=>({name:e})))),o("blur",{value:e.list}),o("multi",{view:j.view,lookup:_,name:d.name,value:e.list}),B()},O=async()=>{const e={[D]:u[D]},t=await n.getSectionView(E,e),i=Array.from({length:t.length},((e,n)=>t[n][d.name]));V({detail:{list:i}})},M=(e=!1)=>{if(p||!j.required)return;const t=j.maxItem;if(!t||j.unique)return;i(9,q=!1!==e?e:y||u[t]||0);const n=T?.length!=q,r=document.getElementById(a);r?.classList?.toggle("invalid",n),o("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"item"in e&&i(4,d=e.item),"record"in e&&i(5,u=e.record),"value"in e&&i(0,m=e.value),"noForm"in e&&i(28,f=e.noForm),"disabled"in e&&i(1,p=e.disabled),"formnovalidate"in e&&i(29,$=e.formnovalidate),"numberInput"in e&&i(30,h=e.numberInput),"praefix"in e&&i(31,g=e.praefix),"toDelete"in e&&i(32,v=e.toDelete),"reqQuantity"in e&&i(33,y=e.reqQuantity),"notifyList"in e&&i(34,w=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&i(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&i(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&i(7,T=[]),128&e.$$.dirty[0]&&T&&(i(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:i}=e;void 0!==g&&g!==i||t&&t.name===j.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&i(6,S=S&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:t,value:r}=e||{};if(!r)return;if(d.refItem?.split(".")[0]!==t)return;let[l,s]=d.refItem.split(".");if(Array.isArray(r)){if(l=l.slice(0,-1),!r.length)return o("record",{itemName:"quantity",value:0}),void i(7,T=[]);const e={_id:{$in:r}},t=await n.getSectionView(l,e);let a=[];for(const e of t)e[s]&&(a=a.concat(e[s]));if(!a.length)return;const c=a[g][d.name];o("record",{itemName:"quantity",value:c?.length||0}),i(7,T=c&&c.map((e=>({name:e}))))}else{const e=await n.getTask(l,r);if(!e||!e[s])return;const t=e[s];if(!Array.isArray(t)&&!t.length)return;const a=t[g][d.name];o("record",{itemName:"quantity",value:a?.length||0}),i(7,T=a&&a.map((e=>({name:e}))))}setTimeout(M,250)})(w)},[m,p,s,a,d,u,S,T,x,q,z,r,l,I,_,C,j,N,L,F,E,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),i(7,T=t.map((e=>({name:e.trim()})))),o("blur",{value:T.map((e=>e.name))}),o("multi",{view:j.view,lookup:_,value:T.map((e=>e.name))})},B,V,()=>{const e=u[N.itemQuantity]||y;if(!e)return;const t=N.prefix||"",n=u[N.variable]||"",i=N.len||5,o=Array.from({length:e},((e,o)=>t+n+"-"+o.toString().padStart(i,"0")));V({detail:{list:o}})},async()=>{if(!0===C)return O();const e=y||u[j.maxItem];if(!e)return;let t={};D&&(t={[D]:u[D]}),L&&(t.status=!0);const i=[].concat(u[j.view]||[]);i.length&&(t[j.view]={$in:i});const o=await n.getSectionView(E,t),r=Array.from({length:e<o.length?e:o.length},((e,t)=>o[t][d.name]));V({detail:{list:r}})},()=>{V({detail:{list:[]}})},f,$,h,g,v,y,w,function(e){T=e,i(7,T),i(5,u),i(4,d),i(32,v)},function(e){q=e,i(9,q)},function(e){z=e,i(10,z)}]}class Mo extends Se{constructor(e){var t;super(),qo.getElementById("svelte-1rbaejz-style")||((t=N("style")).id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",_(qo.head,t)),Ie(this,e,Oo,Bo,k,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}const{document:Wo}=ve;function Ro(e){e[26]=e[28].list,e[27]=e[28].items}function Po(e,t,n){const i=e.slice();return i[29]=t[n],i}function Ho(e,t,n){const i=e.slice();return i[32]=t[n],i}function Qo(e,t,n){const i=e.slice();return i[32]=t[n],i}function Yo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Go(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}Ro(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Uo]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Oe({props:{size:"18"}});let b=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Jo(Qo(e,i,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[27],r=0;r<i.length;r+=1){const l=Qo(e,i,r);o[r]?o[r].p(l,t):(o[r]=Jo(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),q(o,e)}}}(e),x=e[26]?.length&&function(e){let t,n=e[26],i=[];for(let t=0;t<n.length;t+=1)i[t]=Xo(Po(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11779&o[0]){let r;for(n=e[26],r=0;r<n.length;r+=1){const l=Po(e,n,r);i[r]?i[r].p(l,o):(i[r]=Xo(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){q(i,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),o=N("div"),r=F("Suchen: "),be(l.$$.fragment),a=E(),c=N("span"),be(d.$$.fragment),u=E(),m=N("div"),f=N("table"),b&&b.c(),p=E(),$=N("tbody"),x&&x.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),xe(n,t,null),C(s,i,y),C(s,o,y),_(o,r),xe(l,o,null),_(o,a),_(o,c),xe(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Ro(e);const i={};64&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[27]?.length&&b.p(e,t),e[26]?.length&&x.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),ke(n),e&&j(i),e&&j(o),ke(l),ke(d),e&&j(u),e&&j(m),b&&b.d(),x&&x.d(),g=!1,v()}}}function Uo(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Jo(e){let t,n,i=e[32]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function Ko(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Zo(Ho(e,i,t));return{c(){t=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=E(),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[29]._id===e[0])},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const s=Ho(e,i,l);o[l]?o[l].p(s,r):(o[l]=Zo(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}2049&r[0]&&W(t,"active",e[29]._id===e[0])},d(e){e&&j(t),q(o,e)}}}function Zo(e){let t,n,i,o,r=e[9](e[29],e[32])+"";return{c(){t=N("td"),n=F(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[29]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function Xo(e){let t,n=e[13](e[29],e[27],e[1]),i=n&&Ko(e);return{c(){i&&i.c(),t=D()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[29],e[27],e[1])),n?i?i.p(e,o):(i=Ko(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function er(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function tr(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:er,then:Go,catch:Yo,value:28,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function nr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[tr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};3&n[0]|64&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ir(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{className:p}=t,{classId:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,x="",k=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(p);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(k)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&ya(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(15,m=e.item),"className"in e&&o(16,p=e.className),"classId"in e&&o(17,h=e.classId),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(18,v=e.viewName),"viewValue"in e&&o(19,y=e.viewValue),"recordId"in e&&o(20,w=e.recordId),"filter"in e&&o(21,b=e.filter)},[g,x,r,l,s,a,d,u,k,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S,t="."+h+"#"+v;document.querySelector(t);let i={[v]:y},o=[];i[v]&&(o=await n.getSectionView(e.class,i,!0)),b&&(o=o.filter((e=>e._id!=b)));const r=e.display;return{list:o,items:Nt(r,e,o)}},({detail:{value:e}})=>{o(1,x=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,x="")},m,p,h,v,y,w,b,()=>r("back"),function(e){x=e,o(1,x)}]}class or extends Se{constructor(e){var t;super(),Wo.getElementById("svelte-14hcfjl-style")||((t=N("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Wo.head,t)),Ie(this,e,ir,nr,k,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function rr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function lr(e){let t,n,i,o,r;function l(t){e[21](t)}let s={id:e[2],name:e[3].name,inputClass:e[5]||e[1],disabled:e[6],formnovalidate:e[7],readonly:e[13],pattern:e[12],required:e[14],style:"padding-left:2em;"};void 0!==e[0]&&(s.value=e[0]),n=new e[10]({props:s}),K.push((()=>we(n,"value",l)));let a=!e[6]&&sr(e);return{c(){t=N("div"),be(n.$$.fragment),o=E(),a&&a.c(),M(t,"position","relative")},m(e,i){C(e,t,i),xe(n,t,null),_(t,o),a&&a.m(t,null),r=!0},p(e,o){const r={};4&o&&(r.id=e[2]),8&o&&(r.name=e[3].name),34&o&&(r.inputClass=e[5]||e[1]),64&o&&(r.disabled=e[6]),128&o&&(r.formnovalidate=e[7]),!i&&1&o&&(i=!0,r.value=e[0],re((()=>i=!1))),n.$set(r),e[6]?a&&(me(),$e(a,1,1,(()=>{a=null})),fe()):a?(a.p(e,o),64&o&&pe(a,1)):(a=sr(e),a.c(),pe(a,1),a.m(t,null))},i(e){r||(pe(n.$$.fragment,e),pe(a),r=!0)},o(e){$e(n.$$.fragment,e),$e(a),r=!1},d(e){e&&j(t),ke(n),a&&a.d()}}}function sr(e){let t,n,i,o,r;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-wbrqzu")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[17]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function ar(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function cr(e){let t,n,i;function o(t){e[22](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[dr]},$$scope:{ctx:e}};return void 0!==e[8]&&(r.open=e[8]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};268435994&i&&(o.$$scope={dirty:i,ctx:e}),!n&&256&i&&(n=!0,o.open=e[8],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function dr(e){let t,n;return t=new or({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8&n&&(i.item=e[3]),8&n&&(i.className=e[3].refClass),2&n&&(i.classId=e[1]),16&n&&(i.recordId=e[4]._id),512&n&&(i.viewValue=e[9]),16&n&&(i.filter=e[4]._id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ur(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:ar,then:lr,catch:rr,value:27,blocks:[,,,]};he(e[16](),o);let r=e[8]&&cr(e);return{c(){o.block.c(),t=E(),r&&r.c(),n=D()},m(e,l){o.block.m(e,o.anchor=l),o.mount=()=>t.parentNode,o.anchor=t,C(e,t,l),r&&r.m(e,l),C(e,n,l),i=!0},p(t,[i]){ge(o,e=t,i),e[8]?r?(r.p(e,i),256&i&&pe(r,1)):(r=cr(e),r.c(),pe(r,1),r.m(n.parentNode,n)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){i||(pe(o.block),pe(r),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}$e(r),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&j(t),r&&r.d(e),e&&j(n)}}}function mr(e,t,n){const{TextField:i,Modal:o}=c;let{classId:r}=t,{id:l}=t,{item:s}=t,{record:a}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:m}=t,{formnovalidate:f}=t,{praefix:p}=t;const{properties:$={}}=s;let h,{pattern:g,placeholder:v,readonly:y,required:w=!1,view:b}=$,x=!1;const k=()=>{n(8,x=!1)};return e.$$set=e=>{"classId"in e&&n(1,r=e.classId),"id"in e&&n(2,l=e.id),"item"in e&&n(3,s=e.item),"record"in e&&n(4,a=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,m=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,p=e.praefix)},[d,r,l,s,a,u,m,f,x,h,i,o,g,y,w,b,async()=>(n(9,h=a[b.selection]),!0),()=>{n(8,x=!0)},({detail:e})=>{n(0,d=e.row[b.value?b.value:"_id"]),k()},k,p,function(e){d=e,n(0,d)},function(e){x=e,n(8,x)}]}class fr extends Se{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=N("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",_(document.head,t)),Ie(this,e,mr,ur,k,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function pr(e,t,n){const i=e.slice();return i[12]=t[n][0],i[13]=t[n][1],i}function $r(e){let t;return{c(){t=N("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function hr(e){let t;return{c(){t=N("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function gr(e){let t,n,i,o,r=e[12]+"";return{c(){t=N("option"),n=F(r),t.__value=i=e[13],t.value=t.__value,t.selected=o=e[0]==e[13]},m(e,i){C(e,t,i),_(t,n)},p(e,l){64&l&&r!==(r=e[12]+"")&&V(n,r),64&l&&i!==(i=e[13])&&(t.__value=i,t.value=t.__value),65&l&&o!==(o=e[0]==e[13])&&(t.selected=o)},d(e){e&&j(t)}}}function vr(e){let t,n,i,o,r,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?hr:$r}let i=n(e),o=i(e);return{c(){o.c(),t=D()},m(e,n){o.m(e,n),C(e,t,n)},p(e,r){i!==(i=n(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){o.d(e),e&&j(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=gr(pr(e,s,t));return{c(){t=N("select"),l&&l.c(),n=D();for(let e=0;e<a.length;e+=1)a[e].c();B(t,"class",i=S(e[3]||e[4])+" svelte-5xpzvo"),B(t,"id",e[2]),B(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(i,s){C(i,t,s),l&&l.m(t,null),_(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);o||(r=z(t,"change",e[9]),o=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let i;for(s=e[6],i=0;i<s.length;i+=1){const o=pr(e,s,i);a[i]?a[i].p(o,n):(a[i]=gr(o),a[i].c(),a[i].m(t,null))}for(;i<a.length;i+=1)a[i].d(1);a.length=s.length}24&n&&i!==(i=S(e[3]||e[4])+" svelte-5xpzvo")&&B(t,"class",i),4&n&&B(t,"id",e[2]),4&n&&B(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:v,o:v,d(e){e&&j(t),l&&l.d(),q(a,e),o=!1,r()}}}function yr(e,t,n){const i=G();let{id:o}=t,{item:r}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=r.properties;u&&(u=u.map((e=>[e,e]))),"valueAddedTax"===m&&(l||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!!f,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,o=e.id),"item"in e&&n(10,r=e.item),"value"in e&&n(0,l=e.value),"noForm"in e&&n(3,s=e.noForm),"classId"in e&&n(4,a=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[l,c,o,s,a,d,u,m,f,e=>i("blur",{value:e.srcElement.value}),r]}class wr extends Se{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=N("style")).id="svelte-5xpzvo-style",t.textContent="select.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:focus{border:none;border-bottom:2px solid #4300b0}",_(document.head,t)),Ie(this,e,yr,vr,k,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function br(e){let t;return{c(){t=F("Stunden")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function xr(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[br]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function kr(e){let t;return{c(){t=F("Minuten")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ir(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[kr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Sr(e){let t;return{c(){t=F("Jetzt")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function _r(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[Sr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Cr(e){let t,n,i,o,r,l,s,a,c;return o=new e[5]({props:{value:e[0],closeOnSelection:!0}}),o.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[_r],"minutes-label":[Ir],"hours-label":[xr]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=N("input"),i=E(),be(o.$$.fragment),r=E(),be(l.$$.fragment),B(t,"type","string"),B(t,"class",n=e[2]||e[3]),B(t,"id",e[1]),B(t,"name",e[1]),t.hidden=!0},m(n,d){C(n,t,d),O(t,e[0]),C(n,i,d),xe(o,n,d),C(n,r,d),xe(l,n,d),s=!0,a||(c=z(t,"input",e[9]),a=!0)},p(e,[i]){(!s||12&i&&n!==(n=e[2]||e[3]))&&B(t,"class",n),(!s||2&i)&&B(t,"id",e[1]),(!s||2&i)&&B(t,"name",e[1]),1&i&&O(t,e[0]);const r={};1&i&&(r.value=e[0]),o.$set(r);const a={};1&i&&(a.value=e[0]),4096&i&&(a.$$scope={dirty:i,ctx:e}),l.$set(a)},i(e){s||(pe(o.$$.fragment,e),pe(l.$$.fragment,e),s=!0)},o(e){$e(o.$$.fragment,e),$e(l.$$.fragment,e),s=!1},d(e){e&&j(t),e&&j(i),ke(o,e),e&&j(r),ke(l,e),a=!1,c()}}}function jr(e,t,n){const i=G(),{Label:o,DatePicker:r,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>i("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,s=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)},[s,a,d,u,o,r,l,({detail:e})=>{var t,i;n(0,(t=e.value,i=s,s=null==t||null==i?t:(i.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),i))),m(s)},({detail:e})=>{n(0,s=Yn(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class qr extends Se{constructor(e){super(),Ie(this,e,jr,Cr,k,{value:0,id:1,noForm:2,classId:3})}}function Nr(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],closeOnSelection:!0}}),u.$on("change",e[10]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[11]),{c(){t=N("input"),r=E(),l=N("input"),d=E(),be(u.$$.fragment),m=F(" /\n"),be(f.$$.fragment),B(t,"type","string"),B(t,"class",n=e[1]||e[2]),B(t,"id",i=e[0]+"_from"),B(t,"name",o=e[0]+"_from"),t.hidden=!0,B(l,"type","string"),B(l,"class",s=e[1]||e[2]),B(l,"id",a=e[0]+"_to"),B(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,i){C(n,t,i),O(t,e[7]),C(n,r,i),C(n,l,i),O(l,e[8]),C(n,d,i),xe(u,n,i),C(n,m,i),xe(f,n,i),p=!0,$||(h=[z(t,"input",e[13]),z(l,"input",e[14])],$=!0)},p(e,[r]){(!p||6&r&&n!==(n=e[1]||e[2]))&&B(t,"class",n),(!p||1&r&&i!==(i=e[0]+"_from"))&&B(t,"id",i),(!p||1&r&&o!==(o=e[0]+"_from"))&&B(t,"name",o),128&r&&O(t,e[7]),(!p||6&r&&s!==(s=e[1]||e[2]))&&B(l,"class",s),(!p||1&r&&a!==(a=e[0]+"_to"))&&B(l,"id",a),(!p||1&r&&c!==(c=e[0]+"_to"))&&B(l,"name",c),256&r&&O(l,e[8]);const d={};32&r&&(d.format=e[5]),8&r&&(d.required=e[3]),16&r&&(d.disabled=e[4]),128&r&&(d.value=e[7]),u.$set(d);const m={};64&r&&(m.format=e[6]),8&r&&(m.required=e[3]),16&r&&(m.disabled=e[4]),256&r&&(m.value=e[8]),f.$set(m)},i(e){p||(pe(u.$$.fragment,e),pe(f.$$.fragment,e),p=!0)},o(e){$e(u.$$.fragment,e),$e(f.$$.fragment,e),p=!1},d(e){e&&j(t),e&&j(r),e&&j(l),e&&j(d),ke(u,e),e&&j(m),ke(f,e),$=!1,b(h)}}}function Lr(e,t,n){const i=G(),{DatePicker:o}=c;let{value:r}=t,{id:l}=t,{noForm:s=!1}=t,{classId:a}=t,{required:d}=t,{disabled:u}=t,m="%d.%m.%Y",f="%d.%m.%Y",p=r?.from,$=r?.to;"Invalid Date"===p?.toString()&&(p=void 0),"Invalid Date"===$?.toString()&&($=void 0),u&&(void 0===p&&(m=""),void 0===$&&(f=""));return e.$$set=e=>{"value"in e&&n(12,r=e.value),"id"in e&&n(0,l=e.id),"noForm"in e&&n(1,s=e.noForm),"classId"in e&&n(2,a=e.classId),"required"in e&&n(3,d=e.required),"disabled"in e&&n(4,u=e.disabled)},[l,s,a,d,u,m,f,p,$,o,({detail:e})=>{n(7,p=Yn(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),i("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=Yn(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),i("change",{value:$,range:"_to"})},r,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class Fr extends Se{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=N("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",_(document.head,t)),Ie(this,e,Lr,Nr,k,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function Er(e){let t,n,i;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:Dr,placeholder:zr,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=N("div"),be(n.$$.fragment),M(t,"max-width","4em")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,[t]){const i={};4&t&&(i.inputClass=e[2]),1&t&&(i.id=e[0]),1&t&&(i.name=e[0]),2&t&&(i.value=e[1]),8&t&&(i.readonly=e[3]),16&t&&(i.disabled=e[4]),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}const Dr="([01][0-9]|2[0-3]):([0-5][0-9])",zr="";function Tr(e,t,n){const i=G(),{TextField:o}=c;let{id:r}=t,{item:l}=t,{value:s}=t,{inputClass:a}=t,{readonly:d}=t,{disabled:u}=t,{praefix: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(7,l=e.item),"value"in e&&n(1,s=e.value),"inputClass"in e&&n(2,a=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,m=e.praefix)},[r,s,a,d,u,o,({detail:e})=>{i("blur",{value:f(e.value)}),i("checkRange",{idx:m,fieldId:r,value:e.value})},l,m]}class Ar extends Se{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=N("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",_(document.head,t)),Ie(this,e,Tr,Er,k,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Br}=ve;function Vr(e,t,n){const i=e.slice();return i[0]=t[n],i}function Or(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function Mr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Wr(e){let t,n,i=e[14],o=[];for(let t=0;t<i.length;t+=1)o[t]=Pr(Vr(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(14&n){let l;for(i=e[14],l=0;l<i.length;l+=1){const r=Vr(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Pr(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function Rr(e){let t,n,i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"",o=e[19]&&function(e){let t;return{c(){t=F(", ")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}();return{c(){t=N("span"),o&&o.c(),n=F(i),B(t,"class","lookupValue")},m(e,i){C(e,t,i),o&&o.m(t,null),_(t,n)},p(e,t){2&t&&i!==(i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"")&&V(n,i)},d(e){e&&j(t),o&&o.d()}}}function Pr(e){let t,n,i,o,r,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=Rr(Or(e,c,t));return o=new Re({props:{size:"18"}}),{c(){t=N("div");for(let e=0;e<d.length;e+=1)d[e].c();n=E(),i=N("span"),be(o.$$.fragment),r=E(),B(i,"class","feather pointer svelte-1u646ni"),B(t,"class","lookupItem svelte-1u646ni")},m(c,u){C(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,n),_(t,i),xe(o,i,null),_(t,r),l=!0,s||(a=z(i,"click",e[3](e[0]._id)),s=!0)},p(i,o){if(e=i,6&o){let i;for(c=e[1],i=0;i<c.length;i+=1){const r=Or(e,c,i);d[i]?d[i].p(r,o):(d[i]=Rr(r),d[i].c(),d[i].m(t,n))}for(;i<d.length;i+=1)d[i].d(1);d.length=c.length}},i(e){l||(pe(o.$$.fragment,e),l=!0)},o(e){$e(o.$$.fragment,e),l=!1},d(e){e&&j(t),q(d,e),ke(o),s=!1,a()}}}function Hr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Qr(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Hr,then:Wr,catch:Mr,value:14,blocks:[,,,]};return he(e[2](),i),{c(){t=N("div"),i.block.c(),B(t,"class","lookup svelte-1u646ni")},m(e,o){C(e,t,o),i.block.m(t,i.anchor=null),i.mount=()=>t,i.anchor=null,n=!0},p(t,[n]){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(),i.token=null,i=null}}}function Yr(e,t,i){let{id:o}=t,{item:r}=t,{praefix:l}=t,{record:s}=t;const{refItem:a,view:c}=r.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ie().then((()=>{const e=document.querySelector("div.form-field."+r.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&i(4,o=e.id),"item"in e&&i(0,r=e.item),"praefix"in e&&i(5,l=e.praefix),"record"in e&&i(6,s=e.record)},[r,d,async()=>{let e=[];if(s._id){const t=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const o={[u]:s[u]||s._id};if(e=await n.getSectionView(f,o,t),!t){const t=d.find((e=>e.includes(":"))).split(":")[0];e=e.map((e=>{const n=e[t].find((e=>e[t]===s._id));return n._id=e._id,n})),i(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const t=await n.getTaskByDocId(e);if(!t)return;const i=t._id,o=`/task/${t.event}/${i}/task?view=standalone`;window.open(o)},o,l,s]}class Gr extends Se{constructor(e){var t;super(),Br.getElementById("svelte-1u646ni-style")||((t=N("style")).id="svelte-1u646ni-style",t.textContent=".feather.svelte-1u646ni{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1u646ni{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1u646ni{position:relative;margin-left:2em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}",_(Br.head,t)),Ie(this,e,Yr,Qr,k,{id:4,item:0,praefix:5,record:6})}}function Ur(e){let t,n,i;return n=new tt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function Jr(e){let t,n,i,o,r;return n=new tt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function Kr(e){let t,n,i,o,r,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[Jr,Ur],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function Zr(e,t,i){const{TextField:o}=c;let{inputClass:r}=t,{disabled:l}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:d}=t,{id:u}=t,{name:m}=t,{value:f}=t,{record:p}=t,{item:$}=t;return e.$$set=e=>{"inputClass"in e&&i(0,r=e.inputClass),"disabled"in e&&i(1,l=e.disabled),"formnovalidate"in e&&i(2,s=e.formnovalidate),"readonly"in e&&i(3,a=e.readonly),"required"in e&&i(4,d=e.required),"id"in e&&i(5,u=e.id),"name"in e&&i(6,m=e.name),"value"in e&&i(7,f=e.value),"record"in e&&i(10,p=e.record),"item"in e&&i(11,$=e.item)},[r,l,s,a,d,u,m,f,o,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:t,houseNo:i,postcode:o,location:r,country:l}=e,s=[t&&i?t+" "+i:t,o&&r?o+" "+r:o||r||"",l&&(await n.getTask("country",l)).designation].filter((e=>!!e)).join(", "),a="https://bing.com/maps/default.aspx?where1="+encodeURIComponent(s);window.open(a,"_blank")},p,$,function(t){U(e,t)}]}class Xr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,Zr,Kr,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function el(e){let t,n,i;return n=new Qe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function tl(e){let t,n,i,o,r;return n=new Qe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function nl(e){let t,n,i,o,r,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[10]);const s=[tl,el],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function il(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value)},[o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){U(e,t)}]}class ol extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,il,nl,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function rl(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function ll(e){let t,n,i,o,r;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function sl(e){let t,n,i,o,r,l;n=new e[10]({props:{inputClass:e[2],pattern:e[0],placeholder:e[1],disabled:e[3],formnovalidate:e[4],readonly:e[5],required:e[6],id:e[7],name:e[8],value:e[9]}}),n.$on("change",e[12]);const s=[ll,rl],a=[];function c(e,t){return e[9]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};4&i&&(l.inputClass=e[2]),1&i&&(l.pattern=e[0]),2&i&&(l.placeholder=e[1]),8&i&&(l.disabled=e[3]),16&i&&(l.formnovalidate=e[4]),32&i&&(l.readonly=e[5]),64&i&&(l.required=e[6]),128&i&&(l.id=e[7]),256&i&&(l.name=e[8]),512&i&&(l.value=e[9]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function al(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;f||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,o=e.inputClass),"disabled"in e&&n(3,r=e.disabled),"formnovalidate"in e&&n(4,l=e.formnovalidate),"readonly"in e&&n(5,s=e.readonly),"required"in e&&n(6,a=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,m=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,p=e.placeholder)},[f,p,o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class cl extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,al,sl,k,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function dl(e){let t,n,i;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function ul(e){let t,n,i,o,r;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function ml(e){let t,n,i,o,r,l;n=new e[10]({props:{type:"email",inputClass:e[0],pattern:e[8],placeholder:e[9],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[ul,dl],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),256&i&&(l.pattern=e[8]),512&i&&(l.placeholder=e[9]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function fl(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value),"pattern"in e&&n(8,f=e.pattern),"placeholder"in e&&n(9,p=e.placeholder)},[o,r,l,s,a,d,u,m,f,p,i,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class pl extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,fl,ml,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}const $l=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"];function hl(e){let t;return{c(){t=N("textarea"),B(t,"id",e[0]),M(t,"visibility","hidden")},m(n,i){C(n,t,i),e[18](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[18](null)}}}function gl(e){let t;return{c(){t=N("div"),B(t,"id",e[0])},m(n,i){C(n,t,i),e[17](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[17](null)}}}function vl(e){let t;function n(e,t){return e[1]?gl:hl}let i=n(e),o=i(e);return{c(){t=N("div"),o.c(),B(t,"class",e[2])},m(n,i){C(n,t,i),o.m(t,null),e[19](t)},p(e,[r]){i===(i=n(e))&&o?o.p(e,r):(o.d(1),o=i(e),o&&(o.c(),o.m(t,null))),4&r&&B(t,"class",e[2])},i:v,o:v,d(n){n&&j(t),o.d(),e[19](null)}}}const yl=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let wl=(()=>{let e={listeners:[],scriptId:yl("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,i)=>{e.scriptLoaded?i():(e.listeners.push(i),e.injected||((t,n,i,o)=>{e.injected=!0;const r=n.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=i,r.onload=()=>{o()},n.head&&n.head.appendChild(r)})(e.scriptId,t,n,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0})))}}})();function bl(e,t,n){var i;let o,r,l,{id:s=yl("tinymce-svelte")}=t,{inline:a}=t,{disabled:c=!1}=t,{apiKey:d="no-api-key"}=t,{channel:u="6"}=t,{scriptSrc:m}=t,{conf:f={}}=t,{modelEvents:p="change input undo redo"}=t,{value:$=""}=t,{text:h=""}=t,{cssClass:g="tinymce-wrapper"}=t,v=$,y=c;const w=G(),b=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},x=()=>{const e=Object.assign(Object.assign({},f),{target:r,inline:void 0!==a?a:void 0!==f.inline&&f.inline,readonly:c,setup:e=>{n(14,l=e),e.on("init",(()=>{e.setContent($),e.on(p,(()=>{n(15,v=e.getContent()),v!==$&&(n(5,$=v),n(6,h=e.getContent({format:"text"})))}))})),((e,t)=>{$l.forEach((n=>{e.on(n,(i=>{t(n.toLowerCase(),{eventName:n,event:i,editor:e})}))}))})(e,w),"function"==typeof f.setup&&f.setup(e)}});n(4,r.style.visibility="",r),b().init(e)};return Q((()=>{if(null!==b())x();else{const e=m||`https://cdn.tiny.cloud/1/${d}/tinymce/${u}/tinymce.min.js`;wl.load(o.ownerDocument,e,(()=>{x()}))}})),Y((()=>{var e;l&&(null===(e=b())||void 0===e||e.remove(l))})),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,c=e.disabled),"apiKey"in e&&n(8,d=e.apiKey),"channel"in e&&n(9,u=e.channel),"scriptSrc"in e&&n(10,m=e.scriptSrc),"conf"in e&&n(11,f=e.conf),"modelEvents"in e&&n(12,p=e.modelEvents),"value"in e&&n(5,$=e.value),"text"in e&&n(6,h=e.text),"cssClass"in e&&n(2,g=e.cssClass)},e.$$.update=()=>{123040&e.$$.dirty&&(l&&v!==$&&(l.setContent($),n(6,h=l.getContent({format:"text"}))),l&&c!==y&&(n(16,y=c),"function"==typeof(null===n(13,i=l.mode)||void 0===i?void 0:i.set)?l.mode.set(c?"readonly":"design"):l.setMode(c?"readonly":"design")))},[s,a,g,o,r,$,h,c,d,u,m,f,p,i,l,v,y,function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class xl extends Se{constructor(e){super(),Ie(this,e,bl,vl,k,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function kl(e){let t,n,i,o,r,l,s;function a(t){e[7](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",conf:e[6],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new xl({props:c}),K.push((()=>we(n,"value",a))),{c(){t=N("div"),be(n.$$.fragment),o=E(),r=N("input"),B(r,"class",l=e[1]||e[2]),B(r,"id",e[3]),B(r,"name",e[3]),r.value=e[0],r.hidden=!0,M(t,"min-height","10em"),M(t,"margin-top","-1em")},m(e,i){C(e,t,i),xe(n,t,null),_(t,o),_(t,r),s=!0},p(e,[t]){const o={};16&t&&(o.disabled=e[4]),32&t&&(o.readonly=e[5]),!i&&1&t&&(i=!0,o.value=e[0],re((()=>i=!1))),n.$set(o),(!s||6&t&&l!==(l=e[1]||e[2]))&&B(r,"class",l),(!s||8&t)&&B(r,"id",e[3]),(!s||8&t)&&B(r,"name",e[3]),(!s||1&t&&r.value!==e[0])&&(r.value=e[0])},i(e){s||(pe(n.$$.fragment,e),s=!0)},o(e){$e(n.$$.fragment,e),s=!1},d(e){e&&j(t),ke(n)}}}function Il(e,n,i){let o=JSON.parse(t.getItem("Locale")).id;o=o.startsWith("fr")?"fr_FR":o.split("-")[0];let{value:r}=n,{noForm:l}=n,{classId:s}=n,{id:a}=n,{disabled:c}=n,{readonly:d}=n;const u={plugins:"advlist numlist link image lists table preview emoticons fullscreen",menu:{file:{title:"File",items:"preview"}},menubar:"edit view insert format table",toolbar:"undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | fullscreen",height:600,language:o};return e.$$set=e=>{"value"in e&&i(0,r=e.value),"noForm"in e&&i(1,l=e.noForm),"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"disabled"in e&&i(4,c=e.disabled),"readonly"in e&&i(5,d=e.readonly)},[r,l,s,a,c,d,u,function(e){r=e,i(0,r)}]}class Sl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zemw0w-style")||((t=N("style")).id="svelte-zemw0w-style",t.textContent="div.tox-statusbar__text-container{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",_(document.head,t)),Ie(this,e,Il,kl,k,{value:0,noForm:1,classId:2,id:3,disabled:4,readonly:5})}}function _l(e){let t,n;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Gl,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1048577&n[0]&&(i.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(i.name=e[0].designation),1&n[0]&&(i.help=e[0].properties?.hint),13631487&n[0]|536870912&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Cl(e){let t,n;return t=new e[28]({props:{text:e[0].designation}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.text=e[0].designation),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function jl(e){let t,n,i,o;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint}}),i=new Sl({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6]}}),i.$on("blur",e[35]()),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment)},m(e,r){xe(t,e,r),C(e,n,r),xe(i,e,r),o=!0},p(e,n){const o={};1048577&n[0]&&(o.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),t.$set(o);const r={};128&n[0]&&(r.classId=e[7]),8&n[0]&&(r.disabled=e[3]),524288&n[0]&&(r.readonly=e[19]),1&n[0]&&(r.name=e[0].name),4194304&n[0]&&(r.value=e[22]()),64&n[0]&&(r.noForm=e[6]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){ke(t,e),e&&j(n),ke(i,e)}}}function ql(e){let t,n,i,o,r,l;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+" hidden",name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Ul]},$$scope:{ctx:e}}}),i=new e[28]({props:{text:e[23]}}),r=new to({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22]()}}),r.$on("setRefValue",e[40]),r.$on("safeReference",e[45]),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment),o=E(),be(r.$$.fragment)},m(e,s){xe(t,e,s),C(e,n,s),xe(i,e,s),C(e,o,s),xe(r,e,s),l=!0},p(e,n){const o={};1&n[0]&&(o.class=e[0].name+" hidden"),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),6291841&n[0]|536870912&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);const l={};8388608&n[0]&&(l.text=e[23]),i.$set(l);const s={};16&n[0]&&(s.required=e[4]),8&n[0]&&(s.disabled=e[3]),524288&n[0]&&(s.readonly=e[19]),1&n[0]&&(s.item=e[0]),131072&n[0]&&(s.currency=e[17]),4194304&n[0]&&(s.value=e[22]()),r.$set(s)},i(e){l||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){ke(t,e),e&&j(n),ke(i,e),e&&j(o),ke(r,e)}}}function Nl(e){let t,n;return t=new e[25]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[29],required:!0===e[4],placeholder:e[30],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=!0===e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ll(e){let t,n;return t=new cl({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Fl(e){let t,n;return t=new ol({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function El(e){let t,n;return t=new pl({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Dl(e){let t,n;return t=new Ar({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[0],value:e[22](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[53]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function zl(e){let t,n;return t=new Gr({props:{id:e[32],item:e[0],praefix:e[5],record:e[1]}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.item=e[0]),32&n[0]&&(i.praefix=e[5]),2&n[0]&&(i.record=e[1]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Tl(e){let t,n;return t=new Xr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22](),record:e[1],item:e[0]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),2&n[0]&&(i.record=e[1]),1&n[0]&&(i.item=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Al(e){let t,n;return t=new qr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[33](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bl(e){let t,n;return t=new Fr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[34](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Vl(e){let t,n;return t=new e[26]({props:{inputClass:e[6]||e[7],required:e[4],disabled:e[3],id:e[32],name:e[31],value:e[33](),closeOnSelection:!0}}),t.$on("change",e[35](!0)),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ol(e){let t,n;return t=new e[27]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),524296&n[0]&&(i.disabled=e[3]||e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.checked=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ml(e){let t,n;return t=new fr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],view:e[0].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[52]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.view=e[0].properties.view),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Wl(e){let t,n;return t=new Mo({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],multi:e[0].properties.multi,numberInput:e[12],praefix:e[5],toDelete:e[15],reqQuantity:e[16],notifyList:e[18]}}),t.$on("blur",e[35]()),t.$on("invalid",e[51]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.multi=e[0].properties.multi),4096&n[0]&&(i.numberInput=e[12]),32&n[0]&&(i.praefix=e[5]),32768&n[0]&&(i.toDelete=e[15]),65536&n[0]&&(i.reqQuantity=e[16]),262144&n[0]&&(i.notifyList=e[18]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Rl(e){let t,n;return t=new ro({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22](),praefix:e[5],notifyList:e[18],noForm:e[6]}}),t.$on("blur",e[35]()),t.$on("formula",e[50]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),16&n[0]&&(i.required=e[4]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),131072&n[0]&&(i.currency=e[17]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),262144&n[0]&&(i.notifyList=e[18]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Pl(e){let t,n;return t=new wr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],value:e[22](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Hl(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6],placeholder:e[0].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.name=e[0].name),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.placeholder=e[0].properties?.placeholder),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ql(e){let t,n;return t=new Nn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[0],desc:e[23],value:e[22](),noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[48]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[49]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),8388608&n[0]&&(i.desc=e[23]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Yl(e){let t,n;return t=new Rn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[0],desc:e[23],values:e[22]()||[],noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[46]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[47]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),8388608&n[0]&&(i.desc=e[23]),4194304&n[0]&&(i.values=e[22]()||[]),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Gl(e){let t,n,i,o;const r=[Yl,Ql,Hl,Pl,Rl,Wl,Ml,Ol,Vl,Bl,Al,Tl,zl,Dl,El,Fl,Ll,Nl],l=[];function s(e,t){return"object"===e[0].type&&e[0].properties?.multi?0:"object"===e[0].type?1:"textarea"===e[0].type||e[0].properties&&"textarea"===e[0].properties.format?2:e[0].properties&&(e[0].properties.enum||e[0].properties.regulation)?3:"number"===e[0].type?4:e[0].properties&&e[0].properties.multi?5:e[0].properties&&e[0].properties.view&&"lookup"!==e[0].properties.format?6:"boolean"===e[0].type?7:"date"===e[0].type?8:"dateRange"===e[0].type?9:"datetime"===e[0].type?10:"map"===e[0].properties?.format?11:"lookup"===e[0].properties?.format?12:"time"===e[0].properties?.format?13:"email"===e[0].type||"email"===e[0].properties?.format?14:"url"===e[0].properties?.format?15:"tel"===e[0].properties?.format?16:17}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Ul(e){let t,n;return t=new Nn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[0],value:e[22](),noList:!0,withRefValue:!0,refValue:e[21]}}),t.$on("setRefDesc",e[41]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),2097152&n[0]&&(i.refValue=e[21]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Jl(e){let t,n,i,o;const r=[ql,jl,Cl,_l],l=[];function s(e,t){return e[5]||"reference"!==e[0].saveAs||"object"!==e[0].type?"html"===e[0].properties?.format?1:"divider"===e[0].type?2:3:0}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Kl(e,t,n){let i,o,r;const l=G(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:m,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:x}=t,{disabled:k}=t,{selectionFields:I}=t,{formnovalidate:S}=t,{selection:_=!1}=t,{notifyList:C}=t,{numberInput:j}=t,{deList:q}=t,{required:N}=t,{isTemplate:L}=t,{toDelete:F}=t,{reqQuantity:E}=t,{currency:D}=t,{changeValue:z}=t,{propSelection:T}=t;y||=v._id;let{required:A,readonly:B,hidden:V,pattern:O,placeholder:M}=h.properties||{};if(V=!0===V,void 0!==B&&(B=!0===B),void 0===N&&(N=A),k=k||!!B,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const W=(g?g+".":"")+h.name,R=W+(""!==$?"-"+$:""),P=(e,t=W)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let H=P(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(0,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(1,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,w=e.noForm),"classId"in e&&n(7,b=e.classId),"eventId"in e&&n(8,x=e.eventId),"disabled"in e&&n(3,k=e.disabled),"selectionFields"in e&&n(9,I=e.selectionFields),"formnovalidate"in e&&n(10,S=e.formnovalidate),"selection"in e&&n(11,_=e.selection),"notifyList"in e&&n(18,C=e.notifyList),"numberInput"in e&&n(12,j=e.numberInput),"deList"in e&&n(13,q=e.deList),"required"in e&&n(4,N=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,F=e.toDelete),"reqQuantity"in e&&n(16,E=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue),"propSelection"in e&&n(44,T=e.propSelection)},e.$$.update=()=>{if(1&e.$$.dirty[0]|8192&e.$$.dirty[1]&&T&&h.properties?.selection){const{refClass:e,refItem:t,target:n}=h.properties.selection,i=T.record[e];l("propSelection",{itemName:h.name,itemType:h.type,prop:t,target:n,source:e,sourceId:i})}if(4096&e.$$.dirty[1])for(const e in z)e===W&&n(1,v[W]=z[e],v);2&e.$$.dirty[0]&&n(22,i=(e=W)=>{let t=P(v);return void 0===t?"":t}),2&e.$$.dirty[0]&&(r=P(v))},n(23,o=((e=W)=>{let t=v["_"+e];return t=f(t),void 0===t?"":t})()),[h,v,y,k,N,$,w,b,x,I,S,_,j,q,L,F,E,D,C,B,V,H,i,o,s,a,d,m,p,O,M,W,R,(e=W)=>{let t=P(v);return t?new Date(t):""===$?new Date:void 0},(e=W)=>{const t=P(v,e+"_from"),n=P(v,e+"_to");return{from:void 0===t?t:new Date(t),to:void 0===n?n:new Date(n)}},e=>({detail:t})=>{let{value:i,checked:o,range:s}=t;void 0!==o&&(i=o);const a=W+(s||"");n(1,v[a]=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("%%","%")}(i,"%d.%m.%Y"):i,v);const c=Object.values(v).every((e=>!e))&&i;l("notify",{oldValue:r,value:i,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,V=!0),()=>"object"===h.type?"comment_"+R:R,({detail:e})=>{n(21,H=e)},({detail:e})=>{const{designation:t}=h;n(23,o=t+": "+(e||"(Neu)"))},g,z,T,function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)}]}class Zl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zmu4lk-style")||((t=N("style")).id="svelte-zmu4lk-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em;color:black}.form-field div.field > label.checkbox{padding-top:0.5em}",_(document.head,t)),Ie(this,e,Kl,Jl,k,{praefix:5,item:0,listName:42,record:1,recordId:2,noForm:6,classId:7,eventId:8,disabled:3,selectionFields:9,formnovalidate:10,selection:11,notifyList:18,numberInput:12,deList:13,required:4,isTemplate:14,toDelete:15,reqQuantity:16,currency:17,changeValue:43,propSelection:44},[-1,-1])}}const{document:Xl}=ve;function es(e,t,n){const i=e.slice();return i[90]=t[n],i[92]=n,i}function ts(e,t,n){const i=e.slice();return i[99]=t[n],i}function ns(e,t,n){const i=e.slice();return i[94]=t[n].title,i[95]=t[n].toDelete,i[96]=t[n].icon,i}function is(e){let t,n;return t=new e[19]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[os]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2048&n[0]|512&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function os(e){let t,n,i;function o(t){e[50](t)}let r={item:e[29],disabled:!0};return void 0!==e[11]&&(r.value=e[11]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};!n&&2048&i[0]&&(n=!0,o.value=e[11],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function rs(e){let t,n;return t=new e[19]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[ls]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};16384&n[0]|512&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ls(e){let t,n,i;function o(t){e[51](t)}let r={item:e[27],disabled:!0};return void 0!==e[14]&&(r.value=e[14]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};!n&&16384&i[0]&&(n=!0,o.value=e[14],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function ss(e){let t,n;return t=new e[19]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[as]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1152&n[0]|512&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function as(e){let t,n,i;function o(t){e[52](t)}let r={item:e[25],disabled:!0,currency:e[7]};return void 0!==e[10]&&(r.value=e[10]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function cs(e){let t,n;return t=new e[22]({props:{class:e[16][e[92]],open:e[9]&&!e[1]&&0===e[92],$$slots:{handle:[gs,({toggle:e,open:t})=>({93:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,0,e?1:0]],default:[fs,({toggle:e,open:t})=>({93:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,0,e?1:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){x(e[43](e[92],e[89]))&&e[43](e[92],e[89]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};65536&i[0]&&(o.class=e[16][e[92]]),514&i[0]&&(o.open=e[9]&&!e[1]&&0===e[92]),439293&i[0]|513&i[3]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ds(e){let t,n;return t=new Zl({props:{praefix:e[92],item:e[99],eventId:e[6],record:e[90],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:xs,classId:e[5],disabled:e[0],required:e[23],selectionFields:e[30],propSelection:e[15],numberInput:e[18],currency:e[7],formnovalidate:e[92]===e[12].length-1||e[12][e[92]]._delete}}),t.$on("notify",(function(){x(e[32](e[99],e[92]))&&e[32](e[99],e[92]).apply(this,arguments)})),t.$on("task",e[53]),t.$on("invalid",e[33]),t.$on("defPrep",e[34]),t.$on("checkRange",e[35]),t.$on("formula",e[44](e[92])),t.$on("record",e[54]),t.$on("propSelection",e[45](e[92])),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};8&i[0]&&(o.item=e[99]),64&i[0]&&(o.eventId=e[6]),4096&i[0]&&(o.record=e[90]),16&i[0]&&(o.recordId=e[4]._id),4&i[0]&&(o.reqQuantity=e[2]),256&i[0]&&(o.notifyList=e[8]),32&i[0]&&(o.classId=e[5]),1&i[0]&&(o.disabled=e[0]),32768&i[0]&&(o.propSelection=e[15]),262144&i[0]&&(o.numberInput=e[18]),128&i[0]&&(o.currency=e[7]),4096&i[0]&&(o.formnovalidate=e[92]===e[12].length-1||e[12][e[92]]._delete),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function us(e){let t,n,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=ds(ts(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082429949&n[0]|24606&n[1]){let l;for(i=e[3].item,l=0;l<i.length;l+=1){const r=ts(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ds(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function ms(e){let t,n,i=e[12][e[92]]._delete,o=us(e);return{c(){o.c(),t=D()},m(e,i){o.m(e,i),C(e,t,i),n=!0},p(e,n){4096&n[0]&&k(i,i=e[12][e[92]]._delete)?(me(),$e(o,1,1,v),fe(),o=us(e),o.c(),pe(o),o.m(t.parentNode,t)):o.p(e,n)},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){e&&j(t),o.d(e)}}}function fs(e){let t,n,i,o,r=e[12].length,l=ms(e);return{c(){t=N("div"),l.c(),i=E(),B(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[92]}`)},m(e,n){C(e,t,n),l.m(t,null),C(e,i,n),o=!0},p(e,i){4096&i[0]&&k(r,r=e[12].length)?(me(),$e(l,1,1,v),fe(),l=ms(e),l.c(),pe(l),l.m(t,null)):l.p(e,i),(!o||40&i[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[92]}`))&&B(t,"id",n)},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(t),l.d(e),e&&j(i)}}}function ps(e){let t,n,i,o,r,l=e[31](e[13],e[92])+"";return{c(){t=N("div"),n=F(l),B(t,"class",i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1"),B(t,"draggable",!0),W(t,"delete",e[90]._delete),W(t,"is-active-top",e[17]?.top===e[92]),W(t,"is-active-bottom",e[17]?.bottom===e[92])},m(i,l){C(i,t,l),_(t,n),o||(r=[z(t,"dragover",e[41]),z(t,"dragleave",e[42](e[92])),z(t,"dragstart",e[39](e[92])),z(t,"drop",T(e[38](e[92]))),z(t,"dragenter",e[40](e[92]))],o=!0)},p(o,r){e=o,8192&r[0]&&l!==(l=e[31](e[13],e[92])+"")&&V(n,l),8&r[0]&&i!==(i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&B(t,"class",i),4104&r[0]&&W(t,"delete",e[90]._delete),131080&r[0]&&W(t,"is-active-top",e[17]?.top===e[92]),131080&r[0]&&W(t,"is-active-bottom",e[17]?.bottom===e[92])},d(e){e&&j(t),o=!1,b(r)}}}function $s(e){let t,n,i;var o=e[96];return o&&(t=new o({props:{size:"20"}})),{c(){t&&be(t.$$.fragment),n=D()},m(e,o){t&&xe(t,e,o),C(e,n,o),i=!0},p(e,i){if(o!==(o=e[96])){if(t){me();const e=t;$e(e.$$.fragment,1,0,(()=>{ke(e,1)})),fe()}o?(t=new o({props:{size:"20"}}),be(t.$$.fragment),pe(t.$$.fragment,1),xe(t,n.parentNode,n)):t=null}},i(e){i||(t&&pe(t.$$.fragment,e),i=!0)},o(e){t&&$e(t.$$.fragment,e),i=!1},d(e){e&&j(n),t&&ke(t,e)}}}function hs(e){let t,n,i,o,r,l=!e[0]&&!e[3].readonly&&$s(e);return{c(){t=N("span"),l&&l.c(),B(t,"class","pointer icon svelte-1es1ap1"),B(t,"title",e[94]),t.hidden=n=e[92]===e[12].length-1||!(e[90]._delete^e[95])},m(n,s){C(n,t,s),l&&l.m(t,null),i=!0,o||(r=z(t,"click",(function(){x(e[37](e[92],e[9],e[93]))&&e[37](e[92],e[9],e[93]).apply(this,arguments)})),o=!0)},p(o,r){(e=o)[0]||e[3].readonly?l&&(me(),$e(l,1,1,(()=>{l=null})),fe()):l?(l.p(e,r),9&r[0]&&pe(l,1)):(l=$s(e),l.c(),pe(l,1),l.m(t,null)),(!i||4096&r[0]&&n!==(n=e[92]===e[12].length-1||!(e[90]._delete^e[95])))&&(t.hidden=n)},i(e){i||(pe(l),i=!0)},o(e){$e(l),i=!1},d(e){e&&j(t),l&&l.d(),o=!1,r()}}}function gs(e){let t,n,i,o,r,l;n=new e[20]({props:{$$slots:{default:[ps]},$$scope:{ctx:e}}}),n.$on("click",(function(){x(e[36](e[93],e[92],e[9]))&&e[36](e[93],e[92],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Oe},{title:"undo",toDelete:!1,icon:Ae}],a=[];for(let t=0;t<2;t+=1)a[t]=hs(ns(e,s,t));const c=e=>$e(a[e],1,1,(()=>{a[e]=null}));return{c(){t=N("div"),be(n.$$.fragment),i=E();for(let e=0;e<2;e+=1)a[e].c();o=E(),B(t,"class",r=S("accordion "+e[3].name)+" svelte-1es1ap1"),B(t,"slot","handle")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i);for(let e=0;e<2;e+=1)a[e].m(t,null);_(t,o),l=!0},p(i,d){e=i;const u={};if(143368&d[0]|512&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|64&d[1]|1&d[3]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Oe},{title:"undo",toDelete:!1,icon:Ae}],n=0;n<2;n+=1){const i=ns(e,s,n);a[n]?(a[n].p(i,d),pe(a[n],1)):(a[n]=hs(i),a[n].c(),pe(a[n],1),a[n].m(t,o))}for(me(),n=2;n<2;n+=1)c(n);fe()}(!l||8&d[0]&&r!==(r=S("accordion "+e[3].name)+" svelte-1es1ap1"))&&B(t,"class",r)},i(e){if(!l){pe(n.$$.fragment,e);for(let e=0;e<2;e+=1)pe(a[e]);l=!0}},o(e){$e(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)$e(a[e]);l=!1},d(e){e&&j(t),ke(n),q(a,e)}}}function vs(e){let t,n,i=(!e[1]&&!e[0]||e[92]<e[12].length-1)&&cs(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){!e[1]&&!e[0]||e[92]<e[12].length-1?i?(i.p(e,n),4099&n[0]&&pe(i,1)):(i=cs(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function ys(e){let t,n,i=e[12],o=[];for(let t=0;t<i.length;t+=1)o[t]=vs(es(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082635263&n[0]|32767&n[1]|134217728&n[2]|1&n[3]){let l;for(i=e[12],l=0;l<i.length;l+=1){const r=es(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=vs(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function ws(e){let t,n,i,o,r,l,s=e[28]&&e[11]&&0!=e[11]&&is(e),a=e[26]&&e[14]&&0!=e[14]&&rs(e),c=e[24]&&e[10]&&0!=e[10]&&ss(e);return r=new e[21]({props:{class:e[5]+e[3].name,$$slots:{default:[ys,({closeOtherPanels:e})=>({89:e}),({closeOtherPanels:e})=>[0,0,e?134217728:0]]},$$scope:{ctx:e}}}),{c(){t=N("div"),s&&s.c(),n=E(),a&&a.c(),i=E(),c&&c.c(),o=E(),be(r.$$.fragment),B(t,"class","formList")},m(e,d){C(e,t,d),s&&s.m(t,null),_(t,n),a&&a.m(t,null),_(t,i),c&&c.m(t,null),_(t,o),xe(r,t,null),l=!0},p(e,l){e[28]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&pe(s,1)):(s=is(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[26]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&pe(a,1)):(a=rs(e),a.c(),pe(a,1),a.m(t,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),e[24]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&pe(c,1)):(c=ss(e),c.c(),pe(c,1),c.m(t,o)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe());const d={};40&l[0]&&(d.class=e[5]+e[3].name),504831&l[0]|134217728&l[2]|512&l[3]&&(d.$$scope={dirty:l,ctx:e}),r.$set(d)},i(e){l||(pe(s),pe(a),pe(c),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(a),$e(c),$e(r.$$.fragment,e),l=!1},d(e){e&&j(t),s&&s.d(),a&&a.d(),c&&c.d(),ke(r)}}}let bs=new Map;const xs=!0,ks="pos/target";function Is(e,t,i){let o,r;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:m}=c,h=G();let{list:g}=t,{mainSchema:v}=t,{schema:y}=t,{record:w}=t,{classId:b}=t,{eventId:x}=t,{disabled:k}=t,{fixed:I}=t,{template:S={}}=t,{reqQuantity:_}=t,{open:C=!1}=t,{currency:j}=t,{notifyList:q}=t;const N=y.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),L=N&&y.find((e=>"quantity"===e.name));let F=0;const E=y.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let D=0;const z=y.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",T=!!z;let A=0;const B={};let V,O=y.properties?.readonly,M=b.split("form-")[1].slice(0,-4),W=new Map;g.group&&(I=!0);const R={};k||=O;let P,H,Q=[],Y=[],J=!1,K={},Z=[];y.filter((e=>e.selection)).map((e=>Q.push({className:M,parentClass:y,refClass:e.selection,value:""}))),y.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{y.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[i,o]=n.split(".");o||(o=i,i=void 0),Z.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));const X=e=>e.slice(0,3).join(", "),ee=async(e,t,n)=>{const i=w[n];if(!i?.length)return;const o=i[0][n];if(!o)return;const r=await va(n,o);return r?r[g.name]:void 0},te=async(e,t)=>{const n=Z.filter((e=>(e.refObj||M)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:o,refName:r,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(o){const t=P[e][o];o===M&&r?d=w:t&&(d=await va(o,t))}!o&&r&&(d=P[e]),d&&(u=d[r],Array.isArray(u)&&0===u.length&&(u=!1)),"!"===l&&(u=!u),"required"!==c&&"readonly"!==c||(c="required"===c?c:"disabled",setTimeout((()=>{s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field textarea`,a=document.querySelector(s),a||(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field input`,a=document.querySelector(s)),a&&u&&a.setAttribute(c,""),a&&!u&&a.removeAttribute(c)}),0)),"hidden"===c&&(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n}`,a=document.querySelector(s),a?.classList?.toggle("hidden",u),u&&i(12,P[e][n]="",P))}},ne=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(n);let r=!1;o.forEach((e=>{e.required&&""===e.value&&(r=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),i(16,Y[e]=r||t?"invalid":"",Y)},oe=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},re=(e,t)=>{if(!t)return;const n=y.find((e=>e.name===t)),o=n.properties.value.formula,{operator:r,argument:l}=o,s=l.map((t=>P[e][t.refItem]||w[t.refItem]));let a=0;"$add"===r&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,i]=e.split(":");e=i?(+n+ +i/60).toFixed(2):+n;const[o,r]=t.split(":");return o?e-=r?(+o+ +r/60).toFixed(2):+o:0}))),"$multiply"===r&&(a=s.reduce(((e,t)=>+e*+t)));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;i(12,P[e][t]="$multiply"===r?a?le(a,n.properties?.decimals):"":le(a,n.properties?.decimals),P),i(18,K={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)},le=(e,t)=>("number"==typeof e&&e||(e=Number(e||0)),e.toFixed(t||0));H=y.filter((e=>e.refClass)).reduce(((e,t)=>{const n=y.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,i]=t.selection.split(":"),[o]=i?.split(".")||[];o&&e.push({refClass:o,items:[n],selection:t.selection})}const i={refClass:t.refClass,items:[]};return n.forEach((e=>{i.items.push(e.name)})),e.push(i),e}),[]);const se=async(e,t,n,o)=>{const r=(await H).find((e=>e.refClass===t.refClass));if(!r)return;const{refClass:l,items:s,selection:a}=r,c=t.name;if(Z.find((e=>e.itemName===c))){const t=`#accordion-content-${b}-${g.name}-${e} .form-field.${l}.hidden`;if(document.querySelector(t))return}return n?Promise.all(s.map((async r=>{const c=y.find((e=>e.name===r));if(c.properties?.readonly&&!t.refInput){const n=P[e][t.refClass];return Promise.resolve(va(t.refClass,n,!0)).then((t=>{let n=t[r];Array.isArray(n)&&(n=n.length?n[0][r]:""),i(12,P[e][r]=n,P)}))}let d="";const{refInput:u}=t;if(u&&P[e]){const[t,n]=u.split(".");d=n?P[e][n]:w[t]}if(a&&n!==o)s.map((t=>{i(12,P[e][t]="",P)}));else if(u&&!d||ae(e,r)||o!==n){const n=y.find((e=>e.refClass===l)),o=P[e][n.name];if(t.selection){const n=ga(t.selection+o.toString());if(n)return Promise.resolve(n).then((t=>i(12,P[e][r]=t[r],P)))}return Promise.resolve(va(n.refClass,o)).then((t=>i(12,P[e][r]=t[r],P)))}}))):Promise.resolve(s.map((t=>{i(12,P[e][t]="",P)})))},ae=(e,t)=>{let n=P[e][t];return"number"===y.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},ce=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let de=!1;const ue=e=>!(!I&&e>=P.length-1),me=(e,t=!1)=>{const[n,i]=e.split(";");return g.name===i&&(!!ue(t)&&((!1===t||t!=n)&&parseInt(n)))};y.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=y.find((e=>e.name===t.refItem))||y.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const fe=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,i=document.querySelectorAll(n);if(!i?.length)return;const o=i[i.length-1];ie().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(ce)})).then((()=>{t&&o.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&i(3,g=e.list),"mainSchema"in e&&i(46,v=e.mainSchema),"schema"in e&&i(47,y=e.schema),"record"in e&&i(4,w=e.record),"classId"in e&&i(5,b=e.classId),"eventId"in e&&i(6,x=e.eventId),"disabled"in e&&i(0,k=e.disabled),"fixed"in e&&i(1,I=e.fixed),"template"in e&&i(48,S=e.template),"reqQuantity"in e&&i(2,_=e.reqQuantity),"open"in e&&i(9,C=e.open),"currency"in e&&i(7,j=e.currency),"notifyList"in e&&i(8,q=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&w&&(i(2,_=w.quantity),i(12,P=(w[g.name]||[]).concat({})),(e=>{i(15,V={record:e})})(w)),4096&e.$$.dirty[0]&&i(13,o=P),15368&e.$$.dirty[0]&&o&&((()=>{if(E)i(14,D=P?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(T)i(11,A=P?.reduce(((e,t)=>e+(t._delete?0:+(t[z]||0))),0)||0)})(),(()=>{if(N)i(10,F=P?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}else if(t.price){const n=(L?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ie().then((()=>h("save",{listName:g.name,value:P,amountValue:F,weeksValue:A})))),262144&e.$$.dirty[1]&&(r=e=>B[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[k,I,_,g,w,b,x,j,q,C,F,A,P,o,D,V,Y,J,K,l,a,d,u,undefined,N,{name:"amountValue",properties:{decimals:2}},E,{name:"hoursValue",properties:{decimals:2}},T,{name:"weeksValue",properties:{decimals:1}},Q,(e,t)=>{let n=e[t];return R["pos"+t]&&(n=R["pos"+t]),n&&y.filter((e=>!0!==e.properties?.hidden&&("dateRange"===e.type||void 0!==n[e.name])&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?r(n[e.name]):Array.isArray(n[e.name])?X(n[e.name]):"boolean"===e.type?$(n[e.name]):"dateRange"===e.type?((e,t)=>{let n,i;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{i=t[e+"_to"],i=new Date(i||"").toLocaleDateString(),"Invalid Date"===i&&(i="")}catch{i=""}return[n,i].filter((e=>""!==e)).join(" - ").trim()})(e.name,n):"date"===e.type?f(n[e.name]):"datetime"===e.type?p(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:r,value:l,add:s,desc:a}=n;if(g.refItem){const n=await ee(t,e,g.refItem);n&&i(12,P=n)}re(t,e._formulaActor);const c=Q?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&P.length===t+1&&i(12,P=P.concat({})),a&&i(49,B[l]=a,B),await se(t,e,l,r),await te(t,e.name),i(13,o=P),"number"===e.type&&i(18,K={item:e,value:l,idx:t}),ne(t)},({detail:e})=>{const{idx:t,value:n}=e;ne(t,n)},async({detail:{className:e,itemName:t,value:i}})=>{if(W.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===M+"."+g.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&W.set(e,r[0])},({detail:e})=>{const{idx:t,fieldId:n,value:i}=e;if(!i)return;const o=oe(i);let r=!1;P.forEach(((e,n)=>{if(t===n)return;const{start:i,end:l}=P[n];i&&l&&o>oe(i)&&o<oe(l)&&(r=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",r)},(e,t,n)=>n=>{P[t]._delete||(e(n),fe(t,!0))},(e,t,n)=>o=>{if(i(12,P[e]._delete=!P[e]._delete,P),P[e]._delete){R["pos"+e]={...P[e]};for(const t of y)i(12,P[e][t.name]="",P);t&&n(o)}else{if(R["pos"+e]){const t={};for(const n of y)t[n.name]=R["pos"+e][n.name];i(12,P[e]=t,P)}R["pos"+e]=void 0,t||n(o)}},e=>t=>{t.preventDefault(),i(17,J=!1);const n=me(t.dataTransfer.getData(ks),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const o=[...P].map(((e,t)=>(e._index=t,e)));n<e?(o.splice(e+1,0,o[n]),o.splice(n,1)):(o.splice(e,0,o[n]),o.splice(n+1,1)),o.map(((e,t)=>{return n=e._index,i=t,void bs.set(i,n);var n,i}));let r=[];Y.map(((e,t)=>{r[t]=Y[(e=>{const t=bs.get(e);return void 0===t?e:t})(t)]})),i(16,Y=r),i(12,P=o.map(((e,t)=>(delete e._index,e)))),de=!1},e=>t=>{if(!ue(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(ks,e+";"+g.name),de=e},e=>t=>{const n=me(t.dataTransfer.getData(ks),e)||de;return!1===n||n===e?i(17,J=!1):void i(17,J={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{i(17,J=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(W).forEach((([t,n])=>{P[e][t]||i(12,P[e][t]=n._id,P)}))}),500);const o=new Set;for(const e of Z)o.add(e.refObj||M);for(const t of Array.from(o))te(e,t);t(n),fe(e)},e=>({detail:t})=>{re(e,t.item.name)},e=>async({detail:t})=>{const{itemName:n,itemType:o,source:r,target:l,sourceId:s,prop:a}=t;if(!s)return void i(12,P[e][n]="",P);let c=await va(r,s);const d=c[a];c=await va(g.name,w[g.name][e][g.name]);const u=c[l];let m="number"===o?0:"",f=0;u.forEach((e=>{const t=e[a];t.length<=f||t.every((e=>d.find((t=>t===e))))&&(m=e[n],f=t.length)})),i(12,P[e][n]=m,P)},v,y,S,B,function(e){A=e,i(11,A)},function(e){D=e,i(14,D)},function(e){F=e,i(10,F)},function(t){U(e,t)},function(t){U(e,t)}]}class Ss extends Se{constructor(e){var t;super(),Xl.getElementById("svelte-1es1ap1-style")||((t=N("style")).id="svelte-1es1ap1-style",t.textContent=".accordion.svelte-1es1ap1{display:flex;overflow:hidden}.accordion-content.svelte-1es1ap1{position:relative}.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-1es1ap1{padding-top:1em}div.delete.svelte-1es1ap1{text-decoration:line-through}.icon.svelte-1es1ap1{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-1es1ap1{cursor:drag}.draggableListItem.is-active-top.svelte-1es1ap1{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-1es1ap1{border-bottom:3px purple solid;padding-bottom:2em}",_(Xl.head,t)),Ie(this,e,Is,ws,k,{list:3,mainSchema:46,schema:47,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:48,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:_s,document:Cs}=ve;function js(e,t,n){const i=e.slice();return i[127]=t[n],i}function qs(e,t,n){const i=e.slice();return i[130]=t[n],i}function Ns(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ls(e){let t,n,i=e[126]&&function(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g=e[1].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=Es(qs(e,g,t));const y=e=>$e(v[e],1,1,(()=>{v[e]=null}));let w=e[1].list&&Ds(e),x=!e[3]&&!e[2]&&e[41]&&e[4]&&!e[22]&&Ps(e);d=new e[25]({props:{outline:!0,$$slots:{default:[Qs]},$$scope:{ctx:e}}}),d.$on("click",e[44]);const k=[Gs,Ys],I=[];function L(e,t){return e[6]?0:e[41]?1:-1}~(m=L(e))&&(f=I[m]=k[m](e));return{c(){t=N("section"),n=N("form"),i=N("input"),r=E();for(let e=0;e<v.length;e+=1)v[e].c();l=E(),w&&w.c(),s=E(),x&&x.c(),a=E(),c=N("div"),be(d.$$.fragment),u=E(),f&&f.c(),B(i,"class",S(e[31])+" svelte-9xiaib"),B(i,"name","_id"),B(i,"type","hidden"),i.value=o=e[5]._id||"",B(n,"class",S(e[32])+" svelte-9xiaib"),B(n,"id",e[31]),B(c,"class","form--buttons svelte-9xiaib"),B(t,"class",S(e[33])+" svelte-9xiaib")},m(o,f){C(o,t,f),_(t,n),_(n,i),_(n,r);for(let e=0;e<v.length;e+=1)v[e].m(n,null);_(n,l),w&&w.m(n,null),_(t,s),x&&x.m(t,null),_(t,a),_(t,c),xe(d,c,null),_(c,u),~m&&I[m].m(c,null),p=!0,$||(h=[z(n,"keydown",e[49]),z(n,"submit",T(e[43]))],$=!0)},p(e,r){if((!p||32&r[0]&&o!==(o=e[5]._id||""))&&(i.value=o),4264226&r[0]|58835457&r[1]){let t;for(g=e[1].items,t=0;t<g.length;t+=1){const i=qs(e,g,t);v[t]?(v[t].p(i,r),pe(v[t],1)):(v[t]=Es(i),v[t].c(),pe(v[t],1),v[t].m(n,l))}for(me(),t=g.length;t<v.length;t+=1)y(t);fe()}e[1].list?w?(w.p(e,r),2&r[0]&&pe(w,1)):(w=Ds(e),w.c(),pe(w,1),w.m(n,null)):w&&(me(),$e(w,1,1,(()=>{w=null})),fe()),e[3]||e[2]||!e[41]||!e[4]||e[22]?x&&(me(),$e(x,1,1,(()=>{x=null})),fe()):x?(x.p(e,r),4194332&r[0]&&pe(x,1)):(x=Ps(e),x.c(),pe(x,1),x.m(t,a));const s={};512&r[4]&&(s.$$scope={dirty:r,ctx:e}),d.$set(s);let u=m;m=L(e),m===u?~m&&I[m].p(e,r):(f&&(me(),$e(I[u],1,1,(()=>{I[u]=null})),fe()),~m?(f=I[m],f?f.p(e,r):(f=I[m]=k[m](e),f.c()),pe(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)pe(v[e]);pe(w),pe(x),pe(d.$$.fragment,e),pe(f),p=!0}},o(e){v=v.filter(_s);for(let e=0;e<v.length;e+=1)$e(v[e]);$e(w),$e(x),$e(d.$$.fragment,e),$e(f),p=!1},d(e){e&&j(t),q(v,e),w&&w.d(),x&&x.d(),ke(d),~m&&I[m].d(),$=!1,b(h)}}}(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[126]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Fs(e){let t,n;return t=new Zl({props:{classId:e[31],item:e[130],selection:e[130].selection,record:e[5],disabled:e[22],eventId:e[40],toDelete:e[12],currency:e[8],changeValue:e[16]}}),t.$on("task",e[45]),t.$on("notify",e[46]),t.$on("safeReference",e[55]),t.$on("multi",e[47]),t.$on("defPrep",e[54]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2&n[0]&&(i.item=e[130]),2&n[0]&&(i.selection=e[130].selection),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),4096&n[0]&&(i.toDelete=e[12]),256&n[0]&&(i.currency=e[8]),65536&n[0]&&(i.changeValue=e[16]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Es(e){let t,n,i="list"!==e[130].type&&Fs(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[130].type?i?(i.p(e,n),2&n[0]&&pe(i,1)):(i=Fs(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Ds(e){let t,n,i,o,r,l=e[36]&&e[9]&&0!=e[9]&&zs(e),s=e[10]&&As(e),a=e[37]&&e[15]&&0!=e[15]&&Vs(e),c=e[1].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=Rs(js(e,c,t));const u=e=>$e(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=E(),s&&s.c(),n=E(),a&&a.c(),i=E();for(let e=0;e<d.length;e+=1)d[e].c();o=D()},m(e,c){l&&l.m(e,c),C(e,t,c),s&&s.m(e,c),C(e,n,c),a&&a.m(e,c),C(e,i,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);C(e,o,c),r=!0},p(e,r){if(e[36]&&e[9]&&0!=e[9]?l?(l.p(e,r),512&r[0]&&pe(l,1)):(l=zs(e),l.c(),pe(l,1),l.m(t.parentNode,t)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[10]?s?(s.p(e,r),1024&r[0]&&pe(s,1)):(s=As(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[37]&&e[15]&&0!=e[15]?a?(a.p(e,r),32768&r[0]&&pe(a,1)):(a=Vs(e),a.c(),pe(a,1),a.m(i.parentNode,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),4612518&r[0]|33686017&r[1]){let t;for(c=e[1].list,t=0;t<c.length;t+=1){const n=js(e,c,t);d[t]?(d[t].p(n,r),pe(d[t],1)):(d[t]=Rs(n),d[t].c(),pe(d[t],1),d[t].m(o.parentNode,o))}for(me(),t=c.length;t<d.length;t+=1)u(t);fe()}},i(e){if(!r){pe(l),pe(s),pe(a);for(let e=0;e<c.length;e+=1)pe(d[e]);r=!0}},o(e){$e(l),$e(s),$e(a),d=d.filter(_s);for(let e=0;e<d.length;e+=1)$e(d[e]);r=!1},d(e){l&&l.d(e),e&&j(t),s&&s.d(e),e&&j(n),a&&a.d(e),e&&j(i),q(d,e),e&&j(o)}}}function zs(e){let t,n;return t=new e[26]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[Ts]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ts(e){let t,n,i;function o(t){e[64](t)}let r={item:e[34],disabled:!0,currency:e[8]};return void 0!==e[9]&&(r.value=e[9]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&512&i[0]&&(n=!0,o.value=e[9],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function As(e){let t,n;return t=new e[26]({props:{name:"Total MWSt "+(e[11]?"("+e[11]+"%)":""),nameClass:"formField_italic",$$slots:{default:[Bs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2048&n[0]&&(i.name="Total MWSt "+(e[11]?"("+e[11]+"%)":"")),1280&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bs(e){let t,n,i;function o(t){e[65](t)}let r={item:e[35],disabled:!0,currency:e[8]};return void 0!==e[10]&&(r.value=e[10]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Vs(e){let t,n;return t=new e[26]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[Os]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};32768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Os(e){let t,n,i;function o(t){e[66](t)}let r={item:e[38],disabled:!0};return void 0!==e[15]&&(r.value=e[15]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};!n&&32768&i[0]&&(n=!0,o.value=e[15],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Ms(e){let t,n;return t=new yi({props:{classId:e[31],open:!e[2]&&1===e[1].list.length,list:e[127],template:e[17],eventId:e[40],schema:e[127].item,record:e[5],disabled:e[22],currency:e[8]}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};6&n[0]&&(i.open=!e[2]&&1===e[1].list.length),2&n[0]&&(i.list=e[127]),131072&n[0]&&(i.template=e[17]),2&n[0]&&(i.schema=e[127].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ws(e){let t,n;return t=new Ss({props:{classId:e[31],open:e[14],list:e[127],template:e[18],eventId:e[40],schema:e[127].item,mainSchema:e[1].item,record:e[5],disabled:e[22],fixed:e[127].fixed,reqQuantity:e[13],currency:e[8],notifyList:e[7]}}),t.$on("save",e[48]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};16384&n[0]&&(i.open=e[14]),2&n[0]&&(i.list=e[127]),262144&n[0]&&(i.template=e[18]),2&n[0]&&(i.schema=e[127].item),2&n[0]&&(i.mainSchema=e[1].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),2&n[0]&&(i.fixed=e[127].fixed),8192&n[0]&&(i.reqQuantity=e[13]),256&n[0]&&(i.currency=e[8]),128&n[0]&&(i.notifyList=e[7]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Rs(e){let t,n,i,o,r,l;t=new e[24]({props:{text:e[127].designation}});const s=[Ws,Ms],a=[];function c(e,t){return"array"===e[127].type?0:1}return i=c(e),o=a[i]=s[i](e),{c(){be(t.$$.fragment),n=E(),o.c(),r=D()},m(e,o){xe(t,e,o),C(e,n,o),a[i].m(e,o),C(e,r,o),l=!0},p(e,n){const l={};2&n[0]&&(l.text=e[127].designation),t.$set(l);let d=i;i=c(e),i===d?a[i].p(e,n):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),o=a[i],o?o.p(e,n):(o=a[i]=s[i](e),o.c()),pe(o,1),o.m(r.parentNode,r))},i(e){l||(pe(t.$$.fragment,e),pe(o),l=!0)},o(e){$e(t.$$.fragment,e),$e(o),l=!1},d(e){ke(t,e),e&&j(n),a[i].d(e),e&&j(r)}}}function Ps(e){let t,n,i,o;function r(t){e[67](t)}let l={title:"",$$slots:{default:[Hs]},$$scope:{ctx:e}};return void 0!==e[21]&&(l.checked=e[21]),n=new e[27]({props:l}),K.push((()=>we(n,"checked",r))),{c(){t=N("div"),be(n.$$.fragment),B(t,"class","askNext"),M(t,"margin-top","1em"),M(t,"margin-left","23em")},m(e,i){C(e,t,i),xe(n,t,null),o=!0},p(e,t){const o={};512&t[4]&&(o.$$scope={dirty:t,ctx:e}),!i&&2097152&t[0]&&(i=!0,o.checked=e[21],re((()=>i=!1))),n.$set(o)},i(e){o||(pe(n.$$.fragment,e),o=!0)},o(e){$e(n.$$.fragment,e),o=!1},d(e){e&&j(t),ke(n)}}}function Hs(e){let t;return{c(){t=N("span"),t.textContent="Weiter erfassen",M(t,"margin-left",".75em")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Qs(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ys(e){let t,n,i,o,r;t=new e[25]({props:{class:"close",disabled:e[22],form:e[31],filled:!0,type:"submit",$$slots:{default:[Us]},$$scope:{ctx:e}}});let l=e[4]&&!e[22]&&Js(e),s=e[19]&&Zs(e);return{c(){be(t.$$.fragment),n=E(),l&&l.c(),i=E(),s&&s.c(),o=D()},m(e,a){xe(t,e,a),C(e,n,a),l&&l.m(e,a),C(e,i,a),s&&s.m(e,a),C(e,o,a),r=!0},p(e,n){const r={};4194304&n[0]&&(r.disabled=e[22]),512&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[4]&&!e[22]?l?(l.p(e,n),4194320&n[0]&&pe(l,1)):(l=Js(e),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=Zs(e),s.c(),pe(s,1),s.m(o.parentNode,o)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){r||(pe(t.$$.fragment,e),pe(l),pe(s),r=!0)},o(e){$e(t.$$.fragment,e),$e(l),$e(s),r=!1},d(e){ke(t,e),e&&j(n),l&&l.d(e),e&&j(i),s&&s.d(e),e&&j(o)}}}function Gs(e){let t,n,i,o;t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[la]},$$scope:{ctx:e}}}),t.$on("click",e[52]);let r=e[20]&&sa(e);return{c(){be(t.$$.fragment),n=E(),r&&r.c(),i=D()},m(e,l){xe(t,e,l),C(e,n,l),r&&r.m(e,l),C(e,i,l),o=!0},p(e,n){const o={};512&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o),e[20]?r?(r.p(e,n),1048576&n[0]&&pe(r,1)):(r=sa(e),r.c(),pe(r,1),r.m(i.parentNode,i)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(t.$$.fragment,e),pe(r),o=!0)},o(e){$e(t.$$.fragment,e),$e(r),o=!1},d(e){ke(t,e),e&&j(n),r&&r.d(e),e&&j(i)}}}function Us(e){let t;return{c(){t=F("Speichern und schliessen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Js(e){let t,n;return t=new e[25]({props:{form:e[31],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[Ks]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ks(e){let t;return{c(){t=F("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Zs(e){let t,n,i,o,r;const l=[ea,Xs],s=[];t=function(e,t){return e[39]?0:1}(e),n=s[t]=l[t](e);let a=e[20]&&oa(e);return{c(){n.c(),i=E(),a&&a.c(),o=D()},m(e,n){s[t].m(e,n),C(e,i,n),a&&a.m(e,n),C(e,o,n),r=!0},p(e,t){n.p(e,t),e[20]?a?(a.p(e,t),1048576&t[0]&&pe(a,1)):(a=oa(e),a.c(),pe(a,1),a.m(o.parentNode,o)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe())},i(e){r||(pe(n),pe(a),r=!0)},o(e){$e(n),$e(a),r=!1},d(e){s[t].d(e),e&&j(i),a&&a.d(e),e&&j(o)}}}function Xs(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[ta]},$$scope:{ctx:e}}}),t.$on("click",(function(){x(e[50](e[0]))&&e[50](e[0]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ea(e){let t,n;return t=new d({props:{text:e[39],extended:!0,$$slots:{default:[ia]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ta(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=N("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function na(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=N("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function ia(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[na]},$$scope:{ctx:e}}}),t.$on("click",(function(){x(e[50](e[0]))&&e[50](e[0]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function oa(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[ra]},$$scope:{ctx:e}}}),t.$on("click",(function(){x(e[51](e[0]))&&e[51](e[0]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ra(e){let t,n,i;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function la(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Erstellen",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function sa(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[aa]},$$scope:{ctx:e}}}),t.$on("click",e[53]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function aa(e){let t,n,i;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function ca(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function da(e){let t,n,i,o;Cs.title=t=e[23];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:ca,then:Ls,catch:Ns,value:126,blocks:[,,,]};return he(e[42](),r),{c(){n=E(),i=D(),r.block.c()},m(e,t){C(e,n,t),C(e,i,t),r.block.m(e,r.anchor=t),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(n,i){e=n,(!o||8388608&i[0])&&t!==(t=e[23])&&(Cs.title=t),ge(r,e,i)},i(e){o||(pe(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}let ua=new Map,ma=new Map,fa=new Map;const pa=(e,t)=>{const i=t;return ua.has(i)||ua.set(i,n.getTasksList(t).then((({data:e})=>e))),ua.get(i)},$a=(e,t,i,o=!1)=>ma.get(i)||o?n.getTaskList(e,i).then((e=>(ma.set(i,e),e))):pa(e,t).then((t=>t.find((({_id:e})=>e===i))||n.getTaskList(e,i))).then((e=>(ma.set(i,e),e))),ha=(e,t)=>{fa.set(e,t)},ga=e=>fa.get(e),va=(e,t,i=!1)=>!i&&fa.get(t)||n.getTask(e,t).then((e=>(fa.set(t,e),e))),ya=(e,t)=>{if(!ua.get(t))return;const i=t;ua.set(i,n.getTasksList(t).then((({data:e})=>e)))};function wa(e,r,a){let d,f,p,$,v,y,w,b;I(e,m,(e=>a(78,v=e))),I(e,s,(e=>a(79,y=e))),I(e,o,(e=>a(80,w=e)));const{Divider:x,Button:k,FormField:S,Checkbox:_}=c,{loggedIn:C,currentTasks:j,environment:q}=u;I(e,C,(e=>a(81,b=e))),I(e,j,(e=>a(76,p=e))),I(e,q,(e=>a(77,$=e)));const N=JSON.parse(t.getItem("Locale")),L=G();let F,E,D,z,T,{schema:A}=r,{recID:B}=r,{prevEventID:V=!1}=r,{prev:O=!1}=r,{taskId:M=!1}=r,{description:W=""}=r,{root:R=!1}=r,{readonly:P}=r,{isStandalone:H}=r,U={},J={},K="form-"+A.class+Math.floor(9e3*Math.random()+1e3).toString();const Z=R?"fEmbedded":"fTask",X=R?"sEmbedded":"sTask";let ee="CHF";let te,ne,oe=0,re=0,le=0,se=0,ae=1,ce=!B&&A.list&&1===A.list.length;const de={},ue=A.items.find((e=>"price"===e.name&&!e.properties?.hidden)),me=A.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),fe=A.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),pe=!!ue||!!fe,$e=A.list?.filter((e=>"array"===e.type))?.length>1||pe,he=A.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,ge=!!he,ve=A.list?.filter((e=>"array"===e.type))?.length>1||ge,ye={},we=A.result?.resultDef[0].button?.description;let be,xe,ke,Ie,Se=0,_e=0,Ce=[],je=[],qe=[],Ne={},Le=new Map,Fe=A.class,Ee=A.id,De=!1,ze=-1!==window.location.search.indexOf("next=");const Te=!p?.length||p.find((e=>e===Ee));["readonly","hidden","required"].map((e=>{A.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");Ce.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));A.items.filter((e=>e.selection&&e.constraint)).map((e=>{je.push({name:e.name,selection:e.selection,constraint:e.constraint})}));A.items.filter((e=>e.lookup)).forEach((e=>{qe.push({name:e.name,lookup:e.lookup})})),A.items.filter((e=>e.properties?.lookup)).forEach((e=>{qe.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const Ae=async e=>{if(e?.length)for(const t of e){if(!t.lookup)break;const{name:e}=t;if(U[e])break;const{domain:i,value:o}=t.lookup;if("user"===i&&o){const t=b.user,i={[o]:t},r=await n.getSectionView(e,i);if(r?.length){const[{_id:t}]=r;t&&a(5,U[e]=t,U)}}}},Be=async e=>{if(!A.input)return;if(!A.input.length)return;if(A.input.length<2)return;const t=!e.input.class[0].name&&e.input.class[0].selection;if(!t)return;const i=e.input.class[1].name,[o,r]=e.input.class[1].destination?.split(".");if(!i||!r)return;const l=A.list?.find((e=>e.name===o));if(!l)return;const s=await n.getSchemaByClass(t),c=(await n.getTasks(s.id)).data;if(!c?.length)return;const d=[];for(const e of c)if(e.active??1){const t={};for(const n of l.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);d.push(t)}d.length&&a(5,U[o]=d,U)},Ve=async()=>{for(const e of A.items)"boolean"==typeof e.properties?.value&&a(5,U[e.name]=e.properties.value,U),e.properties?.value?.concatenation&&Oe(e);for(const e of A.list||[])for(const t of e.item)if("array"!==e.type&&"owner"===t.refItem){const i=await n.getSolitaire(t.refItem);i?.length&&(U[e.name]||a(5,U[e.name]={},U),a(5,U[e.name][t.name]=g(i[0],t.refPos||t.name),U))}},Oe=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 We(e.refItemNext));a(5,U[e.name]=n,U)},Me=async e=>{const t=Ce.filter((t=>t.refObj===e));if(t?.length){a(16,Ne={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:r}=e;if(!n)break;let l,s,c=!i&&U[n];const d=U[n];d&&i&&(c=(await va(n,d))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==r&&"readonly"!==r||(r="required"===r?r:"disabled",setTimeout((()=>{l=`#${K} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(r,""),s&&!c&&s.removeAttribute(r)}),0)),"hidden"===r&&(l=`#${K} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(16,Ne[t]="",Ne))}}},We=async e=>{const[t,i]=e.offset?.split(",")||[0,0],o=+e.base||0,r=+e.step||1;e.type;const l=e.refItem,s=await n.getLastId(A.class,l);if(!s?.length)return(o+r).toString().padStart(i,"0");const a=s[0][l];return((+a?.substring(t,t+i)||o)+r).toString().padStart(i,"0")},Re=(e,t,n,i=!1)=>{const o=n||t.name,r=o.startsWith("_")?o:o.split("_")[0],l=e.find((e=>e.name===r));let s=t.value;if(!l)return s;if(!i&&l.properties?.multi&&(s=U[o]),"dateRange"===l.type){if(null===s)return;let e=new Date(s);if("Invalid Date"==e)return;return e=`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(e).toISOString()}if(s&&l.type.startsWith("date"))try{return Qn(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if("boolean"===l.type&&(s=!!t.checked),"number"===l.type){const e=Number("1.1").toLocaleString(N.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Pe=()=>H?window.close():R?window.singleSpaNavigate("/"):L("back"),He=async(e,t)=>{if(A.input&&A.input.length>1){if(A.input[0]!==e)return;const{recursive:i}=ke.input.class[1];if(t){const o=await n.getTaskOptions(`${e}:${t}`,Ee,i);a(5,U={...U,...o})}else{const e=A.input.slice(1);for(const t of e)a(5,U[t]=[],U)}}},Qe=()=>{let e=0;if(ue){let t=1;me&&(t=ae),e=se*t}fe&&(e=se);let t=0;for(const e in de)t+=de[e];a(9,oe=t+e)},Ye=()=>{let e=0;for(const t in ye)e+=ye[t];a(15,Se=e+ +_e)};i.subscribe((async e=>{if(!e)return;if(!B)return;const t=await n.getSchema(e.eventId);if(!t)return;const i=A.list?.find((e=>e.name===t.class));if(!i)return;const o=await n.getTaskById(e.taskId);((e,t,n)=>{if(!ua.get(e))return;const i=t;ma.set(i,n)})(o.event,o.docId,o.data);const r=await n.getTask(t.class,o.docId),l=U[t.class].filter((e=>e[t.class]==r._id));l?.length&&l.map((e=>{e[t.class]=o.docId})),a(5,U),a(63,E),a(62,F),a(1,A)})),Q((()=>{ua=new Map,ma=new Map,fa=new Map,Ge()}));const Ge=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(K))&&++n<20;)await e(50);t&&(()=>{if(B)return;const e=new Set;for(const t of Ce)e.add(t.refObj||Fe);Array.from(e).forEach((e=>Me(e)))})(),Ue()},Ue=()=>{setTimeout((()=>{Array.from(Le).forEach((([e,t])=>{U[e]||a(5,U[e]=t._id,U)}))}),350)};Y((()=>{B&&function(e,t,n=t){e.set(n)}(m,v={[B]:{record:U,lists:J}},v)}));const Je=()=>{const e={};Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,i]=t.name.split("."),o=A.list.find((e=>e.name===n));e[t.name]=Re(o.item,t)}else e[t.name]=Re(A.items,t,t.name.split("_")[0])})),A.list&&A.list.map((t=>{"array"===t.type&&J[t.name]&&(e[t.name]=J[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,i])=>("_delete"!==n&&(e[n]=Re(t.item,{name:n,value:i,checked:i},"",!0)),e)),{}))),[]))}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const i=A.items.find((t=>t.name===e));i?.properties?.required&&!n&&(t=!1)})),t&&e},Ke=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(1,A=e.schema),"recID"in e&&a(2,B=e.recID),"prevEventID"in e&&a(60,V=e.prevEventID),"prev"in e&&a(3,O=e.prev),"taskId"in e&&a(0,M=e.taskId),"description"in e&&a(58,W=e.description),"root"in e&&a(4,R=e.root),"readonly"in e&&a(59,P=e.readonly),"isStandalone"in e&&a(61,H=e.isStandalone)},e.$$.update=()=>{268435456&e.$$.dirty[1]&&a(22,d=P),2&e.$$.dirty[0]|3&e.$$.dirty[2]&&E&&F&&A.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const i=F.items.find((t=>t.name===e));if(!i)return;if(t!==i.type)return;const o="_"+e;E[e]?a(5,U[e]=E[e],U):a(5,U[e]="",U),E[o]&&a(5,U[o]=E[o],U),a(14,ce=!1)})),16&e.$$.dirty[0]|134217728&e.$$.dirty[1]&&a(23,f=R?W||"enablerr - Form":document.title)},[M,A,B,O,R,U,D,T,ee,oe,re,le,te,ne,ce,Se,Ne,be,xe,De,Ie,ze,d,f,x,k,S,_,C,j,q,K,Z,X,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},$e,ve,{name:"weekValue",properties:{decimals:1}},we,Ee,Te,async()=>{if(a(18,xe=[]),$.currency?a(8,ee=$.currency.designation):n.getSectionView("owner",{}).then((e=>{e?.length&&e[0].currency&&n.getSectionView("currency",{_id:e[0].currency}).then((e=>{e?.length&&e[0].designation&&a(8,ee=e[0].designation)}))})),ke=await n.getEvent(Ee),B||(a(17,be=xe),Ae(ke.input?.class),Ve(),Be(ke)),B){if(v&&v[B]){const e=v[B].record;A.items.map((t=>{e[t.name]=Re(A.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(5,U=e),A.list&&A.list.map((e=>{"array"===e.type&&v[B].lists[e.name]&&a(5,U[e.name]=v[B].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]),U)}))}else a(5,U=await n.getTask(A.class,B));a(58,W=h(A,U)),a(19,De=!!A.result?.resultDef&&!A.result.resultDef[0].createAfterSave),a(10,re=U._tax?._amount),a(11,le=100*U._tax?._rate||"")}if(V){a(59,P=!1),a(62,F=await n.getSchema(V)),"string"==typeof O&&a(63,E=await n.getTask(F.class,O));const e=A.items.find((e=>e.refClass===F.class));a(5,U[e.name]=E._id,U)}if(ve&&(_e=U[he]||0),ke.trigger?.startOn&&!ke.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(59,P=!0),y.role?.length&&A.authorization?.length){const e=A.authorization.some((e=>w?.find((t=>t===e.role&&"edit"===e.activity))));a(59,P||=!e)}if(a(6,D="report"===ke.output.type),$.userSetting){const e=$.userSetting;if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}else n.getUserSettings().then((e=>{if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}));return!0},async e=>{B||a(22,d=!0);const t=e.submitter?.className?.includes("close"),i={};if(Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((e=>{if(e.name)if(e.name.includes(".")){const t=e.name.split(".")[0],n=A.items.find((e=>e.name===t));if(n&&"object"===n.type&&n.properties?.multi)i[t]=(i[t]||[]).concat(e.value);else{const[t,n]=e.name.split("."),o=A.list.find((e=>e.name===t));i[e.name]=Re(o.item,e)}}else i[e.name]=Re(A.items,e)})),A.list&&A.list.map((e=>{"array"===e.type&&J[e.name]&&(i[e.name]=J[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]))})),i._event=Ee,i._prevEventId=V,i._taskId=M,z){const e=z.record;for(const t in e)t.includes(".")&&delete e[t];e._event=z.event,e._taskId=z.taskId;const{id:t}=await n.saveData(z.class,e);i[z.class]||(i[z.class]=t)}const{id:o,task:r,tax:s,error:c}=await n.saveData(A.class,i);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(22,d=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(10,re=s?._amount||0),a(11,le=100*(s?._rate||0)||""),i._id=o;const u=await n.getTaskList(A.class,o);if(L("choose",{row:u}),t)return Pe();if(!B){if(ze){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Ee}/${Ee}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${Ee}/${r}/task`)}},()=>!D&&V?window.history.back():Pe(),async({detail:e})=>{const{row:t}=e;let{eventId:i}=e;if((()=>{if(B)for(const e of Ce)e.refName||Me(e.itemName)})(),B)return;if(i||=t._task?.event,i&&(await(async(e,t)=>{if(!e)return;const i=(await n.getEvent(e)).output.class[0].name,o=qe.filter((e=>e.lookup===i));if(o?.length)for(const e of o){const{lookup:n,name:i}=e;let o="";if(t){let e=await va(n,t);e&&e[i]?.length&&(o=e[i][0][i])}a(5,U[i]=o,U)}})(i,t._id),A.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const t=await n.getEvent(i);t.output.class[0]?.name===e.properties.lookup&&a(5,U[e.name]="",U)}))),await(async()=>{let e,t=!1;const i={...U};for(const o of A.items)o.refItem&&U[o.refItem]&&(e=await n.getTask(o.refItem,U[o.refItem]),e&&(i[o.name]=e[o.name],t=!0));for(const o of A.list||[])if(o.refItem&&U[o.refItem]){e=await n.getTask(o.refItem,U[o.refItem]);const r=[];for(const n of e[o.name]){const e={};for(const t of o.item)n[t.name]&&(e[t.name]=n[t.name]);r.push(e),t=!0}i[o.name]=r}t&&a(5,U=i)})(),!t._task)return;const o=t._task.event,r=await n.getEvent(o);if(!ke.output?.class?.length)return;const l=ke.output.class[0]?.item.find((e=>(e.refClass||e.name)===r.output.class[0]?.name));(ke.input?.class?.length&&ke.input.class[0].name===r.output.class[0]?.name||l?.asInput)&&(a(62,F=await n.getSchema(o)),a(60,V=o),a(0,M=t._task._id),a(63,E=M?await n.getTask(F.class,t._task.docId):{}),He(F.class,t?._task?.docId))},async({detail:e})=>{if(a(7,T=e),"quantity"===e.itemName&&a(13,ne=U.quantity),(async(e,t)=>{const n=je.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(12,te=!1);for(const i of n){const{selection:n,constraint:o,name:r}=i;if(t)break;a(5,U[r]="",U),e===n&&a(12,te=o);const l=U[n];if(l&&e===o){let e=await va(n,l);const t=U[o];if(t?.length){const n=t[0].split(", ");e=e[o];let i="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(i=t[r])}));a(5,U[r]=i,U)}}}}})(e.itemName,e.oldValue===e.value),Me(e.itemName),ve&&he&&(e.itemName===he&&(_e=+e.value),Ye()),pe&&$e){if(e.itemName===ue?.name)se=e.value;else if(e.itemName===me?.name)ae=e.value;else{if(e.itemName!==fe?.name)return;se=e.value}Qe()}},async({detail:e})=>{if(!(A.input?.length&&A.input.length>1))return;if(F?.class!==A.input[0])return;const{value:t,lookup:i,view:o}=e;if(!i)return;const[r]=i.split(":"),l=(await n.getSectionView(r,{[o]:{$in:t}})).map((e=>e._id));for(const e of A.input.slice(1)){a(5,U[e]=[],U);const t=await n.getSchemaByClass(e);t.id;let i=await n.getTasks(t.id);if(i=i.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[r]))),i?.length){const t=i.map((e=>e._id)),o=await n.getSectionView(e,{_id:{$in:t}});for(const t of o)t[e]=t._id;a(5,U[e]=o,U)}}},({detail:e})=>{J[e.listName]=e.value,$e&&(de[e.listName]=e.amountValue,Qe()),ve&&(ye[e.listName]=e.weeksValue||0,Ye())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const t=await n.getReportDoc(e)||{},{userReportId:i,type:o}=t;if(!i)return;const r="/api/userreport/"+i;if("ics"===o)return window.open(r,"_self","width=1 height=1");const l="/viewer/doc/index.html?file="+r+"&type="+o;window.open(l,"","popup=yes toolbar=no width=624 height=900")},e=>async()=>{const e=await n.getDocData(M);(async(e,t)=>{const n=window.screen.height,i=window.open("","_blank","width=800,height="+n+",location=no");await ie(),i?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),i?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+e+"</textarea>")})(JSON.stringify(e,null,4),A.identity.designation)},async()=>{const e=Je();if(!e)return;const t=ke.result?.resultDef[0]?.addToReports;if(t){const i=e[t];if(i){const t={docId:i},o=(await n.getSectionView("_task",t))[0];e._taskId=o._id}}const{reportId:i,type:o}=await n.createReport(Ee,e);Ke(i),setTimeout(Pe,2e3)},async()=>{const e=Je();if(!e)return;const t=await n.getReportData(Ee,e),i=window.screen.height,o=window.open("","_blank","width=800,height="+i+",location=no");await ie(),o?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(t,null,4)+"</textarea>")},async({detail:{className:e,itemName:t,value:i}})=>{if(Fe!==i)return;if(Le.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===Fe))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&Le.set(e,r[0])},({detail:e})=>{z=e},({detail:e})=>{setTimeout((()=>{a(5,U[e.itemName]=e.value,U)}),200)},()=>A.result.resultDef[0].button?.designation||"Dokument erstellen",W,P,V,H,F,E,function(e){oe=e,a(9,oe)},function(e){re=e,a(10,re)},function(e){Se=e,a(15,Se)},function(e){ze=e,a(21,ze)}]}class ba extends Se{constructor(e){var t;super(),Cs.getElementById("svelte-9xiaib-style")||((t=N("style")).id="svelte-9xiaib-style",t.textContent="form.disabled.svelte-9xiaib input.svelte-9xiaib{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-9xiaib.svelte-9xiaib{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-9xiaib.svelte-9xiaib{min-width:30em}}.fEmbedded.svelte-9xiaib.svelte-9xiaib,.fTask.svelte-9xiaib.svelte-9xiaib{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-9xiaib.svelte-9xiaib{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-9xiaib.svelte-9xiaib{height:fit-content;max-height:70vh}.sTask.svelte-9xiaib.svelte-9xiaib{height:95%;display:inline-grid}.sTask.svelte-9xiaib .btn.svelte-9xiaib{display:initial !important}.form--buttons.svelte-9xiaib.svelte-9xiaib{display:flex;gap:1em;padding-top:0.75em}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}",_(Cs.head,t)),Ie(this,e,wa,da,k,{schema:1,recID:2,prevEventID:60,prev:3,taskId:0,description:58,root:4,readonly:59,isStandalone:61},[-1,-1,-1,-1,-1])}}function xa(e){let t,n,i;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 ba({props:r}),K.push((()=>we(t,"description",o))),t.$on("back",e[2]),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};32&i&&(o.schema=e[5]),64&i&&(o.recID=e[6]),!n&&1&i&&(n=!0,o.description=e[0],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function ka(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[xa,({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(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,[n]){const i={};1&n&&(i.description=e[0]),353&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ia(e,t,i){let o,{refresh:r}=t;return e.$$set=e=>{"refresh"in e&&i(3,r=e.refresh)},[o,(e,t)=>n.getSchema(e).then((n=>({schema:n,recID:t,eventID:e,title:n.identity.designation}))),e=>{},r,function(e){o=e,i(0,o)}]}function Sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _a,Ca,ja=(_a=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,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=i(i({},l),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var l={component:null,domElementGetter:null,props:{}};function s(e){return Promise.resolve()}function a(e,t,n){var o=Object.keys(l),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),l=o();t.instance=new e.component(i(i({},r),{},{target:l,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)}))}},_a(Ca={exports:{}},Ca.exports),Ca.exports);const qa=Sa(ja)({component:class extends Se{constructor(e){super(),Ie(this,e,Ia,ka,k,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:Na,mount:La,unmount:Fa}=qa;e({bootstrap:Na,mount:La,unmount:Fa});e("Form",ba),e("List",Ft),e("Template",class extends Se{constructor(e){var t;super(),Gn.getElementById("svelte-1phofh5-style")||((t=N("style")).id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",_(Gn.head,t)),Ie(this,e,ai,li,k,{schema:0,record:1})}})}}}));
1
+ System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],(function(e){"use strict";var t,n,i,o,r,l,s,a,c,d,u,m;return{setters:[function(e){t=e.Storage,n=e.Request,i=e.task_notification,o=e.currentRoles,r=e.TextArea,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){m=e.taskClipboard}],execute:function(){e("version","0.2.645");const f=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(" · "))),p=e=>{try{return new Date(e).toLocaleString()}catch{return e}},$=e=>e?"(ja)":"(nein)",h=(e,t)=>{const n={...t};return(e.display?.reduce(((t,i)=>{let[o,r]=i.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=>"boolean"==typeof n[e]?$(n[e]):f(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")},g=(e,t)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)??""}catch{return""}};function v(){}function y(e){return e()}function w(){return Object.create(null)}function b(e){e.forEach(y)}function x(e){return"function"==typeof e}function k(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function I(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return v;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function S(e){return null==e?"":e}function _(e,t){e.appendChild(t)}function C(e,t,n){e.insertBefore(t,n||null)}function j(e){e.parentNode.removeChild(e)}function q(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function N(e){return document.createElement(e)}function L(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function F(e){return document.createTextNode(e)}function E(){return F(" ")}function D(){return F("")}function z(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function T(e){return function(t){return t.preventDefault(),e.call(this,t)}}function A(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function B(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function V(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function O(e,t){e.value=null==t?"":t}function M(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function W(e,t,n){e.classList[n?"add":"remove"](t)}let R;function P(e){R=e}function H(){if(!R)throw new Error("Function called outside component initialization");return R}function Q(e){H().$$.on_mount.push(e)}function Y(e){H().$$.on_destroy.push(e)}function G(){const e=H();return(t,n)=>{const i=e.$$.callbacks[t];if(i){const o=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);i.slice().forEach((t=>{t.call(e,o)}))}}}function U(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const J=[],K=[],Z=[],X=[],ee=Promise.resolve();let te=!1;function ne(){te||(te=!0,ee.then(ae))}function ie(){return ne(),ee}function oe(e){Z.push(e)}function re(e){X.push(e)}let le=!1;const se=new Set;function ae(){if(!le){le=!0;do{for(let e=0;e<J.length;e+=1){const t=J[e];P(t),ce(t.$$)}for(P(null),J.length=0;K.length;)K.pop()();for(let e=0;e<Z.length;e+=1){const t=Z[e];se.has(t)||(se.add(t),t())}Z.length=0}while(J.length);for(;X.length;)X.pop()();te=!1,le=!1,se.clear()}}function ce(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(oe)}}const de=new Set;let ue;function me(){ue={r:0,c:[],p:ue}}function fe(){ue.r||b(ue.c),ue=ue.p}function pe(e,t){e&&e.i&&(de.delete(e),e.i(t))}function $e(e,t,n,i){if(e&&e.o){if(de.has(e))return;de.add(e),ue&&ue.c.push((()=>{de.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function he(e,t){const n=t.token={};function i(e,i,o,r){if(t.token!==n)return;t.resolved=r;let l=t.ctx;void 0!==o&&(l=l.slice(),l[o]=r);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==i&&e&&(me(),$e(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),fe())})):t.block.d(1),s.c(),pe(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[i]=s),a&&ae()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=H();if(e.then((e=>{P(n),i(t.then,1,t.value,e),P(null)}),(e=>{if(P(n),i(t.catch,2,t.error,e),P(null),!t.hasCatch)throw e})),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,e),!0;t.resolved=e}var o}function ge(e,t,n){const i=t.slice(),{resolved:o}=e;e.current===e.then&&(i[e.value]=o),e.current===e.catch&&(i[e.error]=o),e.block.p(i,n)}const ve="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ye(e,t){$e(e,1,1,(()=>{t.delete(e.key)}))}function we(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function be(e){e&&e.c()}function xe(e,t,n,i){const{fragment:o,on_mount:r,on_destroy:l,after_update:s}=e.$$;o&&o.m(t,n),i||oe((()=>{const t=r.map(y).filter(x);l?l.push(...t):b(t),e.$$.on_mount=[]})),s.forEach(oe)}function ke(e,t){const n=e.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ie(e,t,n,i,o,r,l=[-1]){const s=R;P(e);const a=e.$$={fragment:null,ctx:null,props:r,update:v,not_equal:o,bound:w(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:w(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...i)=>{const r=i.length?i[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]&&(J.push(e),ne(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,b(a.before_update),a.fragment=!!i&&i(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(j)}else a.fragment&&a.fragment.c();t.intro&&pe(e.$$.fragment),xe(e,t.target,t.anchor,t.customElement),ae()}P(s)}class Se{$destroy(){ke(this,1),this.$destroy=v}$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 _e(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("polyline"),o=L("line"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"points","8 12 12 16 16 12"),B(o,"x1","12"),B(o,"y1","8"),B(o,"x2","12"),B(o,"y2","16"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-arrow-down-circle "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-arrow-down-circle "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Ce(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class je extends Se{constructor(e){super(),Ie(this,e,Ce,_e,k,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),B(i,"points","22 4 12 14.01 9 11.01"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-check-circle "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-check-circle "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ne(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Le extends Se{constructor(e){super(),Ie(this,e,Ne,qe,k,{size:0,strokeWidth:1,class:2})}}function Fe(e){let t,n,i;return{c(){t=L("svg"),n=L("path"),B(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",i="feather feather-command "+e[2])},m(e,i){C(e,t,i),_(t,n)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-command "+e[2])&&B(t,"class",i)},i:v,o:v,d(e){e&&j(t)}}}function Ee(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class De extends Se{constructor(e){super(),Ie(this,e,Ee,Fe,k,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,i,o;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),B(n,"points","9 10 4 15 9 20"),B(i,"d","M20 4v7a4 4 0 0 1-4 4H4"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-corner-down-left "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-corner-down-left "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Te(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ae extends Se{constructor(e){super(),Ie(this,e,Te,ze,k,{size:0,strokeWidth:1,class:2})}}function Be(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("line"),o=L("line"),B(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),B(i,"x1","18"),B(i,"y1","9"),B(i,"x2","12"),B(i,"y2","15"),B(o,"x1","12"),B(o,"y1","9"),B(o,"x2","18"),B(o,"y2","15"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-delete "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function Ve(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Oe extends Se{constructor(e){super(),Ie(this,e,Ve,Be,k,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),o=L("line"),B(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),B(i,"points","15 3 21 3 21 9"),B(o,"x1","10"),B(o,"y1","14"),B(o,"x2","21"),B(o,"y2","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-external-link "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-external-link "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function We(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Re extends Se{constructor(e){super(),Ie(this,e,We,Me,k,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("circle"),i=L("line"),o=L("path"),B(n,"cx","12"),B(n,"cy","12"),B(n,"r","10"),B(i,"x1","2"),B(i,"y1","12"),B(i,"x2","22"),B(i,"y2","12"),B(o,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-globe "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-globe "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function He(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Qe extends Se{constructor(e){super(),Ie(this,e,He,Pe,k,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,i,o,r,l,s,a;return{c(){t=L("svg"),n=L("line"),i=L("line"),o=L("line"),r=L("line"),l=L("line"),s=L("line"),B(n,"x1","8"),B(n,"y1","6"),B(n,"x2","21"),B(n,"y2","6"),B(i,"x1","8"),B(i,"y1","12"),B(i,"x2","21"),B(i,"y2","12"),B(o,"x1","8"),B(o,"y1","18"),B(o,"x2","21"),B(o,"y2","18"),B(r,"x1","3"),B(r,"y1","6"),B(r,"x2","3.01"),B(r,"y2","6"),B(l,"x1","3"),B(l,"y1","12"),B(l,"x2","3.01"),B(l,"y2","12"),B(s,"x1","3"),B(s,"y1","18"),B(s,"x2","3.01"),B(s,"y2","18"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",a="feather feather-list "+e[2])},m(e,a){C(e,t,a),_(t,n),_(t,i),_(t,o),_(t,r),_(t,l),_(t,s)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&a!==(a="feather feather-list "+e[2])&&B(t,"class",a)},i:v,o:v,d(e){e&&j(t)}}}function Ge(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ue extends Se{constructor(e){super(),Ie(this,e,Ge,Ye,k,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("polyline"),B(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),B(i,"points","22,6 12,13 2,6"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-mail "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-mail "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function Ke(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ze extends Se{constructor(e){super(),Ie(this,e,Ke,Je,k,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,i,o;return{c(){t=L("svg"),n=L("path"),i=L("circle"),B(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),B(i,"cx","12"),B(i,"cy","10"),B(i,"r","3"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-map-pin "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-map-pin "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function et(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class tt extends Se{constructor(e){super(),Ie(this,e,et,Xe,k,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("line"),o=L("path"),B(n,"points","23 7 23 1 17 1"),B(i,"x1","16"),B(i,"y1","8"),B(i,"x2","23"),B(i,"y2","1"),B(o,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-phone-outgoing "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-phone-outgoing "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function it(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class ot extends Se{constructor(e){super(),Ie(this,e,it,nt,k,{size:0,strokeWidth:1,class:2})}}function rt(e){let t,n,i,o,r;return{c(){t=L("svg"),n=L("polyline"),i=L("path"),o=L("rect"),B(n,"points","6 9 6 2 18 2 18 9"),B(i,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),B(o,"x","6"),B(o,"y","14"),B(o,"width","12"),B(o,"height","8"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",r="feather feather-printer "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-printer "+e[2])&&B(t,"class",r)},i:v,o:v,d(e){e&&j(t)}}}function lt(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class st extends Se{constructor(e){super(),Ie(this,e,lt,rt,k,{size:0,strokeWidth:1,class:2})}}function at(e){let t,n,i,o;return{c(){t=L("svg"),n=L("circle"),i=L("line"),B(n,"cx","11"),B(n,"cy","11"),B(n,"r","8"),B(i,"x1","21"),B(i,"y1","21"),B(i,"x2","16.65"),B(i,"y2","16.65"),B(t,"xmlns","http://www.w3.org/2000/svg"),B(t,"width",e[0]),B(t,"height",e[0]),B(t,"fill","none"),B(t,"viewBox","0 0 24 24"),B(t,"stroke","currentColor"),B(t,"stroke-width",e[1]),B(t,"stroke-linecap","round"),B(t,"stroke-linejoin","round"),B(t,"class",o="feather feather-search "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&B(t,"width",e[0]),1&n&&B(t,"height",e[0]),2&n&&B(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-search "+e[2])&&B(t,"class",o)},i:v,o:v,d(e){e&&j(t)}}}function ct(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class dt extends Se{constructor(e){super(),Ie(this,e,ct,at,k,{size:0,strokeWidth:1,class:2})}}const{document:ut}=ve;function mt(e){e[45]=e[46].items}function ft(e,t,n){const i=e.slice();return i[47]=t[n],i[49]=n,i}function pt(e,t,n){const i=e.slice();return i[50]=t[n],i}function $t(e,t,n){const i=e.slice();return i[50]=t[n],i}function ht(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function gt(e){let t,n,i,o,r,l;mt(e);let s=e[5]?.length&&vt(e),a=e[45]?.length&&wt(e),c=e[5]?.length&&kt(e);return{c(){s&&s.c(),t=E(),n=N("div"),i=N("table"),a&&a.c(),o=E(),r=N("tbody"),c&&c.c(),B(i,"striped",""),B(i,"class","svelte-v0ogws"),B(n,"class","eList svelte-v0ogws")},m(e,d){s&&s.m(e,d),C(e,t,d),C(e,n,d),_(n,i),a&&a.m(i,null),_(i,o),_(i,r),c&&c.m(r,null),l=!0},p(e,n){mt(e),e[5]?.length?s?(s.p(e,n),32&n[0]&&pe(s,1)):(s=vt(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[45]?.length?a?a.p(e,n):(a=wt(e),a.c(),a.m(i,o)):a&&(a.d(1),a=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&pe(c,1)):(c=kt(e),c.c(),pe(c,1),c.m(r,null)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe())},i(e){l||(pe(s),pe(c),l=!0)},o(e){$e(s),$e(c),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),a&&a.d(),c&&c.d()}}}function vt(e){let t,n,i,o,r,l,s,a,c,d,u,m=e[6]&&yt(e);function f(t){e[29](t)}let p={id:e[10]};return void 0!==e[3]&&(p.value=e[3]),o=new e[8]({props:p}),K.push((()=>we(o,"value",f))),o.$on("input",e[14]),a=new Oe({props:{size:"18"}}),{c(){m&&m.c(),t=E(),n=N("div"),i=F("Suchen: "),be(o.$$.fragment),l=E(),s=N("span"),be(a.$$.fragment),B(s,"class","feather pointer svelte-v0ogws"),M(n,"margin-bottom","1em"),M(n,"position","relative")},m(r,f){m&&m.m(r,f),C(r,t,f),C(r,n,f),_(n,i),xe(o,n,null),_(n,l),_(n,s),xe(a,s,null),c=!0,d||(u=z(s,"click",e[16]),d=!0)},p(e,n){e[6]?m?64&n[0]&&pe(m,1):(m=yt(e),m.c(),pe(m,1),m.m(t.parentNode,t)):m&&(me(),$e(m,1,1,(()=>{m=null})),fe());const i={};!r&&8&n[0]&&(r=!0,i.value=e[3],re((()=>r=!1))),o.$set(i)},i(e){c||(pe(m),pe(o.$$.fragment,e),pe(a.$$.fragment,e),c=!0)},o(e){$e(m),$e(o.$$.fragment,e),$e(a.$$.fragment,e),c=!1},d(e){m&&m.d(e),e&&j(t),e&&j(n),ke(o),ke(a),d=!1,u()}}}function yt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function wt(e){let t,n,i,o=e[4]&&e[0]&&bt(),r=e[45],l=[];for(let t=0;t<r.length;t+=1)l[t]=xt($t(e,r,t));return{c(){t=N("thead"),n=N("tr"),o&&o.c(),i=E();for(let e=0;e<l.length;e+=1)l[e].c();B(n,"class","svelte-v0ogws"),B(t,"class","svelte-v0ogws")},m(e,r){C(e,t,r),_(t,n),o&&o.m(n,null),_(n,i);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=bt(),o.c(),o.m(n,i)):o&&(o.d(1),o=null),8196&t[0]){let i;for(r=e[45],i=0;i<r.length;i+=1){const o=$t(e,r,i);l[i]?l[i].p(o,t):(l[i]=xt(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),o&&o.d(),q(l,e)}}}function bt(e){let t;return{c(){t=N("th"),B(t,"class","svelte-v0ogws")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function xt(e){let t,n,i=e[50]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,t){4&t[0]&&i!==(i=e[50]?.designation+"")&&V(n,i)},d(e){e&&j(t)}}}function kt(e){let t,n,i=[],o=new Map,r=e[5];const l=e=>e[47]._id;for(let t=0;t<r.length;t+=1){let n=ft(e,r,t),s=l(n);o.set(s,i[t]=Ct(s,n))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,o){for(let t=0;t<i.length;t+=1)i[t].m(e,o);C(e,t,o),n=!0},p(e,n){178239&n[0]&&(r=e[5],me(),i=function(e,t,n,i,o,r,l,s,a,c,d,u){let m=e.length,f=r.length,p=m;const $={};for(;p--;)$[e[p].key]=p;const h=[],g=new Map,v=new Map;for(p=f;p--;){const e=u(o,r,p),s=n(e);let a=l.get(s);a?i&&a.p(e,t):(a=c(s,e),a.c()),g.set(s,h[p]=a),s in $&&v.set(s,Math.abs(p-$[s]))}const y=new Set,w=new Set;function b(e){pe(e,1),e.m(s,d),l.set(e.key,e),d=e.first,f--}for(;m&&f;){const t=h[f-1],n=e[m-1],i=t.key,o=n.key;t===n?(d=t.first,m--,f--):g.has(o)?!l.has(i)||y.has(i)?b(t):w.has(o)?m--:v.get(i)>v.get(o)?(w.add(i),b(t)):(y.add(o),m--):(a(n,l),m--)}for(;m--;){const t=e[m];g.has(t.key)||a(t,l)}for(;f;)b(h[f-1]);return h}(i,n,l,1,e,r,o,t.parentNode,ye,Ct,t,ft),fe())},i(e){if(!n){for(let e=0;e<r.length;e+=1)pe(i[e]);n=!0}},o(e){for(let e=0;e<i.length;e+=1)$e(i[e]);n=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&j(t)}}}function It(e){let t,n,i,o,r,l,s=e[4]&&e[0]&&St(e),a=e[45],c=[];for(let t=0;t<a.length;t+=1)c[t]=_t(pt(e,a,t));return{c(){t=N("tr"),s&&s.c(),n=E();for(let e=0;e<c.length;e+=1)c[e].c();i=E(),B(t,"class","pointer svelte-v0ogws"),W(t,"active",e[47]._id===e[1])},m(a,d){C(a,t,d),s&&s.m(t,null),_(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);_(t,i),o=!0,r||(l=z(t,"click",A((function(){x(e[12](e[47],e[49]))&&e[12](e[47],e[49]).apply(this,arguments)}))),r=!0)},p(o,r){if((e=o)[4]&&e[0]?s?(s.p(e,r),17&r[0]&&pe(s,1)):(s=St(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),10276&r[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=pt(e,a,n);c[n]?c[n].p(o,r):(c[n]=_t(o),c[n].c(),c[n].m(t,i))}for(;n<c.length;n+=1)c[n].d(1);c.length=a.length}34&r[0]&&W(t,"active",e[47]._id===e[1])},i(e){o||(pe(s),o=!0)},o(e){$e(s),o=!1},d(e){e&&j(t),s&&s.d(),q(c,e),r=!1,l()}}}function St(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=N("td"),be(n.$$.fragment),B(t,"class","editRow svelte-v0ogws"),M(t,"color","#326173")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",A((function(){x(e[17](e[47]))&&e[17](e[47]).apply(this,arguments)}))),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function _t(e){let t,n,i,o=e[11](e[47],e[50])+"";return{c(){t=N("td"),n=F(o),B(t,"class",i=S(e[50].type)+" svelte-v0ogws")},m(e,i){C(e,t,i),_(t,n)},p(e,r){36&r[0]&&o!==(o=e[11](e[47],e[50])+"")&&V(n,o),4&r[0]&&i!==(i=S(e[50].type)+" svelte-v0ogws")&&B(t,"class",i)},d(e){e&&j(t)}}}function Ct(e,t){let n,i,o,r=t[15](t[47],t[45],t[3]),l=r&&It(t);return{key:e,first:null,c(){n=D(),l&&l.c(),i=D(),this.first=n},m(e,t){C(e,n,t),l&&l.m(e,t),C(e,i,t),o=!0},p(e,n){t=e,44&n[0]&&(r=t[15](t[47],t[45],t[3])),r?l?(l.p(t,n),44&n[0]&&pe(l,1)):(l=It(t),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe())},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(n),l&&l.d(e),e&&j(i)}}}function jt(e){let t,n;return t=new e[7]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function qt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:jt,then:gt,catch:ht,value:46,blocks:[,,,]};return he(n=e[2]&&e[13](),o),{c(){t=D(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,4&i[0]&&n!==(n=e[2]&&e[13]())&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}const Nt=e("getDisplayItems",((e,t,n)=>{if(!e)return;let i=[];return e.forEach((e=>{if("_total"===e)return void i.push({name:"_total",designation:"Betrag",type:"number"});const[o,r]=e.split(".");let l=t.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));l&&(l={...l},l.name=`${o}_${r}`,n=n.map((e=>(e[o]&&(e[l.name]=e["_"+o]?e["_"+o][r]:e[o][r]),e)))),l||(l=t.items.find((e=>e.name===o))),i.find((e=>e?.name===o))||i.push(l)})),i.length?i:t.items}));function Lt(e,o,r){let l;let s=JSON.parse(t.getItem("Locale")).id;const a=G(),{Loading:d,TextField:m}=c,{currentTasks:p}=u;I(e,p,(e=>r(33,l=e)));let h,g,v,y,{inputList:w}=o,{eventId:b}=o,{prevEventId:x}=o,{className:k}=o,{rowId:S}=o,{filterForReady:_=!1}=o,{refStatus:C}=o,{showEdit:j=!1}=o,{praefix:q=""}=o,{selectionFields:N=!1}=o,{deList:L}=o,{stopAggregation:F=!1}=o,{inputSearch:E=""}=o,D=!0,z=E,T=k+Math.floor(9e3*Math.random()+1e3).toString()+"search",A=!1,B=!0;const V=(e,t)=>{if(!t)return;let n=e[t.name];if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&t.name.split("_").length>1){const[i,o]=t.name.split("_");try{n=e[i][0][o],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n=Number(n)?n.toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||0,maximumFractionDigits:t.decimals||0}):""),"number"===t.type?n:"boolean"==typeof n?$(n):f(e[`_${t.name}`]||n||"")},O=n.getSchemaByClass(k),M=async(e,t)=>{if(C)return r(18,C=[].concat(C)),e.filter((e=>!!C.find((t=>e._task.status===t))));if("Information"===t.state.task)return e;if(x){const t=await n.getEvent(x);if("report"===t?.output?.type)return e;if(t?.input?.class?.length&&t.input.class[0].name===k)return"Information"===t.state.task?e.filter((e=>"Closed"!==e._task.status)):e.filter((e=>"Ready"===e._task.status))}return e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status))},W=(e,t)=>{if(e){const n="string"==typeof e?e:Object.keys(e)[0],i=new Intl.Collator(s,{numeric:!0});return t.sort(((e,t)=>i.compare(e[n],t[n])))}return t},R=async e=>{let t,i=0;B=!1;const o=e=>new Promise((t=>setTimeout(t,e)));for(;i++<200&&!F&&!(t=await P(e));)await o(500);r(6,A=!1),F&&n.readTasksByAggregationId(e,!0),t&&(r(5,v=W(g.displaySort,t.data)),window.setTimeout((()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),B=!0}),100))},P=async e=>await n.readTasksByAggregationId(e),H=async(e,t,n,i)=>{const{value:o,refClass:r}=i,[l,s]=n.split("."),a=o?.get(q),c=a&&await va(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let i=e?.find((e=>e._id===n[t]))||{};i={...i};for(const e in i)n[e]&&(i[e]=n[e]);for(const e in n)n[e]&&(i[e]=n[e]);return ha(r+i._id.toString(),i),i})):e};Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(T)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await O;e.eventId===t.id&&(ya(t.class,e.eventId),r(2,D=!r(2,D=!1)))}));return e.$$set=e=>{"inputList"in e&&r(20,w=e.inputList),"eventId"in e&&r(21,b=e.eventId),"prevEventId"in e&&r(22,x=e.prevEventId),"className"in e&&r(23,k=e.className),"rowId"in e&&r(1,S=e.rowId),"filterForReady"in e&&r(24,_=e.filterForReady),"refStatus"in e&&r(18,C=e.refStatus),"showEdit"in e&&r(0,j=e.showEdit),"praefix"in e&&r(25,q=e.praefix),"selectionFields"in e&&r(26,N=e.selectionFields),"deList"in e&&r(27,L=e.deList),"stopAggregation"in e&&r(19,F=e.stopAggregation),"inputSearch"in e&&r(28,E=e.inputSearch)},[j,S,D,z,h,v,A,d,m,p,T,V,(e,t)=>n=>{r(19,F=!0);const i=B?e:y[t];a("choose",{row:i})},async()=>{g=await O,r(4,h=(e=>!l?.length||!!l.find((t=>t===e)))(g.id)),r(5,v=y=W(g.displaySort,w||await pa(g.class,g.id))),500===v?.length&&(r(6,A=!0),n.getTasksList(g.id,!1,!0).then((({aggregationId:e})=>R(e))));let e,t=!1,i="";const o=N&&N?.find((e=>g.class===e.refClass.split(":")[0])),s=o?.value?.get&&o.value.get(q);if(s){const[l,a]=o.refClass.split(":");g.class===l&&r(5,v=await H(v,l,a,o)),t=o.parentClass?.find((e=>"quantity"===e.name)),i=o.className,e=await n.getCountedSection(i,a.split(".")[0],s,l,"quantity")}r(0,j&&=!o),o||!_&&!C||r(5,v=await M(v,g));const{display:c}=g;let d=Nt(c,g,v);return!j&&t?(d=d.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),r(5,v=v.map((t=>{const n=e.find((e=>e._id===t._id));return n&&(t.ist=n.quantity.$numberDecimal),t}))),e.map((e=>{if(!v.find((t=>t._id===e._id))){const t=y.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,v.push(t)}})),a("init",v)):L&&r(5,v=v.filter((e=>!L.find((t=>t._id===e._id))))),{items:d}},({detail:{value:e}})=>{r(3,z=e)},(e,t,n)=>{if(!n)return!0;n=n.toLowerCase();let i=!1;for(const o of t){const t=V(e,o).toLowerCase();!i&&t.includes(n)&&(i=!0)}return i},()=>{r(3,z="")},e=>{window.open(`/task/${e._task.event}/${e._task._id}/task?view=standalone`,"_blank")},C,F,w,b,x,k,_,q,N,L,E,function(e){z=e,r(3,z)}]}class Ft extends Se{constructor(e){var t;super(),ut.getElementById("svelte-v0ogws-style")||((t=N("style")).id="svelte-v0ogws-style",t.textContent=".feather.svelte-v0ogws.svelte-v0ogws{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-v0ogws.svelte-v0ogws{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-v0ogws .editRow.svelte-v0ogws{width:1em}.eList.svelte-v0ogws table.svelte-v0ogws{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-v0ogws table thead.svelte-v0ogws{position:sticky;top:0;background:#326173;color:white}.eList.svelte-v0ogws table thead tr.svelte-v0ogws{height:2.3em}.eList.svelte-v0ogws table tbody tr.svelte-v0ogws{height:2.75em !important}th.svelte-v0ogws.svelte-v0ogws,td.svelte-v0ogws.svelte-v0ogws{padding-left:0.4em;padding-right:0.4em}td.number.svelte-v0ogws.svelte-v0ogws{text-align:end}tr.pointer.svelte-v0ogws.svelte-v0ogws:hover{background-color:#DAE1E5}tr.active.svelte-v0ogws.svelte-v0ogws{color:#326173;background-color:#fcebd5}",_(ut.head,t)),Ie(this,e,Lt,qt,k,{inputList:20,eventId:21,prevEventId:22,className:23,rowId:1,filterForReady:24,refStatus:18,showEdit:0,praefix:25,selectionFields:26,deList:27,stopAggregation:19,inputSearch:28},[-1,-1])}}function Et(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Dt(e){let t,n,i=e[41]&&zt(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[41]?i?(i.p(e,n),8&n[0]&&pe(i,1)):(i=zt(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function zt(e){let t,n;return t=new e[21]({props:{title:e[16]?"Auswahl":e[0],class:"eList "+(e[14]?"form":""),$$slots:{default:[Ht]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};65537&n[0]&&(i.title=e[16]?"Auswahl":e[0]),16384&n[0]&&(i.class="eList "+(e[14]?"form":"")),2097150&n[0]|2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Tt(e){let t,n;return t=new ba({props:{schema:e[2],recID:e[1],readonly:e[15]}}),t.$on("choose",(function(){x(e[30](e[41]))&&e[30](e[41]).apply(this,arguments)})),t.$on("back",e[27]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};4&i[0]&&(o.schema=e[2]),2&i[0]&&(o.recID=e[1]),32768&i[0]&&(o.readonly=e[15]),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function At(e){let t,n,i,o,r,l,s;t=new e[22]({props:{text:e[16]?"Zusätzliche Auswahl":""}});const a=[Vt,Bt],c=[];function d(e,t){return e[16]?0:1}return i=d(e),o=c[i]=a[i](e),l=new Ft({props:{inputSearch:e[12],eventId:e[2].id,className:e[2].class,prevEventId:e[11],filterForReady:e[4],refStatus:e[5],praefix:e[6],selectionFields:e[7],rowId:e[1],deList:e[9],stopAggregation:e[20],showEdit:e[8]}}),l.$on("edit",e[31]),l.$on("choose",e[34]),l.$on("init",e[32]),{c(){be(t.$$.fragment),n=E(),o.c(),r=E(),be(l.$$.fragment)},m(e,o){xe(t,e,o),C(e,n,o),c[i].m(e,o),C(e,r,o),xe(l,e,o),s=!0},p(e,n){const s={};65536&n[0]&&(s.text=e[16]?"Zusätzliche Auswahl":""),t.$set(s);let u=i;i=d(e),i===u?c[i].p(e,n):(me(),$e(c[u],1,1,(()=>{c[u]=null})),fe(),o=c[i],o?o.p(e,n):(o=c[i]=a[i](e),o.c()),pe(o,1),o.m(r.parentNode,r));const m={};4096&n[0]&&(m.inputSearch=e[12]),4&n[0]&&(m.eventId=e[2].id),4&n[0]&&(m.className=e[2].class),2048&n[0]&&(m.prevEventId=e[11]),16&n[0]&&(m.filterForReady=e[4]),32&n[0]&&(m.refStatus=e[5]),64&n[0]&&(m.praefix=e[6]),128&n[0]&&(m.selectionFields=e[7]),2&n[0]&&(m.rowId=e[1]),512&n[0]&&(m.deList=e[9]),1048576&n[0]&&(m.stopAggregation=e[20]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(pe(t.$$.fragment,e),pe(o),pe(l.$$.fragment,e),s=!0)},o(e){$e(t.$$.fragment,e),$e(o),$e(l.$$.fragment,e),s=!1},d(e){ke(t,e),e&&j(n),c[i].d(e),e&&j(r),ke(l,e)}}}function Bt(e){let t,n,i,o;n=new e[23]({props:{outline:!0,$$slots:{default:[Ot]},$$scope:{ctx:e}}}),n.$on("click",e[28]);let r=e[25]&&e[10]&&Mt(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),r&&r.c(),B(t,"class","form--buttons svelte-jb5mrh")},m(e,l){C(e,t,l),xe(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};2048&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[25]&&e[10]?r?(r.p(e,i),1024&i[0]&&pe(r,1)):(r=Mt(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),ke(n),r&&r.d()}}}function Vt(e){let t,n,i,o,r,l,s=e[19]&&Rt(e);return i=new e[23]({props:{outline:!0,$$slots:{default:[Pt]},$$scope:{ctx:e}}}),i.$on("click",e[28]),r=new e[22]({props:{text:"Liste aus "+e[13]}}),{c(){s&&s.c(),t=E(),n=N("div"),be(i.$$.fragment),o=E(),be(r.$$.fragment),B(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),C(e,t,a),C(e,n,a),xe(i,n,null),C(e,o,a),xe(r,e,a),l=!0},p(e,n){e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=Rt(e),s.c(),pe(s,1),s.m(t.parentNode,t)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe());const o={};2048&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o);const l={};8192&n[0]&&(l.text="Liste aus "+e[13]),r.$set(l)},i(e){l||(pe(s),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&j(t),e&&j(n),ke(i),e&&j(o),ke(r,e)}}}function Ot(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Mt(e){let t,n;return t=new e[23]({props:{filled:!0,$$slots:{default:[Wt]},$$scope:{ctx:e}}}),t.$on("click",e[29]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2048&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Wt(e){let t;return{c(){t=F("Neu")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Rt(e){let t,n;return t=new Zl({props:{item:e[17],record:{_id:"",[e[17].name]:""},noForm:"true",classId:"sel_"+e[17].name,eventId:e[18],required:!1,hidden:!1,readonly:!1,deList:e[19]}}),t.$on("notify",e[33]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};131072&n[0]&&(i.item=e[17]),131072&n[0]&&(i.record={_id:"",[e[17].name]:""}),131072&n[0]&&(i.classId="sel_"+e[17].name),262144&n[0]&&(i.eventId=e[18]),524288&n[0]&&(i.deList=e[19]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Pt(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ht(e){let t,n,i,o;const r=[At,Tt],l=[];function s(e,t){return e[41].length&&!e[14]?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Qt(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Yt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Qt,then:Dt,catch:Et,value:41,blocks:[,,,]};return he(n=e[26](e[3]),o),{c(){t=D(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,8&i[0]&&n!==(n=e[26](e[3]))&&he(n,o)||ge(o,e,i)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),o.block.d(e),o.token=null,o=null}}}function Gt(e,t,i){let o;const{Dialog:r,Divider:l,Button:s}=c,a=G(),{currentTasks:d}=u;I(e,d,(e=>i(37,o=e)));let{title:m}=t,{schema:f}=t,{recID:p}=t,{isOpening:$=!0}=t,{filterForReady:h=!1}=t,{refStatus:g}=t,{praefix:v=""}=t,{selectionFields:y=!1}=t,{showEdit:w=!0}=t,{deList:b}=t,{newAllowed:x=!0}=t,{prevEventId:k}=t,{inputSearch:S}=t,_=f.id;f.class;let C,j,q,N,L,F,E,D="",z=!1,T=!1;m??=f.identity.designation;const A=!o?.length||o.find((e=>e===_));return e.$$set=e=>{"title"in e&&i(0,m=e.title),"schema"in e&&i(2,f=e.schema),"recID"in e&&i(1,p=e.recID),"isOpening"in e&&i(3,$=e.isOpening),"filterForReady"in e&&i(4,h=e.filterForReady),"refStatus"in e&&i(5,g=e.refStatus),"praefix"in e&&i(6,v=e.praefix),"selectionFields"in e&&i(7,y=e.selectionFields),"showEdit"in e&&i(8,w=e.showEdit),"deList"in e&&i(9,b=e.deList),"newAllowed"in e&&i(10,x=e.newAllowed),"prevEventId"in e&&i(11,k=e.prevEventId),"inputSearch"in e&&i(12,S=e.inputSearch)},[m,p,f,$,h,g,v,y,w,b,x,k,S,D,z,C,q,L,F,E,T,r,l,s,d,A,async e=>{if(!e)return!1;const t=await pa(f.class,f.id);if(j=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),i(16,q=j?.value?.get&&j.value.get(v)),q){N=j.refClass;const[e,t]=N.split(":"),[o]=t.split(".");i(17,L=j.parentClass.find((t=>t.name===e)));const r=await n.getSchemaByClass(L.refClass);i(18,F=r.id),i(13,D=j.parentClass.find((e=>e.name===o)).designation)}return t},()=>{i(14,z=!1),p||a("back"),w||a("back")},()=>{i(20,T=!0),i(14,z=!1),a("back")},()=>{i(20,T=!0),i(1,p=!1),i(15,C=!1),i(14,z=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,i]=t.split(".");let o=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));if(o){e[`${n}_${i}`]=e[n][i]}})),a("choose",{row:e})},({detail:e})=>{i(15,C=!!e._task.visum||"Closed"===e._task.status),i(1,p=e._docId),i(14,z=!0)},({detail:e})=>{q&&i(19,E=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){U(e,t)}]}class Ut extends Se{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=N("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}",_(document.head,t)),Ie(this,e,Gt,Yt,k,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11,inputSearch:12},[-1,-1])}}const{document:Jt}=ve;function Kt(e){e[27]=e[29].list,e[28]=e[29].items}function Zt(e,t,n){const i=e.slice();return i[30]=t[n],i}function Xt(e,t,n){const i=e.slice();return i[33]=t[n],i}function en(e,t,n){const i=e.slice();return i[33]=t[n],i}function tn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function nn(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Kt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[on]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Oe({props:{size:"18"}});let b=e[28]?.length&&function(e){let t,n,i,o,r=e[28],l=[];for(let t=0;t<r.length;t+=1)l[t]=rn(en(e,r,t));return{c(){t=N("thead"),n=N("tr"),i=N("th"),o=E();for(let e=0;e<l.length;e+=1)l[e].c();B(i,"class","svelte-14hcfjl"),B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,r){C(e,t,r),_(t,n),_(n,i),_(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(r=e[28],i=0;i<r.length;i+=1){const o=en(e,r,i);l[i]?l[i].p(o,t):(l[i]=rn(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&j(t),q(l,e)}}}(e),x=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=an(Zt(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(44547&n[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const r=Zt(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=an(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),o=N("div"),r=F("Suchen: "),be(l.$$.fragment),a=E(),c=N("span"),be(d.$$.fragment),u=E(),m=N("div"),f=N("table"),b&&b.c(),p=E(),$=N("tbody"),x&&x.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),xe(n,t,null),C(s,i,y),C(s,o,y),_(o,r),xe(l,o,null),_(o,a),_(o,c),xe(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Kt(e);const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[28]?.length&&b.p(e,t),e[27]?.length&&x.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),pe(x),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),$e(x),h=!1},d(e){e&&j(t),ke(n),e&&j(i),e&&j(o),ke(l),ke(d),e&&j(u),e&&j(m),b&&b.d(),x&&x.d(),g=!1,v()}}}function on(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function rn(e){let t,n,i=e[33]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function ln(e){let t,n,i,o,r,l,s,a;i=new Re({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=sn(Xt(e,c,t));return{c(){t=N("tr"),n=N("td"),be(i.$$.fragment),o=E();for(let e=0;e<d.length;e+=1)d[e].c();r=E(),B(n,"class","editRow svelte-14hcfjl"),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[30]._id===e[0])},m(c,u){C(c,t,u),_(t,n),xe(i,n,null),_(t,o);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,r),l=!0,s||(a=z(n,"click",e[15](e[30])),s=!0)},p(n,i){if(e=n,3584&i[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const o=Xt(e,c,n);d[n]?d[n].p(o,i):(d[n]=sn(o),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&i[0]&&W(t,"active",e[30]._id===e[0])},i(e){l||(pe(i.$$.fragment,e),l=!0)},o(e){$e(i.$$.fragment,e),l=!1},d(e){e&&j(t),ke(i),q(d,e),s=!1,a()}}}function sn(e){let t,n,i,o,r=e[9](e[30],e[33])+"";return{c(){t=N("td"),n=F(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[30]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function an(e){let t,n,i=e[13](e[30],e[28],e[1]),o=i&&ln(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){2&n[0]&&(i=e[13](e[30],e[28],e[1])),i?o?(o.p(e,n),2&n[0]&&pe(o,1)):(o=ln(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function cn(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function dn(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:cn,then:nn,catch:tn,value:29,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function un(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[dn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};3&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function mn(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{classId:p}=t,{className:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,x="",k=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(h);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(k)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&ya(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(16,m=e.item),"classId"in e&&o(17,p=e.classId),"className"in e&&o(18,h=e.className),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(19,v=e.viewName),"viewValue"in e&&o(20,y=e.viewValue),"recordId"in e&&o(21,w=e.recordId),"filter"in e&&o(22,b=e.filter)},[g,x,r,l,s,a,d,u,k,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S;let t=[];if(m.lookup){const e="."+p+"#"+m.lookup,i=document.querySelector(e),o=i?.value||w;if(o){const e=await va(m.lookup,o);if(e){const i=e[m.name]?.map((e=>e[m.name]));i&&(t=await n.getSectionView(m.name,{_id:{$in:i}},!0))}}}else{const i="."+p+"#"+v.split(":")[0],o=document.querySelector(i);let r={[v]:o?.value||w};if(m.refItem){const e="."+p+"#"+m.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[m.refItem]:t.value},{[m.refItem]:{$exists:!0,$eq:""}}]};r={...r,...e}}}catch{}}r[v]&&(t=await n.getSectionView(e.class,r,!0)),b&&(t=t.filter((e=>e._id!=b)))}const i=e.display;return{list:t,items:Nt(i,e,t)}},({detail:{value:e}})=>{o(1,x=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,x="")},e=>async()=>{const t=await n.getTaskByDocId(e._id),i=`/task/${t.event}/${t._id}/task?view=standalone`;window.open(i)},m,p,h,v,y,w,b,()=>r("back"),function(e){x=e,o(1,x)}]}class fn extends Se{constructor(e){var t;super(),Jt.getElementById("svelte-14hcfjl-style")||((t=N("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Jt.head,t)),Ie(this,e,mn,un,k,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:pn}=ve;function $n(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function hn(e){let t,n,i=e[58]&&function(e){let t,n,i,o,l,s,a,c,d,u,m,f,p,$,h,g,v,y,w;function b(t){e[45](t)}function x(t){e[46](t)}let k={class:"full-width",id:e[28],rows:"1",required:e[1],disabled:e[3],placeholder:e[29],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[2]&&(k.value=e[2]);void 0!==e[23]&&(k.overwrite=e[23]);n=new r({props:k}),K.push((()=>we(n,"value",b))),K.push((()=>we(n,"overwrite",x))),n.$on("click",e[31]()),n.$on("onFocus",e[31](e[28]));const I=[vn,gn],q=[];function L(e,t){return!e[3]||e[14]?0:e[20]&&e[0]?1:-1}~(s=L(e))&&(a=q[s]=I[s](e));let F=(!e[3]||e[14]||e[15])&&yn(e);function T(t){e[47](t)}let A={class:"tModal",noClickaway:!0,$$slots:{default:[kn]},$$scope:{ctx:e}};void 0!==e[17]&&(A.open=e[17]);p=new e[25]({props:A}),K.push((()=>we(p,"open",T)));let V=e[18]&&In(e);return{c(){t=N("div"),be(n.$$.fragment),l=E(),a&&a.c(),c=E(),d=N("input"),m=E(),F&&F.c(),f=E(),be(p.$$.fragment),h=E(),V&&V.c(),g=D(),B(d,"class",u=S(e[7]||e[8])+" svelte-jox15l"),B(d,"id",e[5]),B(d,"name",e[5]),d.value=e[0],d.hidden=!0,M(t,"position","relative")},m(i,o){C(i,t,o),xe(n,t,null),_(t,l),~s&&q[s].m(t,null),_(t,c),_(t,d),_(t,m),F&&F.m(t,null),C(i,f,o),xe(p,i,o),C(i,h,o),V&&V.m(i,o),C(i,g,o),v=!0,y||(w=z(t,"keydown",e[32]),y=!0)},p(e,r){const l={};2&r[0]&&(l.required=e[1]),8&r[0]&&(l.disabled=e[3]),!i&&4&r[0]&&(i=!0,l.value=e[2],re((()=>i=!1))),!o&&8388608&r[0]&&(o=!0,l.overwrite=e[23],re((()=>o=!1))),n.$set(l);let m=s;s=L(e),s===m?~s&&q[s].p(e,r):(a&&(me(),$e(q[m],1,1,(()=>{q[m]=null})),fe()),~s?(a=q[s],a?a.p(e,r):(a=q[s]=I[s](e),a.c()),pe(a,1),a.m(t,c)):a=null),(!v||384&r[0]&&u!==(u=S(e[7]||e[8])+" svelte-jox15l"))&&B(d,"class",u),(!v||32&r[0])&&B(d,"id",e[5]),(!v||32&r[0])&&B(d,"name",e[5]),(!v||1&r[0]&&d.value!==e[0])&&(d.value=e[0]),!e[3]||e[14]||e[15]?F?(F.p(e,r),49160&r[0]&&pe(F,1)):(F=yn(e),F.c(),pe(F,1),F.m(t,null)):F&&(me(),$e(F,1,1,(()=>{F=null})),fe());const f={};6504273&r[0]|268435456&r[1]&&(f.$$scope={dirty:r,ctx:e}),!$&&131072&r[0]&&($=!0,f.open=e[17],re((()=>$=!1))),p.$set(f),e[18]?V?(V.p(e,r),262144&r[0]&&pe(V,1)):(V=In(e),V.c(),pe(V,1),V.m(g.parentNode,g)):V&&(me(),$e(V,1,1,(()=>{V=null})),fe())},i(e){v||(pe(n.$$.fragment,e),pe(a),pe(F),pe(p.$$.fragment,e),pe(V),v=!0)},o(e){$e(n.$$.fragment,e),$e(a),$e(F),$e(p.$$.fragment,e),$e(V),v=!1},d(e){e&&j(t),ke(n),~s&&q[s].d(),F&&F.d(),e&&j(f),ke(p,e),e&&j(h),V&&V.d(e),e&&j(g),y=!1,w()}}}(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[58]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function gn(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[37]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function vn(e){let t,n,i,o,r;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=[z(t,"click",e[31](!0)),z(t,"choose",e[34])],o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,b(r)}}}function yn(e){let t,n,i,o,r;return n=new Oe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-jox15l")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[36]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function wn(e){let t,n,i,o;const r=[xn,bn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function bn(e){let t,n;return t=new Ut({props:{title:e[6].designation,newAllowed:e[21],prevEventId:e[9],schema:e[16],recID:e[0],isOpening:e[17],filterForReady:e[22],refStatus:e[6].refStatus,selectionFields:e[12],deList:e[13],praefix:e[11],inputSearch:e[33]()}}),t.$on("choose",e[34]),t.$on("back",e[35]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.title=e[6].designation),2097152&n[0]&&(i.newAllowed=e[21]),512&n[0]&&(i.prevEventId=e[9]),65536&n[0]&&(i.schema=e[16]),1&n[0]&&(i.recID=e[0]),131072&n[0]&&(i.isOpening=e[17]),4194304&n[0]&&(i.filterForReady=e[22]),64&n[0]&&(i.refStatus=e[6].refStatus),4096&n[0]&&(i.selectionFields=e[12]),8192&n[0]&&(i.deList=e[13]),2048&n[0]&&(i.praefix=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function xn(e){let t,n;return t=new fn({props:{item:e[6],className:e[16].class,classId:e[8],rowId:e[0],recordId:e[10],viewName:e[4],viewValue:""}}),t.$on("choose",e[34]),t.$on("back",e[35]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.item=e[6]),65536&n[0]&&(i.className=e[16].class),256&n[0]&&(i.classId=e[8]),1&n[0]&&(i.rowId=e[0]),1024&n[0]&&(i.recordId=e[10]),16&n[0]&&(i.viewName=e[4]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function kn(e){let t,n,i=e[17]&&wn(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[17]?i?(i.p(e,n),131072&n[0]&&pe(i,1)):(i=wn(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function In(e){let t,n,i;function o(t){e[48](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[_n]},$$scope:{ctx:e}};return void 0!==e[18]&&(r.open=e[18]),t=new e[25]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};589825&i[0]|268435456&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&262144&i[0]&&(n=!0,o.open=e[18],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Sn(e){let t,n;return t=new ba({props:{schema:e[16],recID:e[0],readonly:!0}}),t.$on("back",e[35]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};65536&n[0]&&(i.schema=e[16]),1&n[0]&&(i.recID=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function _n(e){let t,n;return t=new e[24]({props:{title:e[19],$$slots:{default:[Sn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};524288&n[0]&&(i.title=e[19]),65537&n[0]|268435456&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Cn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function jn(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Cn,then:hn,catch:$n,value:58,blocks:[,,,]};return he(e[30](),i),{c(){t=D(),i.block.c()},m(e,o){C(e,t,o),i.block.m(e,i.anchor=o),i.mount=()=>t.parentNode,i.anchor=t,n=!0},p(t,n){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(e),i.token=null,i=null}}}function qn(e,t,i){let r,l,s;I(e,o,(e=>i(44,r=e)));const a=G(),{Dialog:d,Modal:m}=c,{currentTasks:f,loggedIn:p}=u;I(e,f,(e=>i(50,l=e))),I(e,p,(e=>i(51,s=e)));let{id:$}=t,{item:g}=t,{value:v=""}=t,{desc:y=""}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:x}=t,{recordId:k}=t,{withRefValue:S=!1}=t,{refValue:_=""}=t,{required:C}=t,{disabled:j}=t,{readonly:q}=t,{praefix:N}=t,{selectionFields:L}=t,{formnovalidate:F}=t,{selection:E}=t,{deList:D}=t,{isTemplate:z}=t,{noList:T=!1}=t,{multi:A=!1}=t;const B="comment_"+$;let V,O,M,W,R,P,H=!1,Q=!0,Y=!0,U=!0;q||=k&&g.asInput,j||=q,!E&&g.selection&&1===g.selection.split(":").length&&(E=g.selection);const J=q||j||g.lookup||E&&!g.constraint?"":"Suchbegriff ⏎",K=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},Z=e=>{e&&(i(2,y=h(M,e)),a("setRefDesc",y.split(" •")[0]),a("change",{value:v,description:y}),a("task",{row:e,eventId:M.id}))},X=()=>{i(17,H=!1),i(18,V=!1)};return e.$$set=e=>{"id"in e&&i(5,$=e.id),"item"in e&&i(6,g=e.item),"value"in e&&i(0,v=e.value),"desc"in e&&i(2,y=e.desc),"noForm"in e&&i(7,w=e.noForm),"classId"in e&&i(8,b=e.classId),"eventId"in e&&i(9,x=e.eventId),"recordId"in e&&i(10,k=e.recordId),"withRefValue"in e&&i(38,S=e.withRefValue),"refValue"in e&&i(39,_=e.refValue),"required"in e&&i(1,C=e.required),"disabled"in e&&i(3,j=e.disabled),"readonly"in e&&i(40,q=e.readonly),"praefix"in e&&i(11,N=e.praefix),"selectionFields"in e&&i(12,L=e.selectionFields),"formnovalidate"in e&&i(41,F=e.formnovalidate),"selection"in e&&i(4,E=e.selection),"deList"in e&&i(13,D=e.deList),"isTemplate"in e&&i(14,z=e.isTemplate),"noList"in e&&i(42,T=e.noList),"multi"in e&&i(15,A=e.multi)},e.$$.update=()=>{if(2&e.$$.dirty[0]|1024&e.$$.dirty[1]&&i(1,C=C&&!F),384&e.$$.dirty[1]&&S&&i(0,v=_),65601&e.$$.dirty[0]|2048&e.$$.dirty[1]&&v&&M&&Promise.resolve($a(g.refClass,M.id,v,!!g.lookup||T)).then(Z),65&e.$$.dirty[0]|12288&e.$$.dirty[1]&&v&&W&&g.name===W.input?.at(0)&&W.inputLookup?.length){const{domain:e}=W.inputLookup[0]||{};"user"===e&&(r.some((e=>W.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0))}65537&e.$$.dirty[0]&&!v&&M&&Z({})},[v,C,y,j,E,$,g,w,b,x,k,N,L,D,z,A,M,H,V,O,R,Q,Y,U,d,m,f,p,B,J,async()=>{try{const e=await n.getEvent(x);if(P="report"===e.output.type,i(22,Y=!g.asInput),i(21,Q=e.output?.class[0].name!==g.refClass),i(16,M=await n.getSchemaByClass(g.refClass)),K(M),i(20,R=(e=>!l?.length||!!l.find((t=>t===e)))(M.id)),i(43,W=await n.getSchema(x)),x&&k&&v&&!j&&W.input?.find((e=>e===g.refClass))&&i(3,j=!0),g.properties?.query?.lookup){const{domain:e,value:t}=g.properties.query.lookup;if("user"===e){const e=s.user,o={[t]:e},l=await n.getSectionView(g.refClass,o);if(l?.length){const[{_id:e}]=l;e&&(i(39,_=e),i(38,S=!0))}r.some((e=>M.authorization?.find((t=>t.role===e&&!t.constraint))))||i(3,j=!0)}}return i(19,O=M.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if(!0===e&&i(17,H=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(g.lookup||E&&!g.constraint||v)&&i(17,H=!0)},e=>{13==e.which&&(e.preventDefault(),i(17,H=!0))},()=>{if(v)return"";const e=document.getElementById(B);return e?.value||""},({detail:e})=>{i(0,v=e.row._id),X()},X,()=>{(P||R)&&(A?a("change",{value:v,delete:!0}):(i(0,v=""),i(2,y=""),i(23,U=!0),a("change",{value:v,description:y}),a("task",{row:{_task:{event:M.id,_id:!1}}})))},async()=>{if(!v)return;const e=await $a(g.refClass,M.id,v);if(!e._task)return;const t=e._task.task_id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},S,_,q,F,T,W,r,function(e){y=e,i(2,y)},function(e){U=e,i(23,U)},function(e){H=e,i(17,H)},function(e){V=e,i(18,V)}]}class Nn extends Se{constructor(e){var t;super(),pn.getElementById("svelte-jox15l-style")||((t=N("style")).id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",_(pn.head,t)),Ie(this,e,qn,jn,k,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:38,refValue:39,required:1,disabled:3,readonly:40,praefix:11,selectionFields:12,formnovalidate:41,selection:4,deList:13,isTemplate:14,noList:42,multi:15},[-1,-1])}}function Ln(e,t,n){const i=e.slice();return i[35]=t[n],i[37]=n,i}function Fn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function En(e){let t,n;return t=new e[16]({props:{outline:!0,$$slots:{default:[zn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8191&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Dn(e){let t,n;return t=new Nn({props:{classId:e[6],eventId:e[7],required:e[9],disabled:e[1],formnovalidate:e[12],readonly:e[10],id:e[2]+"."+e[37],item:e[3],desc:e[4],value:e[35],noForm:e[5],praefix:e[11],recordId:e[8],multi:!0}}),t.$on("change",e[23]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.classId=e[6]),128&n[0]&&(i.eventId=e[7]),512&n[0]&&(i.required=e[9]),2&n[0]&&(i.disabled=e[1]),4096&n[0]&&(i.formnovalidate=e[12]),1024&n[0]&&(i.readonly=e[10]),4&n[0]&&(i.id=e[2]+"."+e[37]),8&n[0]&&(i.item=e[3]),16&n[0]&&(i.desc=e[4]),1&n[0]&&(i.value=e[35]),32&n[0]&&(i.noForm=e[5]),2048&n[0]&&(i.praefix=e[11]),256&n[0]&&(i.recordId=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function zn(e){let t,n,i,o,r,l,s;n=new Ue({props:{size:"18"}});let a=e[0],c=[];for(let t=0;t<a.length;t+=1)c[t]=Dn(Ln(e,a,t));const d=e=>$e(c[e],1,1,(()=>{c[e]=null}));return{c(){t=N("span"),be(n.$$.fragment),i=E();for(let e=0;e<c.length;e+=1)c[e].c();o=D(),B(t,"class","feather pointer")},m(a,d){C(a,t,d),xe(n,t,null),C(a,i,d);for(let e=0;e<c.length;e+=1)c[e].m(a,d);C(a,o,d),r=!0,l||(s=z(t,"click",(function(){x(e[21](e[0]))&&e[21](e[0]).apply(this,arguments)})),l=!0)},p(t,n){if(e=t,8396799&n[0]){let t;for(a=e[0],t=0;t<a.length;t+=1){const i=Ln(e,a,t);c[t]?(c[t].p(i,n),pe(c[t],1)):(c[t]=Dn(i),c[t].c(),pe(c[t],1),c[t].m(o.parentNode,o))}for(me(),t=a.length;t<c.length;t+=1)d(t);fe()}},i(e){if(!r){pe(n.$$.fragment,e);for(let e=0;e<a.length;e+=1)pe(c[e]);r=!0}},o(e){$e(n.$$.fragment,e),c=c.filter(Boolean);for(let e=0;e<c.length;e+=1)$e(c[e]);r=!1},d(e){e&&j(t),ke(n),e&&j(i),q(c,e),e&&j(o),l=!1,s()}}}function Tn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function An(e){let t,n;return t=new e[18]({props:{title:e[14].designation,class:"eList",$$slots:{default:[Vn]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};16384&n[0]&&(i.title=e[14].designation),49480&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bn(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Vn(e){let t,n,i,o,r;return n=new e[19]({props:{outline:!0,$$slots:{default:[Bn]},$$scope:{ctx:e}}}),n.$on("click",e[24]),o=new Ft({props:{item:e[3],className:e[14].class,classId:e[6],rowId:e[15],recordId:e[8]}}),o.$on("choose",e[22]),o.$on("back",e[24]),{c(){t=N("div"),be(n.$$.fragment),i=E(),be(o.$$.fragment),B(t,"class","form--buttons")},m(e,l){C(e,t,l),xe(n,t,null),C(e,i,l),xe(o,e,l),r=!0},p(e,t){const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const r={};8&t[0]&&(r.item=e[3]),16384&t[0]&&(r.className=e[14].class),64&t[0]&&(r.classId=e[6]),32768&t[0]&&(r.rowId=e[15]),256&t[0]&&(r.recordId=e[8]),o.$set(r)},i(e){r||(pe(n.$$.fragment,e),pe(o.$$.fragment,e),r=!0)},o(e){$e(n.$$.fragment,e),$e(o.$$.fragment,e),r=!1},d(e){e&&j(t),ke(n),e&&j(i),ke(o,e)}}}function On(e){let t,n,i=e[13]&&An(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[13]?i?(i.p(e,n),8192&n[0]&&pe(i,1)):(i=An(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Mn(e){let t,n,i,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Tn,then:En,catch:Fn,value:34,blocks:[,,,]};function l(t){e[32](t)}he(e[20](),r);let s={class:"tModal",noClickaway:!0,$$slots:{default:[On]},$$scope:{ctx:e}};return void 0!==e[13]&&(s.open=e[13]),n=new e[17]({props:s}),K.push((()=>we(n,"open",l))),{c(){r.block.c(),t=E(),be(n.$$.fragment)},m(e,i){r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,C(e,t,i),xe(n,e,i),o=!0},p(t,o){ge(r,e=t,o);const l={};57672&o[0]|128&o[1]&&(l.$$scope={dirty:o,ctx:e}),!i&&8192&o[0]&&(i=!0,l.open=e[13],re((()=>i=!1))),n.$set(l)},i(e){o||(pe(r.block),pe(n.$$.fragment,e),o=!0)},o(e){for(let e=0;e<3;e+=1){$e(r.blocks[e])}$e(n.$$.fragment,e),o=!1},d(e){r.block.d(e),r.token=null,r=null,e&&j(t),ke(n,e)}}}function Wn(e,t,i){const o=G(),{Card:r,Modal:l,Dialog:s,Button:a}=c;let d,u,{id:m}=t,{item:f}=t,{values:p=[]}=t,{desc:$=""}=t,{noForm:h=!1}=t,{classId:g}=t,{eventId:v}=t,{recordId:y}=t,{withRefValue:w=!1}=t,{refValue:b=""}=t,{required:x}=t,{disabled:k}=t,{readonly:I}=t,{praefix:S}=t,{selectionFields:_}=t,{formnovalidate:C}=t,{selection:j}=t,{deList:q}=t,{isTemplate:N}=t,{noList:L=!1}=t,F=!1;k=!0;const E=()=>{i(13,F=!1)};return e.$$set=e=>{"id"in e&&i(2,m=e.id),"item"in e&&i(3,f=e.item),"values"in e&&i(0,p=e.values),"desc"in e&&i(4,$=e.desc),"noForm"in e&&i(5,h=e.noForm),"classId"in e&&i(6,g=e.classId),"eventId"in e&&i(7,v=e.eventId),"recordId"in e&&i(8,y=e.recordId),"withRefValue"in e&&i(25,w=e.withRefValue),"refValue"in e&&i(26,b=e.refValue),"required"in e&&i(9,x=e.required),"disabled"in e&&i(1,k=e.disabled),"readonly"in e&&i(10,I=e.readonly),"praefix"in e&&i(11,S=e.praefix),"selectionFields"in e&&i(27,_=e.selectionFields),"formnovalidate"in e&&i(12,C=e.formnovalidate),"selection"in e&&i(28,j=e.selection),"deList"in e&&i(29,q=e.deList),"isTemplate"in e&&i(30,N=e.isTemplate),"noList"in e&&i(31,L=e.noList)},[p,k,m,f,$,h,g,v,y,x,I,S,C,F,d,u,r,l,s,a,async()=>{i(14,d=await n.getSchemaByClass(f.refClass))},e=>()=>{i(13,F=!0),i(15,u=e)},({detail:e})=>{const t=e.row._id;p.find((e=>e===t))||i(0,p=p.concat(e.row._id)),E()},({detail:e})=>{e.delete&&i(0,p=p.filter((t=>t!==e.value))),e.value=p,o("change",e)},E,w,b,_,j,q,N,L,function(e){F=e,i(13,F)}]}class Rn extends Se{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=N("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",_(document.head,t)),Ie(this,e,Wn,Mn,k,{id:2,item:3,values:0,desc:4,noForm:5,classId:6,eventId:7,recordId:8,withRefValue:25,refValue:26,required:9,disabled:1,readonly:10,praefix:11,selectionFields:27,formnovalidate:12,selection:28,deList:29,isTemplate:30,noList:31},[-1,-1])}}const Pn=/\d+/g,Hn=/%[HMSpPdmyY%]/g;function Qn(e,t,n){const i=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===e)return null;const r=t.split(Hn);let l=0,s=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,l))return n;if(l+=c.length,l===e.length){if(s!==t.length)return n;break}if("%"!==t[s+c.length])break;if(s+=c.length+1,"%"===t[s]){if("%"!==e[l])return n;l++}else if("p"===t[s].toLowerCase()){const t=e.substr(l,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{Pn.lastIndex=l;const r=Pn.exec(e);if(null==r)return n;switch(t[s]){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*i+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}l+=r[0].length}s++}return isNaN(a.valueOf())?n:a}function Yn(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Gn}=ve;function Un(e,t,n){const i=e.slice();return i[17]=t[n],i}function Jn(e,t,n){const i=e.slice();return i[20]=t[n],i}function Kn(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Zn(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=ei(Jn(e,p,t));const h=e=>$e($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&ti(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[ii]},$$scope:{ctx:e}}}),a.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[oi]},$$scope:{ctx:e}}}),{c(){t=N("form"),n=N("input"),o=E();for(let e=0;e<$.length;e+=1)$[e].c();r=E(),g&&g.c(),l=E(),s=N("div"),be(a.$$.fragment),c=E(),be(d.$$.fragment),B(n,"class",S(e[6])+" svelte-1phofh5"),B(n,"name","_id"),B(n,"type","hidden"),n.value=i=e[1]._id||"",B(t,"class","fTask svelte-1phofh5"),B(t,"id",e[6]),B(s,"class","form--buttons svelte-1phofh5")},m(i,p){C(i,t,p),_(t,n),_(t,o);for(let e=0;e<$.length;e+=1)$[e].m(t,null);_(t,r),g&&g.m(t,null),C(i,l,p),C(i,s,p),xe(a,s,null),_(s,c),xe(d,s,null),u=!0,m||(f=[z(t,"keydown",e[8]),z(t,"submit",T(e[10]))],m=!0)},p(e,o){if((!u||2&o&&i!==(i=e[1]._id||""))&&(n.value=i),75&o){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const i=Jn(e,p,n);$[n]?($[n].p(i,o),pe($[n],1)):($[n]=ei(i),$[n].c(),pe($[n],1),$[n].m(t,r))}for(me(),n=p.length;n<$.length;n+=1)h(n);fe()}e[0].list?g?(g.p(e,o),1&o&&pe(g,1)):(g=ti(e),g.c(),pe(g,1),g.m(t,null)):g&&(me(),$e(g,1,1,(()=>{g=null})),fe());const l={};8388608&o&&(l.$$scope={dirty:o,ctx:e}),a.$set(l);const s={};4&o&&(s.disabled=e[2]),8388608&o&&(s.$$scope={dirty:o,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)pe($[e]);pe(g),pe(a.$$.fragment,e),pe(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)$e($[e]);$e(g),$e(a.$$.fragment,e),$e(d.$$.fragment,e),u=!1},d(e){e&&j(t),q($,e),g&&g.d(),e&&j(l),e&&j(s),ke(a),ke(d),m=!1,b(f)}}}function Xn(e){let t,n;return t=new Zl({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.item=e[20]),1&n&&(i.selection=e[20].selection),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),1&n&&(i.eventId=e[0].id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ei(e){let t,n,i=si(!0,e[20]),o=i&&Xn(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){1&n&&(i=si(!0,e[20])),i?o?(o.p(e,n),1&n&&pe(o,1)):(o=Xn(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function ti(e){let t,n,i=e[0].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=ni(Un(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(75&n){let l;for(i=e[0].list,l=0;l<i.length;l+=1){const r=Un(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ni(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function ni(e){let t,n,i,o;return t=new e[4]({props:{text:e[17].designation}}),i=new yi({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment)},m(e,r){xe(t,e,r),C(e,n,r),xe(i,e,r),o=!0},p(e,n){const o={};1&n&&(o.text=e[17].designation),t.$set(o);const r={};1&n&&(r.list=e[17]),1&n&&(r.eventId=e[0].id),1&n&&(r.schema=e[17].item),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){ke(t,e),e&&j(n),ke(i,e)}}}function ii(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function oi(e){let t;return{c(){t=F("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ri(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function li(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:ri,then:Zn,catch:Kn,value:16,blocks:[,,,]};return he(e[7](),o),{c(){t=E(),n=N("section"),o.block.c(),Gn.title="Vorgaben",B(n,"class","sTask svelte-1phofh5")},m(e,r){C(e,t,r),C(e,n,r),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,i=!0},p(t,[n]){ge(o,e=t,n)},i(e){i||(pe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}i=!1},d(e){e&&j(t),e&&j(n),o.block.d(),o.token=null,o=null}}}const si=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function ai(e,i,r){let a,d,u;I(e,s,(e=>r(11,d=e))),I(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(t.getItem("Locale"));let{schema:h}=i,{record:g}=i,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const w=()=>window.history.back(),b=(e,t,n=!1)=>{const i=t.id,o=e.find((e=>e.name===i));let r=t.value;if(!n&&o&&o.properties?.multi&&(r=g[i]),r&&o&&o.type.startsWith("date"))try{return Qn(r,"%d.%m.%Y").toISOString()}catch{return new Date(r).toISOString()}if(o&&"boolean"===o.type&&(r=!!t.checked),o&&"number"===o.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{r=Number(r.replace(e,".")).toString()}catch{}}return r};return e.$$set=e=>{"schema"in e&&r(0,h=e.schema),"record"in e&&r(1,g=e.record)},e.$$.update=()=>{4&e.$$.dirty&&r(3,a=y)},[h,g,y,a,m,f,v,async()=>{const e=await n.getEvent(h.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&r(2,y=!0),d.role?.length&&h.authorization?.length){const e=h.authorization.some((e=>u?.find((t=>t===e.role&&"edit"===e.activity))));r(2,y||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},w,async e=>{const t={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const n=e.id||e.name;if(n)if(n.includes(".")){const[i,o]=n.split("."),r=h.list.find((e=>e.name===i));t[n]=b(r.item,e)}else t[n]=b(h.items,e)})),await n.saveTemplate(h.class,t),l.success("Die Vorgaben wurden gespeichert.",2e3),w()}]}const{document:ci}=ve;function di(e,t,n){const i=e.slice();return i[28]=t[n],i}function ui(e){let t,n;return t=new Zl({props:{classId:e[2],item:e[28],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4],required:e[5],currency:e[8]}}),t.$on("notify",e[14]),t.$on("defPrep",e[16]),t.$on("task",e[21]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),2&n[0]&&(i.item=e[28]),2&n[0]&&(i.listName=e[1].name),8&n[0]&&(i.eventId=e[3]),1&n[0]&&(i.record=e[0]),16&n[0]&&(i.disabled=e[4]),32&n[0]&&(i.required=e[5]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function mi(e){let t,n,i=si(e[7],e[28]),o=i&&ui(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){130&n[0]&&(i=si(e[7],e[28])),i?o?(o.p(e,n),130&n[0]&&pe(o,1)):(o=ui(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function fi(e){let t,n,i,o=e[1].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=mi(di(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));return{c(){t=N("div");for(let e=0;e<r.length;e+=1)r[e].c();B(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){C(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);i=!0},p(e,s){if(82367&s[0]){let n;for(o=e[1].item,n=0;n<o.length;n+=1){const i=di(e,o,n);r[n]?(r[n].p(i,s),pe(r[n],1)):(r[n]=mi(i),r[n].c(),pe(r[n],1),r[n].m(t,null))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}(!i||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&B(t,"id",n)},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);i=!1},d(e){e&&j(t),q(r,e)}}}function pi(e){let t,n,i=e[13](e[9])+"";return{c(){t=N("span"),n=F(i)},m(e,i){C(e,t,i),_(t,n)},p(e,t){512&t[0]&&i!==(i=e[13](e[9])+"")&&V(n,i)},d(e){e&&j(t)}}}function $i(e){let t,n,i;return n=new e[10]({props:{$$slots:{default:[pi]},$$scope:{ctx:e}}}),n.$on("click",(function(){x(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=N("div"),be(n.$$.fragment),B(t,"class","accordion svelte-148ktt9"),B(t,"slot","handle")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(t,i){e=t;const o={};512&i[0]|1&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function hi(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[$i,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[fi,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.open=e[6]),134218687&n[0]|1&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function gi(e){let t,n,i;return n=new e[11]({props:{$$slots:{default:[hi]},$$scope:{ctx:e}}}),{c(){t=N("div"),be(n.$$.fragment),B(t,"class","formList")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,t){const i={};1023&t[0]|1&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function vi(e,t,i){const{Button:o,Accordion:r,AccordionSection:l}=c;let{list:s}=t,{schema:a}=t,{record:d}=t,{classId:u}=t,{eventId:m}=t,{disabled:h}=t,{required:g}=t,{open:v=!1}=t,{template:y={}}=t,{isTemplate:w=!1}=t,{currency:b}=t,{update:x=!1}=t,k=new Map;const I={};let S=d[s.name]||{};d[s.name]=S;const _=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),C=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&i(1,s=e.list),"schema"in e&&i(18,a=e.schema),"record"in e&&i(0,d=e.record),"classId"in e&&i(2,u=e.classId),"eventId"in e&&i(3,m=e.eventId),"disabled"in e&&i(4,h=e.disabled),"required"in e&&i(5,g=e.required),"open"in e&&i(6,v=e.open),"template"in e&&i(19,y=e.template),"isTemplate"in e&&i(7,w=e.isTemplate),"currency"in e&&i(8,b=e.currency),"update"in e&&i(20,x=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&x&&d&&i(9,S=d[s.name]||{})},[d,s,u,m,h,g,v,w,b,S,o,r,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format&&"html"!==t.properties?.format)).map((t=>"object"===t.type?_(t.name):"boolean"===t.type?$(e[t.name]):"date"===t.type?f(e[t.name]):"datetime"===t.type?p(e[t.name]):e[t.name])).filter((e=>!!e)).join(" • ")||"+",({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;e.desc&&(I[n]=e.desc);const o=d[t];i(0,d[t]={...o,[n]:e.value},d),i(9,S=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&i(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,o=document.querySelector(n);ie().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(C)})).then((()=>o.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:t,value:i}})=>{if(k.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===className+"."+s.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&k.set(e,r[0])},()=>{setTimeout((()=>{Array.from(k).forEach((([e,t])=>{d[s.name][e]||i(0,d[s.name][e]=t._id,d)}))}),500)},a,y,x,function(t){U(e,t)}]}class yi extends Se{constructor(e){var t;super(),ci.getElementById("svelte-148ktt9-style")||((t=N("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}}",_(ci.head,t)),Ie(this,e,vi,gi,k,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:wi}=ve;function bi(e){e[0]=e[23].list,e[22]=e[23].items}function xi(e,t,n){const i=e.slice();return i[24]=t[n],i}function ki(e,t,n){const i=e.slice();return i[27]=t[n],i}function Ii(e,t,n){const i=e.slice();return i[27]=t[n],i}function Si(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function _i(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}bi(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Ci]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Oe({props:{size:"18"}});let b=e[22]?.length&&function(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=ji(Ii(e,i,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[22],r=0;r<i.length;r+=1){const l=Ii(e,i,r);o[r]?o[r].p(l,t):(o[r]=ji(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),q(o,e)}}}(e),x=e[0]?.length&&function(e){let t,n=e[0],i=[];for(let t=0;t<n.length;t+=1)i[t]=Li(xi(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11778&o[0]){let r;for(n=e[0],r=0;r<n.length;r+=1){const l=xi(e,n,r);i[r]?i[r].p(l,o):(i[r]=Li(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){q(i,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),o=N("div"),r=F("Suchen: "),be(l.$$.fragment),a=E(),c=N("span"),be(d.$$.fragment),u=E(),m=N("div"),f=N("table"),b&&b.c(),p=E(),$=N("tbody"),x&&x.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),xe(n,t,null),C(s,i,y),C(s,o,y),_(o,r),xe(l,o,null),_(o,a),_(o,c),xe(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){bi(e);const i={};2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[22]?.length&&b.p(e,t),e[0]?.length&&x.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),ke(n),e&&j(i),e&&j(o),ke(l),ke(d),e&&j(u),e&&j(m),b&&b.d(),x&&x.d(),g=!1,v()}}}function Ci(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function ji(e){let t,n,i=e[27]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function qi(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=Ni(ki(e,i,t));return{c(){t=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=E(),B(t,"class","pointer svelte-14hcfjl")},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[22],l=0;l<i.length;l+=1){const s=ki(e,i,l);o[l]?o[l].p(s,r):(o[l]=Ni(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}},d(e){e&&j(t),q(o,e)}}}function Ni(e){let t,n,i,o,r=e[9](e[24],e[27])+"";return{c(){t=N("td"),n=F(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[24]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function Li(e){let t,n=e[13](e[24],e[22],e[1]),i=n&&qi(e);return{c(){i&&i.c(),t=D()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[24],e[22],e[1])),n?i?i.p(e,o):(i=qi(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function Fi(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ei(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Fi,then:_i,catch:Si,value:23,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function Di(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Ei]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2&n[0]|2&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function zi(e,t,i){const o=G(),{Dialog:r,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=t,{className:m}=t,{classId:p}=t,{list:h}=t,g="",v=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},w=n.getSchemaByClass(m);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(v)?.focus()}),200)}));return e.$$set=e=>{"item"in e&&i(15,u=e.item),"className"in e&&i(16,m=e.className),"classId"in e&&i(17,p=e.classId),"list"in e&&i(0,h=e.list)},[h,g,o,r,l,s,a,d,v,y,e=>()=>o("choose",{row:e}),async()=>{const e=await w,t=e.display;let n=Nt(t,e,h);return{list:h,items:n}},({detail:{value:e}})=>{i(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(y(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,g="")},u,m,p,()=>o("back"),function(e){g=e,i(1,g)}]}class Ti extends Se{constructor(e){var t;super(),wi.getElementById("svelte-14hcfjl-style")||((t=N("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(wi.head,t)),Ie(this,e,zi,Di,k,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:Ai}=ve;function Bi(e,t,n){const i=e.slice();return i[11]=t[n],i}function Vi(e,t,n){const i=e.slice();return i[3]=t[n],i}function Oi(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Mi(e){let t,n,i,o=e[7].items,r=[];for(let t=0;t<o.length;t+=1)r[t]=Qi(Vi(e,o,t));const l=e=>$e(r[e],1,1,(()=>{r[e]=null}));let s=e[7].list&&Yi(e);return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=E(),s&&s.c(),n=D()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);C(e,t,o),s&&s.m(e,o),C(e,n,o),i=!0},p(e,i){if(5161959&i[0]){let n;for(o=e[7].items,n=0;n<o.length;n+=1){const l=Vi(e,o,n);r[n]?(r[n].p(l,i),pe(r[n],1)):(r[n]=Qi(l),r[n].c(),pe(r[n],1),r[n].m(t.parentNode,t))}for(me(),n=o.length;n<r.length;n+=1)l(n);fe()}e[7].list?s?(s.p(e,i),128&i[0]&&pe(s,1)):(s=Yi(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){if(!i){for(let e=0;e<o.length;e+=1)pe(r[e]);pe(s),i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)$e(r[e]);$e(s),i=!1},d(e){q(r,e),e&&j(t),s&&s.d(e),e&&j(n)}}}function Wi(e){let t,n,i,o;const r=[Pi,Ri],l=[];function s(e,t){return e[3].name!==e[14]||e[15]?"lookup"!==e[3].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=D()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function Ri(e){let t,n;return t=new Zl({props:{classId:e[8],item:e[3],record:e[6],disabled:e[3].name===e[14]&&e[15]||e[0],eventId:e[5],currency:e[2],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};256&n[0]&&(i.classId=e[8]),128&n[0]&&(i.item=e[3]),64&n[0]&&(i.record=e[6]),129&n[0]&&(i.disabled=e[3].name===e[14]&&e[15]||e[0]),32&n[0]&&(i.eventId=e[5]),4&n[0]&&(i.currency=e[2]),512&n[0]&&(i.changeValue=e[9]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Pi(e){let t,n,i,o;n=new Zl({props:{classId:e[8],item:e[3],record:e[6],disabled:e[0]||!!e[1],required:!0,eventId:e[5],currency:e[2],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]);let r=e[1]&&Hi(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),r&&r.c(),M(t,"padding-top",".25em"),M(t,"background-color","lightyellow"),M(t,"position","relative")},m(e,l){C(e,t,l),xe(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};256&i[0]&&(o.classId=e[8]),128&i[0]&&(o.item=e[3]),64&i[0]&&(o.record=e[6]),3&i[0]&&(o.disabled=e[0]||!!e[1]),32&i[0]&&(o.eventId=e[5]),4&i[0]&&(o.currency=e[2]),512&i[0]&&(o.changeValue=e[9]),n.$set(o),e[1]?r?(r.p(e,i),2&i[0]&&pe(r,1)):(r=Hi(e),r.c(),pe(r,1),r.m(t,null)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(n.$$.fragment,e),pe(r),o=!0)},o(e){$e(n.$$.fragment,e),$e(r),o=!1},d(e){e&&j(t),ke(n),r&&r.d()}}}function Hi(e){let t,n,i,o,r;return n=new Oe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[22]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function Qi(e){let t,n,i="list"!==e[3].type&&Wi(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[3].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=Wi(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Yi(e){let t,n,i=e[7].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Ui(Bi(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(485&n[0]){let l;for(i=e[7].list,l=0;l<i.length;l+=1){const r=Bi(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Ui(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function Gi(e){let t,n,i,o;return t=new e[12]({props:{text:e[11].designation}}),i=new yi({props:{classId:e[8],list:e[11],eventId:e[5],schema:e[11].item,record:e[6],disabled:e[0],currency:e[2],update:!0}}),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment)},m(e,r){xe(t,e,r),C(e,n,r),xe(i,e,r),o=!0},p(e,n){const o={};128&n[0]&&(o.text=e[11].designation),t.$set(o);const r={};256&n[0]&&(r.classId=e[8]),128&n[0]&&(r.list=e[11]),32&n[0]&&(r.eventId=e[5]),128&n[0]&&(r.schema=e[11].item),64&n[0]&&(r.record=e[6]),1&n[0]&&(r.disabled=e[0]),4&n[0]&&(r.currency=e[2]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){ke(t,e),e&&j(n),ke(i,e)}}}function Ui(e){let t,n,i="array"!==e[11].type&&Gi(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"array"!==e[11].type?i?(i.p(e,n),128&n[0]&&pe(i,1)):(i=Gi(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Ji(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ki(e){let t,n;return t=new Ti({props:{item:e[3],className:e[4],classId:e[8],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8&n[0]&&(i.item=e[3]),16&n[0]&&(i.className=e[4]),256&n[0]&&(i.classId=e[8]),2048&n[0]&&(i.list=e[11]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Zi(e){let t,n,i=e[10]&&Ki(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[10]?i?(i.p(e,n),1024&n[0]&&pe(i,1)):(i=Ki(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Xi(e){let t,n,i,o,r,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Ji,then:Mi,catch:Oi,value:52,blocks:[,,,]};function a(t){e[28](t)}he(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Zi]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),o=new e[13]({props:c}),K.push((()=>we(o,"open",a))),{c(){s.block.c(),t=E(),be(n.$$.fragment),i=E(),be(o.$$.fragment)},m(e,r){s.block.m(e,s.anchor=r),s.mount=()=>t.parentNode,s.anchor=t,C(e,t,r),xe(n,e,r),C(e,i,r),xe(o,e,r),l=!0},p(t,n){ge(s,e=t,n);const i={};3352&n[0]|67108864&n[1]&&(i.$$scope={dirty:n,ctx:e}),!r&&1024&n[0]&&(r=!0,i.open=e[10],re((()=>r=!1))),o.$set(i)},i(e){l||(pe(s.block),pe(n.$$.fragment,e),pe(o.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){$e(s.blocks[e])}$e(n.$$.fragment,e),$e(o.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&j(t),ke(n,e),e&&j(i),ke(o,e)}}}function eo(e,t,i){const{Divider:o,FormField:r,Modal:l}=c,s=G();let a,d,u,m,f,{required:p}=t,{disabled:$}=t,{readonly:h}=t,{id:g}=t,{item:v}=t,{value:y}=t,{refValue:w}=t,{currency:b}=t,x={},k=[],I=[],S={},_=new Map,C=!1,j="";const q=v.checkOn,N=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");k.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))},F=()=>{a.items.filter((e=>e.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.lookup})})),a.items.filter((e=>e.properties?.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}))},E=async e=>{const t=k.filter((t=>t.refObj===e));if(t?.length){i(9,S={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:l}=e;if(!n)break;let s,a,c=!o&&x[n];const u=x[n];u&&o&&(c=(await va(n,u))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==l&&"readonly"!==l||(l="required"===l?l:"disabled",setTimeout((()=>{s=`#${d} .form-field.${t} .field textarea`,a=document.querySelector(s),a||(s=`#${d} .form-field.${t} .field input`,a=document.querySelector(s)),a&&c&&a.setAttribute(l,""),a&&!c&&a.removeAttribute(l)}),0)),"hidden"===l&&(s=`#${d} .form-field.${t}`,a=document.querySelector(s),a?.classList?.toggle("hidden",!!c),c&&i(9,S[t]="",S))}}};Q((()=>{D()}));const D=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(d))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of k)e.add(t.refObj||u);Array.from(e).forEach((e=>E(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(_).forEach((([e,t])=>{x[e]||i(6,x[e]=t._id,x)}))}),250)},T=async e=>{if(!e.value)return void B();const t={[e.itemName]:{$regex:`(?i)${e.value}`}},o=await n.getSectionView(u,t);o?.length?(i(11,j=o),i(10,C=!0)):(i(1,y=""),i(23,w=""),s("setRefValue",w))},A=()=>{i(10,C=!1)},B=()=>{i(1,y=""),i(23,w=y),i(6,x={}),s("setRefValue",w)};return e.$$set=e=>{"required"in e&&i(24,p=e.required),"disabled"in e&&i(0,$=e.disabled),"readonly"in e&&i(25,h=e.readonly),"id"in e&&i(26,g=e.id),"item"in e&&i(3,v=e.item),"value"in e&&i(1,y=e.value),"refValue"in e&&i(23,w=e.refValue),"currency"in e&&i(2,b=e.currency)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&i(0,$=$||h),134217840&e.$$.dirty[0]&&x&&s("safeReference",{record:x,class:u,event:m,taskId:f})},[$,y,b,v,u,m,x,a,d,S,C,j,o,l,q,N,async()=>{try{if(y){const e=await n.getTask(v.refClass,y);delete e._task,i(6,x=e),i(27,f=(await n.getTaskByDocId(e._id))._id)}else i(6,x={})}catch{}return i(7,a=await n.getSchemaByClass(v.refClass)),i(8,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),i(4,u=a.class),a.identity.designation,i(5,m=a.id),["readonly","hidden","required"].map(L),F(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(i(6,x[t]=n,x),t===q)return T(e);E(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:t,lookup:o,view:r}=e,[l]=o.split(":"),s=(await n.getSectionView(l,{[r]:{$in:t}})).map((e=>e._id));for(const e of a.input.slice(1)){i(6,x[e]=[],x);const t=await n.getSchemaByClass(e);t.id;let o=await n.getTasks(t.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),o?.length){const t=o.map((e=>e._id)),r=await n.getSectionView(e,{_id:{$in:t}});for(const t of r)t[e]=t._id;i(6,x[e]=r,x)}}},async({detail:{className:e,itemName:t,value:i}})=>{if(_.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===u))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&_.set(e,r[0])},async({detail:e})=>{const t=await n.getSectionView(u,{_id:e.row._id});t?.length&&(i(1,y=t[0]._id),i(23,w=y),s("setRefValue",w),i(6,x=t[0])),A()},A,B,w,p,h,g,f,function(e){C=e,i(10,C)}]}class to extends Se{constructor(e){var t;super(),Ai.getElementById("svelte-16mo2c-style")||((t=N("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",_(Ai.head,t)),Ie(this,e,eo,Xi,k,{required:24,disabled:0,readonly:25,id:26,item:3,value:1,refValue:23,currency:2},[-1,-1])}}function no(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=N("span"),n=F(e[4]),B(t,"class","item")},m(e,i){C(e,t,i),_(t,n)},p(e,t){16&t[0]&&V(n,e[4])},d(e){e&&j(t)}}}(e);return{c(){n&&n.c(),t=D()},m(e,i){n&&n.m(e,i),C(e,t,i)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&j(t)}}}function io(e){let t,n,i;return n=new e[9]({props:{withItem:!0,itemLeft:!0,lang:e[10].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[8],step:e[12],pattern:e[6],placeholder:e[13],readonly:e[7],disabled:e[3],required:e[5],$$slots:{default:[no]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=N("div"),be(n.$$.fragment),M(t,"position","relative"),M(t,"max-width","10em")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,t){const i={};6&t[0]&&(i.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(i.id=e[0]),1&t[0]&&(i.name=e[0]),256&t[0]&&(i.value=e[8]),64&t[0]&&(i.pattern=e[6]),128&t[0]&&(i.readonly=e[7]),8&t[0]&&(i.disabled=e[3]),32&t[0]&&(i.required=e[5]),16&t[0]|2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function oo(e,n,i){let o;const r=G(),{TextField:l}=c;let{id:s}=n,{item:a}=n,{value:d}=n,{noForm:u=!1}=n,{classId:m}=n,{disabled:f}=n,{formnovalidate:p}=n,{currency:$}=n,{praefix:h}=n,{notifyList:g}=n;const v=JSON.parse(t.getItem("Locale")),y=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),w=Number("1.1").toLocaleString(v.id).substring(1,2),{properties:b={}}=a;let{min:x,max:k,step:I,pattern:S,decimals:_=0,unit:C="",placeholder:j,hint:q,readonly:N,negative:L,required:F=!1}=b;N=!0===N||void 0;S||(S=_?`[0-9]+([${w}][0-9]{1,${_}})?`:"[0-9]*"),L&&(S="-?"+S);return e.$$set=e=>{"id"in e&&i(0,s=e.id),"item"in e&&i(16,a=e.item),"value"in e&&i(17,d=e.value),"noForm"in e&&i(1,u=e.noForm),"classId"in e&&i(2,m=e.classId),"disabled"in e&&i(3,f=e.disabled),"formnovalidate"in e&&i(18,p=e.formnovalidate),"currency"in e&&i(4,$=e.currency),"praefix"in e&&i(19,h=e.praefix),"notifyList"in e&&i(20,g=e.notifyList)},e.$$.update=()=>{262176&e.$$.dirty[0]&&i(5,F=F&&!p),131072&e.$$.dirty[0]&&i(8,o=Number(d.toString().replace(w,".")).toFixed(_).toString().replace(".",w)),1048576&e.$$.dirty[0]&&(async e=>{if(void 0===h)return;const t=a.properties?.value?.formula;"$multiply"===t?.operator&&r("formula",{item:a})})()},[s,u,m,f,$,F,S,N,o,l,v,y,I,j,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{N||Number(d.toString().replace(w,"."))||i(8,o="")},a,d,p,h,g]}class ro extends Se{constructor(e){super(),Ie(this,e,oo,io,k,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4,praefix:19,notifyList:20},[-1,-1])}}const{document:lo}=ve;function so(e){e[33]=e[35].list,e[34]=e[35].items}function ao(e,t,n){const i=e.slice();return i[36]=t[n],i[38]=n,i}function co(e,t,n){const i=e.slice();return i[39]=t[n],i[41]=n,i}function uo(e,t,n){const i=e.slice();return i[39]=t[n],i}function mo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function fo(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v,y;so(e),n=new e[8]({props:{outline:!0,$$slots:{default:[po]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let w=!e[1]&&$o(e);function b(t){e[31](t)}let x={id:e[11]};void 0!==e[2]&&(x.value=e[2]),s=new e[6]({props:x}),K.push((()=>we(s,"value",b))),s.$on("input",e[14]),u=new Oe({props:{size:"18"}});let k=e[34]?.length&&function(e){let t,n,i,o,r=!e[1]&&go(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=vo(uo(e,l,t));return{c(){t=N("thead"),n=N("tr"),r&&r.c(),i=E();for(let e=0;e<s.length;e+=1)s[e].c();B(n,"class","svelte-1m010ne"),B(t,"class","svelte-1m010ne")},m(e,l){C(e,t,l),_(t,n),r&&r.m(n,null),_(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null);o=!0},p(e,t){if(e[1]?r&&(me(),$e(r,1,1,(()=>{r=null})),fe()):r?(r.p(e,t),2&t[0]&&pe(r,1)):(r=go(e),r.c(),pe(r,1),r.m(n,i)),8192&t[0]){let i;for(l=e[34],i=0;i<l.length;i+=1){const o=uo(e,l,i);s[i]?s[i].p(o,t):(s[i]=vo(o),s[i].c(),s[i].m(n,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=l.length}},i(e){o||(pe(r),o=!0)},o(e){$e(r),o=!1},d(e){e&&j(t),r&&r.d(),q(s,e)}}}(e),I=e[33]?.length&&function(e){let t,n,i=e[33],o=[];for(let t=0;t<i.length;t+=1)o[t]=ko(ao(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(569359&n[0]){let l;for(i=e[33],l=0;l<i.length;l+=1){const r=ao(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ko(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),w&&w.c(),o=E(),r=N("div"),l=F("Suchen: "),be(s.$$.fragment),c=E(),d=N("span"),be(u.$$.fragment),m=E(),f=N("div"),p=N("table"),k&&k.c(),$=E(),h=N("tbody"),I&&I.c(),B(t,"class","form--buttons svelte-1m010ne"),B(d,"class","feather pointer svelte-1m010ne"),M(r,"margin-bottom","1em"),M(r,"position","relative"),B(p,"striped",""),B(p,"class","svelte-1m010ne"),B(f,"class","eList svelte-1m010ne")},m(a,b){C(a,t,b),xe(n,t,null),_(t,i),w&&w.m(t,null),C(a,o,b),C(a,r,b),_(r,l),xe(s,r,null),_(r,c),_(r,d),xe(u,d,null),C(a,m,b),C(a,f,b),_(f,p),k&&k.m(p,null),_(p,$),_(p,h),I&&I.m(h,null),g=!0,v||(y=z(d,"click",e[16]),v=!0)},p(e,i){so(e);const o={};8192&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[1]?w&&(me(),$e(w,1,1,(()=>{w=null})),fe()):w?(w.p(e,i),2&i[0]&&pe(w,1)):(w=$o(e),w.c(),pe(w,1),w.m(t,null));const r={};!a&&4&i[0]&&(a=!0,r.value=e[2],re((()=>a=!1))),s.$set(r),e[34]?.length&&k.p(e,i),e[33]?.length&&I.p(e,i)},i(e){g||(pe(n.$$.fragment,e),pe(w),pe(s.$$.fragment,e),pe(u.$$.fragment,e),pe(k),pe(I),g=!0)},o(e){$e(n.$$.fragment,e),$e(w),$e(s.$$.fragment,e),$e(u.$$.fragment,e),$e(k),$e(I),g=!1},d(e){e&&j(t),ke(n),w&&w.d(),e&&j(o),e&&j(r),ke(s),ke(u),e&&j(m),e&&j(f),k&&k.d(),I&&I.d(),v=!1,y()}}}function po(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function $o(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[ho]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ho(e){let t;return{c(){t=F("Bestätigen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function go(e){let t,n,i,o,r;return n=new Le({props:{size:"20"}}),{c(){t=N("th"),be(n.$$.fragment),B(t,"class","svelte-1m010ne")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[18](e[33])),o=!0)},p(t,n){e=t},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function vo(e){let t,n,i=e[39]+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function yo(e){let t,n,i,o,r,l,s,a=e[0],c=bo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=xo(co(e,d,t));return{c(){t=N("tr"),c.c(),n=E();for(let e=0;e<u.length;e+=1)u[e].c();i=E(),B(t,"style",o=e[1]?"cursor: default;":"cursor: zoom-in;"),B(t,"title","übernimmt den Wert direkt"),B(t,"class","svelte-1m010ne"),W(t,"active",e[0].includes(e[36]))},m(o,a){C(o,t,a),c.m(t,null),_(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);_(t,i),r=!0,l||(s=z(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&k(a,a=e[0])?(me(),$e(c,1,1,v),fe(),c=bo(e),c.c(),pe(c),c.m(t,n)):c.p(e,s),8200&s[0]){let n;for(d=e[34],n=0;n<d.length;n+=1){const o=co(e,d,n);u[n]?u[n].p(o,s):(u[n]=xo(o),u[n].c(),u[n].m(t,i))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!r||2&s[0]&&o!==(o=e[1]?"cursor: default;":"cursor: zoom-in;"))&&B(t,"style",o),8193&s[0]&&W(t,"active",e[0].includes(e[36]))},i(e){r||(pe(c),r=!0)},o(e){$e(c),r=!1},d(e){e&&j(t),c.d(e),q(u,e),l=!1,s()}}}function wo(e){let t,n,i;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=N("td"),be(n.$$.fragment),B(t,"title","Wählt den Wert aus"),B(t,"class","svelte-1m010ne")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,t){const i={};1&t[0]&&(i.checked=e[0].includes(e[36])),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function bo(e){let t,n,i=!e[1]&&wo(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[1]?i&&(me(),$e(i,1,1,(()=>{i=null})),fe()):i?(i.p(e,n),2&n[0]&&pe(i,1)):(i=wo(e),i.c(),pe(i,1),i.m(t.parentNode,t))},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function xo(e){let t,n,i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=N("td"),n=F(i),B(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p(e,t){8&t[0]&&i!==(i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&V(n,i)},d(e){e&&j(t)}}}function ko(e){let t,n,i=e[15](e[36],e[2]),o=i&&yo(e);return{c(){o&&o.c(),t=D()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){4&n[0]&&(i=e[15](e[36],e[2])),i?o?(o.p(e,n),4&n[0]&&pe(o,1)):(o=yo(e),o.c(),pe(o,1),o.m(t.parentNode,t)):o&&(me(),$e(o,1,1,(()=>{o=null})),fe())},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){o&&o.d(e),e&&j(t)}}}function Io(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function So(e){let t,n,i,o;t=new e[9]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Io,then:fo,catch:mo,value:35,blocks:[,,,]};return he(e[13](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function _o(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[So]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};15&n[0]|8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Co(e,t,i){const o=G(),{Loading:r,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=t,{id:f}=t,{selection:p}=t,{refDoc:$}=t,{tableName:h}=t,{idName:g}=t,{target:v}=t,{view:y}=t,{unique:w}=t,{uniqueView:b}=t,{status:x}=t,{single:k}=t;p||=[];let I="",S=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",_=[];const C=h+g+v+"checkbox",j=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&i(21,m=e.classId),"id"in e&&i(22,f=e.id),"selection"in e&&i(0,p=e.selection),"refDoc"in e&&i(23,$=e.refDoc),"tableName"in e&&i(24,h=e.tableName),"idName"in e&&i(25,g=e.idName),"target"in e&&i(20,v=e.target),"view"in e&&i(26,y=e.view),"unique"in e&&i(27,w=e.unique),"uniqueView"in e&&i(28,b=e.uniqueView),"status"in e&&i(29,x=e.status),"single"in e&&i(1,k=e.single)},[p,k,I,_,o,r,l,s,a,d,u,S,C,async()=>{let e=[],t=[],o={};if(i(3,_=[]),g)if(y){if(f){const t=m.split("-")[1].slice(0,-4),i="input."+m+"[name='_id']",r=document.querySelector(i).value;o={[g]:f},x&&(o.$or=[{status:!0},{[t]:r}]),e=await n.getSectionView(h,o),e=e.sort(((e,n)=>{const i=e=>(e[t]||"z").toString()+e[v];return j(i(e),i(n))}))}}else b?f&&(o={[g]:f,status:!0},Object.entries(b).map((([e,n])=>{n?.length&&(o[e]={$in:n}),t.push(e)})),e=await n.getSectionView(h,o),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})),i(3,_=e.map((e=>{const n=[e[v]];return t.map((t=>n.push(e[t]))),n})))):w?(e=await n.getSection(h,g,f,w),e=e.sort(((e,t)=>j(e,t)))):(e=await n.getSection(h,g,f,!1,x),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})));else o={},f&&!Array.isArray(f)&&(o._id=f),e=await n.getSectionView(h,o);const r=await n.getSchemaByClass(h),l=[];if($){const t=r.items[0].name,n=r.items[1].name,o=r.list[0].name,l=e.find((e=>e[t]===$));e=l?l[o]:[],i(20,v=n)}e.map((e=>{let t=e[v];if(t||h!==v||(i(20,v=r.items[0].name),t=e[v]),Array.isArray(t))for(const e of t){let t=e;"string"!=typeof e&&(t=Array.from(Object.values(e)).filter((e=>!!e&&24!==e?.length)).join(", ")),l.push(t||[])}else l.push(t||[])}));const s=r.items.find((e=>e.name===v))?.designation;return t=t.map((e=>r.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...t]}},({detail:{value:e}})=>{i(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{i(2,I="")},e=>()=>{const t=document.getElementsByName(C),n=[];t.forEach(((t,i)=>{t.checked&&n.push(e[+t.attributes.data.value])})),o("choose",{list:n})},e=>()=>{document.getElementsByName(C).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(k?o("choose",{list:[].concat(e)}):(i(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),o("choose",{list:p})))},v,m,f,$,h,g,y,w,b,x,()=>o("back"),function(e){I=e,i(2,I)}]}class jo extends Se{constructor(e){var t;super(),lo.getElementById("svelte-1m010ne-style")||((t=N("style")).id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",_(lo.head,t)),Ie(this,e,Co,_o,k,{classId:21,id:22,selection:0,refDoc:23,tableName:24,idName:25,target:20,view:26,unique:27,uniqueView:28,status:29,single:1},[-1,-1])}}const{document:qo}=ve;function No(e){let t,n,i,o,r,l=e[7].length+"";return{c(){t=N("span"),n=F("("),i=F(l),o=F(")"),B(t,"class",r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&V(i,l),2&n[0]&&r!==(r=S(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&B(t,"class",r)},d(e){e&&j(t)}}}function Lo(e){let t;return{c(){t=N("div"),B(t,"class","load-more-options"),B(t,"slot","load-more-options-message")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Fo(e){let t,n,i,o;const r=[zo,Do,Eo],l=[];function s(e,t){return!e[16].single&&e[7]?.length?0:e[17]?1:e[14]&&e[16].view&&e[16].maxItem?2:-1}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=D()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){~t&&l[t].d(e),e&&j(i)}}}function Eo(e){let t,n,i,o,r;return n=new je({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"title","Übernehmen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[26]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function Do(e){let t,n,i,o,r;return n=new De({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"title",e[17].title||"Generieren"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[25]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function zo(e){let t,n,i,o,r;return n=new Oe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"title","Löschen"),B(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[27]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function To(e){let t,n,i;function o(t){e[37](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[Ao]},$$scope:{ctx:e}};return void 0!==e[10]&&(r.open=e[10]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};53&i[0]|32768&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&1024&i[0]&&(n=!0,o.open=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Ao(e){let t,n;return t=new jo({props:{classId:e[2],selection:e[0],refDoc:e[19],view:e[15],status:e[18],unique:e[16].unique&&e[4].name,uniqueView:e[16].view&&{[e[16].view]:e[5][e[16].view]},id:e[5][e[21]||e[20]],tableName:e[20],idName:e[21],target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),1&n[0]&&(i.selection=e[0]),16&n[0]&&(i.unique=e[16].unique&&e[4].name),32&n[0]&&(i.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(i.id=e[5][e[21]||e[20]]),16&n[0]&&(i.target=e[4].name),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bo(e){let t,n,i,o,r,l,s,a,c,d=!e[16].single&&e[7]?.length&&No(e);function u(t){e[35](t)}function m(t){e[36](t)}let f={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:Vo,minSearchLength:"3",$$slots:{"load-more-options-message":[Lo]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),i=new e[12]({props:f}),K.push((()=>we(i,"selection",u))),K.push((()=>we(i,"maxOptions",m))),i.$on("change",e[22]);let p=!e[1]&&Fo(e),$=e[10]&&To(e);return{c(){t=N("div"),d&&d.c(),n=E(),be(i.$$.fragment),l=E(),p&&p.c(),s=E(),$&&$.c(),a=D(),M(t,"position","relative")},m(e,o){C(e,t,o),d&&d.m(t,null),_(t,n),xe(i,t,null),_(t,l),p&&p.m(t,null),C(e,s,o),$&&$.m(e,o),C(e,a,o),c=!0},p(e,l){!e[16].single&&e[7]?.length?d?d.p(e,l):(d=No(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const s={};8&l[0]&&(s.id=e[3]),8&l[0]&&(s.name=e[3]),8&l[0]&&(s.class=e[3]),2&l[0]&&(s.disabled=e[1]),64&l[0]&&(s.required=e[6]),256&l[0]&&(s.placeholder=e[8]),32768&l[1]&&(s.$$scope={dirty:l,ctx:e}),!o&&128&l[0]&&(o=!0,s.selection=e[7],re((()=>o=!1))),!r&&512&l[0]&&(r=!0,s.maxOptions=e[9],re((()=>r=!1))),i.$set(s),e[1]?p&&(me(),$e(p,1,1,(()=>{p=null})),fe()):p?(p.p(e,l),2&l[0]&&pe(p,1)):(p=Fo(e),p.c(),pe(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&pe($,1)):($=To(e),$.c(),pe($,1),$.m(a.parentNode,a)):$&&(me(),$e($,1,1,(()=>{$=null})),fe())},i(e){c||(pe(i.$$.fragment,e),pe(p),pe($),c=!0)},o(e){$e(i.$$.fragment,e),$e(p),$e($),c=!1},d(e){e&&j(t),d&&d.d(),ke(i),p&&p.d(),e&&j(s),$&&$.d(e),e&&j(a)}}}async function*Vo(e){yield[{name:e}]}function Oo(e,t,i){const o=G(),{Modal:r,Autocomplete:l}=c;let{classId:s}=t,{id:a}=t,{item:d}=t,{record:u}=t,{value:m}=t,{noForm:f=!1}=t,{disabled:p}=t,{formnovalidate:$}=t,{numberInput:h}=t,{praefix:g}=t,{toDelete:v}=t,{reqQuantity:y}=t,{notifyList:w}=t;const{properties:b={}}=d;let{placeholder:x,hint:k,readonly:I,required:S=!1,lookup:_="",view:C=!1,multi:j,max:q=1e3,generate:N=!1,status:L=!0,refDoc:F}=b;const[E,D]=_.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(x="");Q((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&_&&e.addEventListener("focus",A)}));const A=()=>{if(_){document.getElementById(a).blur();const e=y||q;(j.unique||T.length<e)&&i(10,z=!0)}},B=()=>{i(10,z&&=!1)},V=({detail:e})=>{i(7,T=e.list.map((e=>({name:e})))),o("blur",{value:e.list}),o("multi",{view:j.view,lookup:_,name:d.name,value:e.list}),B()},O=async()=>{const e={[D]:u[D]},t=await n.getSectionView(E,e),i=Array.from({length:t.length},((e,n)=>t[n][d.name]));V({detail:{list:i}})},M=(e=!1)=>{if(p||!j.required)return;const t=j.maxItem;if(!t||j.unique)return;i(9,q=!1!==e?e:y||u[t]||0);const n=T?.length!=q,r=document.getElementById(a);r?.classList?.toggle("invalid",n),o("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"item"in e&&i(4,d=e.item),"record"in e&&i(5,u=e.record),"value"in e&&i(0,m=e.value),"noForm"in e&&i(28,f=e.noForm),"disabled"in e&&i(1,p=e.disabled),"formnovalidate"in e&&i(29,$=e.formnovalidate),"numberInput"in e&&i(30,h=e.numberInput),"praefix"in e&&i(31,g=e.praefix),"toDelete"in e&&i(32,v=e.toDelete),"reqQuantity"in e&&i(33,y=e.reqQuantity),"notifyList"in e&&i(34,w=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&i(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&i(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&i(7,T=[]),128&e.$$.dirty[0]&&T&&(i(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:i}=e;void 0!==g&&g!==i||t&&t.name===j.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&i(6,S=S&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:t,value:r}=e||{};if(!r)return;if(d.refItem?.split(".")[0]!==t)return;let[l,s]=d.refItem.split(".");if(Array.isArray(r)){if(l=l.slice(0,-1),!r.length)return o("record",{itemName:"quantity",value:0}),void i(7,T=[]);const e={_id:{$in:r}},t=await n.getSectionView(l,e);let a=[];for(const e of t)e[s]&&(a=a.concat(e[s]));if(!a.length)return;const c=a[g][d.name];o("record",{itemName:"quantity",value:c?.length||0}),i(7,T=c&&c.map((e=>({name:e}))))}else{const e=await n.getTask(l,r);if(!e||!e[s])return;const t=e[s];if(!Array.isArray(t)&&!t.length)return;const a=t[g][d.name];o("record",{itemName:"quantity",value:a?.length||0}),i(7,T=a&&a.map((e=>({name:e}))))}setTimeout(M,250)})(w)},[m,p,s,a,d,u,S,T,x,q,z,r,l,I,_,C,j,N,L,F,E,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),i(7,T=t.map((e=>({name:e.trim()})))),o("blur",{value:T.map((e=>e.name))}),o("multi",{view:j.view,lookup:_,value:T.map((e=>e.name))})},B,V,()=>{const e=u[N.itemQuantity]||y;if(!e)return;const t=N.prefix||"",n=u[N.variable]||"",i=N.len||5,o=Array.from({length:e},((e,o)=>t+n+"-"+o.toString().padStart(i,"0")));V({detail:{list:o}})},async()=>{if(!0===C)return O();const e=y||u[j.maxItem];if(!e)return;let t={};D&&(t={[D]:u[D]}),L&&(t.status=!0);const i=[].concat(u[j.view]||[]);i.length&&(t[j.view]={$in:i});const o=await n.getSectionView(E,t),r=Array.from({length:e<o.length?e:o.length},((e,t)=>o[t][d.name]));V({detail:{list:r}})},()=>{V({detail:{list:[]}})},f,$,h,g,v,y,w,function(e){T=e,i(7,T),i(5,u),i(4,d),i(32,v)},function(e){q=e,i(9,q)},function(e){z=e,i(10,z)}]}class Mo extends Se{constructor(e){var t;super(),qo.getElementById("svelte-1rbaejz-style")||((t=N("style")).id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",_(qo.head,t)),Ie(this,e,Oo,Bo,k,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}const{document:Wo}=ve;function Ro(e){e[26]=e[28].list,e[27]=e[28].items}function Po(e,t,n){const i=e.slice();return i[29]=t[n],i}function Ho(e,t,n){const i=e.slice();return i[32]=t[n],i}function Qo(e,t,n){const i=e.slice();return i[32]=t[n],i}function Yo(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Go(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}Ro(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Uo]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let w={id:e[8]};void 0!==e[1]&&(w.value=e[1]),l=new e[6]({props:w}),K.push((()=>we(l,"value",y))),l.$on("input",e[12]),d=new Oe({props:{size:"18"}});let b=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Jo(Qo(e,i,t));return{c(){t=N("thead"),n=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();B(n,"class","svelte-14hcfjl"),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[27],r=0;r<i.length;r+=1){const l=Qo(e,i,r);o[r]?o[r].p(l,t):(o[r]=Jo(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&j(t),q(o,e)}}}(e),x=e[26]?.length&&function(e){let t,n=e[26],i=[];for(let t=0;t<n.length;t+=1)i[t]=Xo(Po(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=D()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11779&o[0]){let r;for(n=e[26],r=0;r<n.length;r+=1){const l=Po(e,n,r);i[r]?i[r].p(l,o):(i[r]=Xo(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){q(i,e),e&&j(t)}}}(e);return{c(){t=N("div"),be(n.$$.fragment),i=E(),o=N("div"),r=F("Suchen: "),be(l.$$.fragment),a=E(),c=N("span"),be(d.$$.fragment),u=E(),m=N("div"),f=N("table"),b&&b.c(),p=E(),$=N("tbody"),x&&x.c(),B(t,"class","form--buttons svelte-14hcfjl"),B(c,"class","feather pointer svelte-14hcfjl"),M(o,"margin-bottom","1em"),M(o,"position","relative"),B(f,"striped",""),B(f,"class","svelte-14hcfjl"),B(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),xe(n,t,null),C(s,i,y),C(s,o,y),_(o,r),xe(l,o,null),_(o,a),_(o,c),xe(d,c,null),C(s,u,y),C(s,m,y),_(m,f),b&&b.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=z(c,"click",e[14]),g=!0)},p(e,t){Ro(e);const i={};64&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],re((()=>s=!1))),l.$set(o),e[27]?.length&&b.p(e,t),e[26]?.length&&x.p(e,t)},i(e){h||(pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!0)},o(e){$e(n.$$.fragment,e),$e(l.$$.fragment,e),$e(d.$$.fragment,e),h=!1},d(e){e&&j(t),ke(n),e&&j(i),e&&j(o),ke(l),ke(d),e&&j(u),e&&j(m),b&&b.d(),x&&x.d(),g=!1,v()}}}function Uo(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Jo(e){let t,n,i=e[32]?.designation+"";return{c(){t=N("th"),n=F(i),B(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:v,d(e){e&&j(t)}}}function Ko(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Zo(Ho(e,i,t));return{c(){t=N("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=E(),B(t,"class","pointer svelte-14hcfjl"),W(t,"active",e[29]._id===e[0])},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const s=Ho(e,i,l);o[l]?o[l].p(s,r):(o[l]=Zo(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}2049&r[0]&&W(t,"active",e[29]._id===e[0])},d(e){e&&j(t),q(o,e)}}}function Zo(e){let t,n,i,o,r=e[9](e[29],e[32])+"";return{c(){t=N("td"),n=F(r),B(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=z(t,"click",A(e[10](e[29]))),i=!0)},p(t,n){e=t},d(e){e&&j(t),i=!1,o()}}}function Xo(e){let t,n=e[13](e[29],e[27],e[1]),i=n&&Ko(e);return{c(){i&&i.c(),t=D()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[29],e[27],e[1])),n?i?i.p(e,o):(i=Ko(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&j(t)}}}function er(e){let t,n;return t=new e[5]({}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p:v,i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function tr(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:er,then:Go,catch:Yo,value:28,blocks:[,,,]};return he(e[11](),r),{c(){be(t.$$.fragment),n=E(),i=D(),r.block.c()},m(e,l){xe(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){ge(r,e=t,n)},i(e){o||(pe(t.$$.fragment,e),pe(r.block),o=!0)},o(e){$e(t.$$.fragment,e);for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){ke(t,e),e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}function nr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[tr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};3&n[0]|64&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ir(e,t,o){const r=G(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=t,{className:p}=t,{classId:h}=t,{rowId:g}=t,{viewName:v}=t,{viewValue:y}=t,{recordId:w}=t,{filter:b}=t,x="",k=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},S=n.getSchemaByClass(p);Q((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(k)?.focus()}),200)})),i.subscribe((async e=>{if(!e)return;const t=await S;e.eventId===t.id&&ya(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(15,m=e.item),"className"in e&&o(16,p=e.className),"classId"in e&&o(17,h=e.classId),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(18,v=e.viewName),"viewValue"in e&&o(19,y=e.viewValue),"recordId"in e&&o(20,w=e.recordId),"filter"in e&&o(21,b=e.filter)},[g,x,r,l,s,a,d,u,k,I,e=>()=>r("choose",{row:e}),async()=>{const e=await S,t="."+h+"#"+v;document.querySelector(t);let i={[v]:y},o=[];i[v]&&(o=await n.getSectionView(e.class,i,!0)),b&&(o=o.filter((e=>e._id!=b)));const r=e.display;return{list:o,items:Nt(r,e,o)}},({detail:{value:e}})=>{o(1,x=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,x="")},m,p,h,v,y,w,b,()=>r("back"),function(e){x=e,o(1,x)}]}class or extends Se{constructor(e){var t;super(),Wo.getElementById("svelte-14hcfjl-style")||((t=N("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Wo.head,t)),Ie(this,e,ir,nr,k,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function rr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function lr(e){let t,n,i,o,r;function l(t){e[21](t)}let s={id:e[2],name:e[3].name,inputClass:e[5]||e[1],disabled:e[6],formnovalidate:e[7],readonly:e[13],pattern:e[12],required:e[14],style:"padding-left:2em;"};void 0!==e[0]&&(s.value=e[0]),n=new e[10]({props:s}),K.push((()=>we(n,"value",l)));let a=!e[6]&&sr(e);return{c(){t=N("div"),be(n.$$.fragment),o=E(),a&&a.c(),M(t,"position","relative")},m(e,i){C(e,t,i),xe(n,t,null),_(t,o),a&&a.m(t,null),r=!0},p(e,o){const r={};4&o&&(r.id=e[2]),8&o&&(r.name=e[3].name),34&o&&(r.inputClass=e[5]||e[1]),64&o&&(r.disabled=e[6]),128&o&&(r.formnovalidate=e[7]),!i&&1&o&&(i=!0,r.value=e[0],re((()=>i=!1))),n.$set(r),e[6]?a&&(me(),$e(a,1,1,(()=>{a=null})),fe()):a?(a.p(e,o),64&o&&pe(a,1)):(a=sr(e),a.c(),pe(a,1),a.m(t,null))},i(e){r||(pe(n.$$.fragment,e),pe(a),r=!0)},o(e){$e(n.$$.fragment,e),$e(a),r=!1},d(e){e&&j(t),ke(n),a&&a.d()}}}function sr(e){let t,n,i,o,r;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-wbrqzu")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[17]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function ar(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function cr(e){let t,n,i;function o(t){e[22](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[dr]},$$scope:{ctx:e}};return void 0!==e[8]&&(r.open=e[8]),t=new e[11]({props:r}),K.push((()=>we(t,"open",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};268435994&i&&(o.$$scope={dirty:i,ctx:e}),!n&&256&i&&(n=!0,o.open=e[8],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function dr(e){let t,n;return t=new or({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};8&n&&(i.item=e[3]),8&n&&(i.className=e[3].refClass),2&n&&(i.classId=e[1]),16&n&&(i.recordId=e[4]._id),512&n&&(i.viewValue=e[9]),16&n&&(i.filter=e[4]._id),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ur(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:ar,then:lr,catch:rr,value:27,blocks:[,,,]};he(e[16](),o);let r=e[8]&&cr(e);return{c(){o.block.c(),t=E(),r&&r.c(),n=D()},m(e,l){o.block.m(e,o.anchor=l),o.mount=()=>t.parentNode,o.anchor=t,C(e,t,l),r&&r.m(e,l),C(e,n,l),i=!0},p(t,[i]){ge(o,e=t,i),e[8]?r?(r.p(e,i),256&i&&pe(r,1)):(r=cr(e),r.c(),pe(r,1),r.m(n.parentNode,n)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){i||(pe(o.block),pe(r),i=!0)},o(e){for(let e=0;e<3;e+=1){$e(o.blocks[e])}$e(r),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&j(t),r&&r.d(e),e&&j(n)}}}function mr(e,t,n){const{TextField:i,Modal:o}=c;let{classId:r}=t,{id:l}=t,{item:s}=t,{record:a}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:m}=t,{formnovalidate:f}=t,{praefix:p}=t;const{properties:$={}}=s;let h,{pattern:g,placeholder:v,readonly:y,required:w=!1,view:b}=$,x=!1;const k=()=>{n(8,x=!1)};return e.$$set=e=>{"classId"in e&&n(1,r=e.classId),"id"in e&&n(2,l=e.id),"item"in e&&n(3,s=e.item),"record"in e&&n(4,a=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,m=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,p=e.praefix)},[d,r,l,s,a,u,m,f,x,h,i,o,g,y,w,b,async()=>(n(9,h=a[b.selection]),!0),()=>{n(8,x=!0)},({detail:e})=>{n(0,d=e.row[b.value?b.value:"_id"]),k()},k,p,function(e){d=e,n(0,d)},function(e){x=e,n(8,x)}]}class fr extends Se{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=N("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",_(document.head,t)),Ie(this,e,mr,ur,k,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function pr(e,t,n){const i=e.slice();return i[12]=t[n][0],i[13]=t[n][1],i}function $r(e){let t;return{c(){t=N("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function hr(e){let t;return{c(){t=N("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function gr(e){let t,n,i,o,r=e[12]+"";return{c(){t=N("option"),n=F(r),t.__value=i=e[13],t.value=t.__value,t.selected=o=e[0]==e[13]},m(e,i){C(e,t,i),_(t,n)},p(e,l){64&l&&r!==(r=e[12]+"")&&V(n,r),64&l&&i!==(i=e[13])&&(t.__value=i,t.value=t.__value),65&l&&o!==(o=e[0]==e[13])&&(t.selected=o)},d(e){e&&j(t)}}}function vr(e){let t,n,i,o,r,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?hr:$r}let i=n(e),o=i(e);return{c(){o.c(),t=D()},m(e,n){o.m(e,n),C(e,t,n)},p(e,r){i!==(i=n(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){o.d(e),e&&j(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=gr(pr(e,s,t));return{c(){t=N("select"),l&&l.c(),n=D();for(let e=0;e<a.length;e+=1)a[e].c();B(t,"class",i=S(e[3]||e[4])+" svelte-5xpzvo"),B(t,"id",e[2]),B(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(i,s){C(i,t,s),l&&l.m(t,null),_(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);o||(r=z(t,"change",e[9]),o=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let i;for(s=e[6],i=0;i<s.length;i+=1){const o=pr(e,s,i);a[i]?a[i].p(o,n):(a[i]=gr(o),a[i].c(),a[i].m(t,null))}for(;i<a.length;i+=1)a[i].d(1);a.length=s.length}24&n&&i!==(i=S(e[3]||e[4])+" svelte-5xpzvo")&&B(t,"class",i),4&n&&B(t,"id",e[2]),4&n&&B(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:v,o:v,d(e){e&&j(t),l&&l.d(),q(a,e),o=!1,r()}}}function yr(e,t,n){const i=G();let{id:o}=t,{item:r}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=r.properties;u&&(u=u.map((e=>[e,e]))),"valueAddedTax"===m&&(l||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!!f,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,o=e.id),"item"in e&&n(10,r=e.item),"value"in e&&n(0,l=e.value),"noForm"in e&&n(3,s=e.noForm),"classId"in e&&n(4,a=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[l,c,o,s,a,d,u,m,f,e=>i("blur",{value:e.srcElement.value}),r]}class wr extends Se{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=N("style")).id="svelte-5xpzvo-style",t.textContent="select.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:focus{border:none;border-bottom:2px solid #4300b0}",_(document.head,t)),Ie(this,e,yr,vr,k,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function br(e){let t;return{c(){t=F("Stunden")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function xr(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[br]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function kr(e){let t;return{c(){t=F("Minuten")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ir(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[kr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Sr(e){let t;return{c(){t=F("Jetzt")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function _r(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[Sr]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Cr(e){let t,n,i,o,r,l,s,a,c;return o=new e[5]({props:{value:e[0],closeOnSelection:!0}}),o.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[_r],"minutes-label":[Ir],"hours-label":[xr]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=N("input"),i=E(),be(o.$$.fragment),r=E(),be(l.$$.fragment),B(t,"type","string"),B(t,"class",n=e[2]||e[3]),B(t,"id",e[1]),B(t,"name",e[1]),t.hidden=!0},m(n,d){C(n,t,d),O(t,e[0]),C(n,i,d),xe(o,n,d),C(n,r,d),xe(l,n,d),s=!0,a||(c=z(t,"input",e[9]),a=!0)},p(e,[i]){(!s||12&i&&n!==(n=e[2]||e[3]))&&B(t,"class",n),(!s||2&i)&&B(t,"id",e[1]),(!s||2&i)&&B(t,"name",e[1]),1&i&&O(t,e[0]);const r={};1&i&&(r.value=e[0]),o.$set(r);const a={};1&i&&(a.value=e[0]),4096&i&&(a.$$scope={dirty:i,ctx:e}),l.$set(a)},i(e){s||(pe(o.$$.fragment,e),pe(l.$$.fragment,e),s=!0)},o(e){$e(o.$$.fragment,e),$e(l.$$.fragment,e),s=!1},d(e){e&&j(t),e&&j(i),ke(o,e),e&&j(r),ke(l,e),a=!1,c()}}}function jr(e,t,n){const i=G(),{Label:o,DatePicker:r,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>i("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,s=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)},[s,a,d,u,o,r,l,({detail:e})=>{var t,i;n(0,(t=e.value,i=s,s=null==t||null==i?t:(i.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),i))),m(s)},({detail:e})=>{n(0,s=Yn(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class qr extends Se{constructor(e){super(),Ie(this,e,jr,Cr,k,{value:0,id:1,noForm:2,classId:3})}}function Nr(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],closeOnSelection:!0}}),u.$on("change",e[10]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[11]),{c(){t=N("input"),r=E(),l=N("input"),d=E(),be(u.$$.fragment),m=F(" /\n"),be(f.$$.fragment),B(t,"type","string"),B(t,"class",n=e[1]||e[2]),B(t,"id",i=e[0]+"_from"),B(t,"name",o=e[0]+"_from"),t.hidden=!0,B(l,"type","string"),B(l,"class",s=e[1]||e[2]),B(l,"id",a=e[0]+"_to"),B(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,i){C(n,t,i),O(t,e[7]),C(n,r,i),C(n,l,i),O(l,e[8]),C(n,d,i),xe(u,n,i),C(n,m,i),xe(f,n,i),p=!0,$||(h=[z(t,"input",e[13]),z(l,"input",e[14])],$=!0)},p(e,[r]){(!p||6&r&&n!==(n=e[1]||e[2]))&&B(t,"class",n),(!p||1&r&&i!==(i=e[0]+"_from"))&&B(t,"id",i),(!p||1&r&&o!==(o=e[0]+"_from"))&&B(t,"name",o),128&r&&O(t,e[7]),(!p||6&r&&s!==(s=e[1]||e[2]))&&B(l,"class",s),(!p||1&r&&a!==(a=e[0]+"_to"))&&B(l,"id",a),(!p||1&r&&c!==(c=e[0]+"_to"))&&B(l,"name",c),256&r&&O(l,e[8]);const d={};32&r&&(d.format=e[5]),8&r&&(d.required=e[3]),16&r&&(d.disabled=e[4]),128&r&&(d.value=e[7]),u.$set(d);const m={};64&r&&(m.format=e[6]),8&r&&(m.required=e[3]),16&r&&(m.disabled=e[4]),256&r&&(m.value=e[8]),f.$set(m)},i(e){p||(pe(u.$$.fragment,e),pe(f.$$.fragment,e),p=!0)},o(e){$e(u.$$.fragment,e),$e(f.$$.fragment,e),p=!1},d(e){e&&j(t),e&&j(r),e&&j(l),e&&j(d),ke(u,e),e&&j(m),ke(f,e),$=!1,b(h)}}}function Lr(e,t,n){const i=G(),{DatePicker:o}=c;let{value:r}=t,{id:l}=t,{noForm:s=!1}=t,{classId:a}=t,{required:d}=t,{disabled:u}=t,m="%d.%m.%Y",f="%d.%m.%Y",p=r?.from,$=r?.to;"Invalid Date"===p?.toString()&&(p=void 0),"Invalid Date"===$?.toString()&&($=void 0),u&&(void 0===p&&(m=""),void 0===$&&(f=""));return e.$$set=e=>{"value"in e&&n(12,r=e.value),"id"in e&&n(0,l=e.id),"noForm"in e&&n(1,s=e.noForm),"classId"in e&&n(2,a=e.classId),"required"in e&&n(3,d=e.required),"disabled"in e&&n(4,u=e.disabled)},[l,s,a,d,u,m,f,p,$,o,({detail:e})=>{n(7,p=Yn(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),i("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=Yn(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),i("change",{value:$,range:"_to"})},r,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class Fr extends Se{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=N("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",_(document.head,t)),Ie(this,e,Lr,Nr,k,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function Er(e){let t,n,i;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:Dr,placeholder:zr,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=N("div"),be(n.$$.fragment),M(t,"max-width","4em")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p(e,[t]){const i={};4&t&&(i.inputClass=e[2]),1&t&&(i.id=e[0]),1&t&&(i.name=e[0]),2&t&&(i.value=e[1]),8&t&&(i.readonly=e[3]),16&t&&(i.disabled=e[4]),n.$set(i)},i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}const Dr="([01][0-9]|2[0-3]):([0-5][0-9])",zr="";function Tr(e,t,n){const i=G(),{TextField:o}=c;let{id:r}=t,{item:l}=t,{value:s}=t,{inputClass:a}=t,{readonly:d}=t,{disabled:u}=t,{praefix: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(7,l=e.item),"value"in e&&n(1,s=e.value),"inputClass"in e&&n(2,a=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,m=e.praefix)},[r,s,a,d,u,o,({detail:e})=>{i("blur",{value:f(e.value)}),i("checkRange",{idx:m,fieldId:r,value:e.value})},l,m]}class Ar extends Se{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=N("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",_(document.head,t)),Ie(this,e,Tr,Er,k,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Br}=ve;function Vr(e,t,n){const i=e.slice();return i[0]=t[n],i}function Or(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function Mr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Wr(e){let t,n,i=e[14],o=[];for(let t=0;t<i.length;t+=1)o[t]=Pr(Vr(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(14&n){let l;for(i=e[14],l=0;l<i.length;l+=1){const r=Vr(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=Pr(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function Rr(e){let t,n,i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"",o=e[19]&&function(e){let t;return{c(){t=F(", ")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}();return{c(){t=N("span"),o&&o.c(),n=F(i),B(t,"class","lookupValue")},m(e,i){C(e,t,i),o&&o.m(t,null),_(t,n)},p(e,t){2&t&&i!==(i=(e[0]["_"+e[17]]||e[0][e[17]]||"(ja)")+"")&&V(n,i)},d(e){e&&j(t),o&&o.d()}}}function Pr(e){let t,n,i,o,r,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=Rr(Or(e,c,t));return o=new Re({props:{size:"18"}}),{c(){t=N("div");for(let e=0;e<d.length;e+=1)d[e].c();n=E(),i=N("span"),be(o.$$.fragment),r=E(),B(i,"class","feather pointer svelte-1u646ni"),B(t,"class","lookupItem svelte-1u646ni")},m(c,u){C(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,n),_(t,i),xe(o,i,null),_(t,r),l=!0,s||(a=z(i,"click",e[3](e[0]._id)),s=!0)},p(i,o){if(e=i,6&o){let i;for(c=e[1],i=0;i<c.length;i+=1){const r=Or(e,c,i);d[i]?d[i].p(r,o):(d[i]=Rr(r),d[i].c(),d[i].m(t,n))}for(;i<d.length;i+=1)d[i].d(1);d.length=c.length}},i(e){l||(pe(o.$$.fragment,e),l=!0)},o(e){$e(o.$$.fragment,e),l=!1},d(e){e&&j(t),q(d,e),ke(o),s=!1,a()}}}function Hr(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Qr(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Hr,then:Wr,catch:Mr,value:14,blocks:[,,,]};return he(e[2](),i),{c(){t=N("div"),i.block.c(),B(t,"class","lookup svelte-1u646ni")},m(e,o){C(e,t,o),i.block.m(t,i.anchor=null),i.mount=()=>t,i.anchor=null,n=!0},p(t,[n]){ge(i,e=t,n)},i(e){n||(pe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){$e(i.blocks[e])}n=!1},d(e){e&&j(t),i.block.d(),i.token=null,i=null}}}function Yr(e,t,i){let{id:o}=t,{item:r}=t,{praefix:l}=t,{record:s}=t;const{refItem:a,view:c}=r.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ie().then((()=>{const e=document.querySelector("div.form-field."+r.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&i(4,o=e.id),"item"in e&&i(0,r=e.item),"praefix"in e&&i(5,l=e.praefix),"record"in e&&i(6,s=e.record)},[r,d,async()=>{let e=[];if(s._id){const t=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const o={[u]:s[u]||s._id};if(e=await n.getSectionView(f,o,t),!t){const t=d.find((e=>e.includes(":"))).split(":")[0];e=e.map((e=>{const n=e[t].find((e=>e[t]===s._id));return n._id=e._id,n})),i(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const t=await n.getTaskByDocId(e);if(!t)return;const i=t._id,o=`/task/${t.event}/${i}/task?view=standalone`;window.open(o)},o,l,s]}class Gr extends Se{constructor(e){var t;super(),Br.getElementById("svelte-1u646ni-style")||((t=N("style")).id="svelte-1u646ni-style",t.textContent=".feather.svelte-1u646ni{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1u646ni{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1u646ni{position:relative;margin-left:2em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}",_(Br.head,t)),Ie(this,e,Yr,Qr,k,{id:4,item:0,praefix:5,record:6})}}function Ur(e){let t,n,i;return n=new tt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function Jr(e){let t,n,i,o,r;return n=new tt({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function Kr(e){let t,n,i,o,r,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[Jr,Ur],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function Zr(e,t,i){const{TextField:o}=c;let{inputClass:r}=t,{disabled:l}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:d}=t,{id:u}=t,{name:m}=t,{value:f}=t,{record:p}=t,{item:$}=t;return e.$$set=e=>{"inputClass"in e&&i(0,r=e.inputClass),"disabled"in e&&i(1,l=e.disabled),"formnovalidate"in e&&i(2,s=e.formnovalidate),"readonly"in e&&i(3,a=e.readonly),"required"in e&&i(4,d=e.required),"id"in e&&i(5,u=e.id),"name"in e&&i(6,m=e.name),"value"in e&&i(7,f=e.value),"record"in e&&i(10,p=e.record),"item"in e&&i(11,$=e.item)},[r,l,s,a,d,u,m,f,o,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:t,houseNo:i,postcode:o,location:r,country:l}=e,s=[t&&i?t+" "+i:t,o&&r?o+" "+r:o||r||"",l&&(await n.getTask("country",l)).designation].filter((e=>!!e)).join(", "),a="https://bing.com/maps/default.aspx?where1="+encodeURIComponent(s);window.open(a,"_blank")},p,$,function(t){U(e,t)}]}class Xr extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,Zr,Kr,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function el(e){let t,n,i;return n=new Qe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function tl(e){let t,n,i,o,r;return n=new Qe({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[9]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function nl(e){let t,n,i,o,r,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[10]);const s=[tl,el],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function il(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value)},[o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){U(e,t)}]}class ol extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,il,nl,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function rl(e){let t,n,i;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function ll(e){let t,n,i,o,r;return n=new ot({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function sl(e){let t,n,i,o,r,l;n=new e[10]({props:{inputClass:e[2],pattern:e[0],placeholder:e[1],disabled:e[3],formnovalidate:e[4],readonly:e[5],required:e[6],id:e[7],name:e[8],value:e[9]}}),n.$on("change",e[12]);const s=[ll,rl],a=[];function c(e,t){return e[9]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};4&i&&(l.inputClass=e[2]),1&i&&(l.pattern=e[0]),2&i&&(l.placeholder=e[1]),8&i&&(l.disabled=e[3]),16&i&&(l.formnovalidate=e[4]),32&i&&(l.readonly=e[5]),64&i&&(l.required=e[6]),128&i&&(l.id=e[7]),256&i&&(l.name=e[8]),512&i&&(l.value=e[9]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function al(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;f||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,o=e.inputClass),"disabled"in e&&n(3,r=e.disabled),"formnovalidate"in e&&n(4,l=e.formnovalidate),"readonly"in e&&n(5,s=e.readonly),"required"in e&&n(6,a=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,m=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,p=e.placeholder)},[f,p,o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class cl extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,al,sl,k,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function dl(e){let t,n,i;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),xe(n,t,null),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n)}}}function ul(e){let t,n,i,o,r;return n=new Ze({props:{size:"18"}}),{c(){t=N("span"),be(n.$$.fragment),B(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),xe(n,t,null),i=!0,o||(r=z(t,"click",e[11]),o=!0)},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n),o=!1,r()}}}function ml(e){let t,n,i,o,r,l;n=new e[10]({props:{type:"email",inputClass:e[0],pattern:e[8],placeholder:e[9],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[ul,dl],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=N("div"),be(n.$$.fragment),i=E(),r.c(),M(t,"position","relative")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),256&i&&(l.pattern=e[8]),512&i&&(l.placeholder=e[9]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),pe(r,1),r.m(t,null))},i(e){l||(pe(n.$$.fragment,e),pe(r),l=!0)},o(e){$e(n.$$.fragment,e),$e(r),l=!1},d(e){e&&j(t),ke(n),a[o].d()}}}function fl(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value),"pattern"in e&&n(8,f=e.pattern),"placeholder"in e&&n(9,p=e.placeholder)},[o,r,l,s,a,d,u,m,f,p,i,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){U(e,t)}]}class pl extends Se{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=N("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),Ie(this,e,fl,ml,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}const $l=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"];function hl(e){let t;return{c(){t=N("textarea"),B(t,"id",e[0]),M(t,"visibility","hidden")},m(n,i){C(n,t,i),e[18](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[18](null)}}}function gl(e){let t;return{c(){t=N("div"),B(t,"id",e[0])},m(n,i){C(n,t,i),e[17](t)},p(e,n){1&n&&B(t,"id",e[0])},d(n){n&&j(t),e[17](null)}}}function vl(e){let t;function n(e,t){return e[1]?gl:hl}let i=n(e),o=i(e);return{c(){t=N("div"),o.c(),B(t,"class",e[2])},m(n,i){C(n,t,i),o.m(t,null),e[19](t)},p(e,[r]){i===(i=n(e))&&o?o.p(e,r):(o.d(1),o=i(e),o&&(o.c(),o.m(t,null))),4&r&&B(t,"class",e[2])},i:v,o:v,d(n){n&&j(t),o.d(),e[19](null)}}}const yl=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let wl=(()=>{let e={listeners:[],scriptId:yl("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,i)=>{e.scriptLoaded?i():(e.listeners.push(i),e.injected||((t,n,i,o)=>{e.injected=!0;const r=n.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=i,r.onload=()=>{o()},n.head&&n.head.appendChild(r)})(e.scriptId,t,n,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0})))}}})();function bl(e,t,n){var i;let o,r,l,{id:s=yl("tinymce-svelte")}=t,{inline:a}=t,{disabled:c=!1}=t,{apiKey:d="no-api-key"}=t,{channel:u="6"}=t,{scriptSrc:m}=t,{conf:f={}}=t,{modelEvents:p="change input undo redo"}=t,{value:$=""}=t,{text:h=""}=t,{cssClass:g="tinymce-wrapper"}=t,v=$,y=c;const w=G(),b=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},x=()=>{const e=Object.assign(Object.assign({},f),{target:r,inline:void 0!==a?a:void 0!==f.inline&&f.inline,readonly:c,setup:e=>{n(14,l=e),e.on("init",(()=>{e.setContent($),e.on(p,(()=>{n(15,v=e.getContent()),v!==$&&(n(5,$=v),n(6,h=e.getContent({format:"text"})))}))})),((e,t)=>{$l.forEach((n=>{e.on(n,(i=>{t(n.toLowerCase(),{eventName:n,event:i,editor:e})}))}))})(e,w),"function"==typeof f.setup&&f.setup(e)}});n(4,r.style.visibility="",r),b().init(e)};return Q((()=>{if(null!==b())x();else{const e=m||`https://cdn.tiny.cloud/1/${d}/tinymce/${u}/tinymce.min.js`;wl.load(o.ownerDocument,e,(()=>{x()}))}})),Y((()=>{var e;l&&(null===(e=b())||void 0===e||e.remove(l))})),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,c=e.disabled),"apiKey"in e&&n(8,d=e.apiKey),"channel"in e&&n(9,u=e.channel),"scriptSrc"in e&&n(10,m=e.scriptSrc),"conf"in e&&n(11,f=e.conf),"modelEvents"in e&&n(12,p=e.modelEvents),"value"in e&&n(5,$=e.value),"text"in e&&n(6,h=e.text),"cssClass"in e&&n(2,g=e.cssClass)},e.$$.update=()=>{123040&e.$$.dirty&&(l&&v!==$&&(l.setContent($),n(6,h=l.getContent({format:"text"}))),l&&c!==y&&(n(16,y=c),"function"==typeof(null===n(13,i=l.mode)||void 0===i?void 0:i.set)?l.mode.set(c?"readonly":"design"):l.setMode(c?"readonly":"design")))},[s,a,g,o,r,$,h,c,d,u,m,f,p,i,l,v,y,function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class xl extends Se{constructor(e){super(),Ie(this,e,bl,vl,k,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function kl(e){let t,n,i,o,r,l,s;function a(t){e[7](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",conf:e[6],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new xl({props:c}),K.push((()=>we(n,"value",a))),{c(){t=N("div"),be(n.$$.fragment),o=E(),r=N("input"),B(r,"class",l=e[1]||e[2]),B(r,"id",e[3]),B(r,"name",e[3]),r.value=e[0],r.hidden=!0,M(t,"min-height","10em"),M(t,"margin-top","-1em")},m(e,i){C(e,t,i),xe(n,t,null),_(t,o),_(t,r),s=!0},p(e,[t]){const o={};16&t&&(o.disabled=e[4]),32&t&&(o.readonly=e[5]),!i&&1&t&&(i=!0,o.value=e[0],re((()=>i=!1))),n.$set(o),(!s||6&t&&l!==(l=e[1]||e[2]))&&B(r,"class",l),(!s||8&t)&&B(r,"id",e[3]),(!s||8&t)&&B(r,"name",e[3]),(!s||1&t&&r.value!==e[0])&&(r.value=e[0])},i(e){s||(pe(n.$$.fragment,e),s=!0)},o(e){$e(n.$$.fragment,e),s=!1},d(e){e&&j(t),ke(n)}}}function Il(e,n,i){let o=JSON.parse(t.getItem("Locale")).id;o=o.startsWith("fr")?"fr_FR":o.split("-")[0];let{value:r}=n,{noForm:l}=n,{classId:s}=n,{id:a}=n,{disabled:c}=n,{readonly:d}=n;const u={plugins:"advlist numlist link image lists table preview emoticons fullscreen",menu:{file:{title:"File",items:"preview"}},menubar:"edit view insert format table",toolbar:"undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | fullscreen",height:600,language:o};return e.$$set=e=>{"value"in e&&i(0,r=e.value),"noForm"in e&&i(1,l=e.noForm),"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"disabled"in e&&i(4,c=e.disabled),"readonly"in e&&i(5,d=e.readonly)},[r,l,s,a,c,d,u,function(e){r=e,i(0,r)}]}class Sl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zemw0w-style")||((t=N("style")).id="svelte-zemw0w-style",t.textContent="div.tox-statusbar__text-container{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",_(document.head,t)),Ie(this,e,Il,kl,k,{value:0,noForm:1,classId:2,id:3,disabled:4,readonly:5})}}function _l(e){let t,n;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Gl,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1048577&n[0]&&(i.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(i.name=e[0].designation),1&n[0]&&(i.help=e[0].properties?.hint),13631487&n[0]|536870912&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Cl(e){let t,n;return t=new e[28]({props:{text:e[0].designation}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.text=e[0].designation),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function jl(e){let t,n,i,o;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+(e[20]?" hidden ":""),name:e[0].designation,help:e[0].properties?.hint}}),i=new Sl({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6]}}),i.$on("blur",e[35]()),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment)},m(e,r){xe(t,e,r),C(e,n,r),xe(i,e,r),o=!0},p(e,n){const o={};1048577&n[0]&&(o.class=e[0].name+(e[20]?" hidden ":"")),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),t.$set(o);const r={};128&n[0]&&(r.classId=e[7]),8&n[0]&&(r.disabled=e[3]),524288&n[0]&&(r.readonly=e[19]),1&n[0]&&(r.name=e[0].name),4194304&n[0]&&(r.value=e[22]()),64&n[0]&&(r.noForm=e[6]),i.$set(r)},i(e){o||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!1},d(e){ke(t,e),e&&j(n),ke(i,e)}}}function ql(e){let t,n,i,o,r,l;return t=new e[24]({props:{id:e[39](e[32]),class:e[0].name+" hidden",name:e[0].designation,help:e[0].properties?.hint,$$slots:{default:[Ul]},$$scope:{ctx:e}}}),i=new e[28]({props:{text:e[23]}}),r=new to({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22]()}}),r.$on("setRefValue",e[40]),r.$on("safeReference",e[45]),{c(){be(t.$$.fragment),n=E(),be(i.$$.fragment),o=E(),be(r.$$.fragment)},m(e,s){xe(t,e,s),C(e,n,s),xe(i,e,s),C(e,o,s),xe(r,e,s),l=!0},p(e,n){const o={};1&n[0]&&(o.class=e[0].name+" hidden"),1&n[0]&&(o.name=e[0].designation),1&n[0]&&(o.help=e[0].properties?.hint),6291841&n[0]|536870912&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);const l={};8388608&n[0]&&(l.text=e[23]),i.$set(l);const s={};16&n[0]&&(s.required=e[4]),8&n[0]&&(s.disabled=e[3]),524288&n[0]&&(s.readonly=e[19]),1&n[0]&&(s.item=e[0]),131072&n[0]&&(s.currency=e[17]),4194304&n[0]&&(s.value=e[22]()),r.$set(s)},i(e){l||(pe(t.$$.fragment,e),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!0)},o(e){$e(t.$$.fragment,e),$e(i.$$.fragment,e),$e(r.$$.fragment,e),l=!1},d(e){ke(t,e),e&&j(n),ke(i,e),e&&j(o),ke(r,e)}}}function Nl(e){let t,n;return t=new e[25]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[29],required:!0===e[4],placeholder:e[30],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=!0===e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ll(e){let t,n;return t=new cl({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Fl(e){let t,n;return t=new ol({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function El(e){let t,n;return t=new pl({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[29],placeholder:e[30],value:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Dl(e){let t,n;return t=new Ar({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[0],value:e[22](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[53]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function zl(e){let t,n;return t=new Gr({props:{id:e[32],item:e[0],praefix:e[5],record:e[1]}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n[0]&&(i.item=e[0]),32&n[0]&&(i.praefix=e[5]),2&n[0]&&(i.record=e[1]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Tl(e){let t,n;return t=new Xr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[22](),record:e[1],item:e[0]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.value=e[22]()),2&n[0]&&(i.record=e[1]),1&n[0]&&(i.item=e[0]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Al(e){let t,n;return t=new qr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[33](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bl(e){let t,n;return t=new Fr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[34](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Vl(e){let t,n;return t=new e[26]({props:{inputClass:e[6]||e[7],required:e[4],disabled:e[3],id:e[32],name:e[31],value:e[33](),closeOnSelection:!0}}),t.$on("change",e[35](!0)),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ol(e){let t,n;return t=new e[27]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[22]()}}),t.$on("change",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),524296&n[0]&&(i.disabled=e[3]||e[19]),16&n[0]&&(i.required=e[4]),4194304&n[0]&&(i.checked=e[22]()),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ml(e){let t,n;return t=new fr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],view:e[0].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[52]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.view=e[0].properties.view),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Wl(e){let t,n;return t=new Mo({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],record:e[1],value:e[22](),noForm:e[6],multi:e[0].properties.multi,numberInput:e[12],praefix:e[5],toDelete:e[15],reqQuantity:e[16],notifyList:e[18]}}),t.$on("blur",e[35]()),t.$on("invalid",e[51]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),2&n[0]&&(i.record=e[1]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.multi=e[0].properties.multi),4096&n[0]&&(i.numberInput=e[12]),32&n[0]&&(i.praefix=e[5]),32768&n[0]&&(i.toDelete=e[15]),65536&n[0]&&(i.reqQuantity=e[16]),262144&n[0]&&(i.notifyList=e[18]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Rl(e){let t,n;return t=new ro({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[0],currency:e[17],value:e[22](),praefix:e[5],notifyList:e[18],noForm:e[6]}}),t.$on("blur",e[35]()),t.$on("formula",e[50]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),16&n[0]&&(i.required=e[4]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),131072&n[0]&&(i.currency=e[17]),4194304&n[0]&&(i.value=e[22]()),32&n[0]&&(i.praefix=e[5]),262144&n[0]&&(i.notifyList=e[18]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Pl(e){let t,n;return t=new wr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[0],value:e[22](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Hl(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[0].name,value:e[22](),noForm:e[6],placeholder:e[0].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.name=e[0].name),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),1&n[0]&&(i.placeholder=e[0].properties?.placeholder),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ql(e){let t,n;return t=new Nn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[0],desc:e[23],value:e[22](),noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[48]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[49]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),8388608&n[0]&&(i.desc=e[23]),4194304&n[0]&&(i.value=e[22]()),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Yl(e){let t,n;return t=new Rn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[0],desc:e[23],values:e[22]()||[],noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[46]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[47]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),1&n[0]&&(i.item=e[0]),8388608&n[0]&&(i.desc=e[23]),4194304&n[0]&&(i.values=e[22]()||[]),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Gl(e){let t,n,i,o;const r=[Yl,Ql,Hl,Pl,Rl,Wl,Ml,Ol,Vl,Bl,Al,Tl,zl,Dl,El,Fl,Ll,Nl],l=[];function s(e,t){return"object"===e[0].type&&e[0].properties?.multi?0:"object"===e[0].type?1:"textarea"===e[0].type||e[0].properties&&"textarea"===e[0].properties.format?2:e[0].properties&&(e[0].properties.enum||e[0].properties.regulation)?3:"number"===e[0].type?4:e[0].properties&&e[0].properties.multi?5:e[0].properties&&e[0].properties.view&&"lookup"!==e[0].properties.format?6:"boolean"===e[0].type?7:"date"===e[0].type?8:"dateRange"===e[0].type?9:"datetime"===e[0].type?10:"map"===e[0].properties?.format?11:"lookup"===e[0].properties?.format?12:"time"===e[0].properties?.format?13:"email"===e[0].type||"email"===e[0].properties?.format?14:"url"===e[0].properties?.format?15:"tel"===e[0].properties?.format?16:17}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Ul(e){let t,n;return t=new Nn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[0],value:e[22](),noList:!0,withRefValue:!0,refValue:e[21]}}),t.$on("setRefDesc",e[41]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),1&n[0]&&(i.item=e[0]),4194304&n[0]&&(i.value=e[22]()),2097152&n[0]&&(i.refValue=e[21]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Jl(e){let t,n,i,o;const r=[ql,jl,Cl,_l],l=[];function s(e,t){return e[5]||"reference"!==e[0].saveAs||"object"!==e[0].type?"html"===e[0].properties?.format?1:"divider"===e[0].type?2:3:0}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=D()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(me(),$e(l[a],1,1,(()=>{l[a]=null})),fe(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),pe(n,1),n.m(i.parentNode,i))},i(e){o||(pe(n),o=!0)},o(e){$e(n),o=!1},d(e){l[t].d(e),e&&j(i)}}}function Kl(e,t,n){let i,o,r;const l=G(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:m,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:w=!1}=t,{classId:b}=t,{eventId:x}=t,{disabled:k}=t,{selectionFields:I}=t,{formnovalidate:S}=t,{selection:_=!1}=t,{notifyList:C}=t,{numberInput:j}=t,{deList:q}=t,{required:N}=t,{isTemplate:L}=t,{toDelete:F}=t,{reqQuantity:E}=t,{currency:D}=t,{changeValue:z}=t,{propSelection:T}=t;y||=v._id;let{required:A,readonly:B,hidden:V,pattern:O,placeholder:M}=h.properties||{};if(V=!0===V,void 0!==B&&(B=!0===B),void 0===N&&(N=A),k=k||!!B,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const W=(g?g+".":"")+h.name,R=W+(""!==$?"-"+$:""),P=(e,t=W)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let H=P(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(0,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(1,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,w=e.noForm),"classId"in e&&n(7,b=e.classId),"eventId"in e&&n(8,x=e.eventId),"disabled"in e&&n(3,k=e.disabled),"selectionFields"in e&&n(9,I=e.selectionFields),"formnovalidate"in e&&n(10,S=e.formnovalidate),"selection"in e&&n(11,_=e.selection),"notifyList"in e&&n(18,C=e.notifyList),"numberInput"in e&&n(12,j=e.numberInput),"deList"in e&&n(13,q=e.deList),"required"in e&&n(4,N=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,F=e.toDelete),"reqQuantity"in e&&n(16,E=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue),"propSelection"in e&&n(44,T=e.propSelection)},e.$$.update=()=>{if(1&e.$$.dirty[0]|8192&e.$$.dirty[1]&&T&&h.properties?.selection){const{refClass:e,refItem:t,target:n}=h.properties.selection,i=T.record[e];l("propSelection",{itemName:h.name,itemType:h.type,prop:t,target:n,source:e,sourceId:i})}if(4096&e.$$.dirty[1])for(const e in z)e===W&&n(1,v[W]=z[e],v);2&e.$$.dirty[0]&&n(22,i=(e=W)=>{let t=P(v);return void 0===t?"":t}),2&e.$$.dirty[0]&&(r=P(v))},n(23,o=((e=W)=>{let t=v["_"+e];return t=f(t),void 0===t?"":t})()),[h,v,y,k,N,$,w,b,x,I,S,_,j,q,L,F,E,D,C,B,V,H,i,o,s,a,d,m,p,O,M,W,R,(e=W)=>{let t=P(v);return t?new Date(t):""===$?new Date:void 0},(e=W)=>{const t=P(v,e+"_from"),n=P(v,e+"_to");return{from:void 0===t?t:new Date(t),to:void 0===n?n:new Date(n)}},e=>({detail:t})=>{let{value:i,checked:o,range:s}=t;void 0!==o&&(i=o);const a=W+(s||"");n(1,v[a]=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("%%","%")}(i,"%d.%m.%Y"):i,v);const c=Object.values(v).every((e=>!e))&&i;l("notify",{oldValue:r,value:i,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,V=!0),()=>"object"===h.type?"comment_"+R:R,({detail:e})=>{n(21,H=e)},({detail:e})=>{const{designation:t}=h;n(23,o=t+": "+(e||"(Neu)"))},g,z,T,function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)},function(t){U(e,t)}]}class Zl extends Se{constructor(e){var t;super(),document.getElementById("svelte-zmu4lk-style")||((t=N("style")).id="svelte-zmu4lk-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em;color:black}.form-field div.field > label.checkbox{padding-top:0.5em}",_(document.head,t)),Ie(this,e,Kl,Jl,k,{praefix:5,item:0,listName:42,record:1,recordId:2,noForm:6,classId:7,eventId:8,disabled:3,selectionFields:9,formnovalidate:10,selection:11,notifyList:18,numberInput:12,deList:13,required:4,isTemplate:14,toDelete:15,reqQuantity:16,currency:17,changeValue:43,propSelection:44},[-1,-1])}}const{document:Xl}=ve;function es(e,t,n){const i=e.slice();return i[90]=t[n],i[92]=n,i}function ts(e,t,n){const i=e.slice();return i[99]=t[n],i}function ns(e,t,n){const i=e.slice();return i[94]=t[n].title,i[95]=t[n].toDelete,i[96]=t[n].icon,i}function is(e){let t,n;return t=new e[19]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[os]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2048&n[0]|512&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function os(e){let t,n,i;function o(t){e[50](t)}let r={item:e[29],disabled:!0};return void 0!==e[11]&&(r.value=e[11]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};!n&&2048&i[0]&&(n=!0,o.value=e[11],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function rs(e){let t,n;return t=new e[19]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[ls]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};16384&n[0]|512&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ls(e){let t,n,i;function o(t){e[51](t)}let r={item:e[27],disabled:!0};return void 0!==e[14]&&(r.value=e[14]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};!n&&16384&i[0]&&(n=!0,o.value=e[14],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function ss(e){let t,n;return t=new e[19]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[as]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1152&n[0]|512&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function as(e){let t,n,i;function o(t){e[52](t)}let r={item:e[25],disabled:!0,currency:e[7]};return void 0!==e[10]&&(r.value=e[10]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function cs(e){let t,n;return t=new e[22]({props:{class:e[16][e[92]],open:e[9]&&!e[1]&&0===e[92],$$slots:{handle:[gs,({toggle:e,open:t})=>({93:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,0,e?1:0]],default:[fs,({toggle:e,open:t})=>({93:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,0,e?1:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){x(e[43](e[92],e[89]))&&e[43](e[92],e[89]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};65536&i[0]&&(o.class=e[16][e[92]]),514&i[0]&&(o.open=e[9]&&!e[1]&&0===e[92]),439293&i[0]|513&i[3]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ds(e){let t,n;return t=new Zl({props:{praefix:e[92],item:e[99],eventId:e[6],record:e[90],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:xs,classId:e[5],disabled:e[0],required:e[23],selectionFields:e[30],propSelection:e[15],numberInput:e[18],currency:e[7],formnovalidate:e[92]===e[12].length-1||e[12][e[92]]._delete}}),t.$on("notify",(function(){x(e[32](e[99],e[92]))&&e[32](e[99],e[92]).apply(this,arguments)})),t.$on("task",e[53]),t.$on("invalid",e[33]),t.$on("defPrep",e[34]),t.$on("checkRange",e[35]),t.$on("formula",e[44](e[92])),t.$on("record",e[54]),t.$on("propSelection",e[45](e[92])),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};8&i[0]&&(o.item=e[99]),64&i[0]&&(o.eventId=e[6]),4096&i[0]&&(o.record=e[90]),16&i[0]&&(o.recordId=e[4]._id),4&i[0]&&(o.reqQuantity=e[2]),256&i[0]&&(o.notifyList=e[8]),32&i[0]&&(o.classId=e[5]),1&i[0]&&(o.disabled=e[0]),32768&i[0]&&(o.propSelection=e[15]),262144&i[0]&&(o.numberInput=e[18]),128&i[0]&&(o.currency=e[7]),4096&i[0]&&(o.formnovalidate=e[92]===e[12].length-1||e[12][e[92]]._delete),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function us(e){let t,n,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=ds(ts(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082429949&n[0]|24606&n[1]){let l;for(i=e[3].item,l=0;l<i.length;l+=1){const r=ts(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=ds(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function ms(e){let t,n,i=e[12][e[92]]._delete,o=us(e);return{c(){o.c(),t=D()},m(e,i){o.m(e,i),C(e,t,i),n=!0},p(e,n){4096&n[0]&&k(i,i=e[12][e[92]]._delete)?(me(),$e(o,1,1,v),fe(),o=us(e),o.c(),pe(o),o.m(t.parentNode,t)):o.p(e,n)},i(e){n||(pe(o),n=!0)},o(e){$e(o),n=!1},d(e){e&&j(t),o.d(e)}}}function fs(e){let t,n,i,o,r=e[12].length,l=ms(e);return{c(){t=N("div"),l.c(),i=E(),B(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[92]}`)},m(e,n){C(e,t,n),l.m(t,null),C(e,i,n),o=!0},p(e,i){4096&i[0]&&k(r,r=e[12].length)?(me(),$e(l,1,1,v),fe(),l=ms(e),l.c(),pe(l),l.m(t,null)):l.p(e,i),(!o||40&i[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[92]}`))&&B(t,"id",n)},i(e){o||(pe(l),o=!0)},o(e){$e(l),o=!1},d(e){e&&j(t),l.d(e),e&&j(i)}}}function ps(e){let t,n,i,o,r,l=e[31](e[13],e[92])+"";return{c(){t=N("div"),n=F(l),B(t,"class",i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1"),B(t,"draggable",!0),W(t,"delete",e[90]._delete),W(t,"is-active-top",e[17]?.top===e[92]),W(t,"is-active-bottom",e[17]?.bottom===e[92])},m(i,l){C(i,t,l),_(t,n),o||(r=[z(t,"dragover",e[41]),z(t,"dragleave",e[42](e[92])),z(t,"dragstart",e[39](e[92])),z(t,"drop",T(e[38](e[92]))),z(t,"dragenter",e[40](e[92]))],o=!0)},p(o,r){e=o,8192&r[0]&&l!==(l=e[31](e[13],e[92])+"")&&V(n,l),8&r[0]&&i!==(i=S("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&B(t,"class",i),4104&r[0]&&W(t,"delete",e[90]._delete),131080&r[0]&&W(t,"is-active-top",e[17]?.top===e[92]),131080&r[0]&&W(t,"is-active-bottom",e[17]?.bottom===e[92])},d(e){e&&j(t),o=!1,b(r)}}}function $s(e){let t,n,i;var o=e[96];return o&&(t=new o({props:{size:"20"}})),{c(){t&&be(t.$$.fragment),n=D()},m(e,o){t&&xe(t,e,o),C(e,n,o),i=!0},p(e,i){if(o!==(o=e[96])){if(t){me();const e=t;$e(e.$$.fragment,1,0,(()=>{ke(e,1)})),fe()}o?(t=new o({props:{size:"20"}}),be(t.$$.fragment),pe(t.$$.fragment,1),xe(t,n.parentNode,n)):t=null}},i(e){i||(t&&pe(t.$$.fragment,e),i=!0)},o(e){t&&$e(t.$$.fragment,e),i=!1},d(e){e&&j(n),t&&ke(t,e)}}}function hs(e){let t,n,i,o,r,l=!e[0]&&!e[3].readonly&&$s(e);return{c(){t=N("span"),l&&l.c(),B(t,"class","pointer icon svelte-1es1ap1"),B(t,"title",e[94]),t.hidden=n=e[92]===e[12].length-1||!(e[90]._delete^e[95])},m(n,s){C(n,t,s),l&&l.m(t,null),i=!0,o||(r=z(t,"click",(function(){x(e[37](e[92],e[9],e[93]))&&e[37](e[92],e[9],e[93]).apply(this,arguments)})),o=!0)},p(o,r){(e=o)[0]||e[3].readonly?l&&(me(),$e(l,1,1,(()=>{l=null})),fe()):l?(l.p(e,r),9&r[0]&&pe(l,1)):(l=$s(e),l.c(),pe(l,1),l.m(t,null)),(!i||4096&r[0]&&n!==(n=e[92]===e[12].length-1||!(e[90]._delete^e[95])))&&(t.hidden=n)},i(e){i||(pe(l),i=!0)},o(e){$e(l),i=!1},d(e){e&&j(t),l&&l.d(),o=!1,r()}}}function gs(e){let t,n,i,o,r,l;n=new e[20]({props:{$$slots:{default:[ps]},$$scope:{ctx:e}}}),n.$on("click",(function(){x(e[36](e[93],e[92],e[9]))&&e[36](e[93],e[92],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Oe},{title:"undo",toDelete:!1,icon:Ae}],a=[];for(let t=0;t<2;t+=1)a[t]=hs(ns(e,s,t));const c=e=>$e(a[e],1,1,(()=>{a[e]=null}));return{c(){t=N("div"),be(n.$$.fragment),i=E();for(let e=0;e<2;e+=1)a[e].c();o=E(),B(t,"class",r=S("accordion "+e[3].name)+" svelte-1es1ap1"),B(t,"slot","handle")},m(e,r){C(e,t,r),xe(n,t,null),_(t,i);for(let e=0;e<2;e+=1)a[e].m(t,null);_(t,o),l=!0},p(i,d){e=i;const u={};if(143368&d[0]|512&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|64&d[1]|1&d[3]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Oe},{title:"undo",toDelete:!1,icon:Ae}],n=0;n<2;n+=1){const i=ns(e,s,n);a[n]?(a[n].p(i,d),pe(a[n],1)):(a[n]=hs(i),a[n].c(),pe(a[n],1),a[n].m(t,o))}for(me(),n=2;n<2;n+=1)c(n);fe()}(!l||8&d[0]&&r!==(r=S("accordion "+e[3].name)+" svelte-1es1ap1"))&&B(t,"class",r)},i(e){if(!l){pe(n.$$.fragment,e);for(let e=0;e<2;e+=1)pe(a[e]);l=!0}},o(e){$e(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)$e(a[e]);l=!1},d(e){e&&j(t),ke(n),q(a,e)}}}function vs(e){let t,n,i=(!e[1]&&!e[0]||e[92]<e[12].length-1)&&cs(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){!e[1]&&!e[0]||e[92]<e[12].length-1?i?(i.p(e,n),4099&n[0]&&pe(i,1)):(i=cs(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function ys(e){let t,n,i=e[12],o=[];for(let t=0;t<i.length;t+=1)o[t]=vs(es(e,i,t));const r=e=>$e(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,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1082635263&n[0]|32767&n[1]|134217728&n[2]|1&n[3]){let l;for(i=e[12],l=0;l<i.length;l+=1){const r=es(e,i,l);o[l]?(o[l].p(r,n),pe(o[l],1)):(o[l]=vs(r),o[l].c(),pe(o[l],1),o[l].m(t.parentNode,t))}for(me(),l=i.length;l<o.length;l+=1)r(l);fe()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)pe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)$e(o[e]);n=!1},d(e){q(o,e),e&&j(t)}}}function ws(e){let t,n,i,o,r,l,s=e[28]&&e[11]&&0!=e[11]&&is(e),a=e[26]&&e[14]&&0!=e[14]&&rs(e),c=e[24]&&e[10]&&0!=e[10]&&ss(e);return r=new e[21]({props:{class:e[5]+e[3].name,$$slots:{default:[ys,({closeOtherPanels:e})=>({89:e}),({closeOtherPanels:e})=>[0,0,e?134217728:0]]},$$scope:{ctx:e}}}),{c(){t=N("div"),s&&s.c(),n=E(),a&&a.c(),i=E(),c&&c.c(),o=E(),be(r.$$.fragment),B(t,"class","formList")},m(e,d){C(e,t,d),s&&s.m(t,null),_(t,n),a&&a.m(t,null),_(t,i),c&&c.m(t,null),_(t,o),xe(r,t,null),l=!0},p(e,l){e[28]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&pe(s,1)):(s=is(e),s.c(),pe(s,1),s.m(t,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[26]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&pe(a,1)):(a=rs(e),a.c(),pe(a,1),a.m(t,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),e[24]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&pe(c,1)):(c=ss(e),c.c(),pe(c,1),c.m(t,o)):c&&(me(),$e(c,1,1,(()=>{c=null})),fe());const d={};40&l[0]&&(d.class=e[5]+e[3].name),504831&l[0]|134217728&l[2]|512&l[3]&&(d.$$scope={dirty:l,ctx:e}),r.$set(d)},i(e){l||(pe(s),pe(a),pe(c),pe(r.$$.fragment,e),l=!0)},o(e){$e(s),$e(a),$e(c),$e(r.$$.fragment,e),l=!1},d(e){e&&j(t),s&&s.d(),a&&a.d(),c&&c.d(),ke(r)}}}let bs=new Map;const xs=!0,ks="pos/target";function Is(e,t,i){let o,r;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:m}=c,h=G();let{list:g}=t,{mainSchema:v}=t,{schema:y}=t,{record:w}=t,{classId:b}=t,{eventId:x}=t,{disabled:k}=t,{fixed:I}=t,{template:S={}}=t,{reqQuantity:_}=t,{open:C=!1}=t,{currency:j}=t,{notifyList:q}=t;const N=y.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),L=N&&y.find((e=>"quantity"===e.name));let F=0;const E=y.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let D=0;const z=y.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",T=!!z;let A=0;const B={};let V,O=y.properties?.readonly,M=b.split("form-")[1].slice(0,-4),W=new Map;g.group&&(I=!0);const R={};k||=O;let P,H,Q=[],Y=[],J=!1,K={},Z=[];y.filter((e=>e.selection)).map((e=>Q.push({className:M,parentClass:y,refClass:e.selection,value:""}))),y.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{y.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[i,o]=n.split(".");o||(o=i,i=void 0),Z.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));const X=e=>e.slice(0,3).join(", "),ee=async(e,t,n)=>{const i=w[n];if(!i?.length)return;const o=i[0][n];if(!o)return;const r=await va(n,o);return r?r[g.name]:void 0},te=async(e,t)=>{const n=Z.filter((e=>(e.refObj||M)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:o,refName:r,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(o){const t=P[e][o];o===M&&r?d=w:t&&(d=await va(o,t))}!o&&r&&(d=P[e]),d&&(u=d[r],Array.isArray(u)&&0===u.length&&(u=!1)),"!"===l&&(u=!u),"required"!==c&&"readonly"!==c||(c="required"===c?c:"disabled",setTimeout((()=>{s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field textarea`,a=document.querySelector(s),a||(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field input`,a=document.querySelector(s)),a&&u&&a.setAttribute(c,""),a&&!u&&a.removeAttribute(c)}),0)),"hidden"===c&&(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n}`,a=document.querySelector(s),a?.classList?.toggle("hidden",u),u&&i(12,P[e][n]="",P))}},ne=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(n);let r=!1;o.forEach((e=>{e.required&&""===e.value&&(r=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),i(16,Y[e]=r||t?"invalid":"",Y)},oe=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},re=(e,t)=>{if(!t)return;const n=y.find((e=>e.name===t)),o=n.properties.value.formula,{operator:r,argument:l}=o,s=l.map((t=>P[e][t.refItem]||w[t.refItem]));let a=0;"$add"===r&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,i]=e.split(":");e=i?(+n+ +i/60).toFixed(2):+n;const[o,r]=t.split(":");return o?e-=r?(+o+ +r/60).toFixed(2):+o:0}))),"$multiply"===r&&(a=s.reduce(((e,t)=>+e*+t)));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;i(12,P[e][t]="$multiply"===r?a?le(a,n.properties?.decimals):"":le(a,n.properties?.decimals),P),i(18,K={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)},le=(e,t)=>("number"==typeof e&&e||(e=Number(e||0)),e.toFixed(t||0));H=y.filter((e=>e.refClass)).reduce(((e,t)=>{const n=y.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,i]=t.selection.split(":"),[o]=i?.split(".")||[];o&&e.push({refClass:o,items:[n],selection:t.selection})}const i={refClass:t.refClass,items:[]};return n.forEach((e=>{i.items.push(e.name)})),e.push(i),e}),[]);const se=async(e,t,n,o)=>{const r=(await H).find((e=>e.refClass===t.refClass));if(!r)return;const{refClass:l,items:s,selection:a}=r,c=t.name;if(Z.find((e=>e.itemName===c))){const t=`#accordion-content-${b}-${g.name}-${e} .form-field.${l}.hidden`;if(document.querySelector(t))return}return n?Promise.all(s.map((async r=>{const c=y.find((e=>e.name===r));if(c.properties?.readonly&&!t.refInput){const n=P[e][t.refClass];return Promise.resolve(va(t.refClass,n,!0)).then((t=>{let n=t[r];Array.isArray(n)&&(n=n.length?n[0][r]:""),i(12,P[e][r]=n,P)}))}let d="";const{refInput:u}=t;if(u&&P[e]){const[t,n]=u.split(".");d=n?P[e][n]:w[t]}if(a&&n!==o)s.map((t=>{i(12,P[e][t]="",P)}));else if(u&&!d||ae(e,r)||o!==n){const n=y.find((e=>e.refClass===l)),o=P[e][n.name];if(t.selection){const n=ga(t.selection+o.toString());if(n)return Promise.resolve(n).then((t=>i(12,P[e][r]=t[r],P)))}return Promise.resolve(va(n.refClass,o)).then((t=>i(12,P[e][r]=t[r],P)))}}))):Promise.resolve(s.map((t=>{i(12,P[e][t]="",P)})))},ae=(e,t)=>{let n=P[e][t];return"number"===y.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},ce=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let de=!1;const ue=e=>!(!I&&e>=P.length-1),me=(e,t=!1)=>{const[n,i]=e.split(";");return g.name===i&&(!!ue(t)&&((!1===t||t!=n)&&parseInt(n)))};y.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=y.find((e=>e.name===t.refItem))||y.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const fe=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,i=document.querySelectorAll(n);if(!i?.length)return;const o=i[i.length-1];ie().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(ce)})).then((()=>{t&&o.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&i(3,g=e.list),"mainSchema"in e&&i(46,v=e.mainSchema),"schema"in e&&i(47,y=e.schema),"record"in e&&i(4,w=e.record),"classId"in e&&i(5,b=e.classId),"eventId"in e&&i(6,x=e.eventId),"disabled"in e&&i(0,k=e.disabled),"fixed"in e&&i(1,I=e.fixed),"template"in e&&i(48,S=e.template),"reqQuantity"in e&&i(2,_=e.reqQuantity),"open"in e&&i(9,C=e.open),"currency"in e&&i(7,j=e.currency),"notifyList"in e&&i(8,q=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&w&&(i(2,_=w.quantity),i(12,P=(w[g.name]||[]).concat({})),(e=>{i(15,V={record:e})})(w)),4096&e.$$.dirty[0]&&i(13,o=P),15368&e.$$.dirty[0]&&o&&((()=>{if(E)i(14,D=P?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(T)i(11,A=P?.reduce(((e,t)=>e+(t._delete?0:+(t[z]||0))),0)||0)})(),(()=>{if(N)i(10,F=P?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}else if(t.price){const n=(L?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ie().then((()=>h("save",{listName:g.name,value:P,amountValue:F,weeksValue:A})))),262144&e.$$.dirty[1]&&(r=e=>B[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[k,I,_,g,w,b,x,j,q,C,F,A,P,o,D,V,Y,J,K,l,a,d,u,undefined,N,{name:"amountValue",properties:{decimals:2}},E,{name:"hoursValue",properties:{decimals:2}},T,{name:"weeksValue",properties:{decimals:1}},Q,(e,t)=>{let n=e[t];return R["pos"+t]&&(n=R["pos"+t]),n&&y.filter((e=>!0!==e.properties?.hidden&&("dateRange"===e.type||void 0!==n[e.name])&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?r(n[e.name]):Array.isArray(n[e.name])?X(n[e.name]):"boolean"===e.type?$(n[e.name]):"dateRange"===e.type?((e,t)=>{let n,i;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{i=t[e+"_to"],i=new Date(i||"").toLocaleDateString(),"Invalid Date"===i&&(i="")}catch{i=""}return[n,i].filter((e=>""!==e)).join(" - ").trim()})(e.name,n):"date"===e.type?f(n[e.name]):"datetime"===e.type?p(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:r,value:l,add:s,desc:a}=n;if(g.refItem){const n=await ee(t,e,g.refItem);n&&i(12,P=n)}re(t,e._formulaActor);const c=Q?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&P.length===t+1&&i(12,P=P.concat({})),a&&i(49,B[l]=a,B),await se(t,e,l,r),await te(t,e.name),i(13,o=P),"number"===e.type&&i(18,K={item:e,value:l,idx:t}),ne(t)},({detail:e})=>{const{idx:t,value:n}=e;ne(t,n)},async({detail:{className:e,itemName:t,value:i}})=>{if(W.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===M+"."+g.name))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&W.set(e,r[0])},({detail:e})=>{const{idx:t,fieldId:n,value:i}=e;if(!i)return;const o=oe(i);let r=!1;P.forEach(((e,n)=>{if(t===n)return;const{start:i,end:l}=P[n];i&&l&&o>oe(i)&&o<oe(l)&&(r=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",r)},(e,t,n)=>n=>{P[t]._delete||(e(n),fe(t,!0))},(e,t,n)=>o=>{if(i(12,P[e]._delete=!P[e]._delete,P),P[e]._delete){R["pos"+e]={...P[e]};for(const t of y)i(12,P[e][t.name]="",P);t&&n(o)}else{if(R["pos"+e]){const t={};for(const n of y)t[n.name]=R["pos"+e][n.name];i(12,P[e]=t,P)}R["pos"+e]=void 0,t||n(o)}},e=>t=>{t.preventDefault(),i(17,J=!1);const n=me(t.dataTransfer.getData(ks),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const o=[...P].map(((e,t)=>(e._index=t,e)));n<e?(o.splice(e+1,0,o[n]),o.splice(n,1)):(o.splice(e,0,o[n]),o.splice(n+1,1)),o.map(((e,t)=>{return n=e._index,i=t,void bs.set(i,n);var n,i}));let r=[];Y.map(((e,t)=>{r[t]=Y[(e=>{const t=bs.get(e);return void 0===t?e:t})(t)]})),i(16,Y=r),i(12,P=o.map(((e,t)=>(delete e._index,e)))),de=!1},e=>t=>{if(!ue(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(ks,e+";"+g.name),de=e},e=>t=>{const n=me(t.dataTransfer.getData(ks),e)||de;return!1===n||n===e?i(17,J=!1):void i(17,J={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{i(17,J=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(W).forEach((([t,n])=>{P[e][t]||i(12,P[e][t]=n._id,P)}))}),500);const o=new Set;for(const e of Z)o.add(e.refObj||M);for(const t of Array.from(o))te(e,t);t(n),fe(e)},e=>({detail:t})=>{re(e,t.item.name)},e=>async({detail:t})=>{const{itemName:n,itemType:o,source:r,target:l,sourceId:s,prop:a}=t;if(!s)return void i(12,P[e][n]="",P);let c=await va(r,s);const d=c[a];c=await va(g.name,w[g.name][e][g.name]);const u=c[l];let m="number"===o?0:"",f=0;u.forEach((e=>{const t=e[a];t.length<=f||t.every((e=>d.find((t=>t===e))))&&(m=e[n],f=t.length)})),i(12,P[e][n]=m,P)},v,y,S,B,function(e){A=e,i(11,A)},function(e){D=e,i(14,D)},function(e){F=e,i(10,F)},function(t){U(e,t)},function(t){U(e,t)}]}class Ss extends Se{constructor(e){var t;super(),Xl.getElementById("svelte-1es1ap1-style")||((t=N("style")).id="svelte-1es1ap1-style",t.textContent=".accordion.svelte-1es1ap1{display:flex;overflow:hidden}.accordion-content.svelte-1es1ap1{position:relative}.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-1es1ap1{padding-top:1em}div.delete.svelte-1es1ap1{text-decoration:line-through}.icon.svelte-1es1ap1{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-1es1ap1{cursor:drag}.draggableListItem.is-active-top.svelte-1es1ap1{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-1es1ap1{border-bottom:3px purple solid;padding-bottom:2em}",_(Xl.head,t)),Ie(this,e,Is,ws,k,{list:3,mainSchema:46,schema:47,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:48,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:_s,document:Cs}=ve;function js(e,t,n){const i=e.slice();return i[127]=t[n],i}function qs(e,t,n){const i=e.slice();return i[130]=t[n],i}function Ns(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Ls(e){let t,n,i=e[126]&&function(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g=e[1].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=Es(qs(e,g,t));const y=e=>$e(v[e],1,1,(()=>{v[e]=null}));let w=e[1].list&&Ds(e),x=!e[3]&&!e[2]&&e[41]&&e[4]&&!e[22]&&Ps(e);d=new e[25]({props:{outline:!0,$$slots:{default:[Qs]},$$scope:{ctx:e}}}),d.$on("click",e[44]);const k=[Gs,Ys],I=[];function L(e,t){return e[6]?0:e[41]?1:-1}~(m=L(e))&&(f=I[m]=k[m](e));return{c(){t=N("section"),n=N("form"),i=N("input"),r=E();for(let e=0;e<v.length;e+=1)v[e].c();l=E(),w&&w.c(),s=E(),x&&x.c(),a=E(),c=N("div"),be(d.$$.fragment),u=E(),f&&f.c(),B(i,"class",S(e[31])+" svelte-9xiaib"),B(i,"name","_id"),B(i,"type","hidden"),i.value=o=e[5]._id||"",B(n,"class",S(e[32])+" svelte-9xiaib"),B(n,"id",e[31]),B(c,"class","form--buttons svelte-9xiaib"),B(t,"class",S(e[33])+" svelte-9xiaib")},m(o,f){C(o,t,f),_(t,n),_(n,i),_(n,r);for(let e=0;e<v.length;e+=1)v[e].m(n,null);_(n,l),w&&w.m(n,null),_(t,s),x&&x.m(t,null),_(t,a),_(t,c),xe(d,c,null),_(c,u),~m&&I[m].m(c,null),p=!0,$||(h=[z(n,"keydown",e[49]),z(n,"submit",T(e[43]))],$=!0)},p(e,r){if((!p||32&r[0]&&o!==(o=e[5]._id||""))&&(i.value=o),4264226&r[0]|58835457&r[1]){let t;for(g=e[1].items,t=0;t<g.length;t+=1){const i=qs(e,g,t);v[t]?(v[t].p(i,r),pe(v[t],1)):(v[t]=Es(i),v[t].c(),pe(v[t],1),v[t].m(n,l))}for(me(),t=g.length;t<v.length;t+=1)y(t);fe()}e[1].list?w?(w.p(e,r),2&r[0]&&pe(w,1)):(w=Ds(e),w.c(),pe(w,1),w.m(n,null)):w&&(me(),$e(w,1,1,(()=>{w=null})),fe()),e[3]||e[2]||!e[41]||!e[4]||e[22]?x&&(me(),$e(x,1,1,(()=>{x=null})),fe()):x?(x.p(e,r),4194332&r[0]&&pe(x,1)):(x=Ps(e),x.c(),pe(x,1),x.m(t,a));const s={};512&r[4]&&(s.$$scope={dirty:r,ctx:e}),d.$set(s);let u=m;m=L(e),m===u?~m&&I[m].p(e,r):(f&&(me(),$e(I[u],1,1,(()=>{I[u]=null})),fe()),~m?(f=I[m],f?f.p(e,r):(f=I[m]=k[m](e),f.c()),pe(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)pe(v[e]);pe(w),pe(x),pe(d.$$.fragment,e),pe(f),p=!0}},o(e){v=v.filter(_s);for(let e=0;e<v.length;e+=1)$e(v[e]);$e(w),$e(x),$e(d.$$.fragment,e),$e(f),p=!1},d(e){e&&j(t),q(v,e),w&&w.d(),x&&x.d(),ke(d),~m&&I[m].d(),$=!1,b(h)}}}(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[126]&&i.p(e,t)},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Fs(e){let t,n;return t=new Zl({props:{classId:e[31],item:e[130],selection:e[130].selection,record:e[5],disabled:e[22],eventId:e[40],toDelete:e[12],currency:e[8],changeValue:e[16]}}),t.$on("task",e[45]),t.$on("notify",e[46]),t.$on("safeReference",e[55]),t.$on("multi",e[47]),t.$on("defPrep",e[54]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2&n[0]&&(i.item=e[130]),2&n[0]&&(i.selection=e[130].selection),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),4096&n[0]&&(i.toDelete=e[12]),256&n[0]&&(i.currency=e[8]),65536&n[0]&&(i.changeValue=e[16]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Es(e){let t,n,i="list"!==e[130].type&&Fs(e);return{c(){i&&i.c(),t=D()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[130].type?i?(i.p(e,n),2&n[0]&&pe(i,1)):(i=Fs(e),i.c(),pe(i,1),i.m(t.parentNode,t)):i&&(me(),$e(i,1,1,(()=>{i=null})),fe())},i(e){n||(pe(i),n=!0)},o(e){$e(i),n=!1},d(e){i&&i.d(e),e&&j(t)}}}function Ds(e){let t,n,i,o,r,l=e[36]&&e[9]&&0!=e[9]&&zs(e),s=e[10]&&As(e),a=e[37]&&e[15]&&0!=e[15]&&Vs(e),c=e[1].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=Rs(js(e,c,t));const u=e=>$e(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=E(),s&&s.c(),n=E(),a&&a.c(),i=E();for(let e=0;e<d.length;e+=1)d[e].c();o=D()},m(e,c){l&&l.m(e,c),C(e,t,c),s&&s.m(e,c),C(e,n,c),a&&a.m(e,c),C(e,i,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);C(e,o,c),r=!0},p(e,r){if(e[36]&&e[9]&&0!=e[9]?l?(l.p(e,r),512&r[0]&&pe(l,1)):(l=zs(e),l.c(),pe(l,1),l.m(t.parentNode,t)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[10]?s?(s.p(e,r),1024&r[0]&&pe(s,1)):(s=As(e),s.c(),pe(s,1),s.m(n.parentNode,n)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe()),e[37]&&e[15]&&0!=e[15]?a?(a.p(e,r),32768&r[0]&&pe(a,1)):(a=Vs(e),a.c(),pe(a,1),a.m(i.parentNode,i)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe()),4612518&r[0]|33686017&r[1]){let t;for(c=e[1].list,t=0;t<c.length;t+=1){const n=js(e,c,t);d[t]?(d[t].p(n,r),pe(d[t],1)):(d[t]=Rs(n),d[t].c(),pe(d[t],1),d[t].m(o.parentNode,o))}for(me(),t=c.length;t<d.length;t+=1)u(t);fe()}},i(e){if(!r){pe(l),pe(s),pe(a);for(let e=0;e<c.length;e+=1)pe(d[e]);r=!0}},o(e){$e(l),$e(s),$e(a),d=d.filter(_s);for(let e=0;e<d.length;e+=1)$e(d[e]);r=!1},d(e){l&&l.d(e),e&&j(t),s&&s.d(e),e&&j(n),a&&a.d(e),e&&j(i),q(d,e),e&&j(o)}}}function zs(e){let t,n;return t=new e[26]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[Ts]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ts(e){let t,n,i;function o(t){e[64](t)}let r={item:e[34],disabled:!0,currency:e[8]};return void 0!==e[9]&&(r.value=e[9]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&512&i[0]&&(n=!0,o.value=e[9],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function As(e){let t,n;return t=new e[26]({props:{name:"Total MWSt "+(e[11]?"("+e[11]+"%)":""),nameClass:"formField_italic",$$slots:{default:[Bs]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};2048&n[0]&&(i.name="Total MWSt "+(e[11]?"("+e[11]+"%)":"")),1280&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Bs(e){let t,n,i;function o(t){e[65](t)}let r={item:e[35],disabled:!0,currency:e[8]};return void 0!==e[10]&&(r.value=e[10]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};256&i[0]&&(o.currency=e[8]),!n&&1024&i[0]&&(n=!0,o.value=e[10],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Vs(e){let t,n;return t=new e[26]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[Os]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};32768&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Os(e){let t,n,i;function o(t){e[66](t)}let r={item:e[38],disabled:!0};return void 0!==e[15]&&(r.value=e[15]),t=new ro({props:r}),K.push((()=>we(t,"value",o))),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};!n&&32768&i[0]&&(n=!0,o.value=e[15],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function Ms(e){let t,n;return t=new yi({props:{classId:e[31],open:!e[2]&&1===e[1].list.length,list:e[127],template:e[17],eventId:e[40],schema:e[127].item,record:e[5],disabled:e[22],currency:e[8]}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};6&n[0]&&(i.open=!e[2]&&1===e[1].list.length),2&n[0]&&(i.list=e[127]),131072&n[0]&&(i.template=e[17]),2&n[0]&&(i.schema=e[127].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ws(e){let t,n;return t=new Ss({props:{classId:e[31],open:e[14],list:e[127],template:e[18],eventId:e[40],schema:e[127].item,mainSchema:e[1].item,record:e[5],disabled:e[22],fixed:e[127].fixed,reqQuantity:e[13],currency:e[8],notifyList:e[7]}}),t.$on("save",e[48]),t.$on("record",e[56]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};16384&n[0]&&(i.open=e[14]),2&n[0]&&(i.list=e[127]),262144&n[0]&&(i.template=e[18]),2&n[0]&&(i.schema=e[127].item),2&n[0]&&(i.mainSchema=e[1].item),32&n[0]&&(i.record=e[5]),4194304&n[0]&&(i.disabled=e[22]),2&n[0]&&(i.fixed=e[127].fixed),8192&n[0]&&(i.reqQuantity=e[13]),256&n[0]&&(i.currency=e[8]),128&n[0]&&(i.notifyList=e[7]),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Rs(e){let t,n,i,o,r,l;t=new e[24]({props:{text:e[127].designation}});const s=[Ws,Ms],a=[];function c(e,t){return"array"===e[127].type?0:1}return i=c(e),o=a[i]=s[i](e),{c(){be(t.$$.fragment),n=E(),o.c(),r=D()},m(e,o){xe(t,e,o),C(e,n,o),a[i].m(e,o),C(e,r,o),l=!0},p(e,n){const l={};2&n[0]&&(l.text=e[127].designation),t.$set(l);let d=i;i=c(e),i===d?a[i].p(e,n):(me(),$e(a[d],1,1,(()=>{a[d]=null})),fe(),o=a[i],o?o.p(e,n):(o=a[i]=s[i](e),o.c()),pe(o,1),o.m(r.parentNode,r))},i(e){l||(pe(t.$$.fragment,e),pe(o),l=!0)},o(e){$e(t.$$.fragment,e),$e(o),l=!1},d(e){ke(t,e),e&&j(n),a[i].d(e),e&&j(r)}}}function Ps(e){let t,n,i,o;function r(t){e[67](t)}let l={title:"",$$slots:{default:[Hs]},$$scope:{ctx:e}};return void 0!==e[21]&&(l.checked=e[21]),n=new e[27]({props:l}),K.push((()=>we(n,"checked",r))),{c(){t=N("div"),be(n.$$.fragment),B(t,"class","askNext"),M(t,"margin-top","1em"),M(t,"margin-left","23em")},m(e,i){C(e,t,i),xe(n,t,null),o=!0},p(e,t){const o={};512&t[4]&&(o.$$scope={dirty:t,ctx:e}),!i&&2097152&t[0]&&(i=!0,o.checked=e[21],re((()=>i=!1))),n.$set(o)},i(e){o||(pe(n.$$.fragment,e),o=!0)},o(e){$e(n.$$.fragment,e),o=!1},d(e){e&&j(t),ke(n)}}}function Hs(e){let t;return{c(){t=N("span"),t.textContent="Weiter erfassen",M(t,"margin-left",".75em")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Qs(e){let t;return{c(){t=F("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Ys(e){let t,n,i,o,r;t=new e[25]({props:{class:"close",disabled:e[22],form:e[31],filled:!0,type:"submit",$$slots:{default:[Us]},$$scope:{ctx:e}}});let l=e[4]&&!e[22]&&Js(e),s=e[19]&&Zs(e);return{c(){be(t.$$.fragment),n=E(),l&&l.c(),i=E(),s&&s.c(),o=D()},m(e,a){xe(t,e,a),C(e,n,a),l&&l.m(e,a),C(e,i,a),s&&s.m(e,a),C(e,o,a),r=!0},p(e,n){const r={};4194304&n[0]&&(r.disabled=e[22]),512&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[4]&&!e[22]?l?(l.p(e,n),4194320&n[0]&&pe(l,1)):(l=Js(e),l.c(),pe(l,1),l.m(i.parentNode,i)):l&&(me(),$e(l,1,1,(()=>{l=null})),fe()),e[19]?s?(s.p(e,n),524288&n[0]&&pe(s,1)):(s=Zs(e),s.c(),pe(s,1),s.m(o.parentNode,o)):s&&(me(),$e(s,1,1,(()=>{s=null})),fe())},i(e){r||(pe(t.$$.fragment,e),pe(l),pe(s),r=!0)},o(e){$e(t.$$.fragment,e),$e(l),$e(s),r=!1},d(e){ke(t,e),e&&j(n),l&&l.d(e),e&&j(i),s&&s.d(e),e&&j(o)}}}function Gs(e){let t,n,i,o;t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[la]},$$scope:{ctx:e}}}),t.$on("click",e[52]);let r=e[20]&&sa(e);return{c(){be(t.$$.fragment),n=E(),r&&r.c(),i=D()},m(e,l){xe(t,e,l),C(e,n,l),r&&r.m(e,l),C(e,i,l),o=!0},p(e,n){const o={};512&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o),e[20]?r?(r.p(e,n),1048576&n[0]&&pe(r,1)):(r=sa(e),r.c(),pe(r,1),r.m(i.parentNode,i)):r&&(me(),$e(r,1,1,(()=>{r=null})),fe())},i(e){o||(pe(t.$$.fragment,e),pe(r),o=!0)},o(e){$e(t.$$.fragment,e),$e(r),o=!1},d(e){ke(t,e),e&&j(n),r&&r.d(e),e&&j(i)}}}function Us(e){let t;return{c(){t=F("Speichern und schliessen")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Js(e){let t,n;return t=new e[25]({props:{form:e[31],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[Ks]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ks(e){let t;return{c(){t=F("Speichern")},m(e,n){C(e,t,n)},d(e){e&&j(t)}}}function Zs(e){let t,n,i,o,r;const l=[ea,Xs],s=[];t=function(e,t){return e[39]?0:1}(e),n=s[t]=l[t](e);let a=e[20]&&oa(e);return{c(){n.c(),i=E(),a&&a.c(),o=D()},m(e,n){s[t].m(e,n),C(e,i,n),a&&a.m(e,n),C(e,o,n),r=!0},p(e,t){n.p(e,t),e[20]?a?(a.p(e,t),1048576&t[0]&&pe(a,1)):(a=oa(e),a.c(),pe(a,1),a.m(o.parentNode,o)):a&&(me(),$e(a,1,1,(()=>{a=null})),fe())},i(e){r||(pe(n),pe(a),r=!0)},o(e){$e(n),$e(a),r=!1},d(e){s[t].d(e),e&&j(i),a&&a.d(e),e&&j(o)}}}function Xs(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[ta]},$$scope:{ctx:e}}}),t.$on("click",(function(){x(e[50](e[0]))&&e[50](e[0]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ea(e){let t,n;return t=new d({props:{text:e[39],extended:!0,$$slots:{default:[ia]},$$scope:{ctx:e}}}),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};1&n[0]|512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ta(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=N("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function na(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=N("span"),t.textContent=`${e[57]()}`,be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function ia(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[na]},$$scope:{ctx:e}}}),t.$on("click",(function(){x(e[50](e[0]))&&e[50](e[0]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function oa(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[ra]},$$scope:{ctx:e}}}),t.$on("click",(function(){x(e[51](e[0]))&&e[51](e[0]).apply(this,arguments)})),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(n,i){e=n;const o={};512&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function ra(e){let t,n,i;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function la(e){let t,n,i;return n=new st({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Erstellen",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function sa(e){let t,n;return t=new e[25]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[aa]},$$scope:{ctx:e}}}),t.$on("click",e[53]),{c(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,n){const i={};512&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function aa(e){let t,n,i;return n=new dt({props:{size:"18"}}),{c(){t=N("span"),t.textContent="Daten",be(n.$$.fragment),M(t,"margin-right",".75em")},m(e,o){C(e,t,o),xe(n,e,o),i=!0},p:v,i(e){i||(pe(n.$$.fragment,e),i=!0)},o(e){$e(n.$$.fragment,e),i=!1},d(e){e&&j(t),ke(n,e)}}}function ca(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function da(e){let t,n,i,o;Cs.title=t=e[23];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:ca,then:Ls,catch:Ns,value:126,blocks:[,,,]};return he(e[42](),r),{c(){n=E(),i=D(),r.block.c()},m(e,t){C(e,n,t),C(e,i,t),r.block.m(e,r.anchor=t),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(n,i){e=n,(!o||8388608&i[0])&&t!==(t=e[23])&&(Cs.title=t),ge(r,e,i)},i(e){o||(pe(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){$e(r.blocks[e])}o=!1},d(e){e&&j(n),e&&j(i),r.block.d(e),r.token=null,r=null}}}let ua=new Map,ma=new Map,fa=new Map;const pa=(e,t)=>{const i=t;return ua.has(i)||ua.set(i,n.getTasksList(t).then((({data:e})=>e))),ua.get(i)},$a=(e,t,i,o=!1)=>ma.get(i)||o?n.getTaskList(e,i).then((e=>(ma.set(i,e),e))):pa(e,t).then((t=>t.find((({_id:e})=>e===i))||n.getTaskList(e,i))).then((e=>(ma.set(i,e),e))),ha=(e,t)=>{fa.set(e,t)},ga=e=>fa.get(e),va=(e,t,i=!1)=>!i&&fa.get(t)||n.getTask(e,t).then((e=>(fa.set(t,e),e))),ya=(e,t)=>{if(!ua.get(t))return;const i=t;ua.set(i,n.getTasksList(t).then((({data:e})=>e)))};function wa(e,r,a){let d,f,p,$,v,y,w,b;I(e,m,(e=>a(78,v=e))),I(e,s,(e=>a(79,y=e))),I(e,o,(e=>a(80,w=e)));const{Divider:x,Button:k,FormField:S,Checkbox:_}=c,{loggedIn:C,currentTasks:j,environment:q}=u;I(e,C,(e=>a(81,b=e))),I(e,j,(e=>a(76,p=e))),I(e,q,(e=>a(77,$=e)));const N=JSON.parse(t.getItem("Locale")),L=G();let F,E,D,z,T,{schema:A}=r,{recID:B}=r,{prevEventID:V=!1}=r,{prev:O=!1}=r,{taskId:M=!1}=r,{description:W=""}=r,{root:R=!1}=r,{readonly:P}=r,{isStandalone:H}=r,U={},J={},K="form-"+A.class+Math.floor(9e3*Math.random()+1e3).toString();const Z=R?"fEmbedded":"fTask",X=R?"sEmbedded":"sTask";let ee="CHF";let te,ne,oe=0,re=0,le=0,se=0,ae=1,ce=!B&&A.list&&1===A.list.length;const de={},ue=A.items.find((e=>"price"===e.name&&!e.properties?.hidden)),me=A.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),fe=A.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),pe=!!ue||!!fe,$e=A.list?.filter((e=>"array"===e.type))?.length>1||pe,he=A.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,ge=!!he,ve=A.list?.filter((e=>"array"===e.type))?.length>1||ge,ye={},we=A.result?.resultDef[0].button?.description;let be,xe,ke,Ie,Se=0,_e=0,Ce=[],je=[],qe=[],Ne={},Le=new Map,Fe=A.class,Ee=A.id,De=!1,ze=-1!==window.location.search.indexOf("next=");const Te=!p?.length||p.find((e=>e===Ee));["readonly","hidden","required"].map((e=>{A.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");Ce.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));A.items.filter((e=>e.selection&&e.constraint)).map((e=>{je.push({name:e.name,selection:e.selection,constraint:e.constraint})}));A.items.filter((e=>e.lookup)).forEach((e=>{qe.push({name:e.name,lookup:e.lookup})})),A.items.filter((e=>e.properties?.lookup)).forEach((e=>{qe.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const Ae=async e=>{if(e?.length)for(const t of e){if(!t.lookup)break;const{name:e}=t;if(U[e])break;const{domain:i,value:o}=t.lookup;if("user"===i&&o){const t=b.user,i={[o]:t},r=await n.getSectionView(e,i);if(r?.length){const[{_id:t}]=r;t&&a(5,U[e]=t,U)}}}},Be=async e=>{if(!A.input)return;if(!A.input.length)return;if(A.input.length<2)return;const t=!e.input.class[0].name&&e.input.class[0].selection;if(!t)return;const i=e.input.class[1].name,[o,r]=e.input.class[1].destination?.split(".");if(!i||!r)return;const l=A.list?.find((e=>e.name===o));if(!l)return;const s=await n.getSchemaByClass(t),c=(await n.getTasks(s.id)).data;if(!c?.length)return;const d=[];for(const e of c)if(e.active??1){const t={};for(const n of l.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);d.push(t)}d.length&&a(5,U[o]=d,U)},Ve=async()=>{for(const e of A.items)"boolean"==typeof e.properties?.value&&a(5,U[e.name]=e.properties.value,U),e.properties?.value?.concatenation&&Oe(e);for(const e of A.list||[])for(const t of e.item)if("array"!==e.type&&"owner"===t.refItem){const i=await n.getSolitaire(t.refItem);i?.length&&(U[e.name]||a(5,U[e.name]={},U),a(5,U[e.name][t.name]=g(i[0],t.refPos||t.name),U))}},Oe=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 We(e.refItemNext));a(5,U[e.name]=n,U)},Me=async e=>{const t=Ce.filter((t=>t.refObj===e));if(t?.length){a(16,Ne={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:r}=e;if(!n)break;let l,s,c=!i&&U[n];const d=U[n];d&&i&&(c=(await va(n,d))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==r&&"readonly"!==r||(r="required"===r?r:"disabled",setTimeout((()=>{l=`#${K} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(r,""),s&&!c&&s.removeAttribute(r)}),0)),"hidden"===r&&(l=`#${K} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(16,Ne[t]="",Ne))}}},We=async e=>{const[t,i]=e.offset?.split(",")||[0,0],o=+e.base||0,r=+e.step||1;e.type;const l=e.refItem,s=await n.getLastId(A.class,l);if(!s?.length)return(o+r).toString().padStart(i,"0");const a=s[0][l];return((+a?.substring(t,t+i)||o)+r).toString().padStart(i,"0")},Re=(e,t,n,i=!1)=>{const o=n||t.name,r=o.startsWith("_")?o:o.split("_")[0],l=e.find((e=>e.name===r));let s=t.value;if(!l)return s;if(!i&&l.properties?.multi&&(s=U[o]),"dateRange"===l.type){if(null===s)return;let e=new Date(s);if("Invalid Date"==e)return;return e=`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(e).toISOString()}if(s&&l.type.startsWith("date"))try{return Qn(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if("boolean"===l.type&&(s=!!t.checked),"number"===l.type){const e=Number("1.1").toLocaleString(N.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Pe=()=>H?window.close():R?window.singleSpaNavigate("/"):L("back"),He=async(e,t)=>{if(A.input&&A.input.length>1){if(A.input[0]!==e)return;const{recursive:i}=ke.input.class[1];if(t){const o=await n.getTaskOptions(`${e}:${t}`,Ee,i);a(5,U={...U,...o})}else{const e=A.input.slice(1);for(const t of e)a(5,U[t]=[],U)}}},Qe=()=>{let e=0;if(ue){let t=1;me&&(t=ae),e=se*t}fe&&(e=se);let t=0;for(const e in de)t+=de[e];a(9,oe=t+e)},Ye=()=>{let e=0;for(const t in ye)e+=ye[t];a(15,Se=e+ +_e)};i.subscribe((async e=>{if(!e)return;if(!B)return;const t=await n.getSchema(e.eventId);if(!t)return;const i=A.list?.find((e=>e.name===t.class));if(!i)return;const o=await n.getTaskById(e.taskId);((e,t,n)=>{if(!ua.get(e))return;const i=t;ma.set(i,n)})(o.event,o.docId,o.data);const r=await n.getTask(t.class,o.docId),l=U[t.class].filter((e=>e[t.class]==r._id));l?.length&&l.map((e=>{e[t.class]=o.docId})),a(5,U),a(63,E),a(62,F),a(1,A)})),Q((()=>{ua=new Map,ma=new Map,fa=new Map,Ge()}));const Ge=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(K))&&++n<20;)await e(50);t&&(()=>{if(B)return;const e=new Set;for(const t of Ce)e.add(t.refObj||Fe);Array.from(e).forEach((e=>Me(e)))})(),Ue()},Ue=()=>{setTimeout((()=>{Array.from(Le).forEach((([e,t])=>{U[e]||a(5,U[e]=t._id,U)}))}),350)};Y((()=>{B&&function(e,t,n=t){e.set(n)}(m,v={[B]:{record:U,lists:J}},v)}));const Je=()=>{const e={};Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,i]=t.name.split("."),o=A.list.find((e=>e.name===n));e[t.name]=Re(o.item,t)}else e[t.name]=Re(A.items,t,t.name.split("_")[0])})),A.list&&A.list.map((t=>{"array"===t.type&&J[t.name]&&(e[t.name]=J[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,i])=>("_delete"!==n&&(e[n]=Re(t.item,{name:n,value:i,checked:i},"",!0)),e)),{}))),[]))}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const i=A.items.find((t=>t.name===e));i?.properties?.required&&!n&&(t=!1)})),t&&e},Ke=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(1,A=e.schema),"recID"in e&&a(2,B=e.recID),"prevEventID"in e&&a(60,V=e.prevEventID),"prev"in e&&a(3,O=e.prev),"taskId"in e&&a(0,M=e.taskId),"description"in e&&a(58,W=e.description),"root"in e&&a(4,R=e.root),"readonly"in e&&a(59,P=e.readonly),"isStandalone"in e&&a(61,H=e.isStandalone)},e.$$.update=()=>{268435456&e.$$.dirty[1]&&a(22,d=P),2&e.$$.dirty[0]|3&e.$$.dirty[2]&&E&&F&&A.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const i=F.items.find((t=>t.name===e));if(!i)return;if(t!==i.type)return;const o="_"+e;E[e]?a(5,U[e]=E[e],U):a(5,U[e]="",U),E[o]&&a(5,U[o]=E[o],U),a(14,ce=!1)})),16&e.$$.dirty[0]|134217728&e.$$.dirty[1]&&a(23,f=R?W||"enablerr - Form":document.title)},[M,A,B,O,R,U,D,T,ee,oe,re,le,te,ne,ce,Se,Ne,be,xe,De,Ie,ze,d,f,x,k,S,_,C,j,q,K,Z,X,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},$e,ve,{name:"weekValue",properties:{decimals:1}},we,Ee,Te,async()=>{if(a(18,xe=[]),$.currency?a(8,ee=$.currency.designation):n.getSectionView("owner",{}).then((e=>{e?.length&&e[0].currency&&n.getSectionView("currency",{_id:e[0].currency}).then((e=>{e?.length&&e[0].designation&&a(8,ee=e[0].designation)}))})),ke=await n.getEvent(Ee),B||(a(17,be=xe),Ae(ke.input?.class),Ve(),Be(ke)),B){if(v&&v[B]){const e=v[B].record;A.items.map((t=>{e[t.name]=Re(A.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(5,U=e),A.list&&A.list.map((e=>{"array"===e.type&&v[B].lists[e.name]&&a(5,U[e.name]=v[B].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]),U)}))}else a(5,U=await n.getTask(A.class,B));a(58,W=h(A,U)),a(19,De=!!A.result?.resultDef&&!A.result.resultDef[0].createAfterSave),a(10,re=U._tax?._amount),a(11,le=100*U._tax?._rate||"")}if(V){a(59,P=!1),a(62,F=await n.getSchema(V)),"string"==typeof O&&a(63,E=await n.getTask(F.class,O));const e=A.items.find((e=>e.refClass===F.class));a(5,U[e.name]=E._id,U)}if(ve&&(_e=U[he]||0),ke.trigger?.startOn&&!ke.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(59,P=!0),y.role?.length&&A.authorization?.length){const e=A.authorization.some((e=>w?.find((t=>t===e.role&&"edit"===e.activity))));a(59,P||=!e)}if(a(6,D="report"===ke.output.type),$.userSetting){const e=$.userSetting;if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}else n.getUserSettings().then((e=>{if(a(20,Ie=e.isAdmin),!Ie){const e=b.tenants.find((e=>e._id===b.tenant));e&&a(20,Ie=e.admin?.find((e=>e===b.user)))}}));return!0},async e=>{B||a(22,d=!0);const t=e.submitter?.className?.includes("close"),i={};if(Array.from(document.querySelectorAll("form#"+K+" ."+K)).map((e=>{if(e.name)if(e.name.includes(".")){const t=e.name.split(".")[0],n=A.items.find((e=>e.name===t));if(n&&"object"===n.type&&n.properties?.multi)i[t]=(i[t]||[]).concat(e.value);else{const[t,n]=e.name.split("."),o=A.list.find((e=>e.name===t));i[e.name]=Re(o.item,e)}}else i[e.name]=Re(A.items,e)})),A.list&&A.list.map((e=>{"array"===e.type&&J[e.name]&&(i[e.name]=J[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Re(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]))})),i._event=Ee,i._prevEventId=V,i._taskId=M,z){const e=z.record;for(const t in e)t.includes(".")&&delete e[t];e._event=z.event,e._taskId=z.taskId;const{id:t}=await n.saveData(z.class,e);i[z.class]||(i[z.class]=t)}const{id:o,task:r,tax:s,error:c}=await n.saveData(A.class,i);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(22,d=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(10,re=s?._amount||0),a(11,le=100*(s?._rate||0)||""),i._id=o;const u=await n.getTaskList(A.class,o);if(L("choose",{row:u}),t)return Pe();if(!B){if(ze){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Ee}/${Ee}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${Ee}/${r}/task`)}},()=>!D&&V?window.history.back():Pe(),async({detail:e})=>{const{row:t}=e;let{eventId:i}=e;if((()=>{if(B)for(const e of Ce)e.refName||Me(e.itemName)})(),await(async e=>{let t,i=!1;const o={...U};for(const r of A.items)e&&!r.properties?.linkOnly||r.refItem&&U[r.refItem]&&(t=await n.getTask(r.refItem,U[r.refItem]),t&&(o[r.name]=t[r.name],i=!0));for(const r of A.list||[])if((!e||r.properties?.linkOnly)&&r.refItem&&U[r.refItem]){t=await n.getTask(r.refItem,U[r.refItem]);const e=[];for(const n of t[r.name]){const t={};for(const e of r.item)n[e.name]&&(t[e.name]=n[e.name]);e.push(t),i=!0}o[r.name]=e}i&&a(5,U=o)})(!!B),B)return;if(i||=t._task?.event,i&&(await(async(e,t)=>{if(!e)return;const i=(await n.getEvent(e)).output.class[0].name,o=qe.filter((e=>e.lookup===i));if(o?.length)for(const e of o){const{lookup:n,name:i}=e;let o="";if(t){let e=await va(n,t);e&&e[i]?.length&&(o=e[i][0][i])}a(5,U[i]=o,U)}})(i,t._id),A.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const t=await n.getEvent(i);t.output.class[0]?.name===e.properties.lookup&&a(5,U[e.name]="",U)}))),!t._task)return;const o=t._task.event,r=await n.getEvent(o);if(!ke.output?.class?.length)return;const l=ke.output.class[0]?.item.find((e=>(e.refClass||e.name)===r.output.class[0]?.name));(ke.input?.class?.length&&ke.input.class[0].name===r.output.class[0]?.name||l?.asInput)&&(a(62,F=await n.getSchema(o)),a(60,V=o),a(0,M=t._task._id),a(63,E=M?await n.getTask(F.class,t._task.docId):{}),He(F.class,t?._task?.docId))},async({detail:e})=>{if(a(7,T=e),"quantity"===e.itemName&&a(13,ne=U.quantity),(async(e,t)=>{const n=je.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(12,te=!1);for(const i of n){const{selection:n,constraint:o,name:r}=i;if(t)break;a(5,U[r]="",U),e===n&&a(12,te=o);const l=U[n];if(l&&e===o){let e=await va(n,l);const t=U[o];if(t?.length){const n=t[0].split(", ");e=e[o];let i="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(i=t[r])}));a(5,U[r]=i,U)}}}}})(e.itemName,e.oldValue===e.value),Me(e.itemName),ve&&he&&(e.itemName===he&&(_e=+e.value),Ye()),pe&&$e){if(e.itemName===ue?.name)se=e.value;else if(e.itemName===me?.name)ae=e.value;else{if(e.itemName!==fe?.name)return;se=e.value}Qe()}},async({detail:e})=>{if(!(A.input?.length&&A.input.length>1))return;if(F?.class!==A.input[0])return;const{value:t,lookup:i,view:o}=e;if(!i)return;const[r]=i.split(":"),l=(await n.getSectionView(r,{[o]:{$in:t}})).map((e=>e._id));for(const e of A.input.slice(1)){a(5,U[e]=[],U);const t=await n.getSchemaByClass(e);t.id;let i=await n.getTasks(t.id);if(i=i.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[r]))),i?.length){const t=i.map((e=>e._id)),o=await n.getSectionView(e,{_id:{$in:t}});for(const t of o)t[e]=t._id;a(5,U[e]=o,U)}}},({detail:e})=>{J[e.listName]=e.value,$e&&(de[e.listName]=e.amountValue,Qe()),ve&&(ye[e.listName]=e.weeksValue||0,Ye())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const t=await n.getReportDoc(e)||{},{userReportId:i,type:o}=t;if(!i)return;const r="/api/userreport/"+i;if("ics"===o)return window.open(r,"_self","width=1 height=1");const l="/viewer/doc/index.html?file="+r+"&type="+o;window.open(l,"","popup=yes toolbar=no width=624 height=900")},e=>async()=>{const e=await n.getDocData(M);(async(e,t)=>{const n=window.screen.height,i=window.open("","_blank","width=800,height="+n+",location=no");await ie(),i?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),i?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+e+"</textarea>")})(JSON.stringify(e,null,4),A.identity.designation)},async()=>{const e=Je();if(!e)return;const t=ke.result?.resultDef[0]?.addToReports;if(t){const i=e[t];if(i){const t={docId:i},o=(await n.getSectionView("_task",t))[0];e._taskId=o._id}}const{reportId:i,type:o}=await n.createReport(Ee,e);Ke(i),setTimeout(Pe,2e3)},async()=>{const e=Je();if(!e)return;const t=await n.getReportData(Ee,e),i=window.screen.height,o=window.open("","_blank","width=800,height="+i+",location=no");await ie(),o?.document.write("<title>Report Daten für '"+A.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(t,null,4)+"</textarea>")},async({detail:{className:e,itemName:t,value:i}})=>{if(Fe!==i)return;if(Le.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===Fe))),!i)return;const o={[t]:!0},r=await n.getSectionView(e,o);r?.length&&Le.set(e,r[0])},({detail:e})=>{z=e},({detail:e})=>{setTimeout((()=>{a(5,U[e.itemName]=e.value,U)}),200)},()=>A.result.resultDef[0].button?.designation||"Dokument erstellen",W,P,V,H,F,E,function(e){oe=e,a(9,oe)},function(e){re=e,a(10,re)},function(e){Se=e,a(15,Se)},function(e){ze=e,a(21,ze)}]}class ba extends Se{constructor(e){var t;super(),Cs.getElementById("svelte-9xiaib-style")||((t=N("style")).id="svelte-9xiaib-style",t.textContent="form.disabled.svelte-9xiaib input.svelte-9xiaib{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-9xiaib.svelte-9xiaib{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-9xiaib.svelte-9xiaib{min-width:30em}}.fEmbedded.svelte-9xiaib.svelte-9xiaib,.fTask.svelte-9xiaib.svelte-9xiaib{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-9xiaib.svelte-9xiaib{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-9xiaib.svelte-9xiaib{height:fit-content;max-height:70vh}.sTask.svelte-9xiaib.svelte-9xiaib{height:95%;display:inline-grid}.sTask.svelte-9xiaib .btn.svelte-9xiaib{display:initial !important}.form--buttons.svelte-9xiaib.svelte-9xiaib{display:flex;gap:1em;padding-top:0.75em}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}",_(Cs.head,t)),Ie(this,e,wa,da,k,{schema:1,recID:2,prevEventID:60,prev:3,taskId:0,description:58,root:4,readonly:59,isStandalone:61},[-1,-1,-1,-1,-1])}}function xa(e){let t,n,i;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 ba({props:r}),K.push((()=>we(t,"description",o))),t.$on("back",e[2]),{c(){be(t.$$.fragment)},m(e,n){xe(t,e,n),i=!0},p(e,i){const o={};32&i&&(o.schema=e[5]),64&i&&(o.recID=e[6]),!n&&1&i&&(n=!0,o.description=e[0],re((()=>n=!1))),t.$set(o)},i(e){i||(pe(t.$$.fragment,e),i=!0)},o(e){$e(t.$$.fragment,e),i=!1},d(e){ke(t,e)}}}function ka(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[xa,({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(){be(t.$$.fragment)},m(e,i){xe(t,e,i),n=!0},p(e,[n]){const i={};1&n&&(i.description=e[0]),353&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(pe(t.$$.fragment,e),n=!0)},o(e){$e(t.$$.fragment,e),n=!1},d(e){ke(t,e)}}}function Ia(e,t,i){let o,{refresh:r}=t;return e.$$set=e=>{"refresh"in e&&i(3,r=e.refresh)},[o,(e,t)=>n.getSchema(e).then((n=>({schema:n,recID:t,eventID:e,title:n.identity.designation}))),e=>{},r,function(e){o=e,i(0,o)}]}function Sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _a,Ca,ja=(_a=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,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=i(i({},l),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var l={component:null,domElementGetter:null,props:{}};function s(e){return Promise.resolve()}function a(e,t,n){var o=Object.keys(l),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),l=o();t.instance=new e.component(i(i({},r),{},{target:l,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)}))}},_a(Ca={exports:{}},Ca.exports),Ca.exports);const qa=Sa(ja)({component:class extends Se{constructor(e){super(),Ie(this,e,Ia,ka,k,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:Na,mount:La,unmount:Fa}=qa;e({bootstrap:Na,mount:La,unmount:Fa});e("Form",ba),e("List",Ft),e("Template",class extends Se{constructor(e){var t;super(),Gn.getElementById("svelte-1phofh5-style")||((t=N("style")).id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",_(Gn.head,t)),Ie(this,e,ai,li,k,{schema:0,record:1})}})}}}));