@enablerr-ui/detail 0.3.214 → 0.3.216

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,4 +1,4 @@
1
- System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],function(e){"use strict";var t,n,r,i,o,s,a,l,c,d,u,f;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.settings,s=e.TextArea,a=e.toasts,l=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){f=e.taskClipboard}],execute:function(){function h(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}e("version","0.3.214");const m=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}},g=(e,t)=>{let n,r;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{r=t[e+"_to"],r=new Date(r||"").toLocaleDateString(),"Invalid Date"===r&&(r="")}catch{r=""}return[n,r].filter(e=>""!==e).join(" - ").trim()},w=e=>/^[0-9a-f]{24}/.test(e),y=e=>!0===e?"(ja)":!1===e?"(nein)":"",v=(e,t)=>{if(!e.display&&!e.items)return"";const n={...t};return(e.display?.reduce((t,r)=>{let[i,o]=r.split(".");if(e.list?.find(({name:e})=>e===i)&&o&&void 0!==n[i]){const e=`${i}_${o}`;n[e]=n[i][o],i=e}return t.find(e=>e===i)||t.push(i),t},[]).map(e=>{const t=n[e];if("boolean"==typeof t)return y(t);if("number"==typeof t){const e=t.toString().split(".")[1];return e&&e.length>2?((e,t)=>(t||=0,"number"==typeof e&&e||(e=Number(e||0)),(+(Math.round(e+"e+"+t)+"e-"+t)).toString()))(t,2):t}return m(n["_"+e]||t)})||e.items.map(e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&y(t[e.name]),t[e.name]))).map(e=>e?.toString().split(" · ").filter(e=>!!e&&!w(e)).join(" · ")).filter(e=>!!e).join(" • ")},$=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};const I=e=>{if(t=e,"[object Date]"===Object.prototype.toString.call(t))return e;var t;if("string"!=typeof e)return e;try{if((e=e.slice(0,10)).includes(".")){const[t,n,r]=e.split(".");return new Date(r,n-1,t)}if(e.includes("-")){const[t,n,r]=e.split("-");return new Date(t,n-1,r)}}catch{return e}return e};function _(){}function C(e){return e()}function E(){return Object.create(null)}function A(e){e.forEach(C)}function b(e){return"function"==typeof e}function S(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function N(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return _;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function T(e){return null==e?"":e}function D(e,t,n=t){return e.set(n),t}function R(e,t){e.appendChild(t)}function x(e,t,n){e.insertBefore(t,n||null)}function k(e){e.parentNode.removeChild(e)}function O(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function M(e){return document.createElement(e)}function P(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function B(e){return document.createTextNode(e)}function L(){return B(" ")}function F(){return B("")}function V(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function U(e){return function(t){return t.preventDefault(),e.call(this,t)}}function W(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function z(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function H(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function j(e,t){e.value=null==t?"":t}function q(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function G(e,t,n){e.classList[n?"add":"remove"](t)}class X{constructor(e=null){this.a=e,this.e=this.n=null}m(e,t,n=null){this.e||(this.e=M(t.nodeName),this.t=t,this.h(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)x(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(k)}}let Y;function Z(e){Y=e}function K(){if(!Y)throw new Error("Function called outside component initialization");return Y}function Q(e){K().$$.on_mount.push(e)}function J(e){K().$$.on_destroy.push(e)}function ee(){const e=K();return(t,n)=>{const r=e.$$.callbacks[t];if(r){const i=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);r.slice().forEach(t=>{t.call(e,i)})}}}function te(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const ne=[],re=[],ie=[],oe=[],se=Promise.resolve();let ae=!1;function le(){ae||(ae=!0,se.then(me))}function ce(){return le(),se}function de(e){ie.push(e)}function ue(e){oe.push(e)}let fe=!1;const he=new Set;function me(){if(!fe){fe=!0;do{for(let e=0;e<ne.length;e+=1){const t=ne[e];Z(t),pe(t.$$)}for(Z(null),ne.length=0;re.length;)re.pop()();for(let e=0;e<ie.length;e+=1){const t=ie[e];he.has(t)||(he.add(t),t())}ie.length=0}while(ne.length);for(;oe.length;)oe.pop()();ae=!1,fe=!1,he.clear()}}function pe(e){if(null!==e.fragment){e.update(),A(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(de)}}const ge=new Set;let we;function ye(){we={r:0,c:[],p:we}}function ve(){we.r||A(we.c),we=we.p}function $e(e,t){e&&e.i&&(ge.delete(e),e.i(t))}function Ie(e,t,n,r){if(e&&e.o){if(ge.has(e))return;ge.add(e),we&&we.c.push(()=>{ge.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function _e(e,t){const n=t.token={};function r(e,r,i,o){if(t.token!==n)return;t.resolved=o;let s=t.ctx;void 0!==i&&(s=s.slice(),s[i]=o);const a=e&&(t.current=e)(s);let l=!1;t.block&&(t.blocks?t.blocks.forEach((e,n)=>{n!==r&&e&&(ye(),Ie(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),ve())}):t.block.d(1),a.c(),$e(a,1),a.m(t.mount(),t.anchor),l=!0),t.block=a,t.blocks&&(t.blocks[r]=a),l&&me()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=K();if(e.then(e=>{Z(n),r(t.then,1,t.value,e),Z(null)},e=>{if(Z(n),r(t.catch,2,t.error,e),Z(null),!t.hasCatch)throw e}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}var i}function Ce(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}const Ee="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Ae(e,t){Ie(e,1,1,()=>{t.delete(e.key)})}function be(e,t,n,r,i,o,s,a,l,c,d,u){let f=e.length,h=o.length,m=f;const p={};for(;m--;)p[e[m].key]=m;const g=[],w=new Map,y=new Map;for(m=h;m--;){const e=u(i,o,m),a=n(e);let l=s.get(a);l?r&&l.p(e,t):(l=c(a,e),l.c()),w.set(a,g[m]=l),a in p&&y.set(a,Math.abs(m-p[a]))}const v=new Set,$=new Set;function I(e){$e(e,1),e.m(a,d),s.set(e.key,e),d=e.first,h--}for(;f&&h;){const t=g[h-1],n=e[f-1],r=t.key,i=n.key;t===n?(d=t.first,f--,h--):w.has(i)?!s.has(r)||v.has(r)?I(t):$.has(i)?f--:y.get(r)>y.get(i)?($.add(r),I(t)):(v.add(i),f--):(l(n,s),f--)}for(;f--;){const t=e[f];w.has(t.key)||l(t,s)}for(;h;)I(g[h-1]);return g}function Se(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Ne(e){e&&e.c()}function Te(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||de(()=>{const t=o.map(C).filter(b);s?s.push(...t):A(t),e.$$.on_mount=[]}),a.forEach(de)}function De(e,t){const n=e.$$;null!==n.fragment&&(A(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Re(e,t,n,r,i,o,s=[-1]){const a=Y;Z(e);const l=e.$$={fragment:null,ctx:null,props:o,update:_,not_equal:i,bound:E(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:t.context||[]),callbacks:E(),dirty:s,skip_bound:!1};let c=!1;if(l.ctx=n?n(e,t.props||{},(t,n,...r)=>{const o=r.length?r[0]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=o)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](o),c&&function(e,t){-1===e.$$.dirty[0]&&(ne.push(e),le(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n}):[],l.update(),c=!0,A(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);l.fragment&&l.fragment.l(e),e.forEach(k)}else l.fragment&&l.fragment.c();t.intro&&$e(e.$$.fragment),Te(e,t.target,t.anchor,t.customElement),me()}Z(a)}class xe{$destroy(){De(this,1),this.$destroy=_}$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 ke(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("polygon"),z(n,"d","M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"),z(r,"points","12 15 17 21 7 21 12 15"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-airplay "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function Oe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Me extends xe{constructor(e){super(),Re(this,e,Oe,ke,S,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("path"),r=P("line"),i=P("line"),z(n,"d","M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"),z(r,"x1","12"),z(r,"y1","9"),z(r,"x2","12"),z(r,"y2","13"),z(i,"x1","12"),z(i,"y1","17"),z(i,"x2","12.01"),z(i,"y2","17"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Be(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Le extends xe{constructor(e){super(),Re(this,e,Be,Pe,S,{size:0,strokeWidth:1,class:2})}}function Fe(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("circle"),r=P("polyline"),i=P("line"),z(n,"cx","12"),z(n,"cy","12"),z(n,"r","10"),z(r,"points","8 12 12 16 16 12"),z(i,"x1","12"),z(i,"y1","8"),z(i,"x2","12"),z(i,"y2","16"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Ve(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ue extends xe{constructor(e){super(),Re(this,e,Ve,Fe,S,{size:0,strokeWidth:1,class:2})}}function We(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("path"),z(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),z(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-book-open "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function ze(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class He extends xe{constructor(e){super(),Re(this,e,ze,We,S,{size:0,strokeWidth:1,class:2})}}function je(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("circle"),z(n,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),z(r,"cx","12"),z(r,"cy","13"),z(r,"r","4"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-camera "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function qe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ge extends xe{constructor(e){super(),Re(this,e,qe,je,S,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),z(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),z(r,"points","22 4 12 14.01 9 11.01"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function Ye(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ze extends xe{constructor(e){super(),Re(this,e,Ye,Xe,S,{size:0,strokeWidth:1,class:2})}}function Ke(e){let t,n,r;return{c(){t=P("svg"),n=P("path"),z(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"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",r="feather feather-command "+e[2])},m(e,r){x(e,t,r),R(t,n)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&z(t,"class",r)},i:_,o:_,d(e){e&&k(t)}}}function Qe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Je extends xe{constructor(e){super(),Re(this,e,Qe,Ke,S,{size:0,strokeWidth:1,class:2})}}function et(e){let t,n,r,i;return{c(){t=P("svg"),n=P("polyline"),r=P("path"),z(n,"points","9 10 4 15 9 20"),z(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function tt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class nt extends xe{constructor(e){super(),Re(this,e,tt,et,S,{size:0,strokeWidth:1,class:2})}}function rt(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("path"),r=P("line"),i=P("line"),z(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),z(r,"x1","18"),z(r,"y1","9"),z(r,"x2","12"),z(r,"y2","15"),z(i,"x1","12"),z(i,"y1","9"),z(i,"x2","18"),z(i,"y2","15"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-delete "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function it(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ot extends xe{constructor(e){super(),Re(this,e,it,rt,S,{size:0,strokeWidth:1,class:2})}}function st(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),i=P("line"),z(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),z(r,"points","15 3 21 3 21 9"),z(i,"x1","10"),z(i,"y1","14"),z(i,"x2","21"),z(i,"y2","3"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-external-link "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function at(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class lt extends xe{constructor(e){super(),Re(this,e,at,st,S,{size:0,strokeWidth:1,class:2})}}function ct(e){let t,n,r,i,o,s;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),i=P("line"),o=P("line"),z(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),z(r,"points","14 2 14 8 20 8"),z(i,"x1","12"),z(i,"y1","18"),z(i,"x2","12"),z(i,"y2","12"),z(o,"x1","9"),z(o,"y1","15"),z(o,"x2","15"),z(o,"y2","15"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){x(e,t,s),R(t,n),R(t,r),R(t,i),R(t,o)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&z(t,"class",s)},i:_,o:_,d(e){e&&k(t)}}}function dt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ut extends xe{constructor(e){super(),Re(this,e,dt,ct,S,{size:0,strokeWidth:1,class:2})}}function ft(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("circle"),r=P("line"),i=P("path"),z(n,"cx","12"),z(n,"cy","12"),z(n,"r","10"),z(r,"x1","2"),z(r,"y1","12"),z(r,"x2","22"),z(r,"y2","12"),z(i,"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"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-globe "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function ht(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class mt extends xe{constructor(e){super(),Re(this,e,ht,ft,S,{size:0,strokeWidth:1,class:2})}}function pt(e){let t,n,r,i,o,s,a,l;return{c(){t=P("svg"),n=P("line"),r=P("line"),i=P("line"),o=P("line"),s=P("line"),a=P("line"),z(n,"x1","8"),z(n,"y1","6"),z(n,"x2","21"),z(n,"y2","6"),z(r,"x1","8"),z(r,"y1","12"),z(r,"x2","21"),z(r,"y2","12"),z(i,"x1","8"),z(i,"y1","18"),z(i,"x2","21"),z(i,"y2","18"),z(o,"x1","3"),z(o,"y1","6"),z(o,"x2","3.01"),z(o,"y2","6"),z(s,"x1","3"),z(s,"y1","12"),z(s,"x2","3.01"),z(s,"y2","12"),z(a,"x1","3"),z(a,"y1","18"),z(a,"x2","3.01"),z(a,"y2","18"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",l="feather feather-list "+e[2])},m(e,l){x(e,t,l),R(t,n),R(t,r),R(t,i),R(t,o),R(t,s),R(t,a)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&z(t,"class",l)},i:_,o:_,d(e){e&&k(t)}}}function gt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class wt extends xe{constructor(e){super(),Re(this,e,gt,pt,S,{size:0,strokeWidth:1,class:2})}}function yt(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),z(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"),z(r,"points","22,6 12,13 2,6"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-mail "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function vt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class $t extends xe{constructor(e){super(),Re(this,e,vt,yt,S,{size:0,strokeWidth:1,class:2})}}function It(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("circle"),z(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),z(r,"cx","12"),z(r,"cy","10"),z(r,"r","3"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function _t(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ct extends xe{constructor(e){super(),Re(this,e,_t,It,S,{size:0,strokeWidth:1,class:2})}}function Et(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("polyline"),r=P("line"),i=P("path"),z(n,"points","23 7 23 1 17 1"),z(r,"x1","16"),z(r,"y1","8"),z(r,"x2","23"),z(r,"y2","1"),z(i,"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"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function At(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class bt extends xe{constructor(e){super(),Re(this,e,At,Et,S,{size:0,strokeWidth:1,class:2})}}function St(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("rect"),r=P("line"),i=P("line"),z(n,"x","3"),z(n,"y","3"),z(n,"width","18"),z(n,"height","18"),z(n,"rx","2"),z(n,"ry","2"),z(r,"x1","12"),z(r,"y1","8"),z(r,"x2","12"),z(r,"y2","16"),z(i,"x1","8"),z(i,"y1","12"),z(i,"x2","16"),z(i,"y2","12"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-plus-square "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-plus-square "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Nt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Tt extends xe{constructor(e){super(),Re(this,e,Nt,St,S,{size:0,strokeWidth:1,class:2})}}function Dt(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("polyline"),r=P("path"),i=P("rect"),z(n,"points","6 9 6 2 18 2 18 9"),z(r,"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"),z(i,"x","6"),z(i,"y","14"),z(i,"width","12"),z(i,"height","8"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-printer "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Rt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class xt extends xe{constructor(e){super(),Re(this,e,Rt,Dt,S,{size:0,strokeWidth:1,class:2})}}function kt(e){let t,n,r,i;return{c(){t=P("svg"),n=P("circle"),r=P("line"),z(n,"cx","11"),z(n,"cy","11"),z(n,"r","8"),z(r,"x1","21"),z(r,"y1","21"),z(r,"x2","16.65"),z(r,"y2","16.65"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-search "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function Ot(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Mt extends xe{constructor(e){super(),Re(this,e,Ot,kt,S,{size:0,strokeWidth:1,class:2})}}const{document:Pt}=Ee;function Bt(e){e[53]=e[54].items}function Lt(e,t,n){const r=e.slice();return r[55]=t[n],r[57]=n,r}function Ft(e,t,n){const r=e.slice();return r[58]=t[n],r}function Vt(e,t,n){const r=e.slice();return r[58]=t[n],r}function Ut(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Wt(e){let t,n,r,i,o,s;Bt(e);let a=e[5]?.length&&zt(e),l=e[53]?.length&&jt(e),c=e[5]?.length&&Xt(e);return{c(){a&&a.c(),t=L(),n=M("div"),r=M("table"),l&&l.c(),i=L(),o=M("tbody"),c&&c.c(),z(r,"striped",""),z(r,"class","svelte-47aais"),z(n,"class","eList svelte-47aais")},m(e,d){a&&a.m(e,d),x(e,t,d),x(e,n,d),R(n,r),l&&l.m(r,null),R(r,i),R(r,o),c&&c.m(o,null),s=!0},p(e,n){Bt(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&$e(a,1)):(a=zt(e),a.c(),$e(a,1),a.m(t.parentNode,t)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve()),e[53]?.length?l?l.p(e,n):(l=jt(e),l.c(),l.m(r,i)):l&&(l.d(1),l=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&$e(c,1)):(c=Xt(e),c.c(),$e(c,1),c.m(o,null)):c&&(ye(),Ie(c,1,1,()=>{c=null}),ve())},i(e){s||($e(a),$e(c),s=!0)},o(e){Ie(a),Ie(c),s=!1},d(e){a&&a.d(e),e&&k(t),e&&k(n),l&&l.d(),c&&c.d()}}}function zt(e){let t,n,r,i,o,s,a,l,c,d,u,f=e[6]&&Ht(e);function h(t){e[34](t)}let m={id:e[11]};return void 0!==e[3]&&(m.value=e[3]),i=new e[8]({props:m}),re.push(()=>Se(i,"value",h)),i.$on("input",e[15]),l=new ot({props:{size:"18"}}),{c(){f&&f.c(),t=L(),n=M("div"),r=B("Suchen: "),Ne(i.$$.fragment),s=L(),a=M("span"),Ne(l.$$.fragment),z(a,"class","feather pointer svelte-47aais"),q(n,"margin-bottom","1em"),q(n,"position","relative")},m(o,h){f&&f.m(o,h),x(o,t,h),x(o,n,h),R(n,r),Te(i,n,null),R(n,s),R(n,a),Te(l,a,null),c=!0,d||(u=V(a,"click",e[17]),d=!0)},p(e,n){e[6]?f?64&n[0]&&$e(f,1):(f=Ht(e),f.c(),$e(f,1),f.m(t.parentNode,t)):f&&(ye(),Ie(f,1,1,()=>{f=null}),ve());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],ue(()=>o=!1)),i.$set(r)},i(e){c||($e(f),$e(i.$$.fragment,e),$e(l.$$.fragment,e),c=!0)},o(e){Ie(f),Ie(i.$$.fragment,e),Ie(l.$$.fragment,e),c=!1},d(e){f&&f.d(e),e&&k(t),e&&k(n),De(i),De(l),d=!1,u()}}}function Ht(e){let t,n;return t=new e[7]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function jt(e){let t,n,r,i=e[4]&&e[0]&&qt(),o=e[53],s=[];for(let t=0;t<o.length;t+=1)s[t]=Gt(Vt(e,o,t));return{c(){t=M("thead"),n=M("tr"),i&&i.c(),r=L();for(let e=0;e<s.length;e+=1)s[e].c();z(n,"class","svelte-47aais"),z(t,"class","svelte-47aais")},m(e,o){x(e,t,o),R(t,n),i&&i.m(n,null),R(n,r);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(e[4]&&e[0]?i||(i=qt(),i.c(),i.m(n,r)):i&&(i.d(1),i=null),16388&t[0]){let r;for(o=e[53],r=0;r<o.length;r+=1){const i=Vt(e,o,r);s[r]?s[r].p(i,t):(s[r]=Gt(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&k(t),i&&i.d(),O(s,e)}}}function qt(e){let t;return{c(){t=M("th"),z(t,"class","svelte-47aais")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Gt(e){let t,n,r=e[58]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-47aais")},m(e,r){x(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[58]?.designation+"")&&H(n,r)},d(e){e&&k(t)}}}function Xt(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[55].index||e[55]?._id;for(let t=0;t<o.length;t+=1){let n=Lt(e,o,t),a=s(n);i.set(a,r[t]=Qt(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);x(e,t,i),n=!0},p(e,n){356415&n[0]&&(o=e[5],ye(),r=be(r,n,s,1,e,o,i,t.parentNode,Ae,Qt,t,Lt),ve())},i(e){if(!n){for(let e=0;e<o.length;e+=1)$e(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)Ie(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&k(t)}}}function Yt(e){let t,n,r,i,o,s,a=e[4]&&e[0]&&Zt(e),l=e[53],c=[];for(let t=0;t<l.length;t+=1)c[t]=Kt(Ft(e,l,t));return{c(){t=M("tr"),a&&a.c(),n=L();for(let e=0;e<c.length;e+=1)c[e].c();r=L(),z(t,"class","pointer svelte-47aais"),G(t,"active",e[55]._id===e[1]),G(t,"blocked",!!e[55].blocked),G(t,"undeliverable",!!e[55].undeliverable)},m(l,d){x(l,t,d),a&&a.m(t,null),R(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);R(t,r),i=!0,o||(s=V(t,"click",W(function(){b(e[13](e[55],e[57]))&&e[13](e[55],e[57]).apply(this,arguments)})),o=!0)},p(i,o){if((e=i)[4]&&e[0]?a?(a.p(e,o),17&o[0]&&$e(a,1)):(a=Zt(e),a.c(),$e(a,1),a.m(t,n)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve()),20516&o[0]){let n;for(l=e[53],n=0;n<l.length;n+=1){const i=Ft(e,l,n);c[n]?c[n].p(i,o):(c[n]=Kt(i),c[n].c(),c[n].m(t,r))}for(;n<c.length;n+=1)c[n].d(1);c.length=l.length}34&o[0]&&G(t,"active",e[55]._id===e[1]),32&o[0]&&G(t,"blocked",!!e[55].blocked),32&o[0]&&G(t,"undeliverable",!!e[55].undeliverable)},i(e){i||($e(a),i=!0)},o(e){Ie(a),i=!1},d(e){e&&k(t),a&&a.d(),O(c,e),o=!1,s()}}}function Zt(e){let t,n,r,i,o;return n=new lt({props:{size:"18"}}),{c(){t=M("td"),Ne(n.$$.fragment),z(t,"class","editRow svelte-47aais"),q(t,"color","#326173")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",W(function(){b(e[18](e[55]))&&e[18](e[55]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Kt(e){let t,n,r,i=e[12](e[55],e[58])+"";return{c(){t=M("td"),n=B(i),z(t,"class",r=T(e[58].type)+" svelte-47aais")},m(e,r){x(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[12](e[55],e[58])+"")&&H(n,i),4&o[0]&&r!==(r=T(e[58].type)+" svelte-47aais")&&z(t,"class",r)},d(e){e&&k(t)}}}function Qt(e,t){let n,r,i,o=t[16](t[55],t[53],t[3]),s=o&&Yt(t);return{key:e,first:null,c(){n=F(),s&&s.c(),r=F(),this.first=n},m(e,t){x(e,n,t),s&&s.m(e,t),x(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[16](t[55],t[53],t[3])),o?s?(s.p(t,n),44&n[0]&&$e(s,1)):(s=Yt(t),s.c(),$e(s,1),s.m(r.parentNode,r)):s&&(ye(),Ie(s,1,1,()=>{s=null}),ve())},i(e){i||($e(s),i=!0)},o(e){Ie(s),i=!1},d(e){e&&k(n),s&&s.d(e),e&&k(r)}}}function Jt(e){let t,n;return t=new e[7]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function en(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Jt,then:Wt,catch:Ut,value:54,blocks:[,,,]};return _e(n=e[2]&&e[14](),i),{c(){t=F(),i.block.c()},m(e,n){x(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[14]())&&_e(n,i)||Ce(i,e,r)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),i.block.d(e),i.token=null,i=null}}}const tn=e("getDisplayItems",async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items});function nn(e,o,s){let a,l,d;N(e,i,e=>s(40,l=e));let f=JSON.parse(n.getItem("Locale")).id;const h=ee(),{Loading:p,TextField:g}=c,{currentTasks:w,loggedIn:v}=u;N(e,w,e=>s(39,a=e)),N(e,v,e=>s(41,d=e));let $,I,_,C,E,{inputList:A}=o,{eventId:b}=o,{prevEventId:S}=o,{record:T}=o,{className:D}=o,{rowId:R}=o,{filterForReady:x=!1}=o,{filter:k}=o,{query:O}=o,{refStatus:M}=o,{showEdit:P=!1}=o,{praefix:B=""}=o,{selectionFields:L=!1}=o,{deList:F}=o,{stopAggregation:V=!1}=o,{shouldBlock:U}=o,{inputSearch:W=""}=o,z=!0,H=W,j=D+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=!1,G=!0;const X=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else 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[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(f,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?y(n):m(e[`_${t.name}`]||n||"")},Y=t.getSchemaByClass(D),Z=async(e,n)=>{if(!e)return[];if(k){let n=k;const r=k.startsWith("!");r&&(n=k.replace("!",""));const i=k.startsWith("$");if(n&&!i&&(e=e.filter(e=>r?!e[n]:!!e[n])),i){n=k.replace("$","");const[r,i]=n.split(".");if(T[i]){const n=await t.getSectionView(r,{[i]:T[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}if(M&&!O)return s(19,M=[].concat(M)),e.filter(e=>!!M.find(t=>e._task.status===t));if("Information"===n.state.task)return e;if(S){const n=await t.getEvent(S);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===D)return"Information"===n.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)},K=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(f,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t},J=async e=>{let n,r=0;G=!1;const i=e=>new Promise(t=>setTimeout(t,e)),o=await Y;for(;r++<200&&!V&&!(n=await te(e,o.id));)await i(500);s(6,q=!1),V&&t.readTasksByAggregationId(e,!0),n&&(s(5,_=K(I.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),G=!0,document.getElementById(j)?.focus()},100))},te=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),ne=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(B),c=l&&await xp(s,l);if(!c)return e;const d=c[a];return d?.length?d.map(n=>{let r=e?.find(e=>e._id===n[t])||{};r={...r};for(const e in r)n[e]&&(r[e]=n[e]);for(const e in n)n[e]&&(r[e]=n[e]);return r._id&&Dp(o+r._id.toString(),r),r}):e};Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(j)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await Y;e.eventId===t.id&&(kp(t.class,e.eventId),s(2,z=!s(2,z=!1)))});return e.$$set=e=>{"inputList"in e&&s(21,A=e.inputList),"eventId"in e&&s(22,b=e.eventId),"prevEventId"in e&&s(23,S=e.prevEventId),"record"in e&&s(24,T=e.record),"className"in e&&s(25,D=e.className),"rowId"in e&&s(1,R=e.rowId),"filterForReady"in e&&s(26,x=e.filterForReady),"filter"in e&&s(27,k=e.filter),"query"in e&&s(28,O=e.query),"refStatus"in e&&s(19,M=e.refStatus),"showEdit"in e&&s(0,P=e.showEdit),"praefix"in e&&s(29,B=e.praefix),"selectionFields"in e&&s(30,L=e.selectionFields),"deList"in e&&s(31,F=e.deList),"stopAggregation"in e&&s(20,V=e.stopAggregation),"shouldBlock"in e&&s(32,U=e.shouldBlock),"inputSearch"in e&&s(33,W=e.inputSearch)},[P,R,z,H,$,_,q,p,g,w,v,j,X,(e,t)=>n=>{s(20,V=!0);const r=G?e:C[t];h("choose",{row:r})},async()=>{I=await Y,s(4,$=(e=>!a?.length||!!a.find(t=>t===e))(I.id)),O&&s(5,_=C=await t.getTasksFiltered(I.class,O)),_||s(5,_=C=K(I.displaySort,await A||await Np(I.class,I.id))),500!==_?.length||O||(s(6,q=!0),await t.getTasksList(I.id,!1,!0).then(({aggregationId:e})=>J(e)));let e,n=!1,r="";const i=L&&L?.find(e=>I.class===e.refClass.split(":")[0]),o=i?.value?.get&&i.value.get(B);if(o){const[a,l]=i.refClass.split(":");I.class===a&&s(5,_=await ne(_,a,l,i)),n=i.parentClass?.find(e=>"quantity"===e.name),r=i.className,e=await t.getCountedSection(r,l.split(".")[0],o,a,"quantity")}s(0,P&&=!i),!i&&(k||x||M)&&s(5,_=await Z(_,I)),E=I.authorization?.find(e=>"employee"===e.constraint)&&!l.some(e=>I.authorization?.find(t=>t.role===e&&"employee"!==t.constraint));const{display:c}=I;let u=await tn(c,I,_);if(!P&&n?(u=u.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),s(5,_=_.map((t,n)=>{const r=e.find(e=>e._id===t._id);return r&&(t.ist=r.quantity.$numberDecimal),t.index=n,t})),e.map(e=>{if(!_.find(t=>t._id===e._id)){const t=C.find(t=>t._id===e._id);t&&(t.ist=e.quantity.$numberDecimal),_.push(t)}}),h("init",_)):F&&s(5,_=_.filter(e=>!F.find(t=>t?._id===e._id))),U&&s(5,_=_.filter(e=>!e[U])),E){const e={businessEmail:d.user},n=await t.getSectionView("employee",e);s(5,_=n?.length?_.filter(e=>e.employee===n[0]._id):[])}return{items:u}},({detail:{value:e}})=>{s(3,H=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=X(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{s(3,H="")},async e=>{let t=e._task;t||(t=await Tp(D,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},M,V,A,b,S,T,D,x,k,O,B,L,F,U,W,function(e){H=e,s(3,H)}]}class rn extends xe{constructor(e){var t;super(),Pt.getElementById("svelte-47aais-style")||((t=M("style")).id="svelte-47aais-style",t.textContent=".feather.svelte-47aais.svelte-47aais{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-47aais.svelte-47aais{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-47aais .editRow.svelte-47aais{width:1em}.eList.svelte-47aais table.svelte-47aais{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-47aais table thead.svelte-47aais{position:sticky;top:0;background:#326173;color:white}.eList.svelte-47aais table thead tr.svelte-47aais{height:2.3em}.eList.svelte-47aais table tbody tr.svelte-47aais{height:2.75em !important}th.svelte-47aais.svelte-47aais,td.svelte-47aais.svelte-47aais{padding-left:0.4em;padding-right:0.4em}td.number.svelte-47aais.svelte-47aais{text-align:end}tr.pointer.svelte-47aais.svelte-47aais:hover{background-color:#DAE1E5}tr.active.svelte-47aais.svelte-47aais{color:#326173;background-color:#fcebd5}tr.blocked.svelte-47aais.svelte-47aais{color:red !important}tr.undeliverable.svelte-47aais.svelte-47aais{color:orange}",R(Pt.head,t)),Re(this,e,nn,en,S,{inputList:21,eventId:22,prevEventId:23,record:24,className:25,rowId:1,filterForReady:26,filter:27,query:28,refStatus:19,showEdit:0,praefix:29,selectionFields:30,deList:31,stopAggregation:20,shouldBlock:32,inputSearch:33},[-1,-1,-1])}}function on(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function sn(e){let t,n,r=e[45]&&an(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[45]?r?(r.p(e,n),16&n[0]&&$e(r,1)):(r=an(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function an(e){let t,n;return t=new e[25]({props:{title:e[20]?"Auswahl":e[0],class:"eList "+(e[18]?"form":""),$$slots:{default:[wn]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};1048577&n[0]&&(r.title=e[20]?"Auswahl":e[0]),262144&n[0]&&(r.class="eList "+(e[18]?"form":"")),33554430&n[0]|32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ln(e){let t,n;return t=new Fp({props:{schema:e[2],recID:e[1],readonly:e[19]}}),t.$on("choose",function(){b(e[34](e[45]))&&e[34](e[45]).apply(this,arguments)}),t.$on("back",e[31]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(n,r){e=n;const i={};4&r[0]&&(i.schema=e[2]),2&r[0]&&(i.recID=e[1]),524288&r[0]&&(i.readonly=e[19]),t.$set(i)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function cn(e){let t,n,r,i,o,s,a;t=new e[26]({props:{text:e[20]?"Zusätzliche Auswahl":""}});const l=[un,dn],c=[];function d(e,t){return e[20]?0:1}return r=d(e),i=c[r]=l[r](e),s=new rn({props:{inputSearch:e[15],record:e[3],eventId:e[2].id,className:e[2].class,prevEventId:e[14],filterForReady:e[5],filter:e[6],query:e[7],refStatus:e[8],praefix:e[9],selectionFields:e[10],rowId:e[1],shouldBlock:e[16],deList:e[12],stopAggregation:e[24],showEdit:e[11]}}),s.$on("edit",e[35]),s.$on("choose",e[38]),s.$on("init",e[36]),{c(){Ne(t.$$.fragment),n=L(),i.c(),o=L(),Ne(s.$$.fragment)},m(e,i){Te(t,e,i),x(e,n,i),c[r].m(e,i),x(e,o,i),Te(s,e,i),a=!0},p(e,n){const a={};1048576&n[0]&&(a.text=e[20]?"Zusätzliche Auswahl":""),t.$set(a);let u=r;r=d(e),r===u?c[r].p(e,n):(ye(),Ie(c[u],1,1,()=>{c[u]=null}),ve(),i=c[r],i?i.p(e,n):(i=c[r]=l[r](e),i.c()),$e(i,1),i.m(o.parentNode,o));const f={};32768&n[0]&&(f.inputSearch=e[15]),8&n[0]&&(f.record=e[3]),4&n[0]&&(f.eventId=e[2].id),4&n[0]&&(f.className=e[2].class),16384&n[0]&&(f.prevEventId=e[14]),32&n[0]&&(f.filterForReady=e[5]),64&n[0]&&(f.filter=e[6]),128&n[0]&&(f.query=e[7]),256&n[0]&&(f.refStatus=e[8]),512&n[0]&&(f.praefix=e[9]),1024&n[0]&&(f.selectionFields=e[10]),2&n[0]&&(f.rowId=e[1]),65536&n[0]&&(f.shouldBlock=e[16]),4096&n[0]&&(f.deList=e[12]),16777216&n[0]&&(f.stopAggregation=e[24]),2048&n[0]&&(f.showEdit=e[11]),s.$set(f)},i(e){a||($e(t.$$.fragment,e),$e(i),$e(s.$$.fragment,e),a=!0)},o(e){Ie(t.$$.fragment,e),Ie(i),Ie(s.$$.fragment,e),a=!1},d(e){De(t,e),e&&k(n),c[r].d(e),e&&k(o),De(s,e)}}}function dn(e){let t,n,r,i;n=new e[27]({props:{outline:!0,$$slots:{default:[fn]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let o=e[29]&&e[13]&&hn(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),z(t,"class","form--buttons svelte-jb5mrh")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[29]&&e[13]?o?(o.p(e,r),8192&r[0]&&$e(o,1)):(o=hn(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function un(e){let t,n,r,i,o,s,a=e[23]&&pn(e);return r=new e[27]({props:{outline:!0,$$slots:{default:[gn]},$$scope:{ctx:e}}}),r.$on("click",e[32]),o=new e[26]({props:{text:"Liste aus "+e[17]}}),{c(){a&&a.c(),t=L(),n=M("div"),Ne(r.$$.fragment),i=L(),Ne(o.$$.fragment),z(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),x(e,t,l),x(e,n,l),Te(r,n,null),x(e,i,l),Te(o,e,l),s=!0},p(e,n){e[23]?a?(a.p(e,n),8388608&n[0]&&$e(a,1)):(a=pn(e),a.c(),$e(a,1),a.m(t.parentNode,t)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve());const i={};32768&n[1]&&(i.$$scope={dirty:n,ctx:e}),r.$set(i);const s={};131072&n[0]&&(s.text="Liste aus "+e[17]),o.$set(s)},i(e){s||($e(a),$e(r.$$.fragment,e),$e(o.$$.fragment,e),s=!0)},o(e){Ie(a),Ie(r.$$.fragment,e),Ie(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&k(t),e&&k(n),De(r),e&&k(i),De(o,e)}}}function fn(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function hn(e){let t,n;return t=new e[27]({props:{filled:!0,$$slots:{default:[mn]},$$scope:{ctx:e}}}),t.$on("click",e[33]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function mn(e){let t;return{c(){t=B("Neu")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function pn(e){let t,n;return t=new Su({props:{item:e[21],record:{_id:"",[e[21].name]:""},noForm:"true",classId:"sel_"+e[21].name,eventId:e[22],required:!1,hidden:!1,readonly:!1,deList:e[23]}}),t.$on("notify",e[37]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.item=e[21]),2097152&n[0]&&(r.record={_id:"",[e[21].name]:""}),2097152&n[0]&&(r.classId="sel_"+e[21].name),4194304&n[0]&&(r.eventId=e[22]),8388608&n[0]&&(r.deList=e[23]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function gn(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function wn(e){let t,n,r,i;const o=[cn,ln],s=[];function a(e,t){return e[45].length&&!e[18]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function yn(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function vn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:yn,then:sn,catch:on,value:45,blocks:[,,,]};return _e(n=e[30](e[4]),i),{c(){t=F(),i.block.c()},m(e,n){x(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,16&r[0]&&n!==(n=e[30](e[4]))&&_e(n,i)||Ce(i,e,r)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),i.block.d(e),i.token=null,i=null}}}function $n(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=c,l=ee(),{currentTasks:d}=u;N(e,d,e=>r(41,i=e));let{title:f}=n,{schema:h}=n,{record:m}=n,{recID:p}=n,{isOpening:g=!0}=n,{filterForReady:w=!1}=n,{filter:y}=n,{query:v}=n,{refStatus:$}=n,{praefix:I=""}=n,{selectionFields:_=!1}=n,{showEdit:C=!0}=n,{deList:E}=n,{newAllowed:A=!0}=n,{prevEventId:b}=n,{inputSearch:S}=n,{shouldBlock:T}=n,D=h.id;h.class;let R,x,k,O,M,P,B,L="",F=!1,V=!1;f??=h.identity.designation;const U=!i?.length||i.find(e=>e===D);return e.$$set=e=>{"title"in e&&r(0,f=e.title),"schema"in e&&r(2,h=e.schema),"record"in e&&r(3,m=e.record),"recID"in e&&r(1,p=e.recID),"isOpening"in e&&r(4,g=e.isOpening),"filterForReady"in e&&r(5,w=e.filterForReady),"filter"in e&&r(6,y=e.filter),"query"in e&&r(7,v=e.query),"refStatus"in e&&r(8,$=e.refStatus),"praefix"in e&&r(9,I=e.praefix),"selectionFields"in e&&r(10,_=e.selectionFields),"showEdit"in e&&r(11,C=e.showEdit),"deList"in e&&r(12,E=e.deList),"newAllowed"in e&&r(13,A=e.newAllowed),"prevEventId"in e&&r(14,b=e.prevEventId),"inputSearch"in e&&r(15,S=e.inputSearch),"shouldBlock"in e&&r(16,T=e.shouldBlock)},[f,p,h,m,g,w,y,v,$,I,_,C,E,A,b,S,T,L,F,R,k,M,P,B,V,o,s,a,d,U,async e=>{if(!e)return!1;const n=await Np(h.class,h.id);if(x=_&&_?.find(e=>h.class===e.refClass.split(":")[0]),r(20,k=x?.value?.get&&x.value.get(I)),k){O=x.refClass;const[e,n]=O.split(":"),[i]=n.split(".");r(21,M=x.parentClass.find(t=>t.name===e));const o=await t.getSchemaByClass(M.refClass);r(22,P=o.id),r(17,L=x.parentClass.find(e=>e.name===i).designation)}return n},()=>{r(18,F=!1),p||l("back"),C||l("back")},()=>{r(24,V=!0),r(18,F=!1),l("back")},()=>{r(24,V=!0),r(1,p=!1),r(19,R=!1),r(18,F=!0)},e=>({detail:{row:e}})=>{let t=h.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=h.list?.find(e=>e.name===n)?.item.find(e=>e.name===r);if(i){e[`${n}_${r}`]=e[n][r]}}),l("choose",{row:e})},({detail:e})=>{r(19,R=!!e._task.visum||"Closed"===e._task.status),r(1,p=e._docId),r(18,F=!0)},({detail:e})=>{k&&r(23,B=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){te(e,t)}]}class In extends xe{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=M("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}",R(document.head,t)),Re(this,e,$n,vn,S,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,praefix:9,selectionFields:10,showEdit:11,deList:12,newAllowed:13,prevEventId:14,inputSearch:15,shouldBlock:16},[-1,-1])}}const{document:_n}=Ee;function Cn(e){e[28]=e[30].list,e[29]=e[30].items}function En(e,t,n){const r=e.slice();return r[31]=t[n],r}function An(e,t,n){const r=e.slice();return r[34]=t[n],r}function bn(e,t,n){const r=e.slice();return r[34]=t[n],r}function Sn(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Nn(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[25](t)}Cn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Tn]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let $={id:e[8]};void 0!==e[0]&&($.value=e[0]),s=new e[6]({props:$}),re.push(()=>Se(s,"value",v)),s.$on("input",e[12]),d=new ot({props:{size:"18"}});let I=e[29]?.length&&function(e){let t,n,r,i,o=e[29],s=[];for(let t=0;t<o.length;t+=1)s[t]=Dn(bn(e,o,t));return{c(){t=M("thead"),n=M("tr"),r=M("th"),i=L();for(let e=0;e<s.length;e+=1)s[e].c();z(r,"class","svelte-14hcfjl"),z(n,"class","svelte-14hcfjl"),z(t,"class","svelte-14hcfjl")},m(e,o){x(e,t,o),R(t,n),R(n,r),R(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(o=e[29],r=0;r<o.length;r+=1){const i=bn(e,o,r);s[r]?s[r].p(i,t):(s[r]=Dn(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&k(t),O(s,e)}}}(e),_=e[28]?.length&&function(e){let t,n,r=e[28],i=[];for(let t=0;t<r.length;t+=1)i[t]=kn(En(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(44547&n[0]){let s;for(r=e[28],s=0;s<r.length;s+=1){const o=En(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=kn(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),i=M("div"),o=B("Suchen: "),Ne(s.$$.fragment),l=L(),c=M("span"),Ne(d.$$.fragment),u=L(),f=M("div"),h=M("table"),I&&I.c(),m=L(),p=M("tbody"),_&&_.c(),z(t,"class","form--buttons svelte-14hcfjl"),z(c,"class","feather pointer svelte-14hcfjl"),q(i,"margin-bottom","1em"),q(i,"position","relative"),z(h,"striped",""),z(h,"class","svelte-14hcfjl"),z(f,"class","eList svelte-14hcfjl")},m(a,v){x(a,t,v),Te(n,t,null),x(a,r,v),x(a,i,v),R(i,o),Te(s,i,null),R(i,l),R(i,c),Te(d,c,null),x(a,u,v),x(a,f,v),R(f,h),I&&I.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=V(c,"click",e[14]),w=!0)},p(e,t){Cn(e);const r={};256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&1&t[0]&&(a=!0,i.value=e[0],ue(()=>a=!1)),s.$set(i),e[29]?.length&&I.p(e,t),e[28]?.length&&_.p(e,t)},i(e){g||($e(n.$$.fragment,e),$e(s.$$.fragment,e),$e(d.$$.fragment,e),$e(_),g=!0)},o(e){Ie(n.$$.fragment,e),Ie(s.$$.fragment,e),Ie(d.$$.fragment,e),Ie(_),g=!1},d(e){e&&k(t),De(n),e&&k(r),e&&k(i),De(s),De(d),e&&k(u),e&&k(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function Tn(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Dn(e){let t,n,r=e[34]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function Rn(e){let t,n,r,i,o,s,a,l;r=new lt({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=xn(An(e,c,t));return{c(){t=M("tr"),n=M("td"),Ne(r.$$.fragment),i=L();for(let e=0;e<d.length;e+=1)d[e].c();o=L(),z(n,"class","editRow svelte-14hcfjl"),z(t,"class","pointer svelte-14hcfjl"),G(t,"active",e[31]._id===e[1])},m(c,u){x(c,t,u),R(t,n),Te(r,n,null),R(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);R(t,o),s=!0,a||(l=V(n,"click",e[15](e[31])),a=!0)},p(n,r){if(e=n,3584&r[0]){let n;for(c=e[29],n=0;n<c.length;n+=1){const i=An(e,c,n);d[n]?d[n].p(i,r):(d[n]=xn(i),d[n].c(),d[n].m(t,o))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2050&r[0]&&G(t,"active",e[31]._id===e[1])},i(e){s||($e(r.$$.fragment,e),s=!0)},o(e){Ie(r.$$.fragment,e),s=!1},d(e){e&&k(t),De(r),O(d,e),a=!1,l()}}}function xn(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=M("td"),n=B(o),z(t,"class","svelte-14hcfjl")},m(o,s){x(o,t,s),R(t,n),r||(i=V(t,"click",W(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&k(t),r=!1,i()}}}function kn(e){let t,n,r=e[13](e[31],e[29],e[0]),i=r&&Rn(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){1&n[0]&&(r=e[13](e[31],e[29],e[0])),r?i?(i.p(e,n),1&n[0]&&$e(i,1)):(i=Rn(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function On(e){let t,n;return t=new e[5]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Mn(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:On,then:Nn,catch:Sn,value:30,blocks:[,,,]};return _e(e[11](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function Pn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Mn]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};3&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Bn(e,n,i){const o=ee(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{classId:h}=n,{className:p}=n,{rowId:g}=n,{viewName:w}=n,{viewValue:v}=n,{recordId:$}=n,{filter:I}=n,{multiValues:_}=n,{searchValue:C=""}=n,E=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const A=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?y(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(p);Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(E)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await b;e.eventId===t.id&&kp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(16,f=e.item),"classId"in e&&i(17,h=e.classId),"className"in e&&i(18,p=e.className),"rowId"in e&&i(1,g=e.rowId),"viewName"in e&&i(19,w=e.viewName),"viewValue"in e&&i(20,v=e.viewValue),"recordId"in e&&i(21,$=e.recordId),"filter"in e&&i(22,I=e.filter),"multiValues"in e&&i(23,_=e.multiValues),"searchValue"in e&&i(0,C=e.searchValue)},[C,g,o,s,a,l,d,u,E,A,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let n=[];if(f.lookup){let r,i,o;if("string"==typeof f.lookup){if(r="."+h+"#"+f.lookup,i=document.querySelector(r),o=i?.value||$,_.has(f.lookup)){const r=_.get(f.lookup)[0];n=r?await t.getSectionView(f.name,{[f.lookup]:r},!0):await Np(f.name,e.id)}else if(o&&24===o.toString().length){const e=await xp(f.lookup,o);if(e&&e[f.name]&&e[f.name].length){const r=e[f.name]?.map(e=>e[f.name]);r?.length&&(n=await t.getSectionView(f.name,{_id:{$in:r}},!0)),n?.length||(n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0))}else n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0)}}else{const{refItem:e,refList:s}=f.lookup,[a,l]=e.split(".");if(r="."+h+"#"+a,i=document.querySelector(r),o=i?.value||$,o){let e=await t.getDocById(a,o);if(e&&l&&(e=await t.getDocById(l,e[l])),e&&e[s]){const r=e[s].map(e=>e[f.name]);n=await t.getSectionView(f.name,{_id:{$in:r}},!0)}}}}else{const r="."+h+"#"+w.split(":")[0],i=document.querySelector(r);let o={[w]:i?.value||$};if(f.refItem){const e="."+h+"#"+f.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[f.refItem]:t.value},{[f.refItem]:{$exists:!0,$eq:""}}]};o={...o,...e}}}catch{}}o[w]&&(n=await t.getSectionView(e.class,o,!0)),I&&(n=n.filter(e=>e._id!=I))}const r=e.display;return{list:n,items:await tn(r,e,n)}},({detail:{value:e}})=>{i(0,C=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(A(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(0,C="")},e=>async()=>{const n=await t.getTaskByDocId(e._id,!0),r=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(r)},f,h,p,w,v,$,I,_,()=>o("back"),function(e){C=e,i(0,C)}]}class Ln extends xe{constructor(e){var t;super(),_n.getElementById("svelte-14hcfjl-style")||((t=M("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}",R(_n.head,t)),Re(this,e,Bn,Pn,S,{item:16,classId:17,className:18,rowId:1,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23,searchValue:0},[-1,-1])}}const{document:Fn}=Ee;function Vn(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Un(e){let t,n,r=e[83]&&function(e){let t,n,r,i,o,a,l,c,d,u,f,h,m,p,g,w,y,v,$,I;function _(t){e[63](t)}function C(t){e[64](t)}let E={class:"full-width",id:e[34],name:e[34],rows:"1",required:e[2],disabled:e[3]||e[36],placeholder:e[36]?"":e[37],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[1]&&(E.value=e[1]);void 0!==e[27]&&(E.overwrite=e[27]);n=new s({props:E}),re.push(()=>Se(n,"value",_)),re.push(()=>Se(n,"overwrite",C)),n.$on("click",e[40]()),n.$on("blur",e[49]);const A=[Hn,zn,Wn],b=[];function S(e,t){return e[36]?0:!e[3]||e[16]?1:e[22]&&e[0]?2:-1}~(a=S(e))&&(l=b[a]=A[a](e));let N=(!e[3]||e[16])&&e[0]&&!e[17]&&!e[36]&&Xn(e);function D(t){e[65](t)}let O={class:"tModal",noClickaway:!0,$$slots:{default:[Qn]},$$scope:{ctx:e}};void 0!==e[19]&&(O.open=e[19]);m=new e[30]({props:O}),re.push(()=>Se(m,"open",D));let P=e[20]&&Jn(e),B=e[24]&&nr(e);return{c(){t=M("div"),Ne(n.$$.fragment),o=L(),l&&l.c(),c=L(),d=M("input"),f=L(),N&&N.c(),h=L(),Ne(m.$$.fragment),g=L(),P&&P.c(),w=L(),B&&B.c(),y=F(),z(d,"class",u=T(e[9]||e[10])+" svelte-10ggg6v"),z(d,"id",e[5]),z(d,"name",e[5]),d.value=e[0],d.hidden=!0,q(t,"position","relative")},m(r,i){x(r,t,i),Te(n,t,null),R(t,o),~a&&b[a].m(t,null),R(t,c),R(t,d),R(t,f),N&&N.m(t,null),x(r,h,i),Te(m,r,i),x(r,g,i),P&&P.m(r,i),x(r,w,i),B&&B.m(r,i),x(r,y,i),v=!0,$||(I=V(t,"keydown",e[41]),$=!0)},p(e,o){const s={};4&o[0]&&(s.required=e[2]),8&o[0]&&(s.disabled=e[3]||e[36]),!r&&2&o[0]&&(r=!0,s.value=e[1],ue(()=>r=!1)),!i&&134217728&o[0]&&(i=!0,s.overwrite=e[27],ue(()=>i=!1)),n.$set(s);let f=a;a=S(e),a===f?~a&&b[a].p(e,o):(l&&(ye(),Ie(b[f],1,1,()=>{b[f]=null}),ve()),~a?(l=b[a],l?l.p(e,o):(l=b[a]=A[a](e),l.c()),$e(l,1),l.m(t,c)):l=null),(!v||1536&o[0]&&u!==(u=T(e[9]||e[10])+" svelte-10ggg6v"))&&z(d,"class",u),(!v||32&o[0])&&z(d,"id",e[5]),(!v||32&o[0])&&z(d,"name",e[5]),(!v||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),e[3]&&!e[16]||!e[0]||e[17]||e[36]?N&&(ye(),Ie(N,1,1,()=>{N=null}),ve()):N?(N.p(e,o),196617&o[0]&&$e(N,1)):(N=Xn(e),N.c(),$e(N,1),N.m(t,null));const h={};344784337&o[0]|4194304&o[2]&&(h.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,h.open=e[19],ue(()=>p=!1)),m.$set(h),e[20]?P?(P.p(e,o),1048576&o[0]&&$e(P,1)):(P=Jn(e),P.c(),$e(P,1),P.m(w.parentNode,w)):P&&(ye(),Ie(P,1,1,()=>{P=null}),ve()),e[24]?B?(B.p(e,o),16777216&o[0]&&$e(B,1)):(B=nr(e),B.c(),$e(B,1),B.m(y.parentNode,y)):B&&(ye(),Ie(B,1,1,()=>{B=null}),ve())},i(e){v||($e(n.$$.fragment,e),$e(l),$e(N),$e(m.$$.fragment,e),$e(P),$e(B),v=!0)},o(e){Ie(n.$$.fragment,e),Ie(l),Ie(N),Ie(m.$$.fragment,e),Ie(P),Ie(B),v=!1},d(e){e&&k(t),De(n),~a&&b[a].d(),N&&N.d(),e&&k(h),De(m,e),e&&k(g),P&&P.d(e),e&&k(w),B&&B.d(e),e&&k(y),$=!1,I()}}}(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,t){e[83]&&r.p(e,t)},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Wn(e){let t,n,r,i,o;return n=new lt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[48]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function zn(e){let t,n,r,i,o;return n=new Mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=[V(t,"click",e[40](!0)),V(t,"choose",e[44])],i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,A(o)}}}function Hn(e){let t,n,r,i;const o=[Gn,qn,jn],s=[];function a(e,t){return e[0]?0:!e[3]&&e[12]?1:2}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function jn(e){let t,n,r;return n=new Tt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather3 svelte-10ggg6v")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function qn(e){let t,n,r,i,o;return n=new Tt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[50]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Gn(e){let t,n,r,i,o;return n=new lt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[48]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Xn(e){let t,n,r,i,o;return n=new ot({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[47]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Yn(e){let t,n,r,i;const o=[Kn,Zn],s=[];function a(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function Zn(e){let t,n;return t=new In({props:{title:e[6].designation,newAllowed:e[23],prevEventId:e[11],schema:e[18],filter:e[35],query:e[38](),record:e[7],recID:e[0],isOpening:e[19],filterForReady:e[26],refStatus:e[6].refStatus,selectionFields:e[14],deList:e[15],praefix:e[13],shouldBlock:e[28],inputSearch:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.title=e[6].designation),8388608&n[0]&&(r.newAllowed=e[23]),2048&n[0]&&(r.prevEventId=e[11]),262144&n[0]&&(r.schema=e[18]),128&n[0]&&(r.record=e[7]),1&n[0]&&(r.recID=e[0]),524288&n[0]&&(r.isOpening=e[19]),67108864&n[0]&&(r.filterForReady=e[26]),64&n[0]&&(r.refStatus=e[6].refStatus),16384&n[0]&&(r.selectionFields=e[14]),32768&n[0]&&(r.deList=e[15]),8192&n[0]&&(r.praefix=e[13]),268435456&n[0]&&(r.shouldBlock=e[28]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Kn(e){let t,n;return t=new Ln({props:{item:e[6],className:e[18].class,classId:e[10],rowId:e[0],recordId:e[12],viewName:e[4],viewValue:"",multiValues:e[8],searchValue:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.item=e[6]),262144&n[0]&&(r.className=e[18].class),1024&n[0]&&(r.classId=e[10]),1&n[0]&&(r.rowId=e[0]),4096&n[0]&&(r.recordId=e[12]),16&n[0]&&(r.viewName=e[4]),256&n[0]&&(r.multiValues=e[8]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Qn(e){let t,n,r=e[19]&&Yn(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&$e(r,1)):(r=Yn(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Jn(e){let t,n,r;function i(t){e[66](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[tr]},$$scope:{ctx:e}};return void 0!==e[20]&&(o.open=e[20]),t=new e[30]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function er(e){let t,n;return t=new Fp({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[45]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),1&n[0]&&(r.recID=e[0]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function tr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[er]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function nr(e){let t,n,r;function i(t){e[67](t)}let o={class:"tModal2",noClickaway:!0,$$slots:{default:[ir]},$$scope:{ctx:e}};return void 0!==e[24]&&(o.open=e[24]),t=new e[30]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};35913728&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&16777216&r[0]&&(n=!0,i.open=e[24],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function rr(e){let t,n;return t=new Fp({props:{schema:e[18],dialogAttr:e[25]}}),t.$on("back",e[46]),t.$on("choose",e[43]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),33554432&n[0]&&(r.dialogAttr=e[25]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ir(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[rr]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),33816576&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function or(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function sr(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:or,then:Un,catch:Vn,value:83,blocks:[,,,]};return _e(e[39](),r),{c(){t=F(),r.block.c()},m(e,i){x(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){Ce(r,e=t,n)},i(e){n||($e(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){Ie(r.blocks[e])}n=!1},d(e){e&&k(t),r.block.d(e),r.token=null,r=null}}}function ar(e,n,r){let s,a,l,d,f;N(e,i,e=>r(62,s=e)),N(e,o,e=>r(73,f=e));const h=ee(),{Dialog:m,Modal:p}=c,{currentTasks:g,environment:w,loggedIn:y}=u;N(e,g,e=>r(70,a=e)),N(e,w,e=>r(72,d=e)),N(e,y,e=>r(71,l=e));let{id:$}=n,{item:I}=n,{record:_}=n,{fullRecord:C}=n,{value:E=""}=n,{multiValues:A}=n,{desc:b=""}=n,{noForm:S=!1}=n,{classId:T}=n,{eventId:D}=n,{recordId:R}=n,{withRefValue:x=!1}=n,{refValue:k=""}=n,{shortEdit:O}=n,{required:M}=n,{disabled:P}=n,{readonly:B}=n,{praefix:L}=n,{selectionFields:F}=n,{formnovalidate:V}=n,{selection:U}=n,{deList:W}=n,{isTemplate:z}=n,{noList:H=!1}=n,{multi:j=!1}=n,{initFinished:q}=n,{listName:G=""}=n;const X="comment_"+$,Y=I.filter,Z=I.properties?.startDialog;let K,Q,J,te,ne,re,ie,oe,se=!1,ae=!0,le=!1,ce=!0,de=!0,ue=!1,fe="";!U&&I.selection&&1===I.selection.split(":").length&&(U=I.selection);const he=B||P||I.lookup||U&&!I.constraint?"":"Suchbegriff ⏎",me=(e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}},pe=()=>{I.refItem&&I.refItem.startsWith("owner")&&(r(52,k=d.owner[I.refClass]),k||r(52,k=me(I.refItem,d)),k&&(r(51,x=!0),h("change",{value:k})))},ge=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{h("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})})},we=async e=>{const n=()=>{r(19,se=!0)};if(9==e.which)return;if(E)return e.preventDefault();if(13!=e.which)return;if(e.preventDefault(),I.lookup)return n();const i=te.items.find(e=>e.properties?.search);if(!i)return n();const o=e.srcElement.value,{name:s,checkOn:a,refClass:l,properties:c}=i;let{search:d}=c;!0===d&&(d={}),"number"==typeof d&&(d={min:d});const{min:u=3,start:f=!1,end:h=!1}=d;if(o.length<u)return n();const m=(f?"^":"")+o+(h?"$":"");let p={[s]:{$regex:m,$options:"i"}};a&&(p=[{$lookup:{from:l,localField:s,foreignField:"_id",as:l}},{$match:{[l+"."+a]:{$regex:m,$options:"i"}}}]);const g=await t.getSectionView(te.class,p);1!==g?.length?n():r(0,E=g[0]._id)},ye=e=>{e&&(r(61,fe=r(1,b=v(te,e))),h("setRefDesc",b.split(" •")[0]),h("change",{value:E,description:b}),h("task",{row:e,eventId:te.id}))},ve=()=>{r(19,se=!1),r(20,Q=!1)},$e=()=>{r(24,le=!1)};return e.$$set=e=>{"id"in e&&r(5,$=e.id),"item"in e&&r(6,I=e.item),"record"in e&&r(55,_=e.record),"fullRecord"in e&&r(7,C=e.fullRecord),"value"in e&&r(0,E=e.value),"multiValues"in e&&r(8,A=e.multiValues),"desc"in e&&r(1,b=e.desc),"noForm"in e&&r(9,S=e.noForm),"classId"in e&&r(10,T=e.classId),"eventId"in e&&r(11,D=e.eventId),"recordId"in e&&r(12,R=e.recordId),"withRefValue"in e&&r(51,x=e.withRefValue),"refValue"in e&&r(52,k=e.refValue),"shortEdit"in e&&r(56,O=e.shortEdit),"required"in e&&r(2,M=e.required),"disabled"in e&&r(3,P=e.disabled),"readonly"in e&&r(53,B=e.readonly),"praefix"in e&&r(13,L=e.praefix),"selectionFields"in e&&r(14,F=e.selectionFields),"formnovalidate"in e&&r(57,V=e.formnovalidate),"selection"in e&&r(4,U=e.selection),"deList"in e&&r(15,W=e.deList),"isTemplate"in e&&r(16,z=e.isTemplate),"noList"in e&&r(58,H=e.noList),"multi"in e&&r(17,j=e.multi),"initFinished"in e&&r(54,q=e.initFinished),"listName"in e&&r(59,G=e.listName)},e.$$.update=()=>{if(4&e.$$.dirty[0]|67108864&e.$$.dirty[1]&&r(2,M="boolean"==typeof M&&(M&&!V)),4160&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(53,B||=R&&I.asInput),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(3,P||=B),3145728&e.$$.dirty[1]&&x&&r(0,E=k),3&e.$$.dirty[0]|1073741824&e.$$.dirty[1]&&!b&&E&&fe&&r(1,b=fe),399425&e.$$.dirty[0]|411041792&e.$$.dirty[1]&&E&&te){let e=!1;if(!Array.isArray(E)){if(R||I.asInput||I.upate||!1!==I.refItem||!0===j||!1===I.refItem&&q){const t="p$"+G+"$"+I.refClass+"$"+D,n=Sp(t);n?.then?n.then(e=>{const t=e.find(({_id:e})=>e===E);t?ye(t):Tp(I.refClass,te.id,E,!!I.lookup||H).then(ye)}):e=!0}e&&Tp(I.refClass,te.id,E,!!I.lookup||H).then(ye),r(54,q=!0)}}if(65&e.$$.dirty[0]|536870912&e.$$.dirty[1]|1&e.$$.dirty[2]&&E&&ne&&I.name===ne.input?.at(0)&&ne.inputLookup?.length){const{domain:e}=ne.inputLookup[0]||{};"user"===e&&(s.some(e=>ne.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0))}262145&e.$$.dirty[0]&&!E&&te&&ye({})},[E,b,M,P,U,$,I,C,A,S,T,D,R,L,F,W,z,j,te,se,Q,J,re,ae,le,ie,ce,de,ue,m,p,g,w,y,X,Y,Z,he,()=>{if(!I.query)return;const[e,t]=I.query.split(".");let n;return n=C[t]?[{$lookup:{from:e,localField:e,foreignField:"_id",as:"__"+e}},{$unwind:{path:"$__"+e,preserveNullAndEmptyArrays:!0}},{$match:{["__"+e+"."+t]:C[t]}}]:[{$match:{[e]:C[e]}}],I.refStatus&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":I.refStatus}}])),n},async()=>{try{if(K=await t.getEvent(D),oe="report"===K.output.type,r(26,ce=!I.asInput),r(23,ae=K.output?.class[0].name!==I.refClass),r(18,te=await t.getSchemaByClass(I.refClass)),te?.blocked)return h("initFail",!0),!1;if(oe||r(28,ue=((e,t)=>{let n=t.items.find(e=>!!e.properties?.blocking);if(!n)return!1;if(e.input?.class?.find(e=>e.name===t.class))return n.name;const r=e.output?.class.at(0)?.list||[];for(const e of r){const t=e.item.find(e=>e.name===I.name);if(t?.properties?.blocking)return n.name}return!1})(K,te)),r(22,re=(e=>!a?.length||!!a.find(t=>t===e))(te.id)),r(60,ne=await t.getSchema(D)),D&&R&&E&&!P&&ne.input?.find(e=>e===I.refClass)&&r(3,P=!0),K.input?.class&&K.input.class[0]&&(K.input.class[0].name===I.refClass&&K.input.class[0].readonly&&r(3,P=!0),R&&K.input.class[0].name===I.refClass&&K.input.class[0].writeState)){(await t.getTaskByDocId(R,!0)).status===K.input.class[0].writeState&&r(3,P=r(53,B=!1))}if(I.properties?.query?.lookup){const{domain:e,value:n}=I.properties.query.lookup;if("user"===e){const e=l.user,i={[n]:e},o=await t.getSectionView(I.refClass,i);if(o?.length){const[{_id:e}]=o;e&&(r(52,k=e),r(51,x=!0),h("change",{value:k}))}s.some(e=>te.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0)}}else pe();if(!P&&!k&&I.filter&&(""===L||void 0===L)){const e=I.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly(I.refClass,{[I.filter]:n});i&&(r(52,k=i._id),r(51,x=!0),h("change",{value:k}))}return r(21,J=te.identity.designation),E||ge(te),!0}catch{return h("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!Z){if(!0===e&&r(19,se=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(I.lookup||U&&!I.constraint||E)&&r(19,se=!0)}},we,()=>{if(E)return"";r(1,b="");const e="#"+T+(G?" ."+T+G:"")+" #"+X,t=document.querySelectorAll(e)[0];return t?.value?t.value:""},async({detail:e})=>{if(e.className=te.class,r(0,E=e.row._id),""===L||void 0===L?h("saveDialog",{itemName:I.name,value:E,closeTask:I.properties?.closeTask}):h("listChange",e),I.properties?.closeTask&&K.output?.approval){const e=await t.getTaskByDocId(_._id),n=K.output.approval.flatMap(({refRole:e})=>e),r={eventId:D,eventDesignation:K.identity.designation,docId:_._id,role:n.filter(e=>s.find(t=>t===e)).join(", "),user:f.email,timeStamp:(new Date).toISOString()};await t.setTaskVisum(e._id,r)}$e()},({detail:e})=>{r(0,E=e.row._id),ve()},ve,$e,()=>{(oe||re)&&(j?h("change",{value:E,delete:!0}):(r(0,E=""),r(1,b=""),r(27,de=!0),h("change",{value:E,description:b}),h("task",{row:{_task:{event:te.id},_id:!1},eventId:te.id})))},async()=>{if(!E)return;let e=await Tp(I.refClass,te.id,E);e._task||(e={_task:await t.getTaskByDocId(E,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{E||b&&we({which:13,preventDefault:()=>{},srcElement:{value:b}})},async e=>{r(25,ie={});for(const e in Z){let n=Z[e],i="";if(n.startsWith("owner"))i=me(n,d);else if(n.startsWith("+")){const[e,r]=n.slice(1).split(".");n=e;const o=await t.getSchemaByClass(n),s=_[n];let a=await Np("",o.id);if(a?.length){a=a.sort((e,t)=>e[r]>t[r]?1:e[r]<t[r]?-1:0);const e=a.findIndex(e=>e._id===s);i=a[+e+1]._id||""}}else if(n.includes("|"))for(const e of n.split("|"))i||(i=_[e]);else i=_[n]||C&&C[n];r(25,ie[e]=i,ie)}r(24,le=!0)},x,k,B,q,_,O,V,H,G,ne,fe,s,function(e){b=e,r(1,b),r(0,E),r(61,fe),r(51,x),r(52,k)},function(e){de=e,r(27,de)},function(e){se=e,r(19,se)},function(e){Q=e,r(20,Q)},function(e){le=e,r(24,le)}]}class lr extends xe{constructor(e){var t;super(),Fn.getElementById("svelte-10ggg6v-style")||((t=M("style")).id="svelte-10ggg6v-style",t.textContent=".feather.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-10ggg6v{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.feather3.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:gray}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}.modal-overlay.tModal2 > .dialog{margin-top:0 !important}",R(Fn.head,t)),Re(this,e,ar,sr,S,{id:5,item:6,record:55,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:51,refValue:52,shortEdit:56,required:2,disabled:3,readonly:53,praefix:13,selectionFields:14,formnovalidate:57,selection:4,deList:15,isTemplate:16,noList:58,multi:17,initFinished:54,listName:59},[-1,-1,-1])}}const{document:cr}=Ee;function dr(e){e[45]=e[46].items}function ur(e,t,n){const r=e.slice();return r[47]=t[n],r[49]=n,r}function fr(e,t,n){const r=e.slice();return r[50]=t[n],r[52]=n,r}function hr(e,t,n){const r=e.slice();return r[50]=t[n],r}function mr(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function pr(e){let t,n,r,i;dr(e);const o=[wr,gr],s=[];function a(e,t){return e[6]?1:0}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){dr(e);let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function gr(e){let t,n;return t=new Fp({props:{schema:e[4],recID:e[7]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.schema=e[4]),128&n[0]&&(r.recID=e[7]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function wr(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v,$,I,_;n=new e[12]({props:{outline:!0,$$slots:{default:[yr]},$$scope:{ctx:e}}}),n.$on("click",e[33]);let C=e[1]&&vr(e);o=new e[12]({props:{disabled:!e[5].length,filled:!0,$$slots:{default:[Ir]},$$scope:{ctx:e}}}),o.$on("click",e[17]);let E=e[14]&&function(e){let t,n;return t=new e[9]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}(e);function A(t){e[34](t)}let b={id:e[13]};void 0!==e[3]&&(b.value=e[3]),d=new e[10]({props:b}),re.push(()=>Se(d,"value",A)),d.$on("input",e[19]),m=new ot({props:{size:"18"}});let S=e[45]?.length&&_r(e),N=e[5]?.length&&Er(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),C&&C.c(),i=L(),Ne(o.$$.fragment),s=L(),E&&E.c(),a=L(),l=M("div"),c=B("Suchen: "),Ne(d.$$.fragment),f=L(),h=M("span"),Ne(m.$$.fragment),p=L(),g=M("div"),w=M("table"),S&&S.c(),y=L(),v=M("tbody"),N&&N.c(),z(t,"class","form--buttons svelte-4visk8"),z(h,"class","feather pointer svelte-4visk8"),q(l,"margin-bottom","1em"),q(l,"position","relative"),z(w,"striped",""),z(w,"class","svelte-4visk8"),z(g,"class","eList svelte-4visk8")},m(u,A){x(u,t,A),Te(n,t,null),R(t,r),C&&C.m(t,null),R(t,i),Te(o,t,null),x(u,s,A),E&&E.m(u,A),x(u,a,A),x(u,l,A),R(l,c),Te(d,l,null),R(l,f),R(l,h),Te(m,h,null),x(u,p,A),x(u,g,A),R(g,w),S&&S.m(w,null),R(w,y),R(w,v),N&&N.m(v,null),$=!0,I||(_=V(h,"click",e[21]),I=!0)},p(e,r){const s={};16777216&r[1]&&(s.$$scope={dirty:r,ctx:e}),n.$set(s),e[1]?C?(C.p(e,r),2&r[0]&&$e(C,1)):(C=vr(e),C.c(),$e(C,1),C.m(t,i)):C&&(ye(),Ie(C,1,1,()=>{C=null}),ve());const a={};32&r[0]&&(a.disabled=!e[5].length),16777216&r[1]&&(a.$$scope={dirty:r,ctx:e}),o.$set(a);const l={};!u&&8&r[0]&&(u=!0,l.value=e[3],ue(()=>u=!1)),d.$set(l),e[45]?.length?S?(S.p(e,r),4&r[0]&&$e(S,1)):(S=_r(e),S.c(),$e(S,1),S.m(w,y)):S&&(ye(),Ie(S,1,1,()=>{S=null}),ve()),e[5]?.length?N?(N.p(e,r),32&r[0]&&$e(N,1)):(N=Er(e),N.c(),$e(N,1),N.m(v,null)):N&&(ye(),Ie(N,1,1,()=>{N=null}),ve())},i(e){$||($e(n.$$.fragment,e),$e(C),$e(o.$$.fragment,e),$e(E),$e(d.$$.fragment,e),$e(m.$$.fragment,e),$e(S),$e(N),$=!0)},o(e){Ie(n.$$.fragment,e),Ie(C),Ie(o.$$.fragment,e),Ie(E),Ie(d.$$.fragment,e),Ie(m.$$.fragment,e),Ie(S),Ie(N),$=!1},d(e){e&&k(t),De(n),C&&C.d(),De(o),e&&k(s),E&&E.d(e),e&&k(a),e&&k(l),De(d),De(m),e&&k(p),e&&k(g),S&&S.d(),N&&N.d(),I=!1,_()}}}function yr(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function vr(e){let t,n;return t=new e[12]({props:{filled:!0,$$slots:{default:[$r]},$$scope:{ctx:e}}}),t.$on("click",e[23]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16777216&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function $r(e){let t;return{c(){t=B("Neu")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Ir(e){let t;return{c(){t=B("Bestätigen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function _r(e){let t,n,r,i,o,s,a,l;i=new Ze({props:{size:"20",style:"color: #326173;"}});let c=e[45],d=[];for(let t=0;t<c.length;t+=1)d[t]=Cr(hr(e,c,t));return{c(){t=M("thead"),n=M("tr"),r=M("th"),Ne(i.$$.fragment),o=L();for(let e=0;e<d.length;e+=1)d[e].c();z(r,"class","svelte-4visk8"),z(n,"class","svelte-4visk8"),z(t,"class","svelte-4visk8")},m(c,u){x(c,t,u),R(t,n),R(n,r),Te(i,r,null),R(n,o);for(let e=0;e<d.length;e+=1)d[e].m(n,null);s=!0,a||(l=V(r,"click",function(){b(e[22](e[5]))&&e[22](e[5]).apply(this,arguments)}),a=!0)},p(t,r){if(e=t,262148&r[0]){let t;for(c=e[45],t=0;t<c.length;t+=1){const i=hr(e,c,t);d[t]?d[t].p(i,r):(d[t]=Cr(i),d[t].c(),d[t].m(n,null))}for(;t<d.length;t+=1)d[t].d(1);d.length=c.length}},i(e){s||($e(i.$$.fragment,e),s=!0)},o(e){Ie(i.$$.fragment,e),s=!1},d(e){e&&k(t),De(i),O(d,e),a=!1,l()}}}function Cr(e){let t,n,r=e[50]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-4visk8")},m(e,r){x(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[50]?.designation+"")&&H(n,r)},d(e){e&&k(t)}}}function Er(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[47]._id;for(let t=0;t<o.length;t+=1){let n=ur(e,o,t),a=s(n);i.set(a,r[t]=Nr(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);x(e,t,i),n=!0},p(e,n){1409069&n[0]&&(o=e[5],ye(),r=be(r,n,s,1,e,o,i,t.parentNode,Ae,Nr,t,ur),ve())},i(e){if(!n){for(let e=0;e<o.length;e+=1)$e(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)Ie(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&k(t)}}}function Ar(e){let t,n,r,i,o=e[0],s=br(e),a=e[45],l=[];for(let t=0;t<a.length;t+=1)l[t]=Sr(fr(e,a,t));return{c(){t=M("tr"),s.c(),n=L();for(let e=0;e<l.length;e+=1)l[e].c();r=L(),z(t,"class","svelte-4visk8"),G(t,"active",e[0].includes(e[47]._id))},m(e,o){x(e,t,o),s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);R(t,r),i=!0},p(e,i){if(1&i[0]&&S(o,o=e[0])?(ye(),Ie(s,1,1,_),ve(),s=br(e),s.c(),$e(s),s.m(t,n)):s.p(e,i),327716&i[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=fr(e,a,n);l[n]?l[n].p(o,i):(l[n]=Sr(o),l[n].c(),l[n].m(t,r))}for(;n<l.length;n+=1)l[n].d(1);l.length=a.length}33&i[0]&&G(t,"active",e[0].includes(e[47]._id))},i(e){i||($e(s),i=!0)},o(e){Ie(s),i=!1},d(e){e&&k(t),s.d(e),O(l,e)}}}function br(e){let t,n,r;return n=new e[11]({props:{name:e[15],data:e[47]._id,checked:e[0].includes(e[47]._id),round:!0}}),{c(){t=M("td"),Ne(n.$$.fragment),z(t,"title","Wählt den Wert aus"),z(t,"class","svelte-4visk8")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};32&t[0]&&(r.data=e[47]._id),33&t[0]&&(r.checked=e[0].includes(e[47]._id)),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Sr(e){let t,n,r,i=e[16](e[47],e[50])+"";return{c(){t=M("td"),n=B(i),z(t,"class",r=T(e[50].type)+" svelte-4visk8")},m(e,r){x(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[16](e[47],e[50])+"")&&H(n,i),4&o[0]&&r!==(r=T(e[50].type)+" svelte-4visk8")&&z(t,"class",r)},d(e){e&&k(t)}}}function Nr(e,t){let n,r,i,o=t[20](t[47],t[45],t[3]),s=o&&Ar(t);return{key:e,first:null,c(){n=F(),s&&s.c(),r=F(),this.first=n},m(e,t){x(e,n,t),s&&s.m(e,t),x(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[20](t[47],t[45],t[3])),o?s?(s.p(t,n),44&n[0]&&$e(s,1)):(s=Ar(t),s.c(),$e(s,1),s.m(r.parentNode,r)):s&&(ye(),Ie(s,1,1,()=>{s=null}),ve())},i(e){i||($e(s),i=!0)},o(e){Ie(s),i=!1},d(e){e&&k(n),s&&s.d(e),e&&k(r)}}}function Tr(e){let t,n;return t=new e[9]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Dr(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Tr,then:pr,catch:mr,value:46,blocks:[,,,]};return _e(n=e[2]&&e[18](),i),{c(){t=F(),i.block.c()},m(e,n){x(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[18]())&&_e(n,i)||Ce(i,e,r)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),i.block.d(e),i.token=null,i=null}}}function Rr(e,i,o){let s=JSON.parse(n.getItem("Locale")).id;const a=ee(),{Loading:l,TextField:d,Checkbox:u,Button:f}=c;let h,p,g,w,{inputList:v}=i,{selection:$}=i,{item:I}=i,{target:_}=i,{className:C}=i,{classId:E}=i,{recordId:A}=i,{stopAggregation:b=!1}=i,{shouldNew:S}=i,N=!0,T=C+Math.floor(9e3*Math.random()+1e3).toString()+"search",D=!1;$||=[];let R=$;const x=C+_+"checkbox",k=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else 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[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?y(n):m(e[`_${t.name}`]||n||"")},O=t.getSchemaByClass(C),M=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(s,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t};Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(T)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await O;e.eventId===t.id&&(kp(t.class,e.eventId),o(2,N=!o(2,N=!1)))});const P=()=>{o(6,D=!1)};return e.$$set=e=>{"inputList"in e&&o(26,v=e.inputList),"selection"in e&&o(0,$=e.selection),"item"in e&&o(27,I=e.item),"target"in e&&o(28,_=e.target),"className"in e&&o(29,C=e.className),"classId"in e&&o(30,E=e.classId),"recordId"in e&&o(31,A=e.recordId),"stopAggregation"in e&&o(32,b=e.stopAggregation),"shouldNew"in e&&o(1,S=e.shouldNew)},[$,S,N,h,p,g,D,w,a,l,d,u,f,T,!1,x,k,()=>{const e=document.getElementsByName(x),t=Array.from(e).filter(e=>e.checked).map(e=>e.attributes.data.value);if(h){const e=R.filter(e=>!t.find(t=>t==e));o(0,$=t.concat(e)),R=[...$]}else o(0,$=t),R=[];a("choose",{list:$})},async()=>{o(4,p=await O),g||o(5,g=M(p.displaySort,await v||await Np(p.class,p.id)));const{display:e}=p;let n=await(async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items})(e,p,g);return{items:n}},({detail:{value:e}})=>{o(3,h=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=k(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{o(3,h="")},e=>()=>{document.getElementsByName(x).forEach((e,t)=>{e.checked=!e.checked})},()=>{o(7,w=!1),o(6,D=!0)},async e=>{o(5,g=M(p.displaySort,await Np(p.class,p.id))),e.detail?.row?._id&&$.push(e.detail.row._id),P()},P,v,I,_,C,E,A,b,()=>a("back"),function(e){h=e,o(3,h)}]}class xr extends xe{constructor(e){var t;super(),cr.getElementById("svelte-4visk8-style")||((t=M("style")).id="svelte-4visk8-style",t.textContent=".feather.svelte-4visk8.svelte-4visk8{position:absolute;top:2em;right:0.5em;color:#326173}td .checkbox .selector{border:0.125em solid #326173 !important}.eList.svelte-4visk8.svelte-4visk8{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-4visk8 .editRow.svelte-4visk8{width:1em}.eList.svelte-4visk8 table.svelte-4visk8{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-4visk8 table thead.svelte-4visk8{position:sticky;top:0;background:#326173;color:white}.eList.svelte-4visk8 table thead tr.svelte-4visk8{height:2.3em}.eList.svelte-4visk8 table tbody tr.svelte-4visk8{height:2.75em !important}th.svelte-4visk8.svelte-4visk8,td.svelte-4visk8.svelte-4visk8{padding-left:0.4em;padding-right:0.4em}td.number.svelte-4visk8.svelte-4visk8{text-align:end}tr.active.svelte-4visk8.svelte-4visk8{color:#326173;background-color:#fcebd5}.form--buttons.svelte-4visk8.svelte-4visk8{display:flex;gap:1em;padding:0.5em 0}",R(cr.head,t)),Re(this,e,Rr,Dr,S,{inputList:26,selection:0,item:27,target:28,className:29,classId:30,recordId:31,stopAggregation:32,shouldNew:1},[-1,-1])}}function kr(e,t,n){const r=e.slice();return r[12]=t[n],r[42]=n,r}function Or(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Mr(e){let t,n;return t=new e[17]({props:{outline:!0,$$slots:{default:[Lr]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};36863&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Pr(e){let t,n,r,i,o;return n=new wt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[23]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Br(e){let t,n;return t=new lr({props:{classId:e[5],eventId:e[6],required:e[8],disabled:e[0],formnovalidate:e[11],readonly:e[9],id:e[1]+"."+e[42],item:e[2],desc:e[3],value:e[12],noForm:e[4],praefix:e[10],recordId:e[7],multi:!0+"}"}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};32&n[0]&&(r.classId=e[5]),64&n[0]&&(r.eventId=e[6]),256&n[0]&&(r.required=e[8]),1&n[0]&&(r.disabled=e[0]),2048&n[0]&&(r.formnovalidate=e[11]),512&n[0]&&(r.readonly=e[9]),2&n[0]&&(r.id=e[1]+"."+e[42]),4&n[0]&&(r.item=e[2]),8&n[0]&&(r.desc=e[3]),32768&n[0]&&(r.value=e[12]),16&n[0]&&(r.noForm=e[4]),1024&n[0]&&(r.praefix=e[10]),128&n[0]&&(r.recordId=e[7]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Lr(e){let t,n,r,i=!e[9]&&Pr(e),o=e[15],s=[];for(let t=0;t<o.length;t+=1)s[t]=Br(kr(e,o,t));const a=e=>Ie(s[e],1,1,()=>{s[e]=null});return{c(){i&&i.c(),t=L();for(let e=0;e<s.length;e+=1)s[e].c();n=F()},m(e,o){i&&i.m(e,o),x(e,t,o);for(let t=0;t<s.length;t+=1)s[t].m(e,o);x(e,n,o),r=!0},p(e,r){if(e[9]?i&&(ye(),Ie(i,1,1,()=>{i=null}),ve()):i?(i.p(e,r),512&r[0]&&$e(i,1)):(i=Pr(e),i.c(),$e(i,1),i.m(t.parentNode,t)),36863&r[0]){let t;for(o=e[15],t=0;t<o.length;t+=1){const i=kr(e,o,t);s[t]?(s[t].p(i,r),$e(s[t],1)):(s[t]=Br(i),s[t].c(),$e(s[t],1),s[t].m(n.parentNode,n))}for(ye(),t=o.length;t<s.length;t+=1)a(t);ve()}},i(e){if(!r){$e(i);for(let e=0;e<o.length;e+=1)$e(s[e]);r=!0}},o(e){Ie(i),s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)Ie(s[e]);r=!1},d(e){i&&i.d(e),e&&k(t),O(s,e),e&&k(n)}}}function Fr(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Vr(e){let t,n;return t=new e[19]({props:{title:e[14].designation,class:"eList",$$slots:{default:[Ur]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),82084&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Ur(e){let t,n;return t=new xr({props:{selection:e[16],item:e[2],className:e[14].class,classId:e[5],recordId:e[7],inputList:e[22](),target:e[2].name,shouldNew:!e[20]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};65536&n[0]&&(r.selection=e[16]),4&n[0]&&(r.item=e[2]),16384&n[0]&&(r.className=e[14].class),32&n[0]&&(r.classId=e[5]),128&n[0]&&(r.recordId=e[7]),4&n[0]&&(r.target=e[2].name),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Wr(e){let t,n,r=e[13]&&Vr(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&$e(r,1)):(r=Vr(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function zr(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Fr,then:Mr,catch:Or,value:40,blocks:[,,,]};function s(t){e[34](t)}_e(e[21](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[Wr]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[18]({props:a}),re.push(()=>Se(n,"open",s)),{c(){o.block.c(),t=L(),Ne(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,x(e,t,r),Te(n,e,r),i=!0},p(t,i){Ce(o,e=t,i);const s={};90276&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],ue(()=>r=!1)),n.$set(s)},i(e){i||($e(o.block),$e(n.$$.fragment,e),i=!0)},o(e){for(let e=0;e<3;e+=1){Ie(o.blocks[e])}Ie(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&k(t),De(n,e)}}}function Hr(e,n,r){const i=ee(),{Card:o,Modal:s,Dialog:a,Button:l}=c;let d,u,f,{id:h}=n,{item:m}=n,{record:p}=n,{value:g=[]}=n,{desc:w=""}=n,{noForm:y=!1}=n,{classId:v}=n,{eventId:$}=n,{recordId:I}=n,{withRefValue:_=!1}=n,{refValue:C=""}=n,{required:E}=n,{disabled:A}=n,{readonly:b}=n,{praefix:S}=n,{selectionFields:N}=n,{formnovalidate:T}=n,{selection:D}=n,{deList:R}=n,{isTemplate:x}=n,{noList:k=!1}=n,O=!1;const{lookup:M,refStatus:P,filter:B,constraint:L}=m.properties.multi;A=!0;const F=()=>{r(13,O=!1)};return e.$$set=e=>{"id"in e&&r(1,h=e.id),"item"in e&&r(2,m=e.item),"record"in e&&r(26,p=e.record),"value"in e&&r(12,g=e.value),"desc"in e&&r(3,w=e.desc),"noForm"in e&&r(4,y=e.noForm),"classId"in e&&r(5,v=e.classId),"eventId"in e&&r(6,$=e.eventId),"recordId"in e&&r(7,I=e.recordId),"withRefValue"in e&&r(27,_=e.withRefValue),"refValue"in e&&r(28,C=e.refValue),"required"in e&&r(8,E=e.required),"disabled"in e&&r(0,A=e.disabled),"readonly"in e&&r(9,b=e.readonly),"praefix"in e&&r(10,S=e.praefix),"selectionFields"in e&&r(29,N=e.selectionFields),"formnovalidate"in e&&r(11,T=e.formnovalidate),"selection"in e&&r(30,D=e.selection),"deList"in e&&r(31,R=e.deList),"isTemplate"in e&&r(32,x=e.isTemplate),"noList"in e&&r(33,k=e.noList)},[A,h,m,w,y,v,$,I,E,b,S,T,g,O,d,u,f,o,s,a,M,async()=>{r(15,u=[].concat(g)),r(14,d=await t.getSchemaByClass(m.refClass))},async()=>{let e,n;if(M)if(M.refClass){if(p[M.refClass]){const r=await xp(M.refClass,p[M.refClass]);r&&Array.isArray(r[M.refItem])&&(n=[{$match:{_id:{$in:r[M.refItem]}}}],e=await t.getSectionView(d.class,n,!0))}}else n=[{$match:{[M]:p[M]}}],P&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":P}}])),e=await t.getSectionView(d.class,n,!0);else e=await Np("",d.id);if(!e?.length)return[];if(L&&e?.length){const{refClass:r,refStatus:i}=L,o=d.class===r?"_id":d.class;n=[{$match:{[o]:{$in:e.map(({_id:e})=>e)}}},{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":i}}];const s=await t.getSectionView(r,n,!0);"project"!==r&&(e=e.filter(e=>!!s.find(t=>t.project==e._id)))}if(B)for(const t in B)e=e.filter(e=>{let[n,r]=t.split(".");if(r||(r=n,n=""),n){if(e[n][0]&&e[n][0][r].length)return!0}else if(e[r])return!0;return!1});return e},()=>{b||(r(13,O=!0),r(16,f=u))},({detail:e})=>{p.__id||(r(15,u=e.list),i("change",{value:u}),i("multi",{lookup:M,filter:B,name:m.name,value:u})),F()},F,p,_,C,N,D,R,x,k,function(e){O=e,r(13,O)}]}class jr extends xe{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=M("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",R(document.head,t)),Re(this,e,Hr,zr,S,{id:1,item:2,record:26,value:12,desc:3,noForm:4,classId:5,eventId:6,recordId:7,withRefValue:27,refValue:28,required:8,disabled:0,readonly:9,praefix:10,selectionFields:29,formnovalidate:11,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const qr=/\d+/g,Gr=/%[HMSpPdmyY%]/g;function Xr(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split(Gr);let s=0,a=0;const l=new Date(0);for(const c of o){if(!e.startsWith(c,s))return n;if(s+=c.length,s===e.length){if(a!==t.length)return n;break}if("%"!==t[a+c.length])break;if(a+=c.length+1,"%"===t[a]){if("%"!==e[s])return n;s++}else if("p"===t[a].toLowerCase()){const t=e.substr(s,2).toUpperCase();if("AM"===t)i=!1,l.getHours()>=12&&l.setHours(l.getHours()-12);else{if("PM"!==t)return n;i=!0,l.getHours()<12&&l.setHours(l.getHours()+12)}}else{qr.lastIndex=s;const o=qr.exec(e);if(null==o)return n;switch(t[a]){case"H":l.setHours(parseInt(o[0])+12*i);break;case"M":l.setMinutes(o[0]);break;case"S":l.setSeconds(o[0]);break;case"d":l.setDate(o[0]);break;case"m":l.setMonth(o[0]-1);break;case"y":l.setFullYear(100*r+parseInt(o[0]));break;case"Y":l.setFullYear(o[0])}s+=o[0].length}a++}return isNaN(l.valueOf())?n:l}function Yr(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Zr}=Ee;function Kr(e,t,n){const r=e.slice();return r[17]=t[n],r}function Qr(e,t,n){const r=e.slice();return r[20]=t[n],r}function Jr(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function ei(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m=e[0].items,p=[];for(let t=0;t<m.length;t+=1)p[t]=ni(Qr(e,m,t));const g=e=>Ie(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&ri(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[oi]},$$scope:{ctx:e}}}),l.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[si]},$$scope:{ctx:e}}}),{c(){t=M("form"),n=M("input"),i=L();for(let e=0;e<p.length;e+=1)p[e].c();o=L(),w&&w.c(),s=L(),a=M("div"),Ne(l.$$.fragment),c=L(),Ne(d.$$.fragment),z(n,"class",T(e[6])+" svelte-1phofh5"),z(n,"name","_id"),z(n,"type","hidden"),n.value=r=e[1]._id||"",z(t,"class","fTask svelte-1phofh5"),z(t,"id",e[6]),z(a,"class","form--buttons svelte-1phofh5")},m(r,m){x(r,t,m),R(t,n),R(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);R(t,o),w&&w.m(t,null),x(r,s,m),x(r,a,m),Te(l,a,null),R(a,c),Te(d,a,null),u=!0,f||(h=[V(t,"keydown",e[8]),V(t,"submit",U(e[10]))],f=!0)},p(e,i){if((!u||2&i&&r!==(r=e[1]._id||""))&&(n.value=r),75&i){let n;for(m=e[0].items,n=0;n<m.length;n+=1){const r=Qr(e,m,n);p[n]?(p[n].p(r,i),$e(p[n],1)):(p[n]=ni(r),p[n].c(),$e(p[n],1),p[n].m(t,o))}for(ye(),n=m.length;n<p.length;n+=1)g(n);ve()}e[0].list?w?(w.p(e,i),1&i&&$e(w,1)):(w=ri(e),w.c(),$e(w,1),w.m(t,null)):w&&(ye(),Ie(w,1,1,()=>{w=null}),ve());const s={};8388608&i&&(s.$$scope={dirty:i,ctx:e}),l.$set(s);const a={};4&i&&(a.disabled=e[2]),8388608&i&&(a.$$scope={dirty:i,ctx:e}),d.$set(a)},i(e){if(!u){for(let e=0;e<m.length;e+=1)$e(p[e]);$e(w),$e(l.$$.fragment,e),$e(d.$$.fragment,e),u=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)Ie(p[e]);Ie(w),Ie(l.$$.fragment,e),Ie(d.$$.fragment,e),u=!1},d(e){e&&k(t),O(p,e),w&&w.d(),e&&k(s),e&&k(a),De(l),De(d),f=!1,A(h)}}}function ti(e){let t,n;return t=new Su({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(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.item=e[20]),1&n&&(r.selection=e[20].selection),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),1&n&&(r.eventId=e[0].id),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ni(e){let t,n,r=ci(!0,e[20]),i=r&&ti(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){1&n&&(r=ci(!0,e[20])),r?i?(i.p(e,n),1&n&&$e(i,1)):(i=ti(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function ri(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=ii(Kr(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(75&n){let s;for(r=e[0].list,s=0;s<r.length;s+=1){const o=Kr(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=ii(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}function ii(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new Ii({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(){Ne(t.$$.fragment),n=L(),Ne(r.$$.fragment)},m(e,o){Te(t,e,o),x(e,n,o),Te(r,e,o),i=!0},p(e,n){const i={};1&n&&(i.text=e[17].designation),t.$set(i);const o={};1&n&&(o.list=e[17]),1&n&&(o.eventId=e[0].id),1&n&&(o.schema=e[17].item),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),r.$set(o)},i(e){i||($e(t.$$.fragment,e),$e(r.$$.fragment,e),i=!0)},o(e){Ie(t.$$.fragment,e),Ie(r.$$.fragment,e),i=!1},d(e){De(t,e),e&&k(n),De(r,e)}}}function oi(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function si(e){let t;return{c(){t=B("Speichern")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function ai(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function li(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:ai,then:ei,catch:Jr,value:16,blocks:[,,,]};return _e(e[7](),i),{c(){t=L(),n=M("section"),i.block.c(),Zr.title="Vorgaben",z(n,"class","sTask svelte-1phofh5")},m(e,o){x(e,t,o),x(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){Ce(i,e=t,n)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),e&&k(n),i.block.d(),i.token=null,i=null}}}const ci=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function di(e,r,s){let l,d,u;N(e,o,e=>s(11,d=e)),N(e,i,e=>s(12,u=e));const{Divider:f,Button:h,FormField:m}=c,p=JSON.parse(n.getItem("Locale"));let{schema:g}=r,{record:w}=r,y="template-"+g.class+Math.floor(9e3*Math.random()+1e3).toString(),v=!1;const $=()=>window.history.back(),I=(e,t,n=!1)=>{const r=t.id,i=e.find(e=>e.name===r);let o=t.value;if(!n&&i&&i.properties?.multi&&(o=w[r]),o&&i&&i.type.startsWith("date"))try{return Xr(o,"%d.%m.%Y").toISOString()}catch{return new Date(o).toISOString()}if(i&&"boolean"===i.type&&(o=!!t.checked),i&&"number"===i.type){const e=Number("1.1").toLocaleString(p.id).substring(1,2);try{o=Number(o.replace(e,".")).toString()}catch{}}return o};return e.$$set=e=>{"schema"in e&&s(0,g=e.schema),"record"in e&&s(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&s(3,l=v)},[g,w,v,l,f,h,y,async()=>{const e=await t.getEvent(g.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some(e=>"Manual"===e.type)&&s(2,v=!0),d.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>u?.find(t=>t===e.role&&"edit"===e.activity));s(2,v||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},$,async e=>{const n={};Array.from(document.querySelectorAll("form#"+y+" ."+y)).map(e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[r,i]=t.split("."),o=g.list.find(e=>e.name===r);n[t]=I(o.item,e)}else n[t]=I(g.items,e)}),await t.saveTemplate(g.class,n),a.success("Die Vorgaben wurden gespeichert.",2e3),$()}]}const{document:ui}=Ee;function fi(e,t,n){const r=e.slice();return r[36]=t[n],r}function hi(e){let t,n;return t=new Su({props:{classId:e[3],item:e[36],listName:e[2].name,eventId:e[4],record:e[0],disabled:e[5],required:e[6],currency:e[9],notifyList:e[1]}}),t.$on("notify",e[15]),t.$on("defPrep",e[17]),t.$on("formula",e[19]),t.$on("task",e[23]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.classId=e[3]),4&n[0]&&(r.item=e[36]),4&n[0]&&(r.listName=e[2].name),16&n[0]&&(r.eventId=e[4]),1&n[0]&&(r.record=e[0]),32&n[0]&&(r.disabled=e[5]),64&n[0]&&(r.required=e[6]),512&n[0]&&(r.currency=e[9]),2&n[0]&&(r.notifyList=e[1]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function mi(e){let t,n,r=ci(e[8],e[36]),i=r&&hi(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){260&n[0]&&(r=ci(e[8],e[36])),r?i?(i.p(e,n),260&n[0]&&$e(i,1)):(i=hi(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function pi(e){let t,n,r,i=e[2].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=mi(fi(e,i,t));const s=e=>Ie(o[e],1,1,()=>{o[e]=null});return{c(){t=M("div");for(let e=0;e<o.length;e+=1)o[e].c();z(t,"id",n=`accordion-content-${e[3]}-${e[2].name}`)},m(e,n){x(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(689023&a[0]){let n;for(i=e[2].item,n=0;n<i.length;n+=1){const r=fi(e,i,n);o[n]?(o[n].p(r,a),$e(o[n],1)):(o[n]=mi(r),o[n].c(),$e(o[n],1),o[n].m(t,null))}for(ye(),n=i.length;n<o.length;n+=1)s(n);ve()}(!r||12&a[0]&&n!==(n=`accordion-content-${e[3]}-${e[2].name}`))&&z(t,"id",n)},i(e){if(!r){for(let e=0;e<i.length;e+=1)$e(o[e]);r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)Ie(o[e]);r=!1},d(e){e&&k(t),O(o,e)}}}function gi(e){let t,n,r=e[14](e[10])+"";return{c(){t=M("span"),n=B(r)},m(e,r){x(e,t,r),R(t,n)},p(e,t){1024&t[0]&&r!==(r=e[14](e[10])+"")&&H(n,r)},d(e){e&&k(t)}}}function wi(e){let t,n,r;return n=new e[11]({props:{$$slots:{default:[gi]},$$scope:{ctx:e}}}),n.$on("click",function(){b(e[16](e[35]))&&e[16](e[35]).apply(this,arguments)}),{c(){t=M("div"),Ne(n.$$.fragment),z(t,"class","accordion svelte-148ktt9"),z(t,"slot","handle")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(t,r){e=t;const i={};1024&r[0]|256&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function yi(e){let t,n;return t=new e[13]({props:{open:e[7],$$slots:{handle:[wi,({toggle:e})=>({35:e}),({toggle:e})=>[0,e?16:0]],default:[pi,({toggle:e})=>({35:e}),({toggle:e})=>[0,e?16:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[18]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};128&n[0]&&(r.open=e[7]),1919&n[0]|272&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function vi(e){let t,n,r;return n=new e[12]({props:{$$slots:{default:[yi]},$$scope:{ctx:e}}}),{c(){t=M("div"),Ne(n.$$.fragment),z(t,"class","formList")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};2047&t[0]|256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function $i(e,n,r){const{Button:i,Accordion:o,AccordionSection:s}=c;let{list:a}=n,{schema:l}=n,{record:d}=n,{classId:u}=n,{eventId:f}=n,{disabled:h}=n,{required:w}=n,{open:v=!1}=n,{template:$={}}=n,{isTemplate:I=!1}=n,{currency:_}=n,{update:C=!1}=n,{notifyList:E}=n,A=new Map;const b={};let S=d[a.name]||{};d[a.name]=S;const N=(e,t)=>""===t[e.name]?"":e._attr?T(e,t[e.name]):"object"===e.type?R(t[e.name]):Array.isArray(t[e.name])?D(t[e.name]):"boolean"===e.type?y(t[e.name]):"number"===e.type?x(t[e.name],e.properties?.decimals||0):"dateRange"===e.type?g(e.name,t):"date"===e.type?m(gDate(t[e.name])):"datetime"===e.type?p(t[e.name]):e.properties?.multi?"":t[e.name],T=(e,t)=>b[t]?.split(" • ").at(e._attr),D=e=>e.slice(0,3).join(", "),R=e=>b[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),x=(e,t)=>(t||=0,"number"==typeof e&&e||(e=Number(e||0)),(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t)),k=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)},O=e=>{if(!e)return;const t=e.properties.value.formula,{operator:n,argument:i}=t,o=i.map(e=>d[a.name][e.refItem]);if("$preferred"===n){if(d._id&&void 0!==d[a.name][e.name])return;const t=o.reduce((t,n)=>{let r=t;return"number"===e.type?r=+r||+n:r||=n,r});r(0,d[a.name][e.name]=t,d)}},M=async({item:e,value:t})=>{const n=l.find(t=>t.properties?.value?.formula?.argument?.find(t=>t.refItem===e.name));if(!n)return;const i=n.properties.value.formula,{operator:o,argument:s}=i,c=s.map(n=>n.refItem===e.name?t:S[n.refItem]||d[n.refItem]);let u=0;"$add"===o&&(u=c.reduce((e,t)=>+(e||0)+ +(t||0))),r(0,d[a.name][n.name]=x(u,n.properties?.decimals),d)};return e.$$set=e=>{"list"in e&&r(2,a=e.list),"schema"in e&&r(20,l=e.schema),"record"in e&&r(0,d=e.record),"classId"in e&&r(3,u=e.classId),"eventId"in e&&r(4,f=e.eventId),"disabled"in e&&r(5,h=e.disabled),"required"in e&&r(6,w=e.required),"open"in e&&r(7,v=e.open),"template"in e&&r(21,$=e.template),"isTemplate"in e&&r(8,I=e.isTemplate),"currency"in e&&r(9,_=e.currency),"update"in e&&r(22,C=e.update),"notifyList"in e&&r(1,E=e.notifyList)},e.$$.update=()=>{4194309&e.$$.dirty[0]&&C&&d&&r(10,S=d[a.name]||{})},[d,E,a,u,f,h,w,v,I,_,S,i,o,s,e=>{let t=l;return a.display?.refItem&&(t=a.display.refItem.map(e=>{const[t,n]=e.split("."),r=l.find(e=>e.name===t);if(r)return r._attr=n,r}).filter(e=>!!e)),e&&t.filter(t=>!0!==t.properties?.hidden&&("dateRange"===t.type||void 0!==e[t.name])&&"html"!==t.properties?.format&&"textarea"!==t.properties?.format).map(t=>N(t,e)).filter(e=>!!e).join(" • ")||"+"},({detail:e})=>{const{itemName:t,value:n,desc:i}=e,[o,s]=t.split(".");if(!s)return;const c=l.filter(e=>"$preferred"===e.properties?.value?.formula?.operator);for(const e of c)O(e);r(1,E={listName:a.name,itemName:t,value:n}),i&&(b[s]=i);const u=d[o];r(0,d[o]={...u,[s]:n},d),r(10,S=d[o])},e=>t=>{(()=>{const e=$[a.name]||{};for(const t in e)$[a.name][t]&&!d[a.name][t]&&r(0,d[a.name][t]=$[a.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${a.name} > div.form-field:last-child`;document.querySelector(n),ce().then(()=>{const e=`#accordion-content-${u}-${a.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(k)})},async({detail:{className:e,itemName:n,value:r}})=>{if(A.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===className+"."+a.name)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&A.set(e,o[0])},()=>{setTimeout(()=>{Array.from(A).forEach(([e,t])=>{d[a.name][e]||r(0,d[a.name][e]=t._id,d)})},500)},({detail:e})=>{M(e)},l,$,C,function(t){te(e,t)}]}class Ii extends xe{constructor(e){var t;super(),ui.getElementById("svelte-148ktt9-style")||((t=M("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}}",R(ui.head,t)),Re(this,e,$i,vi,S,{list:2,schema:20,record:0,classId:3,eventId:4,disabled:5,required:6,open:7,template:21,isTemplate:8,currency:9,update:22,notifyList:1},[-1,-1])}}const{document:_i}=Ee;function Ci(e){e[0]=e[23].list,e[22]=e[23].items}function Ei(e,t,n){const r=e.slice();return r[24]=t[n],r}function Ai(e,t,n){const r=e.slice();return r[27]=t[n],r}function bi(e,t,n){const r=e.slice();return r[27]=t[n],r}function Si(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Ni(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[19](t)}Ci(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Ti]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),re.push(()=>Se(s,"value",v)),s.$on("input",e[12]),d=new ot({props:{size:"18"}});let I=e[22]?.length&&function(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Di(bi(e,r,t));return{c(){t=M("thead"),n=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();z(n,"class","svelte-14hcfjl"),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[22],o=0;o<r.length;o+=1){const s=bi(e,r,o);i[o]?i[o].p(s,t):(i[o]=Di(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&k(t),O(i,e)}}}(e),_=e[0]?.length&&function(e){let t,n=e[0],r=[];for(let t=0;t<n.length;t+=1)r[t]=ki(Ei(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);x(e,t,n)},p(e,i){if(11778&i[0]){let o;for(n=e[0],o=0;o<n.length;o+=1){const s=Ei(e,n,o);r[o]?r[o].p(s,i):(r[o]=ki(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){O(r,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),i=M("div"),o=B("Suchen: "),Ne(s.$$.fragment),l=L(),c=M("span"),Ne(d.$$.fragment),u=L(),f=M("div"),h=M("table"),I&&I.c(),m=L(),p=M("tbody"),_&&_.c(),z(t,"class","form--buttons svelte-14hcfjl"),z(c,"class","feather pointer svelte-14hcfjl"),q(i,"margin-bottom","1em"),q(i,"position","relative"),z(h,"striped",""),z(h,"class","svelte-14hcfjl"),z(f,"class","eList svelte-14hcfjl")},m(a,v){x(a,t,v),Te(n,t,null),x(a,r,v),x(a,i,v),R(i,o),Te(s,i,null),R(i,l),R(i,c),Te(d,c,null),x(a,u,v),x(a,f,v),R(f,h),I&&I.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=V(c,"click",e[14]),w=!0)},p(e,t){Ci(e);const r={};2&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ue(()=>a=!1)),s.$set(i),e[22]?.length&&I.p(e,t),e[0]?.length&&_.p(e,t)},i(e){g||($e(n.$$.fragment,e),$e(s.$$.fragment,e),$e(d.$$.fragment,e),g=!0)},o(e){Ie(n.$$.fragment,e),Ie(s.$$.fragment,e),Ie(d.$$.fragment,e),g=!1},d(e){e&&k(t),De(n),e&&k(r),e&&k(i),De(s),De(d),e&&k(u),e&&k(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function Ti(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Di(e){let t,n,r=e[27]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function Ri(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=xi(Ai(e,r,t));return{c(){t=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=L(),z(t,"class","pointer svelte-14hcfjl")},m(e,r){x(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Ai(e,r,s);i[s]?i[s].p(a,o):(i[s]=xi(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(e){e&&k(t),O(i,e)}}}function xi(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=M("td"),n=B(o),z(t,"class","svelte-14hcfjl")},m(o,s){x(o,t,s),R(t,n),r||(i=V(t,"click",W(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&k(t),r=!1,i()}}}function ki(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&Ri(e);return{c(){r&&r.c(),t=F()},m(e,n){r&&r.m(e,n),x(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[24],e[22],e[1])),n?r?r.p(e,i):(r=Ri(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&k(t)}}}function Oi(e){let t,n;return t=new e[5]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Mi(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Oi,then:Ni,catch:Si,value:23,blocks:[,,,]};return _e(e[11](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function Pi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Mi]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Bi(e,n,r){const i=ee(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:d}=c;let{item:u}=n,{className:f}=n,{classId:h}=n,{list:p}=n,g="",w=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const v=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?y(n):m(e[`_${t.name}`]||e[t.name]||"")},$=t.getSchemaByClass(f);Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(w)?.focus()},200)});return e.$$set=e=>{"item"in e&&r(15,u=e.item),"className"in e&&r(16,f=e.className),"classId"in e&&r(17,h=e.classId),"list"in e&&r(0,p=e.list)},[p,g,i,o,s,a,l,d,w,v,e=>()=>i("choose",{row:e}),async()=>{const e=await $,t=e.display;let n=await tn(t,e,p);return{list:p,items:n}},({detail:{value:e}})=>{r(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(v(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,g="")},u,f,h,()=>i("back"),function(e){g=e,r(1,g)}]}class Li extends xe{constructor(e){var t;super(),_i.getElementById("svelte-14hcfjl-style")||((t=M("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}",R(_i.head,t)),Re(this,e,Bi,Pi,S,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:Fi}=Ee;function Vi(e,t,n){const r=e.slice();return r[12]=t[n],r}function Ui(e,t,n){const r=e.slice();return r[4]=t[n],r}function Wi(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function zi(e){let t,n,r,i=e[8].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=Xi(Ui(e,i,t));const s=e=>Ie(o[e],1,1,()=>{o[e]=null});let a=e[8].list&&Yi(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=L(),a&&a.c(),n=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);x(e,t,i),a&&a.m(e,i),x(e,n,i),r=!0},p(e,r){if(60655567&r[0]){let n;for(i=e[8].items,n=0;n<i.length;n+=1){const s=Ui(e,i,n);o[n]?(o[n].p(s,r),$e(o[n],1)):(o[n]=Xi(s),o[n].c(),$e(o[n],1),o[n].m(t.parentNode,t))}for(ye(),n=i.length;n<o.length;n+=1)s(n);ve()}e[8].list?a?(a.p(e,r),256&r[0]&&$e(a,1)):(a=Yi(e),a.c(),$e(a,1),a.m(n.parentNode,n)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve())},i(e){if(!r){for(let e=0;e<i.length;e+=1)$e(o[e]);$e(a),r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)Ie(o[e]);Ie(a),r=!1},d(e){O(o,e),e&&k(t),a&&a.d(e),e&&k(n)}}}function Hi(e){let t,n,r,i;const o=[qi,ji],s=[];function a(e,t){return e[4].name!==e[15]||e[16]?"lookup"!==e[4].properties?.format?1:-1:0}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=F()},m(e,n){~t&&s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){~t&&s[t].d(e),e&&k(r)}}}function ji(e){let t,n;return t=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[4].name===e[15]&&e[16]||e[0],eventId:e[6],notifyList:e[2],currency:e[3],changeValue:e[10]}}),t.$on("notify",e[18]),t.$on("multi",e[19]),t.$on("defPrep",e[20]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};512&n[0]&&(r.classId=e[9]),256&n[0]&&(r.item=e[4]),128&n[0]&&(r.record=e[7]),257&n[0]&&(r.disabled=e[4].name===e[15]&&e[16]||e[0]),64&n[0]&&(r.eventId=e[6]),4&n[0]&&(r.notifyList=e[2]),8&n[0]&&(r.currency=e[3]),1024&n[0]&&(r.changeValue=e[10]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function qi(e){let t,n,r,i;n=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[0]||!!e[1],required:!0,eventId:e[6],notifyList:!0,currency:e[3],changeValue:e[10]}}),n.$on("notify",e[18]),n.$on("multi",e[19]),n.$on("defPrep",e[20]),n.$on("record",e[24]),n.$on("objRecord",e[25]);let o=e[1]&&Gi(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),q(t,"padding-top",".25em"),q(t,"background-color","lightyellow"),q(t,"position","relative")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};512&r[0]&&(i.classId=e[9]),256&r[0]&&(i.item=e[4]),128&r[0]&&(i.record=e[7]),3&r[0]&&(i.disabled=e[0]||!!e[1]),64&r[0]&&(i.eventId=e[6]),8&r[0]&&(i.currency=e[3]),1024&r[0]&&(i.changeValue=e[10]),n.$set(i),e[1]?o?(o.p(e,r),2&r[0]&&$e(o,1)):(o=Gi(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function Gi(e){let t,n,r,i,o;return n=new ot({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[23]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Xi(e){let t,n,r="list"!==e[4].type&&Hi(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){"list"!==e[4].type?r?(r.p(e,n),256&n[0]&&$e(r,1)):(r=Hi(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Yi(e){let t,n,r=e[8].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Ki(Vi(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(973&n[0]){let s;for(r=e[8].list,s=0;s<r.length;s+=1){const o=Vi(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=Ki(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}function Zi(e){let t,n,r,i,o;function s(t){e[31](t)}t=new e[13]({props:{text:e[12].designation}});let a={classId:e[9],list:e[12],eventId:e[6],schema:e[12].item,record:e[7],disabled:e[0],currency:e[3],update:!0};return void 0!==e[2]&&(a.notifyList=e[2]),r=new Ii({props:a}),re.push(()=>Se(r,"notifyList",s)),{c(){Ne(t.$$.fragment),n=L(),Ne(r.$$.fragment)},m(e,i){Te(t,e,i),x(e,n,i),Te(r,e,i),o=!0},p(e,n){const o={};256&n[0]&&(o.text=e[12].designation),t.$set(o);const s={};512&n[0]&&(s.classId=e[9]),256&n[0]&&(s.list=e[12]),64&n[0]&&(s.eventId=e[6]),256&n[0]&&(s.schema=e[12].item),128&n[0]&&(s.record=e[7]),1&n[0]&&(s.disabled=e[0]),8&n[0]&&(s.currency=e[3]),!i&&4&n[0]&&(i=!0,s.notifyList=e[2],ue(()=>i=!1)),r.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(r.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(r.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(n),De(r,e)}}}function Ki(e){let t,n,r="array"!==e[12].type&&Zi(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){"array"!==e[12].type?r?(r.p(e,n),256&n[0]&&$e(r,1)):(r=Zi(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Qi(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Ji(e){let t,n;return t=new Li({props:{item:e[4],className:e[5],classId:e[9],list:e[12]}}),t.$on("choose",e[21]),t.$on("back",e[22]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.item=e[4]),32&n[0]&&(r.className=e[5]),512&n[0]&&(r.classId=e[9]),4096&n[0]&&(r.list=e[12]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function eo(e){let t,n,r=e[11]&&Ji(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[11]?r?(r.p(e,n),2048&n[0]&&$e(r,1)):(r=Ji(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function to(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:Qi,then:zi,catch:Wi,value:56,blocks:[,,,]};function l(t){e[32](t)}_e(e[17](),a),n=new e[13]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[eo]},$$scope:{ctx:e}};return void 0!==e[11]&&(c.open=e[11]),i=new e[14]({props:c}),re.push(()=>Se(i,"open",l)),{c(){a.block.c(),t=L(),Ne(n.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,x(e,t,o),Te(n,e,o),x(e,r,o),Te(i,e,o),s=!0},p(t,n){Ce(a,e=t,n);const r={};6704&n[0]|1073741824&n[1]&&(r.$$scope={dirty:n,ctx:e}),!o&&2048&n[0]&&(o=!0,r.open=e[11],ue(()=>o=!1)),i.$set(r)},i(e){s||($e(a.block),$e(n.$$.fragment,e),$e(i.$$.fragment,e),s=!0)},o(e){for(let e=0;e<3;e+=1){Ie(a.blocks[e])}Ie(n.$$.fragment,e),Ie(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&k(t),De(n,e),e&&k(r),De(i,e)}}}function no(e,n,r){const{Divider:i,FormField:o,Modal:s}=c,a=ee();let l,d,u,f,h,{required:m}=n,{disabled:p}=n,{readonly:g}=n,{id:w}=n,{item:y}=n,{value:v}=n,{refValue:$}=n,{currency:I}=n,{notifyList:_}=n,C={},E=[],A=[],b={},S=new Map,N=!1,T="";const D=y.checkOn,R=v,x=e=>{l.items.filter(t=>"object"==typeof(t.properties&&t.properties[e])).map(t=>{const n=t.properties[e].refItem||"",[r,i]=n.split(".");E.push({action:e,itemName:t.name,refObj:r,refName:i,op:t.properties[e].invert?"!":""})})},k=()=>{l.items.filter(e=>e.lookup).forEach(e=>{A.push({name:e.name,lookup:e.lookup})}),l.items.filter(e=>e.properties?.lookup).forEach(e=>{A.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})})},O=async e=>{const t=E.filter(t=>t.refObj===e);if(t?.length){r(10,b={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:s}=e;if(!n)break;let a,l,c=!i&&C[n];const u=C[n];u&&i&&(c=(await xp(n,u))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==s&&"readonly"!==s||(s="required"===s?s:"disabled",setTimeout(()=>{a=`#${d} .form-field.${t} .field textarea`,l=document.querySelector(a),l||(a=`#${d} .form-field.${t} .field input`,l=document.querySelector(a)),l&&c&&l.setAttribute(s,""),l&&!c&&l.removeAttribute(s)},0)),"hidden"===s&&(a=`#${d} .form-field.${t}`,l=document.querySelector(a),l?.classList?.toggle("hidden",!!c),c&&r(10,b[t]="",b))}}};Q(()=>{M()});const M=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 E)e.add(t.refObj||u);Array.from(e).forEach(e=>O(e))})(),P())},P=()=>{setTimeout(()=>{Array.from(S).forEach(([e,t])=>{C[e]||r(7,C[e]=t._id,C)})},250)},B=async e=>{if(!e.value)return void F();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},i=await t.getSectionView(u,n);i?.length?(r(12,T=i),r(11,N=!0)):(r(1,v=""),r(26,$=""),a("setRefValue",$))},L=()=>{r(11,N=!1)},F=()=>{r(1,v=""),r(26,$=v),r(7,C={}),a("setRefValue",$)};return e.$$set=e=>{"required"in e&&r(27,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(28,g=e.readonly),"id"in e&&r(29,w=e.id),"item"in e&&r(4,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(26,$=e.refValue),"currency"in e&&r(3,I=e.currency),"notifyList"in e&&r(2,_=e.notifyList)},e.$$.update=()=>{268435457&e.$$.dirty[0]&&r(0,p=p||g),1073742048&e.$$.dirty[0]&&C&&a("safeReference",{record:C,class:u,event:f,taskId:h})},[p,v,_,I,y,u,f,C,l,d,b,N,T,i,s,D,R,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(7,C=e),r(30,h=(await t.getTaskByDocId(e._id,!0))._id)}else r(7,C={})}catch{}return r(8,l=await t.getSchemaByClass(y.refClass)),r(9,d="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(5,u=l.class),l.identity.designation,r(6,f=l.id),["readonly","hidden","required"].map(x),k(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(7,C[t]=n,C),t===D)return B(e);O(t)},async({detail:e})=>{if(!(l.input?.length&&l.input.length>1))return;if(prevSchema?.class!==l.input[0])return;const{value:n,lookup:i,view:o}=e,[s]=i.split(":"),a=(await t.getSectionView(s,{[o]:{$in:n}})).map(e=>e._id);for(const e of l.input.slice(1)){r(7,C[e]=[],C);const n=await t.getSchemaByClass(e);n.id;let i=await t.getTasks(n.id);if(i=i.data.filter(e=>"Ready"===e._task?.status&&a.includes(e[s])),i?.length){const n=i.map(e=>e._id),o=await t.getSectionView(e,{_id:{$in:n}});for(const t of o)t[e]=t._id;r(7,C[e]=o,C)}}},async({detail:{className:e,itemName:n,value:r}})=>{if(S.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===u)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&S.set(e,o[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(r(1,v=n[0]._id),r(26,$=v),a("setRefValue",$),r(7,C=n[0])),L()},L,F,({detail:e})=>{r(7,C[e.itemName]=e.value,C)},({detail:e})=>{for(const t of e.items)r(7,C[e.listName][t.name]=t.value,C)},$,m,g,w,h,function(e){_=e,r(2,_)},function(e){N=e,r(11,N)}]}class ro extends xe{constructor(e){var t;super(),Fi.getElementById("svelte-16mo2c-style")||((t=M("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",R(Fi.head,t)),Re(this,e,no,to,S,{required:27,disabled:0,readonly:28,id:29,item:4,value:1,refValue:26,currency:3,notifyList:2},[-1,-1])}}function io(e){let t,n;return{c(){t=M("span"),n=B(e[5]),z(t,"class","item")},m(e,r){x(e,t,r),R(t,n)},p(e,t){32&t[0]&&H(n,e[5])},d(e){e&&k(t)}}}function oo(e){let t,n,r,i=e[6]&&io(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new Ue({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Übernehmen"),z(t,"class","pointer feather svelte-1fuww0c")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[17]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=L(),o&&o.c(),n=F()},m(e,s){i&&i.m(e,s),x(e,t,s),o&&o.m(e,s),x(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=io(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),e[14]&&o.p(e,n)},i(e){r||($e(o),r=!0)},o(e){Ie(o),r=!1},d(e){i&&i.d(e),e&&k(t),o&&o.d(e),e&&k(n)}}}function so(e){let t,n,r;return n=new e[10]({props:{withItem:!0,itemLeft:!0,lang:e[11].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[9],step:e[12],pattern:e[7],placeholder:e[13],readonly:e[8],disabled:e[3],required:e[4],$$slots:{default:[oo]},$$scope:{ctx:e}}}),n.$on("change",e[15]),n.$on("focus",e[16]),{c(){t=M("div"),Ne(n.$$.fragment),q(t,"position","relative"),q(t,"max-width","10em")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};6&t[0]&&(r.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(r.id=e[0]),1&t[0]&&(r.name=e[0]),512&t[0]&&(r.value=e[9]),128&t[0]&&(r.pattern=e[7]),256&t[0]&&(r.readonly=e[8]),8&t[0]&&(r.disabled=e[3]),16&t[0]&&(r.required=e[4]),96&t[0]|256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function ao(e,t,r){const i=ee(),{TextField:o}=c;let{id:s}=t,{item:a}=t,{value:l}=t,{noForm:d=!1}=t,{classId:u}=t,{disabled:f}=t,{formnovalidate:h}=t,{currency:m}=t,{ownCurrency:p}=t,{praefix:g}=t,{notifyList:w}=t;const y=JSON.parse(n.getItem("Locale"));let v=m,$=["price","amount","amountValue","taxValue","total","__total"].find(e=>e===a.name?.split("-")[0])||a.properties?.currency;!1===a.properties?.currency&&($=!1),"owner.currency"===a.properties?.currency&&(v=p);const I=Number("1.1").toLocaleString(y.id).substring(1,2),{properties:_={}}=a;let{min:C,max:E,step:A,pattern:b,decimals:S=0,unit:N="",placeholder:T,hint:D,readonly:R,negative:x,required:k=!1,transfer:O}=_,M="";$&&(S=2),l=l?Number(l.toString().replace(",",".")):0,R=!0===R||void 0;const P=e=>function(e,t){return(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t)}(Number(e.toString()),S).replace(".",I);b||(b=S?`[0-9]+([${I}][0-9]{1,${S}})?`:"[0-9]*"),x&&(b="-?"+b);return e.$$set=e=>{"id"in e&&r(0,s=e.id),"item"in e&&r(19,a=e.item),"value"in e&&r(18,l=e.value),"noForm"in e&&r(1,d=e.noForm),"classId"in e&&r(2,u=e.classId),"disabled"in e&&r(3,f=e.disabled),"formnovalidate"in e&&r(20,h=e.formnovalidate),"currency"in e&&r(21,m=e.currency),"ownCurrency"in e&&r(22,p=e.ownCurrency),"praefix"in e&&r(23,g=e.praefix),"notifyList"in e&&r(24,w=e.notifyList)},e.$$.update=()=>{6815744&e.$$.dirty[0]&&m&&("owner.currency"===a.properties?.currency?r(5,v=p):r(5,v=m)),1048592&e.$$.dirty[0]&&r(4,k=k&&!h),262144&e.$$.dirty[0]&&(e=>{r(9,M=P((e||"0").toString().replace(",",".")))})(l),16777216&e.$$.dirty[0]&&(async()=>{const e=a.properties?.value?.formula;e?.operator&&i("formula",{item:a})})()},[s,d,u,f,k,v,$,b,R,M,o,y,A,T,O,({detail:e})=>{void 0!==g&&""!==g||i("formula",{item:a,value:e.value}),i("blur",{value:P(e.value)})},({detail:e})=>{R||+l||r(9,M="")},({detail:e})=>{const t=[].concat(O.target);if(void 0===g||""===g)for(const e of t)i("record",{itemName:e,value:l});else for(const e of t)i("listRecord",{itemName:e,decimals:a.properties?.decimals,value:l})},l,a,h,m,p,g,w]}class lo extends xe{constructor(e){var t;super(),document.getElementById("svelte-1fuww0c-style")||((t=M("style")).id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",R(document.head,t)),Re(this,e,ao,so,S,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:21,ownCurrency:22,praefix:23,notifyList:24},[-1,-1])}}const{document:co}=Ee;function uo(e){e[34]=e[36].list,e[35]=e[36].items}function fo(e,t,n){const r=e.slice();return r[37]=t[n],r[39]=n,r}function ho(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function mo(e,t,n){const r=e.slice();return r[40]=t[n],r}function po(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function go(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v;uo(e),n=new e[9]({props:{outline:!0,$$slots:{default:[wo]},$$scope:{ctx:e}}}),n.$on("click",e[31]);let $=!e[2]&&yo(e);function I(t){e[32](t)}let _={id:e[12]};void 0!==e[3]&&(_.value=e[3]),a=new e[7]({props:_}),re.push(()=>Se(a,"value",I)),a.$on("input",e[15]),u=new ot({props:{size:"18"}});let C=e[35]?.length&&function(e){let t,n,r,i,o=!e[2]&&$o(e),s=e[35],a=[];for(let t=0;t<s.length;t+=1)a[t]=Io(mo(e,s,t));return{c(){t=M("thead"),n=M("tr"),o&&o.c(),r=L();for(let e=0;e<a.length;e+=1)a[e].c();z(n,"class","svelte-1m010ne"),z(t,"class","svelte-1m010ne")},m(e,s){x(e,t,s),R(t,n),o&&o.m(n,null),R(n,r);for(let e=0;e<a.length;e+=1)a[e].m(n,null);i=!0},p(e,t){if(e[2]?o&&(ye(),Ie(o,1,1,()=>{o=null}),ve()):o?(o.p(e,t),4&t[0]&&$e(o,1)):(o=$o(e),o.c(),$e(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[35],r=0;r<s.length;r+=1){const i=mo(e,s,r);a[r]?a[r].p(i,t):(a[r]=Io(i),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=s.length}},i(e){i||($e(o),i=!0)},o(e){Ie(o),i=!1},d(e){e&&k(t),o&&o.d(),O(a,e)}}}(e),E=e[34]?.length&&function(e){let t,n,r=e[34],i=[];for(let t=0;t<r.length;t+=1)i[t]=bo(fo(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(1138717&n[0]){let s;for(r=e[34],s=0;s<r.length;s+=1){const o=fo(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=bo(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),$&&$.c(),i=L(),o=M("div"),s=B("Suchen: "),Ne(a.$$.fragment),c=L(),d=M("span"),Ne(u.$$.fragment),f=L(),h=M("div"),m=M("table"),C&&C.c(),p=L(),g=M("tbody"),E&&E.c(),z(t,"class","form--buttons svelte-1m010ne"),z(d,"class","feather pointer svelte-1m010ne"),q(o,"margin-bottom","1em"),q(o,"position","relative"),z(m,"striped",""),z(m,"class","svelte-1m010ne"),z(h,"class","eList svelte-1m010ne")},m(l,I){x(l,t,I),Te(n,t,null),R(t,r),$&&$.m(t,null),x(l,i,I),x(l,o,I),R(o,s),Te(a,o,null),R(o,c),R(o,d),Te(u,d,null),x(l,f,I),x(l,h,I),R(h,m),C&&C.m(m,null),R(m,p),R(m,g),E&&E.m(g,null),w=!0,y||(v=V(d,"click",e[17]),y=!0)},p(e,r){uo(e);const i={};16384&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?$&&(ye(),Ie($,1,1,()=>{$=null}),ve()):$?($.p(e,r),4&r[0]&&$e($,1)):($=yo(e),$.c(),$e($,1),$.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],ue(()=>l=!1)),a.$set(o),e[35]?.length&&C.p(e,r),e[34]?.length&&E.p(e,r)},i(e){w||($e(n.$$.fragment,e),$e($),$e(a.$$.fragment,e),$e(u.$$.fragment,e),$e(C),$e(E),w=!0)},o(e){Ie(n.$$.fragment,e),Ie($),Ie(a.$$.fragment,e),Ie(u.$$.fragment,e),Ie(C),Ie(E),w=!1},d(e){e&&k(t),De(n),$&&$.d(),e&&k(i),e&&k(o),De(a),De(u),e&&k(f),e&&k(h),C&&C.d(),E&&E.d(),y=!1,v()}}}function wo(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function yo(e){let t,n;return t=new e[9]({props:{disabled:!e[34].length,filled:!0,$$slots:{default:[vo]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[34])),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function vo(e){let t;return{c(){t=B("Bestätigen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function $o(e){let t,n,r,i,o;return n=new Ze({props:{size:"20"}}),{c(){t=M("th"),Ne(n.$$.fragment),z(t,"class","svelte-1m010ne")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[19](e[34])),i=!0)},p(t,n){e=t},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Io(e){let t,n,r=e[40]+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-1m010ne")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function _o(e){let t,n,r,i,o,s,a,l=e[0],c=Eo(e),d=e[35],u=[];for(let t=0;t<d.length;t+=1)u[t]=Ao(ho(e,d,t));return{c(){t=M("tr"),c.c(),n=L();for(let e=0;e<u.length;e+=1)u[e].c();r=L(),z(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),z(t,"title","übernimmt den Wert direkt"),z(t,"class","svelte-1m010ne"),G(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},m(i,l){x(i,t,l),c.m(t,null),R(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,r),o=!0,s||(a=V(t,"click",e[20](e[37])),s=!0)},p(s,a){if(e=s,1&a[0]&&S(l,l=e[0])?(ye(),Ie(c,1,1,_),ve(),c=Eo(e),c.c(),$e(c),c.m(t,n)):c.p(e,a),16400&a[0]){let n;for(d=e[35],n=0;n<d.length;n+=1){const i=ho(e,d,n);u[n]?u[n].p(i,a):(u[n]=Ao(i),u[n].c(),u[n].m(t,r))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!o||4&a[0]&&i!==(i=e[2]?"cursor: default;":"cursor: zoom-in;"))&&z(t,"style",i),16385&a[0]&&G(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},i(e){o||($e(c),o=!0)},o(e){Ie(c),o=!1},d(e){e&&k(t),c.d(e),O(u,e),s=!1,a()}}}function Co(e){let t,n,r;return n=new e[11]({props:{name:e[13],data:e[39],checked:e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]),round:!0}}),{c(){t=M("td"),Ne(n.$$.fragment),z(t,"title","Wählt den Wert aus"),z(t,"class","svelte-1m010ne")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};1&t[0]&&(r.checked=e[0].includes(Array.isArray(e[37])?e[37][0]:e[37])),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Eo(e){let t,n,r=!e[2]&&Co(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[2]?r&&(ye(),Ie(r,1,1,()=>{r=null}),ve()):r?(r.p(e,n),4&n[0]&&$e(r,1)):(r=Co(e),r.c(),$e(r,1),r.m(t.parentNode,t))},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Ao(e){let t,n,r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"";return{c(){t=M("td"),n=B(r),z(t,"class","svelte-1m010ne")},m(e,r){x(e,t,r),R(t,n)},p(e,t){16&t[0]&&r!==(r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"")&&H(n,r)},d(e){e&&k(t)}}}function bo(e){let t,n,r=e[16](e[37],e[3]),i=r&&_o(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){8&n[0]&&(r=e[16](e[37],e[3])),r?i?(i.p(e,n),8&n[0]&&$e(i,1)):(i=_o(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function So(e){let t,n;return t=new e[6]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function No(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:So,then:go,catch:po,value:36,blocks:[,,,]};return _e(e[14](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function To(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[No]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.title=e[1]||"Auswahl"),29&n[0]|16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Do(e,n,r){const i=ee(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:d,Checkbox:u}=c;let{classId:f}=n,{id:h}=n,{designation:m}=n,{selection:p}=n,{refDoc:g}=n,{tableName:w}=n,{idName:y}=n,{target:v}=n,{view:$}=n,{unique:I}=n,{uniqueView:_}=n,{status:C}=n,{single:E}=n;p||=[];let A="",b=f+Math.floor(9e3*Math.random()+1e3).toString()+"search",S=[];const N=w+y+v+"checkbox",T=(e,t)=>e>t?1:t>e?-1:0;Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(b)?.focus()},200)});return e.$$set=e=>{"classId"in e&&r(22,f=e.classId),"id"in e&&r(23,h=e.id),"designation"in e&&r(1,m=e.designation),"selection"in e&&r(0,p=e.selection),"refDoc"in e&&r(24,g=e.refDoc),"tableName"in e&&r(25,w=e.tableName),"idName"in e&&r(26,y=e.idName),"target"in e&&r(21,v=e.target),"view"in e&&r(27,$=e.view),"unique"in e&&r(28,I=e.unique),"uniqueView"in e&&r(29,_=e.uniqueView),"status"in e&&r(30,C=e.status),"single"in e&&r(2,E=e.single)},[p,m,E,A,S,i,o,s,a,l,d,u,b,N,async()=>{let e=[],n=[],i={};if(r(4,S=[]),y)if($){if(h){const n=f.split("-")[1].slice(0,-4),r="input."+f+"[name='_id']",o=document.querySelector(r).value;i={[y]:h},C&&(i.$or=[{status:!0},{[n]:o}]),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const r=e=>(e[n]||"z").toString()+e[v];return T(r(e),r(t))})}}else _?h&&(i={[y]:h,status:!0},Object.entries(_).map(([e,t])=>{t?.length&&(i[e]={$in:t}),n.push(e)}),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}),r(4,S=e.map(e=>{const t=[e[v]];return n.map(n=>t.push(e[n])),t}))):I?(e=await t.getSection(w,y,h,I),e=e.sort((e,t)=>T(e,t))):(e=await t.getSection(w,y,h,!1,C),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}));else i={},h&&!Array.isArray(h)&&(i._id=h),e=await t.getSectionView(w,i);const o=await t.getSchemaByClass(w),s=[];if(g){const t=o.items[0].name,n=o.items[1].name,i=o.list[0].name,s=e.find(e=>e[t]===g);e=s?s[i]:[],r(21,v=n)}let a;return e.map(e=>{let t=e[v];if(t||w!==v||(r(21,v=o.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(", ")),s.push(t||[])}else g&&(t=o.list[0].item.map(t=>e[t.name]||"")),s.push(t||[])}),a=g?o.list[0].item.map(e=>e.designation):[o.items.find(e=>e.name===v)?.designation],n=n.map(e=>o.items.find(t=>t.name===e)?.designation),{list:g?s:s.flat(),items:[...a,...n]}},({detail:{value:e}})=>{r(3,A=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,A="")},e=>()=>{const t=document.getElementsByName(N),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(N).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;E?i("choose",{list:[].concat(t)}):(r(0,p=p.includes(t)?p.filter(e=>e!==t):p.concat(t)),i("choose",{list:p}))}},v,f,h,g,w,y,$,I,_,C,()=>i("back"),function(e){A=e,r(3,A)}]}class Ro extends xe{constructor(e){var t;super(),co.getElementById("svelte-1m010ne-style")||((t=M("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}",R(co.head,t)),Re(this,e,Do,To,S,{classId:22,id:23,designation:1,selection:0,refDoc:24,tableName:25,idName:26,target:21,view:27,unique:28,uniqueView:29,status:30,single:2},[-1,-1])}}const{document:xo}=Ee;function ko(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=M("span"),n=B("("),r=B(s),i=B(")"),z(t,"class",o=T(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&H(r,s),2&n[0]&&o!==(o=T(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&z(t,"class",o)},d(e){e&&k(t)}}}function Oo(e){let t;return{c(){t=M("div"),z(t,"class","load-more-options"),z(t,"slot","load-more-options-message")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Mo(e){let t,n,r,i;const o=[Lo,Bo,Po],s=[];function a(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=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=F()},m(e,n){~t&&s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){~t&&s[t].d(e),e&&k(r)}}}function Po(e){let t,n,r,i,o;return n=new Ue({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Übernehmen"),z(t,"class","feather pointer svelte-1rbaejz")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[26]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Bo(e){let t,n,r,i,o;return n=new Je({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title",e[17].title||"Generieren"),z(t,"class","feather pointer svelte-1rbaejz")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[25]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Lo(e){let t,n,r,i,o;return n=new ot({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Löschen"),z(t,"class","feather pointer svelte-1rbaejz")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[27]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Fo(e){let t,n,r;function i(t){e[37](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Vo]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};53&r[0]|32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),!n&&1024&r[0]&&(n=!0,i.open=e[10],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function Vo(e){let t,n;return t=new Ro({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],designation:e[4].designation,target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.classId=e[2]),1&n[0]&&(r.selection=e[0]),16&n[0]&&(r.unique=e[16].unique&&e[4].name),32&n[0]&&(r.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(r.id=e[5][e[21]||e[20]]),16&n[0]&&(r.designation=e[4].designation),16&n[0]&&(r.target=e[4].name),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Uo(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&ko(e);function u(t){e[35](t)}function f(t){e[36](t)}let h={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:Wo,minSearchLength:"3",$$slots:{"load-more-options-message":[Oo]},$$scope:{ctx:e}};void 0!==e[7]&&(h.selection=e[7]),void 0!==e[9]&&(h.maxOptions=e[9]),r=new e[12]({props:h}),re.push(()=>Se(r,"selection",u)),re.push(()=>Se(r,"maxOptions",f)),r.$on("change",e[22]);let m=!e[1]&&Mo(e),p=e[10]&&Fo(e);return{c(){t=M("div"),d&&d.c(),n=L(),Ne(r.$$.fragment),s=L(),m&&m.c(),a=L(),p&&p.c(),l=F(),q(t,"position","relative")},m(e,i){x(e,t,i),d&&d.m(t,null),R(t,n),Te(r,t,null),R(t,s),m&&m.m(t,null),x(e,a,i),p&&p.m(e,i),x(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=ko(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const a={};8&s[0]&&(a.id=e[3]),8&s[0]&&(a.name=e[3]),8&s[0]&&(a.class=e[3]),2&s[0]&&(a.disabled=e[1]),64&s[0]&&(a.required=e[6]),256&s[0]&&(a.placeholder=e[8]),32768&s[1]&&(a.$$scope={dirty:s,ctx:e}),!i&&128&s[0]&&(i=!0,a.selection=e[7],ue(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],ue(()=>o=!1)),r.$set(a),e[1]?m&&(ye(),Ie(m,1,1,()=>{m=null}),ve()):m?(m.p(e,s),2&s[0]&&$e(m,1)):(m=Mo(e),m.c(),$e(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&$e(p,1)):(p=Fo(e),p.c(),$e(p,1),p.m(l.parentNode,l)):p&&(ye(),Ie(p,1,1,()=>{p=null}),ve())},i(e){c||($e(r.$$.fragment,e),$e(m),$e(p),c=!0)},o(e){Ie(r.$$.fragment,e),Ie(m),Ie(p),c=!1},d(e){e&&k(t),d&&d.d(),De(r),m&&m.d(),e&&k(a),p&&p.d(e),e&&k(l)}}}async function*Wo(e){yield[{name:e}]}function zo(e,n,r){const i=ee(),{Modal:o,Autocomplete:s}=c;let{classId:a}=n,{id:l}=n,{item:d}=n,{record:u}=n,{value:f}=n,{noForm:h=!1}=n,{disabled:m}=n,{formnovalidate:p}=n,{numberInput:g}=n,{praefix:w}=n,{toDelete:y}=n,{reqQuantity:v}=n,{notifyList:$}=n;const{properties:I={}}=d;let{placeholder:_,hint:C,readonly:E,required:A=!1,lookup:b="",view:S=!1,multi:N,max:T=1e3,generate:D=!1,status:R=!0,refDoc:x}=I;const[k,O]=b.split(":");let M=!1,P=f.map&&f.map(e=>({name:e}))||[];m||=E,m&&(_="");const B=({detail:e})=>{let t=[];e.value.map(e=>{const n=e.name?.split(",");t=t.concat(n)}),r(7,P=t.map(e=>({name:e.trim()})));const n=P.map(e=>e.name);i("blur",{value:n}),i("multi",{view:N.view,lookup:b,name:d.name,value:n})};Q(async()=>{i("multi",{view:N.view,lookup:b,name:d.name,value:f});const e=document.getElementById(l);e.classList.add(a),!E&&b&&e.addEventListener("focus",L)});const L=()=>{if(b){document.getElementById(l).blur();const e=v||T;(N.unique||P.length<e)&&r(10,M=!0)}},F=()=>{r(10,M&&=!1)},V=({detail:e})=>{const t=e.list.map(e=>Array.isArray(e)?e[0]:e);r(7,P=t.map(e=>({name:e}))),i("blur",{value:t}),i("multi",{view:N.view,lookup:b,name:d.name,value:t}),F()},U=async()=>{const e={[O]:u[O]},n=await t.getSectionView(k,e),r=Array.from({length:n.length},(e,t)=>n[t][d.name]);V({detail:{name:d.name,list:r}})},W=(e=!1)=>{if(m||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;r(9,T=!1!==e?e:v||u[t]||0);const n=P?.length!=T,o=document.getElementById(l);o?.classList?.toggle("invalid",n),i("invalid",{idx:w,value:n})};return e.$$set=e=>{"classId"in e&&r(2,a=e.classId),"id"in e&&r(3,l=e.id),"item"in e&&r(4,d=e.item),"record"in e&&r(5,u=e.record),"value"in e&&r(0,f=e.value),"noForm"in e&&r(28,h=e.noForm),"disabled"in e&&r(1,m=e.disabled),"formnovalidate"in e&&r(29,p=e.formnovalidate),"numberInput"in e&&r(30,g=e.numberInput),"praefix"in e&&r(31,w=e.praefix),"toDelete"in e&&r(32,y=e.toDelete),"reqQuantity"in e&&r(33,v=e.reqQuantity),"notifyList"in e&&r(34,$=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&r(7,P=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&r(7,P=u[d.name].map(e=>({name:e}))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&y&&y===d.name&&r(7,P=[]),128&e.$$.dirty[0]&&P&&(r(0,f=P.map&&P.map(e=>e.name)||[]),W()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===N.maxItem&&W(n)})(g),536870976&e.$$.dirty[0]&&r(6,A=A&&!p),8&e.$$.dirty[1]&&(async e=>{if(void 0===w)return;const{itemName:n,value:o}=e||{};if(o){if(d.refItem&&d.refItem?.split(".")[0]===n){let[e,n]=d.refItem.split(".");if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}if(d.refItem2&&d.refItem2?.split(".")[0]===n){let[e,n]=d.refItem2.split(".");if(Array.isArray(o))if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}setTimeout(W,250)}})($)},[f,m,a,l,d,u,A,P,_,T,M,o,s,E,b,S,N,D,R,x,k,O,B,F,V,()=>{const e=u[D.itemQuantity]||v;if(!e)return;const t=D.prefix||"",n=u[D.variable]||"",r=D.len||5,i=Array.from({length:e},(e,i)=>t+n+"-"+i.toString().padStart(r,"0"));V({detail:{name:d.name,list:i}})},async()=>{if(!0===S)return U();const e=v||u[N.maxItem];if(!e)return;let n={};O&&(n={[O]:u[O]}),R&&(n.status=!0);const r=[].concat(u[N.view]||[]);r.length&&(n[N.view]={$in:r});const i=await t.getSectionView(k,n),o=Array.from({length:e<i.length?e:i.length},(e,t)=>i[t][d.name]);V({detail:{name:d.name,list:o}})},()=>{V({detail:{name:d.name,list:[]}})},h,p,g,w,y,v,$,function(e){P=e,r(7,P),r(5,u),r(4,d),r(32,y)},function(e){T=e,r(9,T)},function(e){M=e,r(10,M)}]}class Ho extends xe{constructor(e){var t;super(),xo.getElementById("svelte-1rbaejz-style")||((t=M("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}",R(xo.head,t)),Re(this,e,zo,Uo,S,{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])}}function jo(e){let t,n,r;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function qo(e){let t,n,r,i,o;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[9]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Go(e){let t,n,r,i,o,s;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 a=[qo,jo],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}const Xo=e("getMapLink",async e=>{const{street:n,houseNo:r,postcode:i,location:o,country:s}=e,a=[n&&r?n+" "+r:n,i&&o?i+" "+o:i||o||"",s&&(await t.getTask("country",s)).designation].filter(e=>!!e).join(", ");return"https://bing.com/maps/default.aspx?where1="+encodeURIComponent(a)});function Yo(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{record:h}=t,{item:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"record"in e&&n(10,h=e.record),"item"in e&&n(11,m=e.item)},[i,o,s,a,l,d,u,f,r,async()=>{if(!f)return;const e=u.includes(".")?h[u.split(".")[0]]:h,t=await Xo(e);window.open(t,"_blank")},h,m,function(t){te(e,t)}]}class Zo extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,Yo,Go,S,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:Ko}=Ee;function Qo(e){let t;return{c(){t=M("div"),z(t,"class","load-more-options"),z(t,"slot","load-more-options-message")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Jo(e){let t,n,r;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-wpjws5")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function es(e){let t,n,r,i,o;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-wpjws5")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[8]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function ts(e){let t,n,r,i,o,s,a;function l(t){e[17](t)}function c(t){e[18](t)}function d(t){e[19](t)}let u={id:e[1],name:e[1],class:e[1],minSearchLength:"1",maxOptions:"1",getOptions:e[7],$$slots:{"load-more-options-message":[Qo]},$$scope:{ctx:e}};void 0!==e[0]&&(u.value=e[0]),void 0!==e[2]&&(u.selection=e[2]),void 0!==e[3]&&(u.searchQuery=e[3]),n=new e[4]({props:u}),re.push(()=>Se(n,"value",l)),re.push(()=>Se(n,"selection",c)),re.push(()=>Se(n,"searchQuery",d)),n.$on("change",e[6]);let f=e[5]&&function(e){let t,n,r,i;const o=[es,Jo],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),s=L(),f&&f.c(),q(t,"position","relative"),z(t,"class","inputAutoComplete")},m(e,r){x(e,t,r),Te(n,t,null),R(t,s),f&&f.m(t,null),a=!0},p(e,t){const s={};2&t[0]&&(s.id=e[1]),2&t[0]&&(s.name=e[1]),2&t[0]&&(s.class=e[1]),32&t[1]&&(s.$$scope={dirty:t,ctx:e}),!r&&1&t[0]&&(r=!0,s.value=e[0],ue(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],ue(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],ue(()=>o=!1)),n.$set(s),e[5]&&f.p(e,t)},i(e){a||($e(n.$$.fragment,e),$e(f),a=!0)},o(e){Ie(n.$$.fragment,e),Ie(f),a=!1},d(e){e&&k(t),De(n),f&&f.d()}}}function ns(e,t,n){const{Autocomplete:r}=c,i=ee();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:d}=t,{record:u}=t,{value:f}=t,{noForm:h=!1}=t,{disabled:m}=t,{formnovalidate:p}=t,{autocomplete:{input:g,min:w,url:y,output:v},format:$}=a.properties;y="https://openplzapi.org/";const I=[].concat(g),{name:_}=v,C="map"===$;let E,A=f,b=!1;Q(()=>{const e=document.querySelector("."+a.name+" .autocomplete input");e&&(e.addEventListener("focus",T),e.addEventListener("keyup",N),e.addEventListener("keydown",S));const t=document.getElementById(s);t&&t.classList.add(o)});const S=e=>{b=8===e.keyCode||32===e.keyCode},N=e=>{8===e.keyCode&&""===A&&n(0,f="")},T=async()=>{if(w){const e=I[0].name;if((d?u[d][e]:u[e]).length<w)return}const e=await D();if(e?.length)if(1===e.length){if(f.startsWith(e[0].name))return;n(3,A=n(0,f=e[0].name)),x(f)}else e.find(e=>(A||"").startsWith(e.name))||f||n(3,A=" ");else n(0,f=n(3,A=""))},D=async(e="")=>{const t=await(async()=>{const e=d?u[d].country:u.country;if(e){const t=await xp("country",e);if(t?.countryCode)return t.countryCode?.toLowerCase()}return"ch"})();let n="Streets";"postalCode"===I[0].refItem&&(n="Localities");const r=await fetch(y+t+"/"+n+"?"+R()+"&name=%5E"+e.trim());if(!r.ok)return;const i=r.headers.get("Content-Type").split(";")[0];let o=[];try{if("text/json"===i){const e=await r.text();o=JSON.parse(e||[])}else"application/json"===i&&(o=await r.json())}catch{}return o=o.filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t),o.map(e=>({name:e[_]}))},R=()=>I.map(({name:e,refItem:t})=>`${t}=${(d?u[d][e]:u[e]).split(" ")[0]}`).join("&"),x=e=>{i("blur",{value:e})};return e.$$set=e=>{"classId"in e&&n(9,o=e.classId),"id"in e&&n(1,s=e.id),"item"in e&&n(10,a=e.item),"name"in e&&n(11,l=e.name),"listName"in e&&n(12,d=e.listName),"record"in e&&n(13,u=e.record),"value"in e&&n(0,f=e.value),"noForm"in e&&n(14,h=e.noForm),"disabled"in e&&n(15,m=e.disabled),"formnovalidate"in e&&n(16,p=e.formnovalidate)},[f,s,E,A,r,C,({detail:{value:e}})=>{e.length&&n(3,A=n(0,f=e[0].name)),n(2,E=[]),x(f)},async function*(e){if(b||f&&e.startsWith(f))return n(0,f=e),void x(f);const t=await D(e);if(!t?.length)return n(0,f=e),void x(f);1===t.length?(n(3,A=n(0,f=t[0].name)),n(2,E=[]),x(f)):yield t},async()=>{if(!f)return;const e=l.includes(".")?u[l.split(".")[0]]:u,t=await Xo(e);window.open(t,"_blank")},o,a,l,d,u,h,m,p,function(e){f=e,n(0,f)},function(e){E=e,n(2,E)},function(e){A=e,n(3,A)}]}class rs extends xe{constructor(e){var t;super(),Ko.getElementById("svelte-wpjws5-style")||((t=M("style")).id="svelte-wpjws5-style",t.textContent=".feather.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:light-gray;margin-left:-2em}.inputAutoComplete .autocomplete .chip,.inputAutoComplete .autocomplete .shown-on-focus{display:none !important}",R(Ko.head,t)),Re(this,e,ns,ts,S,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:is}=Ee;function os(e){e[26]=e[28].list,e[27]=e[28].items}function ss(e,t,n){const r=e.slice();return r[29]=t[n],r}function as(e,t,n){const r=e.slice();return r[32]=t[n],r}function ls(e,t,n){const r=e.slice();return r[32]=t[n],r}function cs(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function ds(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[23](t)}os(e),n=new e[7]({props:{outline:!0,$$slots:{default:[us]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),re.push(()=>Se(s,"value",v)),s.$on("input",e[12]),d=new ot({props:{size:"18"}});let I=e[27]?.length&&function(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=fs(ls(e,r,t));return{c(){t=M("thead"),n=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();z(n,"class","svelte-14hcfjl"),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[27],o=0;o<r.length;o+=1){const s=ls(e,r,o);i[o]?i[o].p(s,t):(i[o]=fs(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&k(t),O(i,e)}}}(e),_=e[26]?.length&&function(e){let t,n=e[26],r=[];for(let t=0;t<n.length;t+=1)r[t]=ps(ss(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);x(e,t,n)},p(e,i){if(11779&i[0]){let o;for(n=e[26],o=0;o<n.length;o+=1){const s=ss(e,n,o);r[o]?r[o].p(s,i):(r[o]=ps(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){O(r,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),i=M("div"),o=B("Suchen: "),Ne(s.$$.fragment),l=L(),c=M("span"),Ne(d.$$.fragment),u=L(),f=M("div"),h=M("table"),I&&I.c(),m=L(),p=M("tbody"),_&&_.c(),z(t,"class","form--buttons svelte-14hcfjl"),z(c,"class","feather pointer svelte-14hcfjl"),q(i,"margin-bottom","1em"),q(i,"position","relative"),z(h,"striped",""),z(h,"class","svelte-14hcfjl"),z(f,"class","eList svelte-14hcfjl")},m(a,v){x(a,t,v),Te(n,t,null),x(a,r,v),x(a,i,v),R(i,o),Te(s,i,null),R(i,l),R(i,c),Te(d,c,null),x(a,u,v),x(a,f,v),R(f,h),I&&I.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=V(c,"click",e[14]),w=!0)},p(e,t){os(e);const r={};64&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ue(()=>a=!1)),s.$set(i),e[27]?.length&&I.p(e,t),e[26]?.length&&_.p(e,t)},i(e){g||($e(n.$$.fragment,e),$e(s.$$.fragment,e),$e(d.$$.fragment,e),g=!0)},o(e){Ie(n.$$.fragment,e),Ie(s.$$.fragment,e),Ie(d.$$.fragment,e),g=!1},d(e){e&&k(t),De(n),e&&k(r),e&&k(i),De(s),De(d),e&&k(u),e&&k(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function us(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function fs(e){let t,n,r=e[32]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function hs(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=ms(as(e,r,t));return{c(){t=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=L(),z(t,"class","pointer svelte-14hcfjl"),G(t,"active",e[29]._id===e[0])},m(e,r){x(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=as(e,r,s);i[s]?i[s].p(a,o):(i[s]=ms(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}2049&o[0]&&G(t,"active",e[29]._id===e[0])},d(e){e&&k(t),O(i,e)}}}function ms(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=M("td"),n=B(o),z(t,"class","svelte-14hcfjl")},m(o,s){x(o,t,s),R(t,n),r||(i=V(t,"click",W(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&k(t),r=!1,i()}}}function ps(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&hs(e);return{c(){r&&r.c(),t=F()},m(e,n){r&&r.m(e,n),x(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[29],e[27],e[1])),n?r?r.p(e,i):(r=hs(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&k(t)}}}function gs(e){let t,n;return t=new e[5]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ws(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:gs,then:ds,catch:cs,value:28,blocks:[,,,]};return _e(e[11](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function ys(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ws]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};3&n[0]|64&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function vs(e,n,i){const o=ee(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{className:h}=n,{classId:p}=n,{rowId:g}=n,{viewName:w}=n,{viewValue:v}=n,{recordId:$}=n,{filter:I}=n,_="",C=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const E=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?y(n):m(e[`_${t.name}`]||e[t.name]||"")},A=t.getSchemaByClass(h);Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(C)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await A;e.eventId===t.id&&kp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(15,f=e.item),"className"in e&&i(16,h=e.className),"classId"in e&&i(17,p=e.classId),"rowId"in e&&i(0,g=e.rowId),"viewName"in e&&i(18,w=e.viewName),"viewValue"in e&&i(19,v=e.viewValue),"recordId"in e&&i(20,$=e.recordId),"filter"in e&&i(21,I=e.filter)},[g,_,o,s,a,l,d,u,C,E,e=>()=>o("choose",{row:e}),async()=>{const e=await A,n="."+p+"#"+w;document.querySelector(n);let r={[w]:v},i=[];r[w]&&(i=await t.getSectionView(e.class,r,!0)),I&&(i=i.filter(e=>e._id!=I));const o=e.display;return{list:i,items:await tn(o,e,i)}},({detail:{value:e}})=>{i(1,_=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(E(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,_="")},f,h,p,w,v,$,I,()=>o("back"),function(e){_=e,i(1,_)}]}class $s extends xe{constructor(e){var t;super(),is.getElementById("svelte-14hcfjl-style")||((t=M("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}",R(is.head,t)),Re(this,e,vs,ys,S,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Is(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function _s(e){let t,n,r,i,o;function s(t){e[21](t)}let a={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]&&(a.value=e[0]),n=new e[10]({props:a}),re.push(()=>Se(n,"value",s));let l=!e[6]&&Cs(e);return{c(){t=M("div"),Ne(n.$$.fragment),i=L(),l&&l.c(),q(t,"position","relative")},m(e,r){x(e,t,r),Te(n,t,null),R(t,i),l&&l.m(t,null),o=!0},p(e,i){const o={};4&i&&(o.id=e[2]),8&i&&(o.name=e[3].name),34&i&&(o.inputClass=e[5]||e[1]),64&i&&(o.disabled=e[6]),128&i&&(o.formnovalidate=e[7]),!r&&1&i&&(r=!0,o.value=e[0],ue(()=>r=!1)),n.$set(o),e[6]?l&&(ye(),Ie(l,1,1,()=>{l=null}),ve()):l?(l.p(e,i),64&i&&$e(l,1)):(l=Cs(e),l.c(),$e(l,1),l.m(t,null))},i(e){o||($e(n.$$.fragment,e),$e(l),o=!0)},o(e){Ie(n.$$.fragment,e),Ie(l),o=!1},d(e){e&&k(t),De(n),l&&l.d()}}}function Cs(e){let t,n,r,i,o;return n=new Mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-wbrqzu")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[17]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Es(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function As(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[bs]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};268435994&r&&(i.$$scope={dirty:r,ctx:e}),!n&&256&r&&(n=!0,i.open=e[8],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function bs(e){let t,n;return t=new $s({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(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.item=e[3]),8&n&&(r.className=e[3].refClass),2&n&&(r.classId=e[1]),16&n&&(r.recordId=e[4]._id),512&n&&(r.viewValue=e[9]),16&n&&(r.filter=e[4]._id),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Ss(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Es,then:_s,catch:Is,value:27,blocks:[,,,]};_e(e[16](),i);let o=e[8]&&As(e);return{c(){i.block.c(),t=L(),o&&o.c(),n=F()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,x(e,t,s),o&&o.m(e,s),x(e,n,s),r=!0},p(t,[r]){Ce(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&$e(o,1)):(o=As(e),o.c(),$e(o,1),o.m(n.parentNode,n)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){r||($e(i.block),$e(o),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}Ie(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&k(t),o&&o.d(e),e&&k(n)}}}function Ns(e,t,n){const{TextField:r,Modal:i}=c;let{classId:o}=t,{id:s}=t,{item:a}=t,{record:l}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:f}=t,{formnovalidate:h}=t,{praefix:m}=t;const{properties:p={}}=a;let g,{pattern:w,placeholder:y,readonly:v,required:$=!1,view:I}=p,_=!1;const C=()=>{n(8,_=!1)};return e.$$set=e=>{"classId"in e&&n(1,o=e.classId),"id"in e&&n(2,s=e.id),"item"in e&&n(3,a=e.item),"record"in e&&n(4,l=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,f=e.disabled),"formnovalidate"in e&&n(7,h=e.formnovalidate),"praefix"in e&&n(20,m=e.praefix)},[d,o,s,a,l,u,f,h,_,g,r,i,w,v,$,I,async()=>(n(9,g=l[I.selection]),!0),()=>{n(8,_=!0)},({detail:e})=>{n(0,d=e.row[I.value?I.value:"_id"]),C()},C,m,function(e){d=e,n(0,d)},function(e){_=e,n(8,_)}]}class Ts extends xe{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=M("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",R(document.head,t)),Re(this,e,Ns,Ss,S,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Ds(e,t,n){const r=e.slice();return r[12]=t[n][0],r[13]=t[n][1],r}function Rs(e){let t;return{c(){t=M("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function xs(e){let t;return{c(){t=M("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function ks(e){let t,n,r,i,o=e[12]+"";return{c(){t=M("option"),n=B(o),t.__value=r=e[13],t.value=t.__value,t.selected=i=e[0]==e[13]},m(e,r){x(e,t,r),R(t,n)},p(e,s){64&s&&o!==(o=e[12]+"")&&H(n,o),64&s&&r!==(r=e[13])&&(t.__value=r,t.value=t.__value),65&s&&i!==(i=e[0]==e[13])&&(t.selected=i)},d(e){e&&k(t)}}}function Os(e){let t,n,r,i,o,s=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?xs:Rs}let r=n(e),i=r(e);return{c(){i.c(),t=F()},m(e,n){i.m(e,n),x(e,t,n)},p(e,o){r!==(r=n(e))&&(i.d(1),i=r(e),i&&(i.c(),i.m(t.parentNode,t)))},d(e){i.d(e),e&&k(t)}}}(e),a=e[6],l=[];for(let t=0;t<a.length;t+=1)l[t]=ks(Ds(e,a,t));return{c(){t=M("select"),s&&s.c(),n=F();for(let e=0;e<l.length;e+=1)l[e].c();z(t,"class",r=T(e[3]||e[4])+" svelte-5xpzvo"),z(t,"id",e[2]),z(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,a){x(r,t,a),s&&s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);i||(o=V(t,"change",e[9]),i=!0)},p(e,[n]){if(e[7]||s.p(e,n),65&n){let r;for(a=e[6],r=0;r<a.length;r+=1){const i=Ds(e,a,r);l[r]?l[r].p(i,n):(l[r]=ks(i),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=a.length}24&n&&r!==(r=T(e[3]||e[4])+" svelte-5xpzvo")&&z(t,"class",r),4&n&&z(t,"id",e[2]),4&n&&z(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:_,o:_,d(e){e&&k(t),s&&s.d(),O(l,e),i=!1,o()}}}function Ms(e,t,n){const r=ee();let{id:i}=t,{item:o}=t,{value:s}=t,{noForm:a=!1}=t,{classId:l}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:f,readonly:h}=o.properties;u&&(u=u.map(e=>[e,e])),"businessMonth"===f&&(s||=1,u=[["Januar",1],["Februar",2],["März",3],["April",4],["Mai",5],["Juni",6],["Juli",7],["August",8],["September",9],["Oktober",10],["November",11],["Dezember",12]]),"financialAccounting"===f&&(s||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===f&&(s||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!0===h,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,i=e.id),"item"in e&&n(10,o=e.item),"value"in e&&n(0,s=e.value),"noForm"in e&&n(3,a=e.noForm),"classId"in e&&n(4,l=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[s,c,i,a,l,d,u,f,h,e=>r("blur",{value:e.srcElement.value}),o]}class Ps extends xe{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=M("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}",R(document.head,t)),Re(this,e,Ms,Os,S,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function Bs(e){let t,n,r,i,o,s,a,l,c;i=new e[8]({props:{id:"dp-"+e[1]+(e[2]?"-"+e[2]:""),value:e[0],readonly:e[5],required:e[7],disabled:e[6],noCalendar:e[9],closeOnSelection:!0}}),i.$on("change",e[11]);let d=e[10]&&function(e){let t,n,r,i,o;return n=new Ue({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Übernehmen"),z(t,"class","pointer feather")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[12]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}(e);return{c(){t=M("input"),r=L(),Ne(i.$$.fragment),o=L(),d&&d.c(),s=F(),z(t,"type","string"),z(t,"class",n=e[3]||e[4]),z(t,"id",e[1]),z(t,"name",e[1]),t.hidden=!0},m(n,u){x(n,t,u),j(t,e[0]),x(n,r,u),Te(i,n,u),x(n,o,u),d&&d.m(n,u),x(n,s,u),a=!0,l||(c=V(t,"input",e[18]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&z(t,"class",n),(!a||2&r)&&z(t,"id",e[1]),(!a||2&r)&&z(t,"name",e[1]),1&r&&j(t,e[0]);const o={};6&r&&(o.id="dp-"+e[1]+(e[2]?"-"+e[2]:"")),1&r&&(o.value=e[0]),32&r&&(o.readonly=e[5]),128&r&&(o.required=e[7]),64&r&&(o.disabled=e[6]),i.$set(o),e[10]&&d.p(e,r)},i(e){a||($e(i.$$.fragment,e),$e(d),a=!0)},o(e){Ie(i.$$.fragment,e),Ie(d),a=!1},d(e){e&&k(t),e&&k(r),De(i,e),e&&k(o),d&&d.d(e),e&&k(s),l=!1,c()}}}let Ls=new Map;function Fs(e,n,r){const i=ee(),{DatePicker:o}=c;let{value:s}=n,{id:a}=n,{item:l}=n,{record:d}=n,{praefix:u}=n,{noForm:f=!1}=n,{classId:h}=n,{eventId:m}=n,{readonly:p}=n,{disabled:g}=n,{required:w}=n,{notifyList:y}=n,{dateInput:v}=n;s||(s=void 0);let $=null;const I=(void 0===u?"":u.toString())+"-"+m+"-"+l.name,_=l.properties?.noCalendar||!1,C=l.properties?.transfer,E=({detail:e})=>{try{r(0,s=Yr(e.value,s)),void 0!==u&&""!==u&&Ls.set(I,new Date(s.valueOf())),A(s)}catch{r(0,s=void 0)}},A=e=>{i("change",{value:new Date(e.valueOf())})};if(void 0!==u&&!s){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);s=Yr(t,s)}return e.$$set=e=>{"value"in e&&r(0,s=e.value),"id"in e&&r(1,a=e.id),"item"in e&&r(13,l=e.item),"record"in e&&r(14,d=e.record),"praefix"in e&&r(2,u=e.praefix),"noForm"in e&&r(3,f=e.noForm),"classId"in e&&r(4,h=e.classId),"eventId"in e&&r(15,m=e.eventId),"readonly"in e&&r(5,p=e.readonly),"disabled"in e&&r(6,g=e.disabled),"required"in e&&r(7,w=e.required),"notifyList"in e&&r(16,y=e.notifyList),"dateInput"in e&&r(17,v=e.dateInput)},e.$$.update=()=>{if(1&e.$$.dirty&&s&&!C&&Ls.has(I)&&r(0,s=Ls.get(I)),65536&e.$$.dirty&&(async e=>{if(null===$){const e=(await t.getEvent(m)).output.class[0].item;$=e.find(e=>e.properties?.value?.formula)}$&&$.properties.value.formula.argument[0].refItem===l.name&&(e&&e.itemName!==l.name&&!$.properties.value.formula.argument[1].value&&e.itemName!==$.properties.value.formula.argument[1].refItem.split(".")[0]||i("formula",{item:$}))})(y),131072&e.$$.dirty&&((e={})=>{let{ref:t,val:n,t:r,l:i,n:o}=e;if(o&&(n=o),!n||isNaN(new Date(n)))return;if(r)return;if(!t)return;const[s,a]=t.split(".");s===i&&a===l.name&&null!=u&&E({detail:{value:new Date(n)}})})(v),24673&e.$$.dirty&&d&&d[l.name])try{g||p||r(0,s=Yr(d[l.name],s))}catch{}},[s,a,u,f,h,p,g,w,o,_,C,E,()=>{i("record",{target:C.target,value:s.toISOString()})},l,d,m,y,v,function(){s=this.value,r(0,s),r(14,d),r(13,l),r(6,g),r(5,p)}]}class Vs extends xe{constructor(e){super(),Re(this,e,Fs,Bs,S,{value:0,id:1,item:13,record:14,praefix:2,noForm:3,classId:4,eventId:15,readonly:5,disabled:6,required:7,notifyList:16,dateInput:17})}}function Us(e){let t;return{c(){t=B("Stunden")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Ws(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[Us]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function zs(e){let t;return{c(){t=B("Minuten")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Hs(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[zs]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function js(e){let t;return{c(){t=B("Jetzt")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function qs(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[js]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Gs(e){let t,n,r,i,o,s,a,l,c;return i=new e[5]({props:{value:e[0],closeOnSelection:!0}}),i.$on("change",e[8]),s=new e[6]({props:{value:e[0],$$slots:{"now-label":[qs],"minutes-label":[Hs],"hours-label":[Ws]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=M("input"),r=L(),Ne(i.$$.fragment),o=L(),Ne(s.$$.fragment),z(t,"type","string"),z(t,"class",n=e[2]||e[3]),z(t,"id",e[1]),z(t,"name",e[1]),t.hidden=!0},m(n,d){x(n,t,d),j(t,e[0]),x(n,r,d),Te(i,n,d),x(n,o,d),Te(s,n,d),a=!0,l||(c=V(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&z(t,"class",n),(!a||2&r)&&z(t,"id",e[1]),(!a||2&r)&&z(t,"name",e[1]),1&r&&j(t,e[0]);const o={};1&r&&(o.value=e[0]),i.$set(o);const l={};1&r&&(l.value=e[0]),4096&r&&(l.$$scope={dirty:r,ctx:e}),s.$set(l)},i(e){a||($e(i.$$.fragment,e),$e(s.$$.fragment,e),a=!0)},o(e){Ie(i.$$.fragment,e),Ie(s.$$.fragment,e),a=!1},d(e){e&&k(t),e&&k(r),De(i,e),e&&k(o),De(s,e),l=!1,c()}}}function Xs(e,t,n){const r=ee(),{Label:i,DatePicker:o,TimePicker:s}=c;let{value:a}=t,{id:l}=t,{noForm:d=!1}=t,{classId:u}=t;const f=e=>r("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,a=e.value),"id"in e&&n(1,l=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[a,l,d,u,i,o,s,({detail:e})=>{var t,r;n(0,(t=e.value,r=a,a=null==t||null==r?t:(r.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r))),f(a)},({detail:e})=>{n(0,a=Yr(e.value,a)),f(a)},function(){a=this.value,n(0,a)}]}class Ys extends xe{constructor(e){super(),Re(this,e,Xs,Gs,S,{value:0,id:1,noForm:2,classId:3})}}function Zs(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g;return u=new e[9]({props:{format:e[7],required:e[3],disabled:e[4],value:e[5],noCalendar:e[10],closeOnSelection:!0}}),u.$on("change",e[11]),h=new e[9]({props:{format:e[8],required:e[3],disabled:e[4],value:e[6],noCalendar:e[10],class:"moveLeft",closeOnSelection:!0}}),h.$on("change",e[12]),{c(){t=M("input"),o=L(),s=M("input"),d=L(),Ne(u.$$.fragment),f=B(" /\n"),Ne(h.$$.fragment),z(t,"type","string"),z(t,"class",n=e[1]||e[2]),z(t,"id",r=e[0]+"_from"),z(t,"name",i=e[0]+"_from"),t.hidden=!0,z(s,"type","string"),z(s,"class",a=e[1]||e[2]),z(s,"id",l=e[0]+"_to"),z(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){x(n,t,r),j(t,e[5]),x(n,o,r),x(n,s,r),j(s,e[6]),x(n,d,r),Te(u,n,r),x(n,f,r),Te(h,n,r),m=!0,p||(g=[V(t,"input",e[15]),V(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&z(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&z(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&z(t,"name",i),32&o&&j(t,e[5]),(!m||6&o&&a!==(a=e[1]||e[2]))&&z(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&z(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&z(s,"name",c),64&o&&j(s,e[6]);const d={};128&o&&(d.format=e[7]),8&o&&(d.required=e[3]),16&o&&(d.disabled=e[4]),32&o&&(d.value=e[5]),u.$set(d);const f={};256&o&&(f.format=e[8]),8&o&&(f.required=e[3]),16&o&&(f.disabled=e[4]),64&o&&(f.value=e[6]),h.$set(f)},i(e){m||($e(u.$$.fragment,e),$e(h.$$.fragment,e),m=!0)},o(e){Ie(u.$$.fragment,e),Ie(h.$$.fragment,e),m=!1},d(e){e&&k(t),e&&k(o),e&&k(s),e&&k(d),De(u,e),e&&k(f),De(h,e),p=!1,A(g)}}}function Ks(e,t,n){const r=ee(),{DatePicker:i}=c;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:d}=t,{required:u}=t,{disabled:f}=t;const{noCalendar:h,preset:m}=a.properties||{};let p,g,w="%d.%m.%Y",y="%d.%m.%Y";return e.$$set=e=>{"value"in e&&n(13,o=e.value),"id"in e&&n(0,s=e.id),"item"in e&&n(14,a=e.item),"noForm"in e&&n(1,l=e.noForm),"classId"in e&&n(2,d=e.classId),"required"in e&&n(3,u=e.required),"disabled"in e&&n(4,f=e.disabled)},e.$$.update=()=>{if(8304&e.$$.dirty&&o){if((o?.from||o?.to)&&(n(5,p=o?.from),n(6,g=o?.to)),m){const{first:e,last:t}=function(e){const t=new Date;let n=t.getFullYear();const r=t.getMonth();let i,o;switch(t.getDate(),e){case"currentMonth":i=o=r;break;case"currentYear":i=0,o=i+11;break;case"lastSemiYear":i=r<6?6:0,o=i+5,i>5&&--n;break;case"lastQuarter":i=r<3?9:r<6?0:r<9?3:6,o=i+2,i>8&&--n;break;case"lastMonth":i=o=0===r?11:r-1,11===i&&--n;break;default:i=0,o=i+11,--n}return{first:new Date(n,i,1),last:new Date(n,o+1,0)}}(m);e&&!p&&n(5,p=e),t&&!g&&n(6,g=t)}"Invalid Date"===p?.toString()&&n(5,p=void 0),"Invalid Date"===g?.toString()&&n(6,g=void 0),f&&(n(7,w=void 0===p?"":"%d.%m.%Y"),n(8,y=void 0===g?"":"%d.%m.%Y"))}},[s,l,d,u,f,p,g,w,y,i,h,({detail:e})=>{n(5,p=Yr(e.value,p)),g&&p&&g.valueOf()-p.valueOf()<0&&n(5,p=void 0),n(13,o.from=p,o),r("change",{value:p,range:"_from"})},({detail:e})=>{n(6,g=Yr(e.value,g)),g&&p&&g.valueOf()-p.valueOf()<0&&n(6,g=void 0),n(13,o.to=g,o),r("change",{value:g,range:"_to"})},o,a,function(){p=this.value,n(5,p),n(13,o),n(6,g),n(4,f)},function(){g=this.value,n(6,g),n(13,o),n(5,p),n(4,f)}]}class Qs extends xe{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=M("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",R(document.head,t)),Re(this,e,Ks,Zs,S,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var Js={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function ea(e){return ea="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},ea(e)}function ta(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return na(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return na(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ra={normalizePrecision:function(e){var t=e.reduce(function(e,t){return Math.max(e.getPrecision(),t.getPrecision())});return e.map(function(e){return e.getPrecision()!==t?e.convertPrecision(t):e})},minimum:function(e){var t=ta(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.lessThan(e)?i:e}),i},maximum:function(e){var t=ta(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function ia(e){return!isNaN(parseInt(e))&&isFinite(e)}function oa(e){return e%2==0}function sa(e){return ia(e)&&!Number.isInteger(e)}function aa(e){return Math.abs(e)%1==.5}function la(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(n,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?n(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",e,!0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n])}(i,t.headers),i.send()})}function ca(e){return void 0===e}function da(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n={};return Object.entries(e).forEach(function(e){if("object"===ea(e[1])){var r=da(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function ua(){var e=function(e,t){var n=function(e){return Math.pow(10,function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)},t={HALF_ODD:function(e){var t=Math.round(e);return aa(e)&&oa(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return aa(e)?oa(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return aa(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return aa(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return aa(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(t,n){return sa(t)||sa(n)?e(t,n):t*n},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(e){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](e)}}}var fa=ua();function ha(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,r){return(i=e.endpoint,!Boolean(i)||"object"!==ea(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return la(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,r):e.endpoint).then(function(i){return da(i)[t(e.propertyPath,{from:n,to:r})]});var i}}}function ma(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function pa(e){ma(function(e){return ia(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function ga(e){ma(Number.isInteger(e),"You must provide an integer.",TypeError)}var wa=ua(),ya=Object.assign(function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,i=n.currency,o=n.precision;ga(r),ga(o);var s=e.globalLocale,a=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),u=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},f=function(e){ma(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(e){return u.call(this,{locale:e})},getPrecision:function(){return o},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;ga(e);var n=this.getPrecision(),r=e>n,i=r?wa.multiply:wa.divide,o=r?[e,n]:[n,e],s=Math.pow(10,wa.subtract.apply(wa,o));return u.call(this,{amount:wa.round(i(this.getAmount(),s),t),precision:e})},add:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:wa.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:wa.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:wa.round(wa.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:wa.round(wa.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return pa(e),this.multiply(wa.divide(e,100),t)},allocate:function(e){var t=this;!function(e){ma(function(e){return e.length>0&&e.every(function(e){return e>=0})&&e.some(function(e){return e>0})}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce(function(e,t){return wa.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(wa.divide(wa.multiply(t.getAmount(),e),n));return r=wa.subtract(r,i),u.call(t,{amount:i})}),o=0;r>0;)e[o]>0&&(i[o]=i[o].add(u.call(this,{amount:1})),r=wa.subtract(r,1)),o+=1;return i},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,i=void 0===r?d.endpoint:r,o=n.propertyPath,s=void 0===o?d.propertyPath||"rates.{{to}}":o,a=n.headers,c=void 0===a?d.headers:a,f=n.roundingMode,h=void 0===f?l:f,m=Object.assign({},{endpoint:i,propertyPath:s,headers:c,roundingMode:h});return ha(m).getExchangeRate(this.getCurrency(),e).then(function(n){return ma(!ca(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:wa.round(wa.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==wa.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==wa.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=function(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter(function(e){return!ca(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return ca(this.getMatches().find(e))?0:this.getMatches()[fa.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find(function(e){return"USD"===e||"dollar"===e||"$"===e})]},getStyle:function(){return ca(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ca(this.getMatches().find(function(e){return","===e}))}}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:a);return this.toRoundedUnit(t.getMinimumFractionDigits(),e).toLocaleString(this.getLocale(),{currencyDisplay:t.getCurrencyDisplay(),useGrouping:t.getUseGrouping(),minimumFractionDigits:t.getMinimumFractionDigits(),style:t.getStyle(),currency:this.getCurrency()})},toUnit:function(){return wa.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,n=Math.pow(10,e);return wa.divide(wa.round(wa.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Js,ra),va={},$a={};!function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+(t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",r=new RegExp("^"+n+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,n){if(t){const r=Object.keys(t),i=r.length;for(let o=0;o<i;o++)e[r[o]]="strict"===n?[t[r[o]]]:t[r[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(e){const t=r.exec(e);return!(null==t)},e.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const i=[];i.startIndex=t.lastIndex-r[0].length;const o=r.length;for(let e=0;e<o;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n},e.nameRegexp=n}($a);const Ia=$a,_a={allowBooleanAttributes:!1,unpairedTags:[]};function Ca(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ea(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return xa("InvalidXml","XML declaration allowed only at the start of the document.",Ma(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Aa(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}va.validate=function(e,t){t=Object.assign({},_a,t);const n=[];let r=!1,i=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=Ea(e,o),o.err)return o}else{if("<"!==e[o]){if(Ca(e[o]))continue;return xa("InvalidChar","char '"+e[o]+"' is not expected.",Ma(e,o))}{let s=o;if(o++,"!"===e[o]){o=Aa(e,o);continue}{let a=!1;"/"===e[o]&&(a=!0,o++);let l="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)l+=e[o];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),o--),!Oa(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",xa("InvalidTag",t,Ma(e,o))}const c=Na(e,o);if(!1===c)return xa("InvalidAttr","Attributes for '"+l+"' have open quote.",Ma(e,o));let d=c.value;if(o=c.index,"/"===d[d.length-1]){const n=o-d.length;d=d.substring(0,d.length-1);const i=Da(d,t);if(!0!==i)return xa(i.err.code,i.err.msg,Ma(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return xa("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Ma(e,o));if(d.trim().length>0)return xa("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Ma(e,s));if(0===n.length)return xa("InvalidTag","Closing tag '"+l+"' has not been opened.",Ma(e,s));{const t=n.pop();if(l!==t.tagName){let n=Ma(e,t.tagStartPos);return xa("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",Ma(e,s))}0==n.length&&(i=!0)}}else{const a=Da(d,t);if(!0!==a)return xa(a.err.code,a.err.msg,Ma(e,o-d.length+a.err.line));if(!0===i)return xa("InvalidXml","Multiple possible root nodes found.",Ma(e,o));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:s}),r=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=Aa(e,o);continue}if("?"!==e[o+1])break;if(o=Ea(e,++o),o.err)return o}else if("&"===e[o]){const t=Ra(e,o);if(-1==t)return xa("InvalidChar","char '&' is not expected.",Ma(e,o));o=t}else if(!0===i&&!Ca(e[o]))return xa("InvalidXml","Extra text at the end",Ma(e,o));"<"===e[o]&&o--}}}return r?1==n.length?xa("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Ma(e,n[0].tagStartPos)):!(n.length>0)||xa("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):xa("InvalidXml","Start tag expected.",1)};const ba='"',Sa="'";function Na(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===ba||e[t]===Sa)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}const Ta=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Da(e,t){const n=Ia.getAllMatches(e,Ta),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return xa("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Pa(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return xa("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Pa(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return xa("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Pa(n[e]));const i=n[e][2];if(!ka(i))return xa("InvalidAttr","Attribute '"+i+"' is an invalid name.",Pa(n[e]));if(r.hasOwnProperty(i))return xa("InvalidAttr","Attribute '"+i+"' is repeated.",Pa(n[e]));r[i]=1}return!0}function Ra(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function xa(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function ka(e){return Ia.isName(e)}function Oa(e){return Ia.isName(e)}function Ma(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Pa(e){return e.startIndex+e[1].length}var Ba={};const La={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};Ba.buildOptions=function(e){return Object.assign({},La,e)},Ba.defaultOptions=La;var Fa=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}};const Va=$a;function Ua(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const r=e[t++];let i="";for(;t<e.length&&e[t]!==r;t++)i+=e[t];return[n,i,t]}function Wa(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function za(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function Ha(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function ja(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function qa(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function Ga(e){if(Va.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var Xa=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,i=!1,o=!1,s="";for(;t<e.length;t++)if("<"!==e[t]||o)if(">"===e[t]){if(o?"-"===e[t-1]&&"-"===e[t-2]&&(o=!1,r--):r--,0===r)break}else"["===e[t]?i=!0:s+=e[t];else{if(i&&za(e,t))t+=7,[entityName,val,t]=Ua(e,t+1),-1===val.indexOf("&")&&(n[Ga(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&Ha(e,t))t+=8;else if(i&&ja(e,t))t+=8;else if(i&&qa(e,t))t+=9;else{if(!Wa)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const Ya=/^[-+]?0x[a-fA-F0-9]+$/,Za=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Ka={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var Qa=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1};const Ja=$a,el=Fa,tl=Xa,nl=function(e,t={}){if(t=Object.assign({},Ka,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if(t.hex&&Ya.test(n))return Number.parseInt(n,16);{const r=Za.exec(n);if(r){const i=r[1],o=r[2];let s=function(e){if(e&&-1!==e.indexOf("."))return"."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e;return e}(r[3]);const a=r[4]||r[6];if(!t.leadingZeros&&o.length>0&&i&&"."!==n[2])return e;if(!t.leadingZeros&&o.length>0&&!i&&"."!==n[1])return e;{const r=Number(n),l=""+r;return-1!==l.search(/[eE]/)||a?t.eNotation?r:e:-1!==n.indexOf(".")?"0"===l&&""===s||l===s||i&&l==="-"+s?r:e:o?s===l||i+s===l?r:e:n===l||n===i+l?r:e}}return e}},rl=Qa;function il(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function ol(e,t,n,r,i,o,s){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){s||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,i,o);if(null==r)return e;if(typeof r!=typeof e||r!==e)return r;if(this.options.trimValues)return wl(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?wl(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function sl(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const al=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function ll(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=Ja.getAllMatches(e,al),r=n.length,i={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let o=n[e][4],s=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[s]=null==e?o:typeof e!=typeof o||e!==o?e:wl(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[s]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const cl=function(e){e=e.replace(/\r\n?/g,"\n");const t=new el("!xml");let n=t,r="",i="";for(let o=0;o<e.length;o++){if("<"===e[o])if("/"===e[o+1]){const t=ml(e,">",o,"Closing Tag is not closed.");let s=e.substring(o+2,t).trim();if(this.options.removeNSPrefix){const e=s.indexOf(":");-1!==e&&(s=s.substr(e+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(r=this.saveTextToParentTag(r,n,i));const a=i.substring(i.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=i.lastIndexOf("."),i=i.substring(0,l),n=this.tagsNodeStack.pop(),r="",o=t}else if("?"===e[o+1]){let t=pl(e,o,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,i),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new el(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,i,t.tagName)),this.addChild(n,e,i)}o=t.closeIndex+1}else if("!--"===e.substr(o+1,3)){const t=ml(e,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=e.substring(o+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=t}else if("!D"===e.substr(o+1,2)){const t=tl(e,o);this.docTypeEntities=t.entities,o=t.i}else if("!["===e.substr(o+1,2)){const t=ml(e,"]]>",o,"CDATA is not closed.")-2,s=e.substring(o+9,t);r=this.saveTextToParentTag(r,n,i);let a=this.parseTextData(s,n.tagname,i,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,a),o=t+2}else{let s=pl(e,o,this.options.removeNSPrefix),a=s.tagName;const l=s.rawTagName;let c=s.tagExp,d=s.attrExpPresent,u=s.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,i,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==t.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(e,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,t=n.tagContent}const r=new el(a);a!==c&&d&&(r[":@"]=this.buildAttributesMap(c,i,a)),t&&(t=this.parseTextData(t,a,i,!0,d,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,i)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new el(a);a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),i=i.substr(0,i.lastIndexOf("."))}else{const e=new el(a);this.tagsNodeStack.push(n),a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),n=e}r="",o=u}}else r+=e[o]}return t.child};function dl(e,t,n){const r=this.options.updateTag(t.tagname,n,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}const ul=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function fl(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function hl(e,t,n){const r="*."+n;for(const n in e){const i=e[n];if(r===i||t===i)return!0}return!1}function ml(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function pl(e,t,n,r=">"){const i=function(e,t,n=">"){let r,i="";for(let o=t;o<e.length;o++){let t=e[o];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:i,index:o};if(e[o+1]===n[1])return{data:i,index:o}}else"\t"===t&&(t=" ");i+=t}}(e,t+1,r);if(!i)return;let o=i.data;const s=i.index,a=o.search(/\s/);let l=o,c=!0;-1!==a&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const d=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==i.data.substr(e+1))}return{tagName:l,tagExp:o,closeIndex:s,attrExpPresent:c,rawTagName:d}}function gl(e,t,n){const r=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const o=ml(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(i--,0===i))return{tagContent:e.substring(r,n),i:o};n=o}else if("?"===e[n+1]){n=ml(e,"?>",n+1,"StopNode is not closed.")}else if("!--"===e.substr(n+1,3)){n=ml(e,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===e.substr(n+1,2)){n=ml(e,"]]>",n,"StopNode is not closed.")-2}else{const r=pl(e,n,">");if(r){(r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex}}}function wl(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:nl(e,n))}return Ja.isExist(e)?e:""}var yl=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=il,this.parseXml=cl,this.parseTextData=ol,this.resolveNameSpace=sl,this.buildAttributesMap=ll,this.isItStopNode=hl,this.replaceEntitiesValue=ul,this.readStopNodeData=gl,this.saveTextToParentTag=fl,this.addChild=dl,this.ignoreAttributesFn=rl(this.options.ignoreAttributes)}},vl={};function $l(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=Il(s);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=s[a]:r+=""+s[a];else{if(void 0===a)continue;if(s[a]){let e=$l(s[a],t,l);const n=Cl(e,t);s[":@"]?_l(e,s[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==i[a]&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(e)):t.isArray(a,l,n)?i[a]=[e]:i[a]=e}}}return"string"==typeof r?r.length>0&&(i[t.textNodeName]=r):void 0!==r&&(i[t.textNodeName]=r),i}function Il(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function _l(e,t,n,r){if(t){const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++){const o=i[s];r.isArray(o,n+"."+o,!0,!0)?e[o]=[t[o]]:e[o]=t[o]}}}function Cl(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}vl.prettify=function(e,t){return $l(e,t)};const{buildOptions:El}=Ba,Al=yl,{prettify:bl}=vl,Sl=va;var Nl=class{constructor(e){this.externalEntities={},this.options=El(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=Sl.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Al(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:bl(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};function Tl(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=Dl(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];xl(c,t)||(e=t.tagValueProcessor(l,e),e=kl(e,t)),o&&(i+=r),i+=e,o=!1;continue}if(l===t.cdataPropName){o&&(i+=r),i+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,o=!1;continue}if(l===t.commentPropName){i+=r+`\x3c!--${a[l][0][t.textNodeName]}--\x3e`,o=!0;continue}if("?"===l[0]){const e=Rl(a[":@"],t),n="?xml"===l?"":r;let s=a[l][0][t.textNodeName];s=0!==s.length?" "+s:"",i+=n+`<${l}${s}${e}?>`,o=!0;continue}let d=r;""!==d&&(d+=t.indentBy);const u=r+`<${l}${Rl(a[":@"],t)}`,f=Tl(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":f&&0!==f.length||!t.suppressEmptyNode?f&&f.endsWith(">")?i+=u+`>${f}${r}</${l}>`:(i+=u+">",f&&""!==r&&(f.includes("/>")||f.includes("</"))?i+=r+t.indentBy+f+r:i+=f,i+=`</${l}>`):i+=u+"/>",o=!0}return i}function Dl(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(e.hasOwnProperty(r)&&":@"!==r)return r}}function Rl(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=kl(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function xl(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function kl(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const Ol=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Tl(e,t,"",n)},Ml=Qa,Pl={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Bl(e){this.options=Object.assign({},Pl,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ml(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Vl),this.processTextOrObjNode=Ll,this.options.format?(this.indentate=Fl,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Ll(e,t,n,r){const i=this.j2x(e,n+1,r.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function Fl(e){return this.options.indentBy.repeat(e)}function Vl(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Bl.prototype.build=function(e){return this.options.preserveOrder?Ol(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},Bl.prototype.j2x=function(e,t,n){let r="",i="";const o=n.join(".");for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(void 0===e[s])this.isAttribute(s)&&(i+="");else if(null===e[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,"",t);else if("object"!=typeof e[s]){const n=this.isAttribute(s);if(n&&!this.ignoreAttributesFn(n,o))r+=this.buildAttrPairStr(n,""+e[s]);else if(!n)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,""+e[s]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const r=e[s].length;let o="",a="";for(let l=0;l<r;l++){const r=e[s][l];if(void 0===r);else if(null===r)"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof r)if(this.options.oneListGroup){const e=this.j2x(r,t+1,n.concat(s));o+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else o+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),o+=e}else o+=this.buildTextValNode(r,s,"",t)}this.options.oneListGroup&&(o=this.buildObjectNode(o,s,a,t)),i+=o}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],""+e[s][t[i]])}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},Bl.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},Bl.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,o="";return"?"===t[0]&&(o="?",i=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===o.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+o+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+"<"+t+n+o+">"+e+i}},Bl.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},Bl.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+i+"</"+t+this.tagEndChar}},Bl.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};for(var Ul={XMLParser:Nl,XMLValidator:va,XMLBuilder:Bl},Wl=[],zl=0;zl<256;++zl)Wl.push((zl+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class Hl extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class jl extends Hl{constructor(e){super(e)}}class ql extends Hl{constructor(e){super(e)}}const Gl=e=>e.Id.IBAN?{iban:e.Id.IBAN}:{...e.Id?.Othr?.Id&&{accountNumber:String(e.Id.Othr.Id)},...e.Nm&&{name:e.Nm},...e.Ccy&&{currency:e.Ccy}},Xl=e=>{if(e){if(e.FinInstnId?.BIC)return{bic:e.FinInstnId.BIC};if(e.FinInstnId?.BICFI)return{bic:e.FinInstnId.BICFI};if(e.FinInstnId){const t=e.FinInstnId.Othr?.Id||e.FinInstnId.ClrSysMmbId?.MmbId;if(t)return{abaRoutingNumber:t.toString()}}}},Yl=(e,t="USD")=>{const n=ya({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},Zl=e=>{const t=e.DtTm||e.Dt;return new Date(t)},Kl=e=>{const t=e.Id.toString(),n=e.ElctrncSeqNb,r=e.LglSeqNb,i=new Date(e.CreDtTm);let o,s;e.FrToDt&&(o=new Date(e.FrToDt.FrDtTm),s=new Date(e.FrToDt.ToDtTm));const a=e.TxsSummry?.TtlNtries.NbOfNtries,l=e.TxsSummry?.TtlNtries.Sum,c=e.TxsSummry?.TtlNtries.TtlNetNtryAmt;let d;c&&(d=Yl(c));const u=e.TxsSummry?.TtlCdtNtries.NbOfNtries,f=e.TxsSummry?.TtlCdtNtries.Sum,h=e.TxsSummry?.TtlDbtNtries.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries.Sum,p=Gl(e.Acct),g=Xl(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(Ql):e.Bal&&(w=[Ql(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map(Jl):e.Ntry&&(y=[Jl(e.Ntry)]),{id:t,electronicSequenceNumber:n,legalSequenceNumber:r,creationDate:i,fromDate:o,toDate:s,account:p,agent:g,numOfEntries:a,sumOfEntries:l,netAmountOfEntries:d,numOfCredits:u,sumOfCredits:f,numOfDebits:h,sumOfDebits:m,balances:w,entries:y}},Ql=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=Yl(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:Zl(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},Jl=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=Zl(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=Yl(o,s),l=e.BkTxCd.Prtry?.Cd,c=(e=>{if(e)return Array.isArray(e)?e.join("\n"):e})(e.AddtlNtryInf),d=e.AcctSvcrRef,u=tc(e.BkTxCd);let f=e.NtryDtls||[];Array.isArray(f)||(f=[f]);return{referenceId:t,creditDebitIndicator:n,bookingDate:r,reversal:i,amount:a,currency:s,proprietaryCode:l,transactions:f.map(e=>{let t=e.TxDtls||[];return Array.isArray(t)||(t=[t]),t.map(ec)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},ec=e=>{const t=e.Refs?.MsgId,n=e.Refs?.AcctSvcrRef,r=e.Refs?.PmtInfId,i=e.RmtInf?.Ustrd,o=e.Purp?.Prtry,s=e.RtrInf?.Rsn,a=e.RtrInf?.AddtlInf,l=e.Refs?.EndToEndId,c=e.Amt["@_Ccy"],d=e.Amt["#text"],u=e.RmtInf?.Strd?.CdtrRefInf?.Ref?.toString(),f=e.RmtInf?.Strd?.AddtlRmtInf;let h,m,p,g,w,y,v,$;return e.RltdPties?.Dbtr&&(m=e.RltdPties.Dbtr.Nm||e.RltdPties.Dbtr.Pty?.Nm),e.RltdPties?.DbtrAcct&&(p=Gl(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=Xl(e.RltdAgts.DbtrAgt)),(m||p||g)&&(h={name:m,account:p,agent:g}),e.RltdPties?.Cdtr&&(y=e.RltdPties.Cdtr.Nm||e.RltdPties.Cdtr.Pty?.Nm),e.RltdPties?.CdtrAcct&&(v=Gl(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&($=Xl(e.RltdAgts.CdtrAgt)),(y||v||$)&&(w={name:y,account:v,agent:$}),{messageId:t,accountServicerReferenceId:n,endToEndId:l,currency:c,amount:d,paymentInformationId:r,remittanceInformation:i,proprietaryPurpose:o,returnReason:s,returnAdditionalInformation:a,debtor:h,creditor:w,invoiceRef:u,invoiceRefAdd:f}},tc=e=>{const t=e?.Domn?.Cd,n=e?.Domn?.Fmly?.Cd,r=e?.Domn?.Fmly?.SubFmlyCd,i=e.Prtry?.Cd,o=e.Prtry?.Issr;return{domainCode:t,domainFamilyCode:n,domainSubFamilyCode:r,proprietaryCode:i,proprietaryCodeIssuer:o}};class nc{_messageId;_creationDate;_recipient;_statements;constructor(e){this._messageId=e.messageId,this._creationDate=e.creationDate,this._recipient=e.recipient,this._statements=e.statements}static getParser(){return new Ul.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=nc.getParser().parse(e);if(!t.Document)throw new jl("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new ql("Invalid CAMT.053 namespace");const n=t.Document.BkToCstmrStmt,r=n.GrpHdr.CreDtTm,i=new Date(r);let o=[];o=Array.isArray(n.Stmt)?n.Stmt.map(e=>Kl(e)):[Kl(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new nc({messageId:n.GrpHdr.MsgId.toString(),creationDate:i,recipient:s?(a=s,{id:a.Id?.OrgId?.Othr?.Id,name:a.Nm}):void 0,statements:o});var a}get balances(){return this._statements.flatMap(e=>e.balances)}get transactions(){return this._statements.flatMap(e=>e.entries).flatMap(e=>e.transactions)}get entries(){return this._statements.flatMap(e=>e.entries)}get messageId(){return this._messageId}get recipient(){return this._recipient}get creationDate(){return this._creationDate}get statements(){return this._statements}}function rc(e){let t,n,r,i,o;function s(t){e[17](t)}let a={class:e[0],id:e[1],name:e[2],accept:"text/xml",max:"1",beforeChange:e[13]};return void 0!==e[3]&&(a.files=e[3]),t=new e[7]({props:a}),re.push(()=>Se(t,"files",s)),t.$on("change",e[12]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ne(t.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,n){Te(t,e,n),x(e,r,n),Te(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ue(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(i.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(r),De(i,e)}}}function ic(e){let t,n;return t=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.inputClass=e[0]),2&n&&(r.id=e[1]),2&n&&(r.name=e[1]),16&n&&(r.value=e[4]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function oc(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[sc]},$$scope:{ctx:e}}}),{c(){t=M("div"),Ne(n.$$.fragment),q(t,"margin-top","1em")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};1073741888&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function sc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=B(e[6]),n=L(),Ne(r.$$.fragment)},m(e,o){x(e,t,o),x(e,n,o),Te(r,e,o),i=!0},p(e,n){(!i||64&n)&&H(t,e[6])},i(e){i||($e(r.$$.fragment,e),i=!0)},o(e){Ie(r.$$.fragment,e),i=!1},d(e){e&&k(t),e&&k(n),De(r,e)}}}function ac(e){let t,n,r,i,o;const s=[ic,rc],a=[];t=function(e){return e[11]?0:1}(e),n=a[t]=s[t](e);let l=e[5]&&oc(e);return{c(){n.c(),r=L(),l&&l.c(),i=F()},m(e,n){a[t].m(e,n),x(e,r,n),l&&l.m(e,n),x(e,i,n),o=!0},p(e,[t]){n.p(e,t),e[5]?l?(l.p(e,t),32&t&&$e(l,1)):(l=oc(e),l.c(),$e(l,1),l.m(i.parentNode,i)):l&&(ye(),Ie(l,1,1,()=>{l=null}),ve())},i(e){o||($e(n),$e(l),o=!0)},o(e){Ie(n),Ie(l),o=!1},d(e){a[t].d(e),e&&k(r),l&&l.d(e),e&&k(i)}}}function lc(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=c,l=ee();let{classId:d}=n,{eventId:u}=n,{record:f}=n,{item:h}=n,{id:m}=n,{name:p}=n;const g="camt53"===h.properties?.type;let w=[],y=f[h.name]||"",v=!!f._id,$=!1,I="In Verarbeitung!";const _=async(e,n,r,i,o,s)=>{try{if("debit"!==e)return"";if(n)return"";let a;if(r&&(a=await t.getSectionView("creditPayment",{creditPaymentId:r.split(".")[0]})),a?.length){let e=a[0].listBill.find(e=>i&&e.reference.replaceAll(" ","")===i);if(!e&&s&&(e=a[0].listBill.find(e=>e.iban.replaceAll(" ","")===s&&+e.amount==+o)),e)return e.bill}}catch{}return""},C=async(e,n,r,i,o,s,a=[])=>{try{if("credit"!==e)return"";let i,o=N(n);if(o.startsWith("R-")||(o=""),!o&&r&&(r=r.toString(),o=N(r.replaceAll(" ","")),o.startsWith("R-")||(o=""),!o&&r.includes("R-"))){o="R-"+r.split("R-")[1].slice(0,8)}const l=+Number.parseFloat(+s-.04).toFixed(2),c=+Number.parseFloat(+s+.04).toFixed(2);if(o&&(i=await t.getSectionView("invoice",{invoiceId:o}),i?.length)){const e=i[0];if(!a.find(t=>t.invoice==e._id)&&e.__total>=l&&e.__total<=c)return e._id}}catch{}return""},E=async(e,n,r)=>{try{if(!e)return;const n=await t.getSectionView("incomingPayment",{invoice:e});if(!n?.length)return;const i=n[0];return r===i._total&&i._id}catch{}},A=async e=>{try{if(!e)return;const n=await t.getSectionView("outgoingPayment",{bill:e});if(n?.length)return n[0]._id}catch{}},b=async e=>{try{const n=await t.getSectionView("accountingPlan",{iban:e});if(n?.length)return n[0]._id}catch{}return""},S=async(e,n)=>{try{const i=n.output.class[0].list,o=await(async e=>{if(!e.includes("xsd:camt.053"))return;let t;try{t=nc.fromXML(e)}catch(e){console.log("error",e)}return t})(e);if(!o||!o.messageId)return r(6,I="Das ist keine camt53 Datei!"),void r(5,$=!0);const s=await t.getSectionView("dailyJournal",{messageId:o.messageId});if(s?.length)return r(6,I="Bereits eingelesen!"),void r(5,$=!0);o._saldo=o.balances[1].amount/100,o._saldoDate_from=o.balances[0].date,o._saldoDate_to=o.balances[1].date;let a=!0;for(const e of n.output.class[0].item.filter(e=>e.properties?.source)){let t=o[e.properties.source];if(e.properties?.required&&!t){a=!1;break}if("dateRange"===e.type){const t=o[e.properties.source+"_from"],n=o[e.properties.source+"_to"];l("record",{itemName:e.name+"_from",value:t}),l("record",{itemName:e.name+"_to",value:n});continue}"[object Date]"===Object.prototype.toString.call(t)&&(t=new Date(t)),l("record",{itemName:e.name,value:t})}if(!a)return r(6,I="Ungültiger Inhalt!"),void r(5,$=!0);l("record",{itemName:"status",value:"offen"}),await Promise.all(i.map(async e=>await(async(e,t,n)=>{if(f._id)return;if(!e.process)return;n.output.class[0].name;const i=e.process.target;if(!i)return;r(6,I="In Verarbeitung!"),r(5,$=!0);const o=[],s=[],{refItem:a,value:c}=e.process.filter;for(const n of t[e.source]){const t=await b(n.account?.iban);for(const r of n.entries){if(r[a]!==c)continue;let l="SALA"===r.bankTransactionCode?.domainSubFamilyCode,d=!1;for(const a of r.transactions){let c=await C(r.creditDebitIndicator,a.invoiceRef,a.remittanceInformation,e.process.creditor,a.debtor,a.amount,s),u=await E(c,r.bookingDate,a.amount);!1===u&&(c=void 0,u=void 0);const f=await _(r.creditDebitIndicator,l,a.paymentInformationId,a.invoiceRef,a.amount,a.creditor?.account?.iban),h=await A(f),m="",p="",g={accountServicerReferenceId:a.accountServicerReferenceId,messageId:a.messageId,account:n.account.iban,accountDebit:t,creditDebitIndicator:r.creditDebitIndicator,bookingDate:r.bookingDate,amount:a.amount,currency:a.currency,debtor:a.debtor?.name||"",debtorAccount:a.debtor?.account?.iban||"",creditor:a.creditor?.name||"",creditorAccount:a.creditor?.account?.iban||"",paymentInformationId:a.paymentInformationId,invoiceRef:a.invoiceRef,invoiceRefAdd:a.invoiceRefAdd,remittanceInformation:a.remittanceInformation,returnAdditionalInformation:a.returnAdditionalInformation,additionalInformation:r.additionalInformation,invoice:c,incomingPayment:u,payDebtorAvis:p,isSalary:l,bill:f,outgoingPayment:h,journalFinAcc:m};if(l){if(d)continue;g.amount=r.amount/100,d=!0}g[i]?o.push(g):s.push(g)}}}o.length&&l("record",{itemName:e.name,value:o}),s.length&&l("record",{itemName:"open"+e.name,value:s})})(e,o,n))),setTimeout(()=>{l("saveFull"),r(5,$=!1)},2e3)}catch{r(6,I="Ungültiger Inhalt!"),r(5,$=!0)}},N=e=>{try{if(!e?.length)return"";if(e.length<14)return"";const t=e.replaceAll(" ","").slice(-14),n=t.slice(-8),r=t.slice(0,4);let i="";for(let e=0;e<r.length/2;e++){const t=2*e,n=r.substring(t,t+2);i+=String.fromCharCode(n)}return i+n}catch{}return""};return e.$$set=e=>{"classId"in e&&r(0,d=e.classId),"eventId"in e&&r(14,u=e.eventId),"record"in e&&r(15,f=e.record),"item"in e&&r(16,h=e.item),"id"in e&&r(1,m=e.id),"name"in e&&r(2,p=e.name)},e.$$.update=()=>{8&e.$$.dirty&&(w.length||r(5,$=!1))},[d,m,p,w,y,$,I,i,o,s,a,v,async()=>{const{list:e}=h.properties,n=w[0],i=await t.getEvent(u);if(n){r(4,y=n.name);const t=await n.text();if(g)return await S(t,i);const o=(e=>{var t={toObj:function(e){var n={};if(1==e.nodeType){if(e.attributes.length)for(var r=0;r<e.attributes.length;r++)n["@"+e.attributes[r].nodeName]=(e.attributes[r].nodeValue||"").toString();if(e.firstChild){for(var i=0,o=0,s=!1,a=e.firstChild;a;a=a.nextSibling)1==a.nodeType?s=!0:3==a.nodeType&&a.nodeValue.match(/[^ \f\n\r\t\v]/)?i++:4==a.nodeType&&o++;if(s)if(i<2&&o<2)for(t.removeWhite(e),a=e.firstChild;a;a=a.nextSibling)3==a.nodeType?n["#text"]=t.escape(a.nodeValue):4==a.nodeType?n["#cdata"]=t.escape(a.nodeValue):n[a.nodeName]?n[a.nodeName]instanceof Array?n[a.nodeName][n[a.nodeName].length]=t.toObj(a):n[a.nodeName]=[n[a.nodeName],t.toObj(a)]:n[a.nodeName]=t.toObj(a);else e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(i)e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(o)if(o>1)n=t.escape(t.innerXml(e));else for(a=e.firstChild;a;a=a.nextSibling)n["#cdata"]=t.escape(a.nodeValue)}e.attributes.length||e.firstChild||(n=null)}else 9==e.nodeType&&(n=t.toObj(e.documentElement));return n},toJson:function(e,n,r){var i=n?'"'+n+'"':"";if(e instanceof Array){for(var o=0,s=e.length;o<s;o++)e[o]=t.toJson(e[o],"",r+"\t");i+=(n?":[":"[")+(e.length>1?"\n"+r+"\t"+e.join(",\n"+r+"\t")+"\n"+r:e.join(""))+"]"}else if(null==e)i+=(n&&":")+"null";else if("object"==typeof e){var a=[];for(var l in e)a[a.length]=t.toJson(e[l],l,r+"\t");i+=(n?":{":"{")+(a.length>1?"\n"+r+"\t"+a.join(",\n"+r+"\t")+"\n"+r:a.join(""))+"}"}else i+="string"==typeof e?(n&&":")+'"'+e.toString()+'"':(n&&":")+e.toString();return i},innerXml:function(e){var t="";if("innerHTML"in e)t=e.innerHTML;else for(var n=function(e){var t="";if(1==e.nodeType){t+="<"+e.nodeName;for(var r=0;r<e.attributes.length;r++)t+=" "+e.attributes[r].nodeName+'="'+(e.attributes[r].nodeValue||"").toString()+'"';if(e.firstChild){t+=">";for(var i=e.firstChild;i;i=i.nextSibling)t+=n(i);t+="</"+e.nodeName+">"}else t+="/>"}else 3==e.nodeType?t+=e.nodeValue:4==e.nodeType&&(t+="<![CDATA["+e.nodeValue+"]]>");return t},r=e.firstChild;r;r=r.nextSibling)t+=n(r);return t},escape:function(e){return e.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(e){e.normalize();for(var n=e.firstChild;n;)if(3==n.nodeType)if(n.nodeValue.match(/[^ \f\n\r\t\v]/))n=n.nextSibling;else{var r=n.nextSibling;e.removeChild(n),n=r}else 1==n.nodeType?(t.removeWhite(n),n=n.nextSibling):n=n.nextSibling;return e}};return e=(new window.DOMParser).parseFromString(e,"text/xml"),t.toObj(t.removeWhite(e))})(t),s=[],a=o.BkToCstmrDbtCdtNtfctn.Ntfctn,c=[].concat(a.Ntry);for(const e of c){let t=[].concat(e.NtryDtls.TxDtls);for(const n of t){const t=n.RmtInf?.Strd?.CdtrRefInf?.Ref||n.Refs.EndToEndId||"",r={date:e.ValDt.Dt,branchName:n.RltdPties?.Dbtr?.Nm||"",amount:n.AmtDtls?.TxAmt?.Amt["#text"]||n.Amt["#text"],reference:t,invoiceId:N(t),information:n.RmtInf?.Ustrd||""};s.push(r)}}s.length&&l("record",{itemName:e,value:s})}},()=>{r(3,w)},u,f,h,function(e){w=e,r(3,w)}]}class cc extends xe{constructor(e){var t;super(),document.getElementById("svelte-157hlzf-style")||((t=M("style")).id="svelte-157hlzf-style",t.textContent="label.file-dropzone{margin-top:0 !important}",R(document.head,t)),Re(this,e,lc,ac,S,{classId:0,eventId:14,record:15,item:16,id:1,name:2})}}const dc=e=>{const t={},n=e.replaceAll("\r","").split("\n");return n?(t.iban=n[3],t.supplierText=n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9],t.supplier={company:{}},t.supplier.company.companyName=n[5],t.supplier.company.postcode=n[8],t.amount=n[18],t.amountOrg=n[18],t.currency={},t.currency.designation=n[19],t.reference=n[28],t.additionalInfo=n[29],t.extReference=uc(10,n[31]),t.amountVat=fc(!0,uc(32,n[31]),t.amount)||fc(!1,uc(33,n[31]),t.amount),t):t},uc=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},fc=(e,t,n)=>{if(!t)return"";let r=0;if(t.includes(":")){const n=t.split(";");for(const t of n){const[n,i]=t.split(":");r+=e?i/100*n:i}}else r=+n/(+t+100)*+t;return r},{document:hc}=Ee;function mc(e){let t,n,r,i,o;function s(t){e[14](t)}let a={class:e[0],id:e[1],name:e[2],accept:"application/pdf",max:"1",beforeChange:e[10]};return void 0!==e[3]&&(a.files=e[3]),t=new e[5]({props:a}),re.push(()=>Se(t,"files",s)),t.$on("change",e[8]),i=new e[6]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ne(t.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,n){Te(t,e,n),x(e,r,n),Te(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ue(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(i.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(r),De(i,e)}}}function pc(e){let t,n,r,i;n=new e[6]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}});let o=e[4]&&gc(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),q(t,"position","relative")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),16&r&&(i.value=e[4]),n.$set(i),e[4]?o?(o.p(e,r),16&r&&$e(o,1)):(o=gc(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function gc(e){let t,n,r,i,o;return n=new Me({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-o0hiko")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[9]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function wc(e){let t,n,r,i;const o=[pc,mc],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}let yc;function vc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=ee();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,m=[],p=d[u.name]||"",g=!!d._id;const w={scale:{once:!1,value:3,start:3,step:.4,stop:4},resultOpts:{singleCodeInPage:!0,multiCodesInPage:!1,maxCodesInPage:1},improve:!0,jsQR:{}};var y=async function(e){if(!e.success)return;const n=await t.getSchema(l),i=e.codes?.filter(e=>!!e)?.at(0);if(!i?.length)return;if(!i.startsWith("SPC"))return;const o=dc(i);for(const e in o){if(n.items.find(t=>t.name===e)){if("object"==typeof o[e]){let n={};for(const i in o[e])if("object"==typeof o[e][i])for(const s in o[e][i]){o[e][i][s]&&(n[s]=o[e][i][s]);const a=await t.getSectionView(i,n);if(a?.length){const n=await t.getSectionView(e,{[i]:a[0]._id});n?.length&&r(11,d[e]=n[0]._id,d)}}else{o[e][i]&&(n[i]=o[e][i]);const s=await t.getSectionView(e,n);s?.length&&r(11,d[e]=s[0]._id,d)}}else o[e]&&r(11,d[e]=o[e],d);s("record",{itemName:e,value:d[e]})}}};return Q(()=>{if(yc)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){yc=PDF_QR_JS}}),J(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(12,l=e.eventId),"record"in e&&r(11,d=e.record),"item"in e&&r(13,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name)},[a,f,h,m,p,i,o,g,async e=>{const n=m[0];if(!n){s("record",{itemName:"$file",value:!1});const e=await t.getSchema(l);for(const t of e.items)s("record",{itemName:t.name,value:""});return}const i=URL.createObjectURL(n);r(4,p=n.name),s("record",{itemName:"$file",value:{fileName:p,file:n}}),yc.decodeDocument(i,w,y)},async()=>{if(!d?._id)return;const e=await t.getTaskByDocId(d._id,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;let r="/viewer/doc/index.html?file="+("/api/userreport/"+n[0]._id)+"&type=pdf";window.open(r,"","popup=yes toolbar=no width=800 height=1024")},()=>{r(3,m)},d,l,u,function(e){m=e,r(3,m)}]}class $c extends xe{constructor(e){var t;super(),hc.getElementById("svelte-o0hiko-style")||((t=M("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(hc.head,t)),Re(this,e,vc,wc,S,{classId:0,eventId:12,record:11,item:13,id:1,name:2})}}const{document:Ic}=Ee;function _c(e){let t,n,r,i,o;function s(t){e[18](t)}let a={class:e[0],id:e[1],name:e[2],accept:e[3],max:"1",beforeChange:e[12]};return void 0!==e[4]&&(a.files=e[4]),t=new e[7]({props:a}),re.push(()=>Se(t,"files",s)),t.$on("change",e[9]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[5]}}),{c(){Ne(t.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,n){Te(t,e,n),x(e,r,n),Te(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),8&r&&(o.accept=e[3]),!n&&16&r&&(n=!0,o.files=e[4],ue(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),32&r&&(s.value=e[5]),i.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(i.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(r),De(i,e)}}}function Cc(e){let t,n,r,i;n=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[5]}});let o=e[5]&&Ec(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),q(t,"position","relative")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),32&r&&(i.value=e[5]),n.$set(i),e[5]?o?(o.p(e,r),32&r&&$e(o,1)):(o=Ec(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function Ec(e){let t,n,r,i,o;const s=[bc,Ac],a=[];function l(e,n){return 32&n&&(t=!!e[5].endsWith(".mp4")),t?0:1}return n=l(e,-1),r=a[n]=s[n](e),{c(){r.c(),i=F()},m(e,t){a[n].m(e,t),x(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):(ye(),Ie(a[o],1,1,()=>{a[o]=null}),ve(),r=a[n],r?r.p(e,t):(r=a[n]=s[n](e),r.c()),$e(r,1),r.m(i.parentNode,i))},i(e){o||($e(r),o=!0)},o(e){Ie(r),o=!1},d(e){a[n].d(e),e&&k(i)}}}function Ac(e){let t,n,r,i,o;return n=new Me({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-o0hiko")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[10]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function bc(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:Tc,then:Nc,catch:Sc,value:23};return _e(e[11](),n),{c(){t=F(),n.block.c()},m(e,r){x(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){Ce(n,e=t,r)},i:_,o:_,d(e){e&&k(t),n.block.d(e),n.token=null,n=null}}}function Sc(e){return{c:_,m:_,p:_,d:_}}function Nc(e){let t,n,r,i;return{c(){t=M("video"),n=M("source"),i=B("\n Your browser does not support HTML video."),n.src!==(r=e[23])&&z(n,"src",r),z(n,"type","video/mp4"),z(t,"width","500"),t.controls=!0,q(t,"margin-top","1em")},m(e,r){x(e,t,r),R(t,n),R(t,i)},p:_,d(e){e&&k(t)}}}function Tc(e){return{c:_,m:_,p:_,d:_}}function Dc(e){let t,n,r,i;const o=[Cc,_c],s=[];function a(e,t){return e[6]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,[i]){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function Rc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=ee();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,{praefix:m}=n,{recordId:p}=n,{fileType:g="application/pdf"}=n,w=[],y="",v=!1;return Q(()=>{(async()=>{if(!p)return;const e=await t.getTaskByDocId(p,!0);if(!e)return s("listRecord",{itemName:"fileName",value:"",string:!0});const n=d[u.name];if(!n)return s("listRecord",{itemName:"fileName",value:"",string:!0});const i=await t.getUserReports(e._id);if(!i?.length)return s("listRecord",{itemName:"fileName",value:"",string:!0});let o=i.find(e=>e.fileName===n);if(!o)return s("listRecord",{itemName:"fileName",value:"",string:!0});r(5,y=o.fileName),r(6,v=void 0===m?!!p:!!y)})()}),J(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(13,l=e.eventId),"record"in e&&r(14,d=e.record),"item"in e&&r(15,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name),"praefix"in e&&r(16,m=e.praefix),"recordId"in e&&r(17,p=e.recordId),"fileType"in e&&r(3,g=e.fileType)},[a,f,h,g,w,y,v,i,o,async e=>{const t=w[0];URL.createObjectURL(t),r(5,y=t.name),s("record",{itemName:"$file",value:{fileName:y,file:t}}),void 0!==m&&s("listRecord",{itemName:"fileName",value:y,string:!0})},async()=>{if(!p)return;let e;const n=await t.getTaskByDocId(p,!0);if(!n)return;const r=await t.getUserReports(n._id);if(!r?.length)return;let i=r.find(e=>e.fileName===y);i||(i=r[0]);e="/viewer/doc/index.html?file="+("/api/userreport/"+i._id)+"&type=pdf",window.open(e,"","popup=yes toolbar=no width=800 height=1024")},async()=>{const e=await t.getTaskByDocId(p,!0);if(!e)return"";const n=await t.getUserReports(e._id);if(!n?.length)return"";let r=n.find(e=>e.fileName===y);return r||(r=n[0]),"/api/userreport/"+r._id},()=>{r(4,w)},l,d,u,m,p,function(e){w=e,r(4,w)}]}class xc extends xe{constructor(e){var t;super(),Ic.getElementById("svelte-o0hiko-style")||((t=M("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(Ic.head,t)),Re(this,e,Rc,Dc,S,{classId:0,eventId:13,record:14,item:15,id:1,name:2,praefix:16,recordId:17,fileType:3})}}function kc(e){let t,n,r;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:Oc,placeholder:Mc,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=M("div"),Ne(n.$$.fragment),q(t,"max-width","4em")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,[t]){const r={};4&t&&(r.inputClass=e[2]),1&t&&(r.id=e[0]),1&t&&(r.name=e[0]),2&t&&(r.value=e[1]),8&t&&(r.readonly=e[3]),16&t&&(r.disabled=e[4]),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}const Oc="([01][0-9]|2[0-3]):([0-5][0-9])",Mc="";function Pc(e,t,n){const r=ee(),{TextField:i}=c;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:d}=t,{disabled:u}=t,{praefix:f}=t;const h=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,o=e.id),"item"in e&&n(7,s=e.item),"value"in e&&n(1,a=e.value),"inputClass"in e&&n(2,l=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,f=e.praefix)},[o,a,l,d,u,i,({detail:e})=>{r("blur",{value:h(e.value)}),r("checkRange",{idx:f,fieldId:o,value:e.value})},s,f]}class Bc extends xe{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=M("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",R(document.head,t)),Re(this,e,Pc,kc,S,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Lc}=Ee;function Fc(e,t,n){const r=e.slice();return r[22]=t[n],r}function Vc(e,t,n){const r=e.slice();return r[25]=t[n],r[27]=n,r}function Uc(e){let t,n,r=e[3](e[22],e[25])+"",i=e[27]&&function(){let e;return{c(){e=B(", ")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}();return{c(){t=M("span"),i&&i.c(),n=B(r),z(t,"class","lookupValue")},m(e,r){x(e,t,r),i&&i.m(t,null),R(t,n)},p(e,t){3&t&&r!==(r=e[3](e[22],e[25])+"")&&H(n,r)},d(e){e&&k(t),i&&i.d()}}}function Wc(e){let t,n,r,i,o,s,a,l,c,d=e[0],u=[];for(let t=0;t<d.length;t+=1)u[t]=Uc(Vc(e,d,t));i=new lt({props:{size:"18"}});let f=e[2]&&function(e){let t,n,r,i,o,s,a,l,c;return i=new Me({props:{size:"18"}}),{c(){t=M("span"),t.textContent="  /  ",n=L(),r=M("span"),Ne(i.$$.fragment),o=L(),s=M("span"),s.textContent="Rechnung",z(r,"class","pointer feather2 svelte-1jurfpd")},m(d,u){x(d,t,u),x(d,n,u),x(d,r,u),Te(i,r,null),x(d,o,u),x(d,s,u),a=!0,l||(c=V(r,"click",function(){b(e[5](e[22]._id))&&e[5](e[22]._id).apply(this,arguments)}),l=!0)},p(t,n){e=t},i(e){a||($e(i.$$.fragment,e),a=!0)},o(e){Ie(i.$$.fragment,e),a=!1},d(e){e&&k(t),e&&k(n),e&&k(r),De(i),e&&k(o),e&&k(s),l=!1,c()}}}(e);return{c(){t=M("div");for(let e=0;e<u.length;e+=1)u[e].c();n=L(),r=M("span"),Ne(i.$$.fragment),o=L(),f&&f.c(),s=L(),z(r,"class","feather pointer svelte-1jurfpd"),z(t,"class","lookupItem svelte-1jurfpd")},m(d,h){x(d,t,h);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,n),R(t,r),Te(i,r,null),R(t,o),f&&f.m(t,null),R(t,s),a=!0,l||(c=V(r,"click",function(){b(e[4](e[22]._id))&&e[4](e[22]._id).apply(this,arguments)}),l=!0)},p(r,i){if(e=r,11&i){let r;for(d=e[0],r=0;r<d.length;r+=1){const o=Vc(e,d,r);u[r]?u[r].p(o,i):(u[r]=Uc(o),u[r].c(),u[r].m(t,n))}for(;r<u.length;r+=1)u[r].d(1);u.length=d.length}e[2]&&f.p(e,i)},i(e){a||($e(i.$$.fragment,e),$e(f),a=!0)},o(e){Ie(i.$$.fragment,e),Ie(f),a=!1},d(e){e&&k(t),O(u,e),De(i),f&&f.d(),l=!1,c()}}}function zc(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=Wc(Fc(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){t=M("div");for(let e=0;e<i.length;e+=1)i[e].c();z(t,"class","lookup svelte-1jurfpd")},m(e,r){x(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);n=!0},p(e,[n]){if(63&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=Fc(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=Wc(o),i[s].c(),$e(i[s],1),i[s].m(t,null))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){e&&k(t),O(i,e)}}}function Hc(e,n,r){let{id:i}=n,{item:o}=n,{praefix:s}=n,{record:a}=n,{notifyList:l}=n;const{refItem:c,view:d,beforeSave:u,_state:f,addAttachment:h}=o.properties;let p=d.split(","),[g,w]=c.split(":"),y=[];const[v,$]=w.split("."),I=(e,t)=>{const[n,r]=t.split(".");return r?e[n]?e[n][r]:void 0:""},_=(e=!0)=>{ce().then(()=>{const t=document.querySelector("div.form-field."+o.name);if(t&&(t.style.display=e?"none":"flex"),!e&&u){const e=t.querySelector("div label");e&&(e.style.color="red")}})};return Q(_),e.$$set=e=>{"id"in e&&r(6,i=e.id),"item"in e&&r(7,o=e.item),"praefix"in e&&r(8,s=e.praefix),"record"in e&&r(9,a=e.record),"notifyList"in e&&r(10,l=e.notifyList)},e.$$.update=()=>{1024&e.$$.dirty&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==g)return;if(r(1,y=[]),!i)return;if(!!u==!!a._id)return _();if(!a._id&&!a[g])return _();const o=!p.some(e=>e.includes(":")),s=$?$+"."+g:g;let l={[s]:a[g]||a._id};f&&(l=[{$match:l},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":f}}]);let c=!1;if(!s.includes(".")){const e=(await t.getSchemaByClass(v)).items.find(e=>e.name===s);e?.properties?.multi&&(c=!0)}if(r(1,y=await t.getSectionView(v,l,o,!0,c)),!o&&y.length){const e=p.find(e=>e.includes(":")),t=e.split(":")[0];r(1,y=y.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,p=p.map(e=>e.split(":")[1]))}_(!y.length)})(l)},[p,y,h,(e,t)=>"boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||m(e[t])||e[t]||I(e,t),e=>async()=>{const n=await t.getTaskByDocId(e,!0);if(!n)return;const r=n._id,i=`/task/${n.event}/${r}/task?view=standalone`;window.open(i)},e=>async()=>{let n;const r=await t.getTaskByDocId(e,!0);if(!r)return;const i=await t.getUserReports(r._id);if(!i?.length)return;n="/viewer/doc/index.html?file="+("/api/userreport/"+i[0]._id)+"&type=pdf",window.open(n,"","popup=yes toolbar=no width=800 height=1024")},i,o,s,a,l]}class jc extends xe{constructor(e){var t;super(),Lc.getElementById("svelte-1jurfpd-style")||((t=M("style")).id="svelte-1jurfpd-style",t.textContent=".feather.svelte-1jurfpd{position:absolute;top:0;left:-1.5em;color:#4300b0}.feather2.svelte-1jurfpd{color:#4300b0}div.lookup.svelte-1jurfpd{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1jurfpd{position:relative;margin-left:2em;padding-bottom:0.75em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}div.field:has(div.lookup){margin-bottom:0.25em !important}",R(Lc.head,t)),Re(this,e,Hc,zc,S,{id:6,item:7,praefix:8,record:9,notifyList:10})}}function qc(e){let t,n,r;return n=new mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Gc(e){let t,n,r,i,o;return n=new mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[9]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Xc(e){let t,n,r,i,o,s;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 a=[Gc,qc],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}function Yc(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value)},[i,o,s,a,l,d,u,f,r,async()=>{if(!f)return;let e=f;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){te(e,t)}]}class Zc extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,Yc,Xc,S,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Kc(e){let t,n,r;return n=new bt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Qc(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[12]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Jc(e){let t,n,r,i,o,s;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[15]);const a=[Qc,Kc],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};4&r&&(s.inputClass=e[2]),1&r&&(s.pattern=e[0]),2&r&&(s.placeholder=e[1]),8&r&&(s.disabled=e[3]),16&r&&(s.formnovalidate=e[4]),32&r&&(s.readonly=e[5]),64&r&&(s.required=e[6]),128&r&&(s.id=e[7]),256&r&&(s.name=e[8]),512&r&&(s.value=e[9]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}function ed(e,t,r){let i;const{TextField:o}=c,{environment:s}=u;N(e,s,e=>r(16,i=e));const a=JSON.parse(n.getItem("Locale"));let{inputClass:l}=t,{disabled:d}=t,{formnovalidate:f}=t,{readonly:h}=t,{required:m}=t,{id:p}=t,{name:g}=t,{value:w}=t,{pattern:y}=t,{placeholder:v}=t,{notifyList:$}=t,{country:I}=t;y||="(\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1))?\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*(\\d{1,2})$",v||="+41 58 234 56 78";const _={ch:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",li:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",de:"^((\\+49|0049)\\s?)?(0|\\s?)?\\d{2,5}(\\s?\\d){4,9}$",at:"^((\\+43|0043)\\s?)?(0\\s?)?[1-9]\\d{1,4}(\\s?\\d){4,10}$",us:"^((\\+1|001)\\s?)?(\\d{3}\\s?){2}\\d{4}$",zh:"^((\\+86|0086)\\s?)?((1\\d{10})|(0\\d{2,3}\\s?\\d{7,8}))$"},C={ch:"+41 58 234 5678",li:"+41 58 234 5678",de:"+49 619 1234 5678",at:"+43 800 123 456",us:"+1 2345 678 901",zh:"+86 123 456 7589"};return e.$$set=e=>{"inputClass"in e&&r(2,l=e.inputClass),"disabled"in e&&r(3,d=e.disabled),"formnovalidate"in e&&r(4,f=e.formnovalidate),"readonly"in e&&r(5,h=e.readonly),"required"in e&&r(6,m=e.required),"id"in e&&r(7,p=e.id),"name"in e&&r(8,g=e.name),"value"in e&&r(9,w=e.value),"pattern"in e&&r(0,y=e.pattern),"placeholder"in e&&r(1,v=e.placeholder),"notifyList"in e&&r(13,$=e.notifyList),"country"in e&&r(14,I=e.country)},e.$$.update=()=>{8192&e.$$.dirty&&(async e=>{const{listName:t,itemName:n,value:o}=e||{},s=i?.country?.countryCode?.toLowerCase()||a.lang;I&&n===I&&o?xp("country",o).then(e=>{if(e.phonePattern)r(0,y=e.phonePattern),r(1,v=e.phonePlaceholder||"");else{const t=e.countryCode.toLowerCase();_[t]&&(r(0,y=_[t]),r(1,v=C[t]))}}).catch(()=>{r(0,y=_[s]),r(1,v=C[s])}):I&&(r(0,y=_[s]),r(1,v=C[s]))})($)},[y,v,l,d,f,h,m,p,g,w,o,s,async()=>{if(!w)return;let e="tel:"+w;window.open(e,"_self")},$,I,function(t){te(e,t)}]}class td extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,ed,Jc,S,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1,notifyList:13,country:14})}}function nd(e){let t,n,r;return n=new $t({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function rd(e){let t,n,r,i,o;return n=new $t({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[12]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function id(e){let t,n,r,i,o,s;n=new e[11]({props:{type:"email",inputClass:e[0],pattern:e[9],placeholder:e[10],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],multiple:e[8],value:e[7]}}),n.$on("change",e[13]);const a=[rd,nd],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),512&r&&(s.pattern=e[9]),1024&r&&(s.placeholder=e[10]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),256&r&&(s.multiple=e[8]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}function od(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{multiple:h}=t,{pattern:m}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"multiple"in e&&n(8,h=e.multiple),"pattern"in e&&n(9,m=e.pattern),"placeholder"in e&&n(10,p=e.placeholder)},[i,o,s,a,l,d,u,f,h,m,p,r,async()=>{if(!f)return;let e="mailto:"+f;window.open(e,"_self")},function(t){te(e,t)}]}class sd extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,od,id,S,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const ad=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","CommentChange","CompositionEnd","CompositionStart","CompositionUpdate","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","Input","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 ld(e){let t;return{c(){t=M("textarea"),z(t,"id",e[0]),q(t,"visibility","hidden")},m(n,r){x(n,t,r),e[20](t)},p(e,n){1&n&&z(t,"id",e[0])},d(n){n&&k(t),e[20](null)}}}function cd(e){let t;return{c(){t=M("div"),z(t,"id",e[0])},m(n,r){x(n,t,r),e[19](t)},p(e,n){1&n&&z(t,"id",e[0])},d(n){n&&k(t),e[19](null)}}}function dd(e){let t;function n(e,t){return e[1]?cd:ld}let r=n(e),i=r(e);return{c(){t=M("div"),i.c(),z(t,"class",e[2])},m(n,r){x(n,t,r),i.m(t,null),e[21](t)},p(e,[o]){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null))),4&o&&z(t,"class",e[2])},i:_,o:_,d(n){n&&k(t),i.d(),e[21](null)}}}const ud=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let fd=(()=>{let e={listeners:[],scriptId:ud("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,r)=>{e.scriptLoaded?r():(e.listeners.push(r),e.injected||((t,n,r,i)=>{e.injected=!0;const o=n.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=r,o.onload=()=>{i()},n.head&&n.head.appendChild(o)})(e.scriptId,t,n,()=>{e.listeners.forEach(e=>e()),e.scriptLoaded=!0}))}}})();function hd(e,t,n){let r,i,o,{id:s=ud("tinymce-svelte")}=t,{inline:a}=t,{disabled:l=!1}=t,{readonly:c=!1}=t,{apiKey:d="no-api-key"}=t,{licenseKey:u}=t,{channel:f="8"}=t,{scriptSrc:h}=t,{conf:m={}}=t,{modelEvents:p="change input undo redo"}=t,{value:g=""}=t,{text:w=""}=t,{cssClass:y="tinymce-wrapper"}=t,v=g,$=l,I=c;const _=(e,t)=>{var n;"function"==typeof(null===(n=e.mode)||void 0===n?void 0:n.set)&&e.mode.set(t?"readonly":"design")},C=(e,t)=>{(e=>"function"==typeof e.options.set&&e.options.isRegistered("disabled"))(e)?e.options.set("disabled",t):e.mode.set(t?"readonly":"design")},E=ee(),A=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},b=()=>{var e;const t=Object.assign(Object.assign({},m),{target:i,inline:void 0!==a?a:void 0!==m.inline&&m.inline,license_key:u,setup:e=>{e.on("PreInit",()=>{C(e,l),_(e,c)}),n(15,o=e),e.on("init",()=>{e.setContent(g),e.on(p,()=>{n(16,v=e.getContent()),v!==g&&(n(5,g=v),n(6,w=e.getContent({format:"text"})))})}),((e,t)=>{ad.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,E),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=A())||void 0===e||e.init(t)};return Q(()=>{if(null!==A())b();else{const e=h||`https://cdn.tiny.cloud/1/${d}/tinymce/${f}/tinymce.min.js`;fd.load(r.ownerDocument,e,()=>{b()})}}),J(()=>{var e;o&&(null===(e=A())||void 0===e||e.remove(o))}),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,l=e.disabled),"readonly"in e&&n(8,c=e.readonly),"apiKey"in e&&n(9,d=e.apiKey),"licenseKey"in e&&n(10,u=e.licenseKey),"channel"in e&&n(11,f=e.channel),"scriptSrc"in e&&n(12,h=e.scriptSrc),"conf"in e&&n(13,m=e.conf),"modelEvents"in e&&n(14,p=e.modelEvents),"value"in e&&n(5,g=e.value),"text"in e&&n(6,w=e.text),"cssClass"in e&&n(2,y=e.cssClass)},e.$$.update=()=>{491936&e.$$.dirty&&(o&&v!==g&&(o.setContent(g),n(6,w=o.getContent({format:"text"}))),o&&c!==I&&(n(18,I=c),_(o,c)),o&&l!==$&&(n(17,$=l),C(o,l)))},[s,a,y,r,i,g,w,l,c,d,u,f,h,m,p,o,v,$,I,function(e){re[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){re[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){re[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class md extends xe{constructor(e){super(),Re(this,e,hd,dd,S,{id:0,inline:1,disabled:7,readonly:8,apiKey:9,licenseKey:10,channel:11,scriptSrc:12,conf:13,modelEvents:14,value:5,text:6,cssClass:2})}}function pd(e){let t,n,r,i,o,s,a;function l(t){e[12](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",licenseKey:"gpl",conf:e[8],disabled:e[5],readonly:e[6]};return void 0!==e[0]&&(c.value=e[0]),n=new md({props:c}),re.push(()=>Se(n,"value",l)),n.$on("init",e[9]),{c(){t=M("div"),Ne(n.$$.fragment),i=L(),o=M("input"),z(o,"class",s=e[1]||e[2]),z(o,"id",e[3]),z(o,"name",e[3]),o.value=e[0],o.hidden=!0,q(t,"min-height","10em"),q(t,"margin-top","-1em"),t.hidden=e[4]},m(e,r){x(e,t,r),Te(n,t,null),R(t,i),R(t,o),a=!0},p(e,[i]){const l={};32&i&&(l.disabled=e[5]),64&i&&(l.readonly=e[6]),!r&&1&i&&(r=!0,l.value=e[0],ue(()=>r=!1)),n.$set(l),(!a||6&i&&s!==(s=e[1]||e[2]))&&z(o,"class",s),(!a||8&i)&&z(o,"id",e[3]),(!a||8&i)&&z(o,"name",e[3]),(!a||1&i&&o.value!==e[0])&&(o.value=e[0]),(!a||16&i)&&(t.hidden=e[4])},i(e){a||($e(n.$$.fragment,e),a=!0)},o(e){Ie(n.$$.fragment,e),a=!1},d(e){e&&k(t),De(n)}}}let gd=!1;function wd(e,t,r){let i;const{environment:o}=u;N(e,o,e=>r(16,i=e));const s=ee();let a=JSON.parse(n.getItem("Locale")).id;a=a.startsWith("fr")?"fr_FR":a.split("-")[0];let l,c,{value:d=""}=t,{noForm:f}=t,{classId:h}=t,{id:m}=t,{record:p}=t,{hidden:g}=t,{disabled:y}=t,{readonly:v}=t,{keepOrigin:I}=t;const _=(e,t,n)=>{const r=e.split("{{").slice(1).map(e=>e.split("}}")[0]);if(r?.length)return r.reduce((e,r)=>{let[i,o,s]=r.split(".");if(!o)return e;if(!t[i]&&!n[i])return e;s&&(o=o+"."+s);const a=e.find(e=>e.table===i);return a?a.attrs=a.attrs.concat(o):e.push({table:i,attrs:[o]}),e},[])},C={plugins:"advlist 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:a};return e.$$set=e=>{"value"in e&&r(0,d=e.value),"noForm"in e&&r(1,f=e.noForm),"classId"in e&&r(2,h=e.classId),"id"in e&&r(3,m=e.id),"record"in e&&r(10,p=e.record),"hidden"in e&&r(4,g=e.hidden),"disabled"in e&&r(5,y=e.disabled),"readonly"in e&&r(6,v=e.readonly),"keepOrigin"in e&&r(11,I=e.keepOrigin)},e.$$.update=()=>{1025&e.$$.dirty&&((e,t)=>{if(I)return;if(!l)return;if(gd)return;if(!e)return;if(!e.includes("{{"))return;const n=_(d,p,c);n?.length&&(gd=!0,Promise.all(n.map(async(e,n)=>{let r;return t[e.table]&&(r=await xp(e.table,t[e.table]).catch(()=>{})),{table:r,def:e}})).then(async t=>{if(t?.length){for(const n of t)for(const t of n.def.attrs){const[r,i]=t.split(".");let o;if(i&&w(n.table&&n.table[r])){const e=await xp(r,n.table[r]);e&&(o=e[i]),console.log("a2",o,e)}else o=$(n.table||c[n.def.table],t);if(o?.endsWith("Z")&&24===o?.length){let[e,t,n]=o.split("-");n=n.slice(0,2),o=`${n}.${t}.${e}`}o&&(e=e.replace(`{{${n.def.table}.${t}}}`,o))}s("blur",{value:e||""})}}).catch(e=>{console.log("error",e)}).finally(()=>{r(0,d=e||""),gd=!1}))})(d,p)},[d,f,h,m,g,y,v,o,C,e=>{c={owner:i.owner},l=!0},p,I,function(e){d=e,r(0,d)}]}class yd extends xe{constructor(e){var t;super(),document.getElementById("svelte-yi7lpi-style")||((t=M("style")).id="svelte-yi7lpi-style",t.textContent="div.tox-statusbar__text-container, div.tox-promotion{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",R(document.head,t)),Re(this,e,wd,pd,S,{value:0,noForm:1,classId:2,id:3,record:10,hidden:4,disabled:5,readonly:6,keepOrigin:11})}}
1
+ System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],function(e){"use strict";var t,n,r,i,o,s,a,l,c,d,u,f;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.settings,s=e.TextArea,a=e.toasts,l=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){f=e.taskClipboard}],execute:function(){function h(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}e("version","0.3.216");const m=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}},g=(e,t)=>{let n,r;try{n=t[e+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{r=t[e+"_to"],r=new Date(r||"").toLocaleDateString(),"Invalid Date"===r&&(r="")}catch{r=""}return[n,r].filter(e=>""!==e).join(" - ").trim()},w=e=>/^[0-9a-f]{24}/.test(e),y=e=>!0===e?"(ja)":!1===e?"(nein)":"",v=(e,t)=>{if(!e.display&&!e.items)return"";const n={...t};return(e.display?.reduce((t,r)=>{let[i,o]=r.split(".");if(e.list?.find(({name:e})=>e===i)&&o&&void 0!==n[i]){const e=`${i}_${o}`;n[e]=n[i][o],i=e}return t.find(e=>e===i)||t.push(i),t},[]).map(e=>{const t=n[e];if("boolean"==typeof t)return y(t);if("number"==typeof t){const e=t.toString().split(".")[1];return e&&e.length>2?((e,t)=>(t||=0,"number"==typeof e&&e||(e=Number(e||0)),(+(Math.round(e+"e+"+t)+"e-"+t)).toString()))(t,2):t}return m(n["_"+e]||t)})||e.items.map(e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&y(t[e.name]),t[e.name]))).map(e=>e?.toString().split(" · ").filter(e=>!!e&&!w(e)).join(" · ")).filter(e=>!!e).join(" • ")},$=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};const I=e=>{if(t=e,"[object Date]"===Object.prototype.toString.call(t))return e;var t;if("string"!=typeof e)return e;try{if((e=e.slice(0,10)).includes(".")){const[t,n,r]=e.split(".");return new Date(r,n-1,t)}if(e.includes("-")){const[t,n,r]=e.split("-");return new Date(t,n-1,r)}}catch{return e}return e};function _(){}function C(e){return e()}function E(){return Object.create(null)}function A(e){e.forEach(C)}function b(e){return"function"==typeof e}function S(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function N(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return _;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function T(e){return null==e?"":e}function D(e,t,n=t){return e.set(n),t}function R(e,t){e.appendChild(t)}function x(e,t,n){e.insertBefore(t,n||null)}function k(e){e.parentNode.removeChild(e)}function O(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function M(e){return document.createElement(e)}function P(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function B(e){return document.createTextNode(e)}function L(){return B(" ")}function F(){return B("")}function V(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function U(e){return function(t){return t.preventDefault(),e.call(this,t)}}function W(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function z(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function H(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function j(e,t){e.value=null==t?"":t}function q(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function G(e,t,n){e.classList[n?"add":"remove"](t)}class X{constructor(e=null){this.a=e,this.e=this.n=null}m(e,t,n=null){this.e||(this.e=M(t.nodeName),this.t=t,this.h(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)x(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(k)}}let Y;function Z(e){Y=e}function K(){if(!Y)throw new Error("Function called outside component initialization");return Y}function Q(e){K().$$.on_mount.push(e)}function J(e){K().$$.on_destroy.push(e)}function ee(){const e=K();return(t,n)=>{const r=e.$$.callbacks[t];if(r){const i=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);r.slice().forEach(t=>{t.call(e,i)})}}}function te(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const ne=[],re=[],ie=[],oe=[],se=Promise.resolve();let ae=!1;function le(){ae||(ae=!0,se.then(me))}function ce(){return le(),se}function de(e){ie.push(e)}function ue(e){oe.push(e)}let fe=!1;const he=new Set;function me(){if(!fe){fe=!0;do{for(let e=0;e<ne.length;e+=1){const t=ne[e];Z(t),pe(t.$$)}for(Z(null),ne.length=0;re.length;)re.pop()();for(let e=0;e<ie.length;e+=1){const t=ie[e];he.has(t)||(he.add(t),t())}ie.length=0}while(ne.length);for(;oe.length;)oe.pop()();ae=!1,fe=!1,he.clear()}}function pe(e){if(null!==e.fragment){e.update(),A(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(de)}}const ge=new Set;let we;function ye(){we={r:0,c:[],p:we}}function ve(){we.r||A(we.c),we=we.p}function $e(e,t){e&&e.i&&(ge.delete(e),e.i(t))}function Ie(e,t,n,r){if(e&&e.o){if(ge.has(e))return;ge.add(e),we&&we.c.push(()=>{ge.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function _e(e,t){const n=t.token={};function r(e,r,i,o){if(t.token!==n)return;t.resolved=o;let s=t.ctx;void 0!==i&&(s=s.slice(),s[i]=o);const a=e&&(t.current=e)(s);let l=!1;t.block&&(t.blocks?t.blocks.forEach((e,n)=>{n!==r&&e&&(ye(),Ie(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),ve())}):t.block.d(1),a.c(),$e(a,1),a.m(t.mount(),t.anchor),l=!0),t.block=a,t.blocks&&(t.blocks[r]=a),l&&me()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=K();if(e.then(e=>{Z(n),r(t.then,1,t.value,e),Z(null)},e=>{if(Z(n),r(t.catch,2,t.error,e),Z(null),!t.hasCatch)throw e}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}var i}function Ce(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}const Ee="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Ae(e,t){Ie(e,1,1,()=>{t.delete(e.key)})}function be(e,t,n,r,i,o,s,a,l,c,d,u){let f=e.length,h=o.length,m=f;const p={};for(;m--;)p[e[m].key]=m;const g=[],w=new Map,y=new Map;for(m=h;m--;){const e=u(i,o,m),a=n(e);let l=s.get(a);l?r&&l.p(e,t):(l=c(a,e),l.c()),w.set(a,g[m]=l),a in p&&y.set(a,Math.abs(m-p[a]))}const v=new Set,$=new Set;function I(e){$e(e,1),e.m(a,d),s.set(e.key,e),d=e.first,h--}for(;f&&h;){const t=g[h-1],n=e[f-1],r=t.key,i=n.key;t===n?(d=t.first,f--,h--):w.has(i)?!s.has(r)||v.has(r)?I(t):$.has(i)?f--:y.get(r)>y.get(i)?($.add(r),I(t)):(v.add(i),f--):(l(n,s),f--)}for(;f--;){const t=e[f];w.has(t.key)||l(t,s)}for(;h;)I(g[h-1]);return g}function Se(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Ne(e){e&&e.c()}function Te(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||de(()=>{const t=o.map(C).filter(b);s?s.push(...t):A(t),e.$$.on_mount=[]}),a.forEach(de)}function De(e,t){const n=e.$$;null!==n.fragment&&(A(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Re(e,t,n,r,i,o,s=[-1]){const a=Y;Z(e);const l=e.$$={fragment:null,ctx:null,props:o,update:_,not_equal:i,bound:E(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:t.context||[]),callbacks:E(),dirty:s,skip_bound:!1};let c=!1;if(l.ctx=n?n(e,t.props||{},(t,n,...r)=>{const o=r.length?r[0]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=o)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](o),c&&function(e,t){-1===e.$$.dirty[0]&&(ne.push(e),le(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n}):[],l.update(),c=!0,A(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);l.fragment&&l.fragment.l(e),e.forEach(k)}else l.fragment&&l.fragment.c();t.intro&&$e(e.$$.fragment),Te(e,t.target,t.anchor,t.customElement),me()}Z(a)}class xe{$destroy(){De(this,1),this.$destroy=_}$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 ke(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("polygon"),z(n,"d","M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"),z(r,"points","12 15 17 21 7 21 12 15"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-airplay "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function Oe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Me extends xe{constructor(e){super(),Re(this,e,Oe,ke,S,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("path"),r=P("line"),i=P("line"),z(n,"d","M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"),z(r,"x1","12"),z(r,"y1","9"),z(r,"x2","12"),z(r,"y2","13"),z(i,"x1","12"),z(i,"y1","17"),z(i,"x2","12.01"),z(i,"y2","17"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Be(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Le extends xe{constructor(e){super(),Re(this,e,Be,Pe,S,{size:0,strokeWidth:1,class:2})}}function Fe(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("circle"),r=P("polyline"),i=P("line"),z(n,"cx","12"),z(n,"cy","12"),z(n,"r","10"),z(r,"points","8 12 12 16 16 12"),z(i,"x1","12"),z(i,"y1","8"),z(i,"x2","12"),z(i,"y2","16"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Ve(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ue extends xe{constructor(e){super(),Re(this,e,Ve,Fe,S,{size:0,strokeWidth:1,class:2})}}function We(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("path"),z(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),z(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-book-open "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function ze(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class He extends xe{constructor(e){super(),Re(this,e,ze,We,S,{size:0,strokeWidth:1,class:2})}}function je(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("circle"),z(n,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),z(r,"cx","12"),z(r,"cy","13"),z(r,"r","4"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-camera "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function qe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ge extends xe{constructor(e){super(),Re(this,e,qe,je,S,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),z(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),z(r,"points","22 4 12 14.01 9 11.01"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function Ye(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ze extends xe{constructor(e){super(),Re(this,e,Ye,Xe,S,{size:0,strokeWidth:1,class:2})}}function Ke(e){let t,n,r;return{c(){t=P("svg"),n=P("path"),z(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"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",r="feather feather-command "+e[2])},m(e,r){x(e,t,r),R(t,n)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&z(t,"class",r)},i:_,o:_,d(e){e&&k(t)}}}function Qe(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Je extends xe{constructor(e){super(),Re(this,e,Qe,Ke,S,{size:0,strokeWidth:1,class:2})}}function et(e){let t,n,r,i;return{c(){t=P("svg"),n=P("polyline"),r=P("path"),z(n,"points","9 10 4 15 9 20"),z(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function tt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class nt extends xe{constructor(e){super(),Re(this,e,tt,et,S,{size:0,strokeWidth:1,class:2})}}function rt(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("path"),r=P("line"),i=P("line"),z(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),z(r,"x1","18"),z(r,"y1","9"),z(r,"x2","12"),z(r,"y2","15"),z(i,"x1","12"),z(i,"y1","9"),z(i,"x2","18"),z(i,"y2","15"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-delete "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function it(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ot extends xe{constructor(e){super(),Re(this,e,it,rt,S,{size:0,strokeWidth:1,class:2})}}function st(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),i=P("line"),z(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),z(r,"points","15 3 21 3 21 9"),z(i,"x1","10"),z(i,"y1","14"),z(i,"x2","21"),z(i,"y2","3"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-external-link "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function at(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class lt extends xe{constructor(e){super(),Re(this,e,at,st,S,{size:0,strokeWidth:1,class:2})}}function ct(e){let t,n,r,i,o,s;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),i=P("line"),o=P("line"),z(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),z(r,"points","14 2 14 8 20 8"),z(i,"x1","12"),z(i,"y1","18"),z(i,"x2","12"),z(i,"y2","12"),z(o,"x1","9"),z(o,"y1","15"),z(o,"x2","15"),z(o,"y2","15"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){x(e,t,s),R(t,n),R(t,r),R(t,i),R(t,o)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&z(t,"class",s)},i:_,o:_,d(e){e&&k(t)}}}function dt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class ut extends xe{constructor(e){super(),Re(this,e,dt,ct,S,{size:0,strokeWidth:1,class:2})}}function ft(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("circle"),r=P("line"),i=P("path"),z(n,"cx","12"),z(n,"cy","12"),z(n,"r","10"),z(r,"x1","2"),z(r,"y1","12"),z(r,"x2","22"),z(r,"y2","12"),z(i,"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"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-globe "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function ht(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class mt extends xe{constructor(e){super(),Re(this,e,ht,ft,S,{size:0,strokeWidth:1,class:2})}}function pt(e){let t,n,r,i,o,s,a,l;return{c(){t=P("svg"),n=P("line"),r=P("line"),i=P("line"),o=P("line"),s=P("line"),a=P("line"),z(n,"x1","8"),z(n,"y1","6"),z(n,"x2","21"),z(n,"y2","6"),z(r,"x1","8"),z(r,"y1","12"),z(r,"x2","21"),z(r,"y2","12"),z(i,"x1","8"),z(i,"y1","18"),z(i,"x2","21"),z(i,"y2","18"),z(o,"x1","3"),z(o,"y1","6"),z(o,"x2","3.01"),z(o,"y2","6"),z(s,"x1","3"),z(s,"y1","12"),z(s,"x2","3.01"),z(s,"y2","12"),z(a,"x1","3"),z(a,"y1","18"),z(a,"x2","3.01"),z(a,"y2","18"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",l="feather feather-list "+e[2])},m(e,l){x(e,t,l),R(t,n),R(t,r),R(t,i),R(t,o),R(t,s),R(t,a)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&z(t,"class",l)},i:_,o:_,d(e){e&&k(t)}}}function gt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class wt extends xe{constructor(e){super(),Re(this,e,gt,pt,S,{size:0,strokeWidth:1,class:2})}}function yt(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("polyline"),z(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"),z(r,"points","22,6 12,13 2,6"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-mail "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function vt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class $t extends xe{constructor(e){super(),Re(this,e,vt,yt,S,{size:0,strokeWidth:1,class:2})}}function It(e){let t,n,r,i;return{c(){t=P("svg"),n=P("path"),r=P("circle"),z(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),z(r,"cx","12"),z(r,"cy","10"),z(r,"r","3"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function _t(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Ct extends xe{constructor(e){super(),Re(this,e,_t,It,S,{size:0,strokeWidth:1,class:2})}}function Et(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("polyline"),r=P("line"),i=P("path"),z(n,"points","23 7 23 1 17 1"),z(r,"x1","16"),z(r,"y1","8"),z(r,"x2","23"),z(r,"y2","1"),z(i,"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"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function At(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class bt extends xe{constructor(e){super(),Re(this,e,At,Et,S,{size:0,strokeWidth:1,class:2})}}function St(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("rect"),r=P("line"),i=P("line"),z(n,"x","3"),z(n,"y","3"),z(n,"width","18"),z(n,"height","18"),z(n,"rx","2"),z(n,"ry","2"),z(r,"x1","12"),z(r,"y1","8"),z(r,"x2","12"),z(r,"y2","16"),z(i,"x1","8"),z(i,"y1","12"),z(i,"x2","16"),z(i,"y2","12"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-plus-square "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-plus-square "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Nt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Tt extends xe{constructor(e){super(),Re(this,e,Nt,St,S,{size:0,strokeWidth:1,class:2})}}function Dt(e){let t,n,r,i,o;return{c(){t=P("svg"),n=P("polyline"),r=P("path"),i=P("rect"),z(n,"points","6 9 6 2 18 2 18 9"),z(r,"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"),z(i,"x","6"),z(i,"y","14"),z(i,"width","12"),z(i,"height","8"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",o="feather feather-printer "+e[2])},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&z(t,"class",o)},i:_,o:_,d(e){e&&k(t)}}}function Rt(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class xt extends xe{constructor(e){super(),Re(this,e,Rt,Dt,S,{size:0,strokeWidth:1,class:2})}}function kt(e){let t,n,r,i;return{c(){t=P("svg"),n=P("circle"),r=P("line"),z(n,"cx","11"),z(n,"cy","11"),z(n,"r","8"),z(r,"x1","21"),z(r,"y1","21"),z(r,"x2","16.65"),z(r,"y2","16.65"),z(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"width",e[0]),z(t,"height",e[0]),z(t,"fill","none"),z(t,"viewBox","0 0 24 24"),z(t,"stroke","currentColor"),z(t,"stroke-width",e[1]),z(t,"stroke-linecap","round"),z(t,"stroke-linejoin","round"),z(t,"class",i="feather feather-search "+e[2])},m(e,i){x(e,t,i),R(t,n),R(t,r)},p(e,[n]){1&n&&z(t,"width",e[0]),1&n&&z(t,"height",e[0]),2&n&&z(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&z(t,"class",i)},i:_,o:_,d(e){e&&k(t)}}}function Ot(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=2}=t,{class:o=""}=t;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),e.$$set=e=>{"size"in e&&n(0,r=e.size),"strokeWidth"in e&&n(1,i=e.strokeWidth),"class"in e&&n(2,o=e.class)},[r,i,o]}class Mt extends xe{constructor(e){super(),Re(this,e,Ot,kt,S,{size:0,strokeWidth:1,class:2})}}const{document:Pt}=Ee;function Bt(e){e[53]=e[54].items}function Lt(e,t,n){const r=e.slice();return r[55]=t[n],r[57]=n,r}function Ft(e,t,n){const r=e.slice();return r[58]=t[n],r}function Vt(e,t,n){const r=e.slice();return r[58]=t[n],r}function Ut(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Wt(e){let t,n,r,i,o,s;Bt(e);let a=e[5]?.length&&zt(e),l=e[53]?.length&&jt(e),c=e[5]?.length&&Xt(e);return{c(){a&&a.c(),t=L(),n=M("div"),r=M("table"),l&&l.c(),i=L(),o=M("tbody"),c&&c.c(),z(r,"striped",""),z(r,"class","svelte-47aais"),z(n,"class","eList svelte-47aais")},m(e,d){a&&a.m(e,d),x(e,t,d),x(e,n,d),R(n,r),l&&l.m(r,null),R(r,i),R(r,o),c&&c.m(o,null),s=!0},p(e,n){Bt(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&$e(a,1)):(a=zt(e),a.c(),$e(a,1),a.m(t.parentNode,t)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve()),e[53]?.length?l?l.p(e,n):(l=jt(e),l.c(),l.m(r,i)):l&&(l.d(1),l=null),e[5]?.length?c?(c.p(e,n),32&n[0]&&$e(c,1)):(c=Xt(e),c.c(),$e(c,1),c.m(o,null)):c&&(ye(),Ie(c,1,1,()=>{c=null}),ve())},i(e){s||($e(a),$e(c),s=!0)},o(e){Ie(a),Ie(c),s=!1},d(e){a&&a.d(e),e&&k(t),e&&k(n),l&&l.d(),c&&c.d()}}}function zt(e){let t,n,r,i,o,s,a,l,c,d,u,f=e[6]&&Ht(e);function h(t){e[34](t)}let m={id:e[11]};return void 0!==e[3]&&(m.value=e[3]),i=new e[8]({props:m}),re.push(()=>Se(i,"value",h)),i.$on("input",e[15]),l=new ot({props:{size:"18"}}),{c(){f&&f.c(),t=L(),n=M("div"),r=B("Suchen: "),Ne(i.$$.fragment),s=L(),a=M("span"),Ne(l.$$.fragment),z(a,"class","feather pointer svelte-47aais"),q(n,"margin-bottom","1em"),q(n,"position","relative")},m(o,h){f&&f.m(o,h),x(o,t,h),x(o,n,h),R(n,r),Te(i,n,null),R(n,s),R(n,a),Te(l,a,null),c=!0,d||(u=V(a,"click",e[17]),d=!0)},p(e,n){e[6]?f?64&n[0]&&$e(f,1):(f=Ht(e),f.c(),$e(f,1),f.m(t.parentNode,t)):f&&(ye(),Ie(f,1,1,()=>{f=null}),ve());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],ue(()=>o=!1)),i.$set(r)},i(e){c||($e(f),$e(i.$$.fragment,e),$e(l.$$.fragment,e),c=!0)},o(e){Ie(f),Ie(i.$$.fragment,e),Ie(l.$$.fragment,e),c=!1},d(e){f&&f.d(e),e&&k(t),e&&k(n),De(i),De(l),d=!1,u()}}}function Ht(e){let t,n;return t=new e[7]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function jt(e){let t,n,r,i=e[4]&&e[0]&&qt(),o=e[53],s=[];for(let t=0;t<o.length;t+=1)s[t]=Gt(Vt(e,o,t));return{c(){t=M("thead"),n=M("tr"),i&&i.c(),r=L();for(let e=0;e<s.length;e+=1)s[e].c();z(n,"class","svelte-47aais"),z(t,"class","svelte-47aais")},m(e,o){x(e,t,o),R(t,n),i&&i.m(n,null),R(n,r);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(e[4]&&e[0]?i||(i=qt(),i.c(),i.m(n,r)):i&&(i.d(1),i=null),16388&t[0]){let r;for(o=e[53],r=0;r<o.length;r+=1){const i=Vt(e,o,r);s[r]?s[r].p(i,t):(s[r]=Gt(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&k(t),i&&i.d(),O(s,e)}}}function qt(e){let t;return{c(){t=M("th"),z(t,"class","svelte-47aais")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Gt(e){let t,n,r=e[58]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-47aais")},m(e,r){x(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[58]?.designation+"")&&H(n,r)},d(e){e&&k(t)}}}function Xt(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[55].index||e[55]?._id;for(let t=0;t<o.length;t+=1){let n=Lt(e,o,t),a=s(n);i.set(a,r[t]=Qt(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);x(e,t,i),n=!0},p(e,n){356415&n[0]&&(o=e[5],ye(),r=be(r,n,s,1,e,o,i,t.parentNode,Ae,Qt,t,Lt),ve())},i(e){if(!n){for(let e=0;e<o.length;e+=1)$e(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)Ie(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&k(t)}}}function Yt(e){let t,n,r,i,o,s,a=e[4]&&e[0]&&Zt(e),l=e[53],c=[];for(let t=0;t<l.length;t+=1)c[t]=Kt(Ft(e,l,t));return{c(){t=M("tr"),a&&a.c(),n=L();for(let e=0;e<c.length;e+=1)c[e].c();r=L(),z(t,"class","pointer svelte-47aais"),G(t,"active",e[55]._id===e[1]),G(t,"blocked",!!e[55].blocked),G(t,"undeliverable",!!e[55].undeliverable)},m(l,d){x(l,t,d),a&&a.m(t,null),R(t,n);for(let e=0;e<c.length;e+=1)c[e].m(t,null);R(t,r),i=!0,o||(s=V(t,"click",W(function(){b(e[13](e[55],e[57]))&&e[13](e[55],e[57]).apply(this,arguments)})),o=!0)},p(i,o){if((e=i)[4]&&e[0]?a?(a.p(e,o),17&o[0]&&$e(a,1)):(a=Zt(e),a.c(),$e(a,1),a.m(t,n)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve()),20516&o[0]){let n;for(l=e[53],n=0;n<l.length;n+=1){const i=Ft(e,l,n);c[n]?c[n].p(i,o):(c[n]=Kt(i),c[n].c(),c[n].m(t,r))}for(;n<c.length;n+=1)c[n].d(1);c.length=l.length}34&o[0]&&G(t,"active",e[55]._id===e[1]),32&o[0]&&G(t,"blocked",!!e[55].blocked),32&o[0]&&G(t,"undeliverable",!!e[55].undeliverable)},i(e){i||($e(a),i=!0)},o(e){Ie(a),i=!1},d(e){e&&k(t),a&&a.d(),O(c,e),o=!1,s()}}}function Zt(e){let t,n,r,i,o;return n=new lt({props:{size:"18"}}),{c(){t=M("td"),Ne(n.$$.fragment),z(t,"class","editRow svelte-47aais"),q(t,"color","#326173")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",W(function(){b(e[18](e[55]))&&e[18](e[55]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Kt(e){let t,n,r,i=e[12](e[55],e[58])+"";return{c(){t=M("td"),n=B(i),z(t,"class",r=T(e[58].type)+" svelte-47aais")},m(e,r){x(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[12](e[55],e[58])+"")&&H(n,i),4&o[0]&&r!==(r=T(e[58].type)+" svelte-47aais")&&z(t,"class",r)},d(e){e&&k(t)}}}function Qt(e,t){let n,r,i,o=t[16](t[55],t[53],t[3]),s=o&&Yt(t);return{key:e,first:null,c(){n=F(),s&&s.c(),r=F(),this.first=n},m(e,t){x(e,n,t),s&&s.m(e,t),x(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[16](t[55],t[53],t[3])),o?s?(s.p(t,n),44&n[0]&&$e(s,1)):(s=Yt(t),s.c(),$e(s,1),s.m(r.parentNode,r)):s&&(ye(),Ie(s,1,1,()=>{s=null}),ve())},i(e){i||($e(s),i=!0)},o(e){Ie(s),i=!1},d(e){e&&k(n),s&&s.d(e),e&&k(r)}}}function Jt(e){let t,n;return t=new e[7]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function en(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Jt,then:Wt,catch:Ut,value:54,blocks:[,,,]};return _e(n=e[2]&&e[14](),i),{c(){t=F(),i.block.c()},m(e,n){x(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[14]())&&_e(n,i)||Ce(i,e,r)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),i.block.d(e),i.token=null,i=null}}}const tn=e("getDisplayItems",async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items});function nn(e,o,s){let a,l,d;N(e,i,e=>s(40,l=e));let f=JSON.parse(n.getItem("Locale")).id;const h=ee(),{Loading:p,TextField:g}=c,{currentTasks:w,loggedIn:v}=u;N(e,w,e=>s(39,a=e)),N(e,v,e=>s(41,d=e));let $,I,_,C,E,{inputList:A}=o,{eventId:b}=o,{prevEventId:S}=o,{record:T}=o,{className:D}=o,{rowId:R}=o,{filterForReady:x=!1}=o,{filter:k}=o,{query:O}=o,{refStatus:M}=o,{showEdit:P=!1}=o,{praefix:B=""}=o,{selectionFields:L=!1}=o,{deList:F}=o,{stopAggregation:V=!1}=o,{shouldBlock:U}=o,{inputSearch:W=""}=o,z=!0,H=W,j=D+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=!1,G=!0;const X=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else 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[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(f,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?y(n):m(e[`_${t.name}`]||n||"")},Y=t.getSchemaByClass(D),Z=async(e,n)=>{if(!e)return[];if(k){let n=k;const r=k.startsWith("!");r&&(n=k.replace("!",""));const i=k.startsWith("$");if(n&&!i&&(e=e.filter(e=>r?!e[n]:!!e[n])),i){n=k.replace("$","");const[r,i]=n.split(".");if(T[i]){const n=await t.getSectionView(r,{[i]:T[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}if(M&&!O)return s(19,M=[].concat(M)),e.filter(e=>!!M.find(t=>e._task.status===t));if("Information"===n.state.task)return e;if(S){const n=await t.getEvent(S);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===D)return"Information"===n.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)},K=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(f,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t},J=async e=>{let n,r=0;G=!1;const i=e=>new Promise(t=>setTimeout(t,e)),o=await Y;for(;r++<200&&!V&&!(n=await te(e,o.id));)await i(500);s(6,q=!1),V&&t.readTasksByAggregationId(e,!0),n&&(s(5,_=K(I.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),G=!0,document.getElementById(j)?.focus()},100))},te=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),ne=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(B),c=l&&await xp(s,l);if(!c)return e;const d=c[a];return d?.length?d.map(n=>{let r=e?.find(e=>e._id===n[t])||{};r={...r};for(const e in r)n[e]&&(r[e]=n[e]);for(const e in n)n[e]&&(r[e]=n[e]);return r._id&&Dp(o+r._id.toString(),r),r}):e};Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(j)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await Y;e.eventId===t.id&&(kp(t.class,e.eventId),s(2,z=!s(2,z=!1)))});return e.$$set=e=>{"inputList"in e&&s(21,A=e.inputList),"eventId"in e&&s(22,b=e.eventId),"prevEventId"in e&&s(23,S=e.prevEventId),"record"in e&&s(24,T=e.record),"className"in e&&s(25,D=e.className),"rowId"in e&&s(1,R=e.rowId),"filterForReady"in e&&s(26,x=e.filterForReady),"filter"in e&&s(27,k=e.filter),"query"in e&&s(28,O=e.query),"refStatus"in e&&s(19,M=e.refStatus),"showEdit"in e&&s(0,P=e.showEdit),"praefix"in e&&s(29,B=e.praefix),"selectionFields"in e&&s(30,L=e.selectionFields),"deList"in e&&s(31,F=e.deList),"stopAggregation"in e&&s(20,V=e.stopAggregation),"shouldBlock"in e&&s(32,U=e.shouldBlock),"inputSearch"in e&&s(33,W=e.inputSearch)},[P,R,z,H,$,_,q,p,g,w,v,j,X,(e,t)=>n=>{s(20,V=!0);const r=G?e:C[t];h("choose",{row:r})},async()=>{I=await Y,s(4,$=(e=>!a?.length||!!a.find(t=>t===e))(I.id)),O&&s(5,_=C=await t.getTasksFiltered(I.class,O)),_||s(5,_=C=K(I.displaySort,await A||await Np(I.class,I.id))),500!==_?.length||O||(s(6,q=!0),await t.getTasksList(I.id,!1,!0).then(({aggregationId:e})=>J(e)));let e,n=!1,r="";const i=L&&L?.find(e=>I.class===e.refClass.split(":")[0]),o=i?.value?.get&&i.value.get(B);if(o){const[a,l]=i.refClass.split(":");I.class===a&&s(5,_=await ne(_,a,l,i)),n=i.parentClass?.find(e=>"quantity"===e.name),r=i.className,e=await t.getCountedSection(r,l.split(".")[0],o,a,"quantity")}s(0,P&&=!i),!i&&(k||x||M)&&s(5,_=await Z(_,I)),E=I.authorization?.find(e=>"employee"===e.constraint)&&!l.some(e=>I.authorization?.find(t=>t.role===e&&"employee"!==t.constraint));const{display:c}=I;let u=await tn(c,I,_);if(!P&&n?(u=u.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),s(5,_=_.map((t,n)=>{const r=e.find(e=>e._id===t._id);return r&&(t.ist=r.quantity.$numberDecimal),t.index=n,t})),e.map(e=>{if(!_.find(t=>t._id===e._id)){const t=C.find(t=>t._id===e._id);t&&(t.ist=e.quantity.$numberDecimal),_.push(t)}}),h("init",_)):F&&s(5,_=_.filter(e=>!F.find(t=>t?._id===e._id))),U&&s(5,_=_.filter(e=>!e[U])),E){const e={businessEmail:d.user},n=await t.getSectionView("employee",e);s(5,_=n?.length?_.filter(e=>e.employee===n[0]._id):[])}return{items:u}},({detail:{value:e}})=>{s(3,H=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=X(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{s(3,H="")},async e=>{let t=e._task;t||(t=await Tp(D,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},M,V,A,b,S,T,D,x,k,O,B,L,F,U,W,function(e){H=e,s(3,H)}]}class rn extends xe{constructor(e){var t;super(),Pt.getElementById("svelte-47aais-style")||((t=M("style")).id="svelte-47aais-style",t.textContent=".feather.svelte-47aais.svelte-47aais{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-47aais.svelte-47aais{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-47aais .editRow.svelte-47aais{width:1em}.eList.svelte-47aais table.svelte-47aais{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-47aais table thead.svelte-47aais{position:sticky;top:0;background:#326173;color:white}.eList.svelte-47aais table thead tr.svelte-47aais{height:2.3em}.eList.svelte-47aais table tbody tr.svelte-47aais{height:2.75em !important}th.svelte-47aais.svelte-47aais,td.svelte-47aais.svelte-47aais{padding-left:0.4em;padding-right:0.4em}td.number.svelte-47aais.svelte-47aais{text-align:end}tr.pointer.svelte-47aais.svelte-47aais:hover{background-color:#DAE1E5}tr.active.svelte-47aais.svelte-47aais{color:#326173;background-color:#fcebd5}tr.blocked.svelte-47aais.svelte-47aais{color:red !important}tr.undeliverable.svelte-47aais.svelte-47aais{color:orange}",R(Pt.head,t)),Re(this,e,nn,en,S,{inputList:21,eventId:22,prevEventId:23,record:24,className:25,rowId:1,filterForReady:26,filter:27,query:28,refStatus:19,showEdit:0,praefix:29,selectionFields:30,deList:31,stopAggregation:20,shouldBlock:32,inputSearch:33},[-1,-1,-1])}}function on(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function sn(e){let t,n,r=e[45]&&an(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[45]?r?(r.p(e,n),16&n[0]&&$e(r,1)):(r=an(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function an(e){let t,n;return t=new e[25]({props:{title:e[20]?"Auswahl":e[0],class:"eList "+(e[18]?"form":""),$$slots:{default:[wn]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};1048577&n[0]&&(r.title=e[20]?"Auswahl":e[0]),262144&n[0]&&(r.class="eList "+(e[18]?"form":"")),33554430&n[0]|32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ln(e){let t,n;return t=new Fp({props:{schema:e[2],recID:e[1],readonly:e[19]}}),t.$on("choose",function(){b(e[34](e[45]))&&e[34](e[45]).apply(this,arguments)}),t.$on("back",e[31]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(n,r){e=n;const i={};4&r[0]&&(i.schema=e[2]),2&r[0]&&(i.recID=e[1]),524288&r[0]&&(i.readonly=e[19]),t.$set(i)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function cn(e){let t,n,r,i,o,s,a;t=new e[26]({props:{text:e[20]?"Zusätzliche Auswahl":""}});const l=[un,dn],c=[];function d(e,t){return e[20]?0:1}return r=d(e),i=c[r]=l[r](e),s=new rn({props:{inputSearch:e[15],record:e[3],eventId:e[2].id,className:e[2].class,prevEventId:e[14],filterForReady:e[5],filter:e[6],query:e[7],refStatus:e[8],praefix:e[9],selectionFields:e[10],rowId:e[1],shouldBlock:e[16],deList:e[12],stopAggregation:e[24],showEdit:e[11]}}),s.$on("edit",e[35]),s.$on("choose",e[38]),s.$on("init",e[36]),{c(){Ne(t.$$.fragment),n=L(),i.c(),o=L(),Ne(s.$$.fragment)},m(e,i){Te(t,e,i),x(e,n,i),c[r].m(e,i),x(e,o,i),Te(s,e,i),a=!0},p(e,n){const a={};1048576&n[0]&&(a.text=e[20]?"Zusätzliche Auswahl":""),t.$set(a);let u=r;r=d(e),r===u?c[r].p(e,n):(ye(),Ie(c[u],1,1,()=>{c[u]=null}),ve(),i=c[r],i?i.p(e,n):(i=c[r]=l[r](e),i.c()),$e(i,1),i.m(o.parentNode,o));const f={};32768&n[0]&&(f.inputSearch=e[15]),8&n[0]&&(f.record=e[3]),4&n[0]&&(f.eventId=e[2].id),4&n[0]&&(f.className=e[2].class),16384&n[0]&&(f.prevEventId=e[14]),32&n[0]&&(f.filterForReady=e[5]),64&n[0]&&(f.filter=e[6]),128&n[0]&&(f.query=e[7]),256&n[0]&&(f.refStatus=e[8]),512&n[0]&&(f.praefix=e[9]),1024&n[0]&&(f.selectionFields=e[10]),2&n[0]&&(f.rowId=e[1]),65536&n[0]&&(f.shouldBlock=e[16]),4096&n[0]&&(f.deList=e[12]),16777216&n[0]&&(f.stopAggregation=e[24]),2048&n[0]&&(f.showEdit=e[11]),s.$set(f)},i(e){a||($e(t.$$.fragment,e),$e(i),$e(s.$$.fragment,e),a=!0)},o(e){Ie(t.$$.fragment,e),Ie(i),Ie(s.$$.fragment,e),a=!1},d(e){De(t,e),e&&k(n),c[r].d(e),e&&k(o),De(s,e)}}}function dn(e){let t,n,r,i;n=new e[27]({props:{outline:!0,$$slots:{default:[fn]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let o=e[29]&&e[13]&&hn(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),z(t,"class","form--buttons svelte-jb5mrh")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[29]&&e[13]?o?(o.p(e,r),8192&r[0]&&$e(o,1)):(o=hn(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function un(e){let t,n,r,i,o,s,a=e[23]&&pn(e);return r=new e[27]({props:{outline:!0,$$slots:{default:[gn]},$$scope:{ctx:e}}}),r.$on("click",e[32]),o=new e[26]({props:{text:"Liste aus "+e[17]}}),{c(){a&&a.c(),t=L(),n=M("div"),Ne(r.$$.fragment),i=L(),Ne(o.$$.fragment),z(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),x(e,t,l),x(e,n,l),Te(r,n,null),x(e,i,l),Te(o,e,l),s=!0},p(e,n){e[23]?a?(a.p(e,n),8388608&n[0]&&$e(a,1)):(a=pn(e),a.c(),$e(a,1),a.m(t.parentNode,t)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve());const i={};32768&n[1]&&(i.$$scope={dirty:n,ctx:e}),r.$set(i);const s={};131072&n[0]&&(s.text="Liste aus "+e[17]),o.$set(s)},i(e){s||($e(a),$e(r.$$.fragment,e),$e(o.$$.fragment,e),s=!0)},o(e){Ie(a),Ie(r.$$.fragment,e),Ie(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&k(t),e&&k(n),De(r),e&&k(i),De(o,e)}}}function fn(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function hn(e){let t,n;return t=new e[27]({props:{filled:!0,$$slots:{default:[mn]},$$scope:{ctx:e}}}),t.$on("click",e[33]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};32768&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function mn(e){let t;return{c(){t=B("Neu")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function pn(e){let t,n;return t=new Su({props:{item:e[21],record:{_id:"",[e[21].name]:""},noForm:"true",classId:"sel_"+e[21].name,eventId:e[22],required:!1,hidden:!1,readonly:!1,deList:e[23]}}),t.$on("notify",e[37]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.item=e[21]),2097152&n[0]&&(r.record={_id:"",[e[21].name]:""}),2097152&n[0]&&(r.classId="sel_"+e[21].name),4194304&n[0]&&(r.eventId=e[22]),8388608&n[0]&&(r.deList=e[23]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function gn(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function wn(e){let t,n,r,i;const o=[cn,ln],s=[];function a(e,t){return e[45].length&&!e[18]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function yn(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function vn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:yn,then:sn,catch:on,value:45,blocks:[,,,]};return _e(n=e[30](e[4]),i),{c(){t=F(),i.block.c()},m(e,n){x(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,16&r[0]&&n!==(n=e[30](e[4]))&&_e(n,i)||Ce(i,e,r)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),i.block.d(e),i.token=null,i=null}}}function $n(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=c,l=ee(),{currentTasks:d}=u;N(e,d,e=>r(41,i=e));let{title:f}=n,{schema:h}=n,{record:m}=n,{recID:p}=n,{isOpening:g=!0}=n,{filterForReady:w=!1}=n,{filter:y}=n,{query:v}=n,{refStatus:$}=n,{praefix:I=""}=n,{selectionFields:_=!1}=n,{showEdit:C=!0}=n,{deList:E}=n,{newAllowed:A=!0}=n,{prevEventId:b}=n,{inputSearch:S}=n,{shouldBlock:T}=n,D=h.id;h.class;let R,x,k,O,M,P,B,L="",F=!1,V=!1;f??=h.identity.designation;const U=!i?.length||i.find(e=>e===D);return e.$$set=e=>{"title"in e&&r(0,f=e.title),"schema"in e&&r(2,h=e.schema),"record"in e&&r(3,m=e.record),"recID"in e&&r(1,p=e.recID),"isOpening"in e&&r(4,g=e.isOpening),"filterForReady"in e&&r(5,w=e.filterForReady),"filter"in e&&r(6,y=e.filter),"query"in e&&r(7,v=e.query),"refStatus"in e&&r(8,$=e.refStatus),"praefix"in e&&r(9,I=e.praefix),"selectionFields"in e&&r(10,_=e.selectionFields),"showEdit"in e&&r(11,C=e.showEdit),"deList"in e&&r(12,E=e.deList),"newAllowed"in e&&r(13,A=e.newAllowed),"prevEventId"in e&&r(14,b=e.prevEventId),"inputSearch"in e&&r(15,S=e.inputSearch),"shouldBlock"in e&&r(16,T=e.shouldBlock)},[f,p,h,m,g,w,y,v,$,I,_,C,E,A,b,S,T,L,F,R,k,M,P,B,V,o,s,a,d,U,async e=>{if(!e)return!1;const n=await Np(h.class,h.id);if(x=_&&_?.find(e=>h.class===e.refClass.split(":")[0]),r(20,k=x?.value?.get&&x.value.get(I)),k){O=x.refClass;const[e,n]=O.split(":"),[i]=n.split(".");r(21,M=x.parentClass.find(t=>t.name===e));const o=await t.getSchemaByClass(M.refClass);r(22,P=o.id),r(17,L=x.parentClass.find(e=>e.name===i).designation)}return n},()=>{r(18,F=!1),p||l("back"),C||l("back")},()=>{r(24,V=!0),r(18,F=!1),l("back")},()=>{r(24,V=!0),r(1,p=!1),r(19,R=!1),r(18,F=!0)},e=>({detail:{row:e}})=>{let t=h.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=h.list?.find(e=>e.name===n)?.item.find(e=>e.name===r);if(i){e[`${n}_${r}`]=e[n][r]}}),l("choose",{row:e})},({detail:e})=>{r(19,R=!!e._task.visum||"Closed"===e._task.status),r(1,p=e._docId),r(18,F=!0)},({detail:e})=>{k&&r(23,B=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){te(e,t)}]}class In extends xe{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=M("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}",R(document.head,t)),Re(this,e,$n,vn,S,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,praefix:9,selectionFields:10,showEdit:11,deList:12,newAllowed:13,prevEventId:14,inputSearch:15,shouldBlock:16},[-1,-1])}}const{document:_n}=Ee;function Cn(e){e[28]=e[30].list,e[29]=e[30].items}function En(e,t,n){const r=e.slice();return r[31]=t[n],r}function An(e,t,n){const r=e.slice();return r[34]=t[n],r}function bn(e,t,n){const r=e.slice();return r[34]=t[n],r}function Sn(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Nn(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[25](t)}Cn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Tn]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let $={id:e[8]};void 0!==e[0]&&($.value=e[0]),s=new e[6]({props:$}),re.push(()=>Se(s,"value",v)),s.$on("input",e[12]),d=new ot({props:{size:"18"}});let I=e[29]?.length&&function(e){let t,n,r,i,o=e[29],s=[];for(let t=0;t<o.length;t+=1)s[t]=Dn(bn(e,o,t));return{c(){t=M("thead"),n=M("tr"),r=M("th"),i=L();for(let e=0;e<s.length;e+=1)s[e].c();z(r,"class","svelte-14hcfjl"),z(n,"class","svelte-14hcfjl"),z(t,"class","svelte-14hcfjl")},m(e,o){x(e,t,o),R(t,n),R(n,r),R(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(o=e[29],r=0;r<o.length;r+=1){const i=bn(e,o,r);s[r]?s[r].p(i,t):(s[r]=Dn(i),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=o.length}},d(e){e&&k(t),O(s,e)}}}(e),_=e[28]?.length&&function(e){let t,n,r=e[28],i=[];for(let t=0;t<r.length;t+=1)i[t]=kn(En(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(44547&n[0]){let s;for(r=e[28],s=0;s<r.length;s+=1){const o=En(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=kn(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),i=M("div"),o=B("Suchen: "),Ne(s.$$.fragment),l=L(),c=M("span"),Ne(d.$$.fragment),u=L(),f=M("div"),h=M("table"),I&&I.c(),m=L(),p=M("tbody"),_&&_.c(),z(t,"class","form--buttons svelte-14hcfjl"),z(c,"class","feather pointer svelte-14hcfjl"),q(i,"margin-bottom","1em"),q(i,"position","relative"),z(h,"striped",""),z(h,"class","svelte-14hcfjl"),z(f,"class","eList svelte-14hcfjl")},m(a,v){x(a,t,v),Te(n,t,null),x(a,r,v),x(a,i,v),R(i,o),Te(s,i,null),R(i,l),R(i,c),Te(d,c,null),x(a,u,v),x(a,f,v),R(f,h),I&&I.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=V(c,"click",e[14]),w=!0)},p(e,t){Cn(e);const r={};256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&1&t[0]&&(a=!0,i.value=e[0],ue(()=>a=!1)),s.$set(i),e[29]?.length&&I.p(e,t),e[28]?.length&&_.p(e,t)},i(e){g||($e(n.$$.fragment,e),$e(s.$$.fragment,e),$e(d.$$.fragment,e),$e(_),g=!0)},o(e){Ie(n.$$.fragment,e),Ie(s.$$.fragment,e),Ie(d.$$.fragment,e),Ie(_),g=!1},d(e){e&&k(t),De(n),e&&k(r),e&&k(i),De(s),De(d),e&&k(u),e&&k(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function Tn(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Dn(e){let t,n,r=e[34]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function Rn(e){let t,n,r,i,o,s,a,l;r=new lt({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=xn(An(e,c,t));return{c(){t=M("tr"),n=M("td"),Ne(r.$$.fragment),i=L();for(let e=0;e<d.length;e+=1)d[e].c();o=L(),z(n,"class","editRow svelte-14hcfjl"),z(t,"class","pointer svelte-14hcfjl"),G(t,"active",e[31]._id===e[1])},m(c,u){x(c,t,u),R(t,n),Te(r,n,null),R(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);R(t,o),s=!0,a||(l=V(n,"click",e[15](e[31])),a=!0)},p(n,r){if(e=n,3584&r[0]){let n;for(c=e[29],n=0;n<c.length;n+=1){const i=An(e,c,n);d[n]?d[n].p(i,r):(d[n]=xn(i),d[n].c(),d[n].m(t,o))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2050&r[0]&&G(t,"active",e[31]._id===e[1])},i(e){s||($e(r.$$.fragment,e),s=!0)},o(e){Ie(r.$$.fragment,e),s=!1},d(e){e&&k(t),De(r),O(d,e),a=!1,l()}}}function xn(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=M("td"),n=B(o),z(t,"class","svelte-14hcfjl")},m(o,s){x(o,t,s),R(t,n),r||(i=V(t,"click",W(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&k(t),r=!1,i()}}}function kn(e){let t,n,r=e[13](e[31],e[29],e[0]),i=r&&Rn(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){1&n[0]&&(r=e[13](e[31],e[29],e[0])),r?i?(i.p(e,n),1&n[0]&&$e(i,1)):(i=Rn(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function On(e){let t,n;return t=new e[5]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Mn(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:On,then:Nn,catch:Sn,value:30,blocks:[,,,]};return _e(e[11](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function Pn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Mn]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};3&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Bn(e,n,i){const o=ee(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{classId:h}=n,{className:p}=n,{rowId:g}=n,{viewName:w}=n,{viewValue:v}=n,{recordId:$}=n,{filter:I}=n,{multiValues:_}=n,{searchValue:C=""}=n,E=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const A=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?y(n):m(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(p);Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(E)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await b;e.eventId===t.id&&kp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(16,f=e.item),"classId"in e&&i(17,h=e.classId),"className"in e&&i(18,p=e.className),"rowId"in e&&i(1,g=e.rowId),"viewName"in e&&i(19,w=e.viewName),"viewValue"in e&&i(20,v=e.viewValue),"recordId"in e&&i(21,$=e.recordId),"filter"in e&&i(22,I=e.filter),"multiValues"in e&&i(23,_=e.multiValues),"searchValue"in e&&i(0,C=e.searchValue)},[C,g,o,s,a,l,d,u,E,A,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let n=[];if(f.lookup){let r,i,o;if("string"==typeof f.lookup){if(r="."+h+"#"+f.lookup,i=document.querySelector(r),o=i?.value||$,_.has(f.lookup)){const r=_.get(f.lookup)[0];n=r?await t.getSectionView(f.name,{[f.lookup]:r},!0):await Np(f.name,e.id)}else if(o&&24===o.toString().length){const e=await xp(f.lookup,o);if(e&&e[f.name]&&e[f.name].length){const r=e[f.name]?.map(e=>e[f.name]);r?.length&&(n=await t.getSectionView(f.name,{_id:{$in:r}},!0)),n?.length||(n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0))}else n=await t.getSectionView(f.refClass,{[f.lookup]:o},!0)}}else{const{refItem:e,refList:s}=f.lookup,[a,l]=e.split(".");if(r="."+h+"#"+a,i=document.querySelector(r),o=i?.value||$,o){let e=await t.getDocById(a,o);if(e&&l&&(e=await t.getDocById(l,e[l])),e&&e[s]){const r=e[s].map(e=>e[f.name]);n=await t.getSectionView(f.name,{_id:{$in:r}},!0)}}}}else{const r="."+h+"#"+w.split(":")[0],i=document.querySelector(r);let o={[w]:i?.value||$};if(f.refItem){const e="."+h+"#"+f.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[f.refItem]:t.value},{[f.refItem]:{$exists:!0,$eq:""}}]};o={...o,...e}}}catch{}}o[w]&&(n=await t.getSectionView(e.class,o,!0)),I&&(n=n.filter(e=>e._id!=I))}const r=e.display;return{list:n,items:await tn(r,e,n)}},({detail:{value:e}})=>{i(0,C=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(A(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(0,C="")},e=>async()=>{const n=await t.getTaskByDocId(e._id,!0),r=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(r)},f,h,p,w,v,$,I,_,()=>o("back"),function(e){C=e,i(0,C)}]}class Ln extends xe{constructor(e){var t;super(),_n.getElementById("svelte-14hcfjl-style")||((t=M("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}",R(_n.head,t)),Re(this,e,Bn,Pn,S,{item:16,classId:17,className:18,rowId:1,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23,searchValue:0},[-1,-1])}}const{document:Fn}=Ee;function Vn(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Un(e){let t,n,r=e[83]&&function(e){let t,n,r,i,o,a,l,c,d,u,f,h,m,p,g,w,y,v,$,I;function _(t){e[63](t)}function C(t){e[64](t)}let E={class:"full-width",id:e[34],name:e[34],rows:"1",required:e[2],disabled:e[3]||e[36],placeholder:e[36]?"":e[37],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==e[1]&&(E.value=e[1]);void 0!==e[27]&&(E.overwrite=e[27]);n=new s({props:E}),re.push(()=>Se(n,"value",_)),re.push(()=>Se(n,"overwrite",C)),n.$on("click",e[40]()),n.$on("blur",e[49]);const A=[Hn,zn,Wn],b=[];function S(e,t){return e[36]?0:!e[3]||e[16]?1:e[22]&&e[0]?2:-1}~(a=S(e))&&(l=b[a]=A[a](e));let N=(!e[3]||e[16])&&e[0]&&!e[17]&&!e[36]&&Xn(e);function D(t){e[65](t)}let O={class:"tModal",noClickaway:!0,$$slots:{default:[Qn]},$$scope:{ctx:e}};void 0!==e[19]&&(O.open=e[19]);m=new e[30]({props:O}),re.push(()=>Se(m,"open",D));let P=e[20]&&Jn(e),B=e[24]&&nr(e);return{c(){t=M("div"),Ne(n.$$.fragment),o=L(),l&&l.c(),c=L(),d=M("input"),f=L(),N&&N.c(),h=L(),Ne(m.$$.fragment),g=L(),P&&P.c(),w=L(),B&&B.c(),y=F(),z(d,"class",u=T(e[9]||e[10])+" svelte-10ggg6v"),z(d,"id",e[5]),z(d,"name",e[5]),d.value=e[0],d.hidden=!0,q(t,"position","relative")},m(r,i){x(r,t,i),Te(n,t,null),R(t,o),~a&&b[a].m(t,null),R(t,c),R(t,d),R(t,f),N&&N.m(t,null),x(r,h,i),Te(m,r,i),x(r,g,i),P&&P.m(r,i),x(r,w,i),B&&B.m(r,i),x(r,y,i),v=!0,$||(I=V(t,"keydown",e[41]),$=!0)},p(e,o){const s={};4&o[0]&&(s.required=e[2]),8&o[0]&&(s.disabled=e[3]||e[36]),!r&&2&o[0]&&(r=!0,s.value=e[1],ue(()=>r=!1)),!i&&134217728&o[0]&&(i=!0,s.overwrite=e[27],ue(()=>i=!1)),n.$set(s);let f=a;a=S(e),a===f?~a&&b[a].p(e,o):(l&&(ye(),Ie(b[f],1,1,()=>{b[f]=null}),ve()),~a?(l=b[a],l?l.p(e,o):(l=b[a]=A[a](e),l.c()),$e(l,1),l.m(t,c)):l=null),(!v||1536&o[0]&&u!==(u=T(e[9]||e[10])+" svelte-10ggg6v"))&&z(d,"class",u),(!v||32&o[0])&&z(d,"id",e[5]),(!v||32&o[0])&&z(d,"name",e[5]),(!v||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),e[3]&&!e[16]||!e[0]||e[17]||e[36]?N&&(ye(),Ie(N,1,1,()=>{N=null}),ve()):N?(N.p(e,o),196617&o[0]&&$e(N,1)):(N=Xn(e),N.c(),$e(N,1),N.m(t,null));const h={};344784337&o[0]|4194304&o[2]&&(h.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,h.open=e[19],ue(()=>p=!1)),m.$set(h),e[20]?P?(P.p(e,o),1048576&o[0]&&$e(P,1)):(P=Jn(e),P.c(),$e(P,1),P.m(w.parentNode,w)):P&&(ye(),Ie(P,1,1,()=>{P=null}),ve()),e[24]?B?(B.p(e,o),16777216&o[0]&&$e(B,1)):(B=nr(e),B.c(),$e(B,1),B.m(y.parentNode,y)):B&&(ye(),Ie(B,1,1,()=>{B=null}),ve())},i(e){v||($e(n.$$.fragment,e),$e(l),$e(N),$e(m.$$.fragment,e),$e(P),$e(B),v=!0)},o(e){Ie(n.$$.fragment,e),Ie(l),Ie(N),Ie(m.$$.fragment,e),Ie(P),Ie(B),v=!1},d(e){e&&k(t),De(n),~a&&b[a].d(),N&&N.d(),e&&k(h),De(m,e),e&&k(g),P&&P.d(e),e&&k(w),B&&B.d(e),e&&k(y),$=!1,I()}}}(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,t){e[83]&&r.p(e,t)},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Wn(e){let t,n,r,i,o;return n=new lt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[48]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function zn(e){let t,n,r,i,o;return n=new Mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=[V(t,"click",e[40](!0)),V(t,"choose",e[44])],i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,A(o)}}}function Hn(e){let t,n,r,i;const o=[Gn,qn,jn],s=[];function a(e,t){return e[0]?0:!e[3]&&e[12]?1:2}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function jn(e){let t,n,r;return n=new Tt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather3 svelte-10ggg6v")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function qn(e){let t,n,r,i,o;return n=new Tt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[50]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Gn(e){let t,n,r,i,o;return n=new lt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[48]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Xn(e){let t,n,r,i,o;return n=new ot({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 pointer svelte-10ggg6v")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[47]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Yn(e){let t,n,r,i;const o=[Kn,Zn],s=[];function a(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function Zn(e){let t,n;return t=new In({props:{title:e[6].designation,newAllowed:e[23],prevEventId:e[11],schema:e[18],filter:e[35],query:e[38](),record:e[7],recID:e[0],isOpening:e[19],filterForReady:e[26],refStatus:e[6].refStatus,selectionFields:e[14],deList:e[15],praefix:e[13],shouldBlock:e[28],inputSearch:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.title=e[6].designation),8388608&n[0]&&(r.newAllowed=e[23]),2048&n[0]&&(r.prevEventId=e[11]),262144&n[0]&&(r.schema=e[18]),128&n[0]&&(r.record=e[7]),1&n[0]&&(r.recID=e[0]),524288&n[0]&&(r.isOpening=e[19]),67108864&n[0]&&(r.filterForReady=e[26]),64&n[0]&&(r.refStatus=e[6].refStatus),16384&n[0]&&(r.selectionFields=e[14]),32768&n[0]&&(r.deList=e[15]),8192&n[0]&&(r.praefix=e[13]),268435456&n[0]&&(r.shouldBlock=e[28]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Kn(e){let t,n;return t=new Ln({props:{item:e[6],className:e[18].class,classId:e[10],rowId:e[0],recordId:e[12],viewName:e[4],viewValue:"",multiValues:e[8],searchValue:e[42]()}}),t.$on("choose",e[44]),t.$on("back",e[45]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.item=e[6]),262144&n[0]&&(r.className=e[18].class),1024&n[0]&&(r.classId=e[10]),1&n[0]&&(r.rowId=e[0]),4096&n[0]&&(r.recordId=e[12]),16&n[0]&&(r.viewName=e[4]),256&n[0]&&(r.multiValues=e[8]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Qn(e){let t,n,r=e[19]&&Yn(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&$e(r,1)):(r=Yn(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Jn(e){let t,n,r;function i(t){e[66](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[tr]},$$scope:{ctx:e}};return void 0!==e[20]&&(o.open=e[20]),t=new e[30]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function er(e){let t,n;return t=new Fp({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[45]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),1&n[0]&&(r.recID=e[0]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function tr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[er]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function nr(e){let t,n,r;function i(t){e[67](t)}let o={class:"tModal2",noClickaway:!0,$$slots:{default:[ir]},$$scope:{ctx:e}};return void 0!==e[24]&&(o.open=e[24]),t=new e[30]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};35913728&r[0]|4194304&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&16777216&r[0]&&(n=!0,i.open=e[24],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function rr(e){let t,n;return t=new Fp({props:{schema:e[18],dialogAttr:e[25]}}),t.$on("back",e[46]),t.$on("choose",e[43]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};262144&n[0]&&(r.schema=e[18]),33554432&n[0]&&(r.dialogAttr=e[25]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ir(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[rr]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),33816576&n[0]|4194304&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function or(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function sr(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:or,then:Un,catch:Vn,value:83,blocks:[,,,]};return _e(e[39](),r),{c(){t=F(),r.block.c()},m(e,i){x(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){Ce(r,e=t,n)},i(e){n||($e(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){Ie(r.blocks[e])}n=!1},d(e){e&&k(t),r.block.d(e),r.token=null,r=null}}}function ar(e,n,r){let s,a,l,d,f;N(e,i,e=>r(62,s=e)),N(e,o,e=>r(73,f=e));const h=ee(),{Dialog:m,Modal:p}=c,{currentTasks:g,environment:w,loggedIn:y}=u;N(e,g,e=>r(70,a=e)),N(e,w,e=>r(72,d=e)),N(e,y,e=>r(71,l=e));let{id:$}=n,{item:I}=n,{record:_}=n,{fullRecord:C}=n,{value:E=""}=n,{multiValues:A}=n,{desc:b=""}=n,{noForm:S=!1}=n,{classId:T}=n,{eventId:D}=n,{recordId:R}=n,{withRefValue:x=!1}=n,{refValue:k=""}=n,{shortEdit:O}=n,{required:M}=n,{disabled:P}=n,{readonly:B}=n,{praefix:L}=n,{selectionFields:F}=n,{formnovalidate:V}=n,{selection:U}=n,{deList:W}=n,{isTemplate:z}=n,{noList:H=!1}=n,{multi:j=!1}=n,{initFinished:q}=n,{listName:G=""}=n;const X="comment_"+$,Y=I.filter,Z=I.properties?.startDialog;let K,Q,J,te,ne,re,ie,oe,se=!1,ae=!0,le=!1,ce=!0,de=!0,ue=!1,fe="";!U&&I.selection&&1===I.selection.split(":").length&&(U=I.selection);const he=B||P||I.lookup||U&&!I.constraint?"":"Suchbegriff ⏎",me=(e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}},pe=()=>{I.refItem&&I.refItem.startsWith("owner")&&(r(52,k=d.owner[I.refClass]),k||r(52,k=me(I.refItem,d)),k&&(r(51,x=!0),h("change",{value:k})))},ge=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{h("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})})},we=async e=>{const n=()=>{r(19,se=!0)};if(9==e.which)return;if(E)return e.preventDefault();if(13!=e.which)return;if(e.preventDefault(),I.lookup)return n();const i=te.items.find(e=>e.properties?.search);if(!i)return n();const o=e.srcElement.value,{name:s,checkOn:a,refClass:l,properties:c}=i;let{search:d}=c;!0===d&&(d={}),"number"==typeof d&&(d={min:d});const{min:u=3,start:f=!1,end:h=!1}=d;if(o.length<u)return n();const m=(f?"^":"")+o+(h?"$":"");let p={[s]:{$regex:m,$options:"i"}};a&&(p=[{$lookup:{from:l,localField:s,foreignField:"_id",as:l}},{$match:{[l+"."+a]:{$regex:m,$options:"i"}}}]);const g=await t.getSectionView(te.class,p);1!==g?.length?n():r(0,E=g[0]._id)},ye=e=>{e&&(r(61,fe=r(1,b=v(te,e))),h("setRefDesc",b.split(" •")[0]),h("change",{value:E,description:b}),h("task",{row:e,eventId:te.id}))},ve=()=>{r(19,se=!1),r(20,Q=!1)},$e=()=>{r(24,le=!1)};return e.$$set=e=>{"id"in e&&r(5,$=e.id),"item"in e&&r(6,I=e.item),"record"in e&&r(55,_=e.record),"fullRecord"in e&&r(7,C=e.fullRecord),"value"in e&&r(0,E=e.value),"multiValues"in e&&r(8,A=e.multiValues),"desc"in e&&r(1,b=e.desc),"noForm"in e&&r(9,S=e.noForm),"classId"in e&&r(10,T=e.classId),"eventId"in e&&r(11,D=e.eventId),"recordId"in e&&r(12,R=e.recordId),"withRefValue"in e&&r(51,x=e.withRefValue),"refValue"in e&&r(52,k=e.refValue),"shortEdit"in e&&r(56,O=e.shortEdit),"required"in e&&r(2,M=e.required),"disabled"in e&&r(3,P=e.disabled),"readonly"in e&&r(53,B=e.readonly),"praefix"in e&&r(13,L=e.praefix),"selectionFields"in e&&r(14,F=e.selectionFields),"formnovalidate"in e&&r(57,V=e.formnovalidate),"selection"in e&&r(4,U=e.selection),"deList"in e&&r(15,W=e.deList),"isTemplate"in e&&r(16,z=e.isTemplate),"noList"in e&&r(58,H=e.noList),"multi"in e&&r(17,j=e.multi),"initFinished"in e&&r(54,q=e.initFinished),"listName"in e&&r(59,G=e.listName)},e.$$.update=()=>{if(4&e.$$.dirty[0]|67108864&e.$$.dirty[1]&&r(2,M="boolean"==typeof M&&(M&&!V)),4160&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(53,B||=R&&I.asInput),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(3,P||=B),3145728&e.$$.dirty[1]&&x&&r(0,E=k),3&e.$$.dirty[0]|1073741824&e.$$.dirty[1]&&!b&&E&&fe&&r(1,b=fe),399425&e.$$.dirty[0]|411041792&e.$$.dirty[1]&&E&&te){let e=!1;if(!Array.isArray(E)){if(R||I.asInput||I.upate||!1!==I.refItem||!0===j||!1===I.refItem&&q){const t="p$"+G+"$"+I.refClass+"$"+D,n=Sp(t);n?.then?n.then(e=>{const t=e.find(({_id:e})=>e===E);t?ye(t):Tp(I.refClass,te.id,E,!!I.lookup||H).then(ye)}):e=!0}e&&Tp(I.refClass,te.id,E,!!I.lookup||H).then(ye),r(54,q=!0)}}if(65&e.$$.dirty[0]|536870912&e.$$.dirty[1]|1&e.$$.dirty[2]&&E&&ne&&I.name===ne.input?.at(0)&&ne.inputLookup?.length){const{domain:e}=ne.inputLookup[0]||{};"user"===e&&(s.some(e=>ne.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0))}262145&e.$$.dirty[0]&&!E&&te&&ye({})},[E,b,M,P,U,$,I,C,A,S,T,D,R,L,F,W,z,j,te,se,Q,J,re,ae,le,ie,ce,de,ue,m,p,g,w,y,X,Y,Z,he,()=>{if(!I.query)return;const[e,t]=I.query.split(".");let n;return n=C[t]?[{$lookup:{from:e,localField:e,foreignField:"_id",as:"__"+e}},{$unwind:{path:"$__"+e,preserveNullAndEmptyArrays:!0}},{$match:{["__"+e+"."+t]:C[t]}}]:[{$match:{[e]:C[e]}}],I.refStatus&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":I.refStatus}}])),n},async()=>{try{if(K=await t.getEvent(D),oe="report"===K.output.type,r(26,ce=!I.asInput),r(23,ae=K.output?.class[0].name!==I.refClass),r(18,te=await t.getSchemaByClass(I.refClass)),te?.blocked)return h("initFail",!0),!1;if(oe||r(28,ue=((e,t)=>{let n=t.items.find(e=>!!e.properties?.blocking);if(!n)return!1;if(e.input?.class?.find(e=>e.name===t.class))return n.name;const r=e.output?.class.at(0)?.list||[];for(const e of r){const t=e.item.find(e=>e.name===I.name);if(t?.properties?.blocking)return n.name}return!1})(K,te)),r(22,re=(e=>!a?.length||!!a.find(t=>t===e))(te.id)),r(60,ne=await t.getSchema(D)),D&&R&&E&&!P&&ne.input?.find(e=>e===I.refClass)&&r(3,P=!0),K.input?.class&&K.input.class[0]&&(K.input.class[0].name===I.refClass&&K.input.class[0].readonly&&r(3,P=!0),R&&K.input.class[0].name===I.refClass&&K.input.class[0].writeState)){(await t.getTaskByDocId(R,!0)).status===K.input.class[0].writeState&&r(3,P=r(53,B=!1))}if(I.properties?.query?.lookup){const{domain:e,value:n}=I.properties.query.lookup;if("user"===e){const e=l.user,i={[n]:e},o=await t.getSectionView(I.refClass,i);if(o?.length){const[{_id:e}]=o;e&&(r(52,k=e),r(51,x=!0),h("change",{value:k}))}s.some(e=>te.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0)}}else pe();if(!P&&!k&&I.filter&&(""===L||void 0===L)){const e=I.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly(I.refClass,{[I.filter]:n});i&&(r(52,k=i._id),r(51,x=!0),h("change",{value:k}))}return r(21,J=te.identity.designation),E||ge(te),!0}catch{return h("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!Z){if(!0===e&&r(19,se=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}(I.lookup||U&&!I.constraint||E)&&r(19,se=!0)}},we,()=>{if(E)return"";r(1,b="");const e="#"+T+(G?" ."+T+G:"")+" #"+X,t=document.querySelectorAll(e)[0];return t?.value?t.value:""},async({detail:e})=>{if(e.className=te.class,r(0,E=e.row._id),""===L||void 0===L?h("saveDialog",{itemName:I.name,value:E,closeTask:I.properties?.closeTask}):h("listChange",e),I.properties?.closeTask&&K.output?.approval){const e=await t.getTaskByDocId(_._id),n=K.output.approval.flatMap(({refRole:e})=>e),r={eventId:D,eventDesignation:K.identity.designation,docId:_._id,role:n.filter(e=>s.find(t=>t===e)).join(", "),user:f.email,timeStamp:(new Date).toISOString()};await t.setTaskVisum(e._id,r)}$e()},({detail:e})=>{r(0,E=e.row._id),ve()},ve,$e,()=>{(oe||re)&&(j?h("change",{value:E,delete:!0}):(r(0,E=""),r(1,b=""),r(27,de=!0),h("change",{value:E,description:b}),h("task",{row:{_task:{event:te.id},_id:!1},eventId:te.id})))},async()=>{if(!E)return;let e=await Tp(I.refClass,te.id,E);e._task||(e={_task:await t.getTaskByDocId(E,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{E||b&&we({which:13,preventDefault:()=>{},srcElement:{value:b}})},async e=>{r(25,ie={});for(const e in Z){let n=Z[e],i="";if(n.startsWith("owner"))i=me(n,d);else if(n.startsWith("+")){const[e,r]=n.slice(1).split(".");n=e;const o=await t.getSchemaByClass(n),s=_[n];let a=await Np("",o.id);if(a?.length){a=a.sort((e,t)=>e[r]>t[r]?1:e[r]<t[r]?-1:0);const e=a.findIndex(e=>e._id===s);i=a[+e+1]._id||""}}else if(n.includes("|"))for(const e of n.split("|"))i||(i=_[e]);else i=_[n]||C&&C[n];r(25,ie[e]=i,ie)}r(24,le=!0)},x,k,B,q,_,O,V,H,G,ne,fe,s,function(e){b=e,r(1,b),r(0,E),r(61,fe),r(51,x),r(52,k)},function(e){de=e,r(27,de)},function(e){se=e,r(19,se)},function(e){Q=e,r(20,Q)},function(e){le=e,r(24,le)}]}class lr extends xe{constructor(e){var t;super(),Fn.getElementById("svelte-10ggg6v-style")||((t=M("style")).id="svelte-10ggg6v-style",t.textContent=".feather.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-10ggg6v{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.feather3.svelte-10ggg6v{position:absolute;top:0.75em;left:0.5em;color:gray}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}.modal-overlay.tModal2 > .dialog{margin-top:0 !important}",R(Fn.head,t)),Re(this,e,ar,sr,S,{id:5,item:6,record:55,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:51,refValue:52,shortEdit:56,required:2,disabled:3,readonly:53,praefix:13,selectionFields:14,formnovalidate:57,selection:4,deList:15,isTemplate:16,noList:58,multi:17,initFinished:54,listName:59},[-1,-1,-1])}}const{document:cr}=Ee;function dr(e){e[45]=e[46].items}function ur(e,t,n){const r=e.slice();return r[47]=t[n],r[49]=n,r}function fr(e,t,n){const r=e.slice();return r[50]=t[n],r[52]=n,r}function hr(e,t,n){const r=e.slice();return r[50]=t[n],r}function mr(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function pr(e){let t,n,r,i;dr(e);const o=[wr,gr],s=[];function a(e,t){return e[6]?1:0}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){dr(e);let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function gr(e){let t,n;return t=new Fp({props:{schema:e[4],recID:e[7]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.schema=e[4]),128&n[0]&&(r.recID=e[7]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function wr(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v,$,I,_;n=new e[12]({props:{outline:!0,$$slots:{default:[yr]},$$scope:{ctx:e}}}),n.$on("click",e[33]);let C=e[1]&&vr(e);o=new e[12]({props:{disabled:!e[5].length,filled:!0,$$slots:{default:[Ir]},$$scope:{ctx:e}}}),o.$on("click",e[17]);let E=e[14]&&function(e){let t,n;return t=new e[9]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}(e);function A(t){e[34](t)}let b={id:e[13]};void 0!==e[3]&&(b.value=e[3]),d=new e[10]({props:b}),re.push(()=>Se(d,"value",A)),d.$on("input",e[19]),m=new ot({props:{size:"18"}});let S=e[45]?.length&&_r(e),N=e[5]?.length&&Er(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),C&&C.c(),i=L(),Ne(o.$$.fragment),s=L(),E&&E.c(),a=L(),l=M("div"),c=B("Suchen: "),Ne(d.$$.fragment),f=L(),h=M("span"),Ne(m.$$.fragment),p=L(),g=M("div"),w=M("table"),S&&S.c(),y=L(),v=M("tbody"),N&&N.c(),z(t,"class","form--buttons svelte-4visk8"),z(h,"class","feather pointer svelte-4visk8"),q(l,"margin-bottom","1em"),q(l,"position","relative"),z(w,"striped",""),z(w,"class","svelte-4visk8"),z(g,"class","eList svelte-4visk8")},m(u,A){x(u,t,A),Te(n,t,null),R(t,r),C&&C.m(t,null),R(t,i),Te(o,t,null),x(u,s,A),E&&E.m(u,A),x(u,a,A),x(u,l,A),R(l,c),Te(d,l,null),R(l,f),R(l,h),Te(m,h,null),x(u,p,A),x(u,g,A),R(g,w),S&&S.m(w,null),R(w,y),R(w,v),N&&N.m(v,null),$=!0,I||(_=V(h,"click",e[21]),I=!0)},p(e,r){const s={};16777216&r[1]&&(s.$$scope={dirty:r,ctx:e}),n.$set(s),e[1]?C?(C.p(e,r),2&r[0]&&$e(C,1)):(C=vr(e),C.c(),$e(C,1),C.m(t,i)):C&&(ye(),Ie(C,1,1,()=>{C=null}),ve());const a={};32&r[0]&&(a.disabled=!e[5].length),16777216&r[1]&&(a.$$scope={dirty:r,ctx:e}),o.$set(a);const l={};!u&&8&r[0]&&(u=!0,l.value=e[3],ue(()=>u=!1)),d.$set(l),e[45]?.length?S?(S.p(e,r),4&r[0]&&$e(S,1)):(S=_r(e),S.c(),$e(S,1),S.m(w,y)):S&&(ye(),Ie(S,1,1,()=>{S=null}),ve()),e[5]?.length?N?(N.p(e,r),32&r[0]&&$e(N,1)):(N=Er(e),N.c(),$e(N,1),N.m(v,null)):N&&(ye(),Ie(N,1,1,()=>{N=null}),ve())},i(e){$||($e(n.$$.fragment,e),$e(C),$e(o.$$.fragment,e),$e(E),$e(d.$$.fragment,e),$e(m.$$.fragment,e),$e(S),$e(N),$=!0)},o(e){Ie(n.$$.fragment,e),Ie(C),Ie(o.$$.fragment,e),Ie(E),Ie(d.$$.fragment,e),Ie(m.$$.fragment,e),Ie(S),Ie(N),$=!1},d(e){e&&k(t),De(n),C&&C.d(),De(o),e&&k(s),E&&E.d(e),e&&k(a),e&&k(l),De(d),De(m),e&&k(p),e&&k(g),S&&S.d(),N&&N.d(),I=!1,_()}}}function yr(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function vr(e){let t,n;return t=new e[12]({props:{filled:!0,$$slots:{default:[$r]},$$scope:{ctx:e}}}),t.$on("click",e[23]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16777216&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function $r(e){let t;return{c(){t=B("Neu")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Ir(e){let t;return{c(){t=B("Bestätigen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function _r(e){let t,n,r,i,o,s,a,l;i=new Ze({props:{size:"20",style:"color: #326173;"}});let c=e[45],d=[];for(let t=0;t<c.length;t+=1)d[t]=Cr(hr(e,c,t));return{c(){t=M("thead"),n=M("tr"),r=M("th"),Ne(i.$$.fragment),o=L();for(let e=0;e<d.length;e+=1)d[e].c();z(r,"class","svelte-4visk8"),z(n,"class","svelte-4visk8"),z(t,"class","svelte-4visk8")},m(c,u){x(c,t,u),R(t,n),R(n,r),Te(i,r,null),R(n,o);for(let e=0;e<d.length;e+=1)d[e].m(n,null);s=!0,a||(l=V(r,"click",function(){b(e[22](e[5]))&&e[22](e[5]).apply(this,arguments)}),a=!0)},p(t,r){if(e=t,262148&r[0]){let t;for(c=e[45],t=0;t<c.length;t+=1){const i=hr(e,c,t);d[t]?d[t].p(i,r):(d[t]=Cr(i),d[t].c(),d[t].m(n,null))}for(;t<d.length;t+=1)d[t].d(1);d.length=c.length}},i(e){s||($e(i.$$.fragment,e),s=!0)},o(e){Ie(i.$$.fragment,e),s=!1},d(e){e&&k(t),De(i),O(d,e),a=!1,l()}}}function Cr(e){let t,n,r=e[50]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-4visk8")},m(e,r){x(e,t,r),R(t,n)},p(e,t){4&t[0]&&r!==(r=e[50]?.designation+"")&&H(n,r)},d(e){e&&k(t)}}}function Er(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[47]._id;for(let t=0;t<o.length;t+=1){let n=ur(e,o,t),a=s(n);i.set(a,r[t]=Nr(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);x(e,t,i),n=!0},p(e,n){1409069&n[0]&&(o=e[5],ye(),r=be(r,n,s,1,e,o,i,t.parentNode,Ae,Nr,t,ur),ve())},i(e){if(!n){for(let e=0;e<o.length;e+=1)$e(r[e]);n=!0}},o(e){for(let e=0;e<r.length;e+=1)Ie(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&k(t)}}}function Ar(e){let t,n,r,i,o=e[0],s=br(e),a=e[45],l=[];for(let t=0;t<a.length;t+=1)l[t]=Sr(fr(e,a,t));return{c(){t=M("tr"),s.c(),n=L();for(let e=0;e<l.length;e+=1)l[e].c();r=L(),z(t,"class","svelte-4visk8"),G(t,"active",e[0].includes(e[47]._id))},m(e,o){x(e,t,o),s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);R(t,r),i=!0},p(e,i){if(1&i[0]&&S(o,o=e[0])?(ye(),Ie(s,1,1,_),ve(),s=br(e),s.c(),$e(s),s.m(t,n)):s.p(e,i),327716&i[0]){let n;for(a=e[45],n=0;n<a.length;n+=1){const o=fr(e,a,n);l[n]?l[n].p(o,i):(l[n]=Sr(o),l[n].c(),l[n].m(t,r))}for(;n<l.length;n+=1)l[n].d(1);l.length=a.length}33&i[0]&&G(t,"active",e[0].includes(e[47]._id))},i(e){i||($e(s),i=!0)},o(e){Ie(s),i=!1},d(e){e&&k(t),s.d(e),O(l,e)}}}function br(e){let t,n,r;return n=new e[11]({props:{name:e[15],data:e[47]._id,checked:e[0].includes(e[47]._id),round:!0}}),{c(){t=M("td"),Ne(n.$$.fragment),z(t,"title","Wählt den Wert aus"),z(t,"class","svelte-4visk8")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};32&t[0]&&(r.data=e[47]._id),33&t[0]&&(r.checked=e[0].includes(e[47]._id)),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Sr(e){let t,n,r,i=e[16](e[47],e[50])+"";return{c(){t=M("td"),n=B(i),z(t,"class",r=T(e[50].type)+" svelte-4visk8")},m(e,r){x(e,t,r),R(t,n)},p(e,o){36&o[0]&&i!==(i=e[16](e[47],e[50])+"")&&H(n,i),4&o[0]&&r!==(r=T(e[50].type)+" svelte-4visk8")&&z(t,"class",r)},d(e){e&&k(t)}}}function Nr(e,t){let n,r,i,o=t[20](t[47],t[45],t[3]),s=o&&Ar(t);return{key:e,first:null,c(){n=F(),s&&s.c(),r=F(),this.first=n},m(e,t){x(e,n,t),s&&s.m(e,t),x(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[20](t[47],t[45],t[3])),o?s?(s.p(t,n),44&n[0]&&$e(s,1)):(s=Ar(t),s.c(),$e(s,1),s.m(r.parentNode,r)):s&&(ye(),Ie(s,1,1,()=>{s=null}),ve())},i(e){i||($e(s),i=!0)},o(e){Ie(s),i=!1},d(e){e&&k(n),s&&s.d(e),e&&k(r)}}}function Tr(e){let t,n;return t=new e[9]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Dr(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Tr,then:pr,catch:mr,value:46,blocks:[,,,]};return _e(n=e[2]&&e[18](),i),{c(){t=F(),i.block.c()},m(e,n){x(e,t,n),i.block.m(e,i.anchor=n),i.mount=()=>t.parentNode,i.anchor=t,r=!0},p(t,r){e=t,i.ctx=e,4&r[0]&&n!==(n=e[2]&&e[18]())&&_e(n,i)||Ce(i,e,r)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),i.block.d(e),i.token=null,i=null}}}function Rr(e,i,o){let s=JSON.parse(n.getItem("Locale")).id;const a=ee(),{Loading:l,TextField:d,Checkbox:u,Button:f}=c;let h,p,g,w,{inputList:v}=i,{selection:$}=i,{item:I}=i,{target:_}=i,{className:C}=i,{classId:E}=i,{recordId:A}=i,{stopAggregation:b=!1}=i,{shouldNew:S}=i,N=!0,T=C+Math.floor(9e3*Math.random()+1e3).toString()+"search",D=!1;$||=[];let R=$;const x=C+_+"checkbox",k=(e,t)=>{if(!t)return;let n=e[t.name];if("__total"===t.name&&void 0===n&&(n=1.081*e._total),!n&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[r,i]=t.name.split("_");try{n=e[r][i]}catch{}}if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let t=[];for(const r of n)t=t.concat(r.serialno.map(e));n=t.join(", ")}else 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[r,i]=t.name.split("_");try{n=e[r][0][i],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===t.type&&(n||(n=e[`_${t.name}`]),n=Number(n)?Number(n).toLocaleString(s,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===n&&(n=!1),"number"===t.type?n:"boolean"==typeof n||"boolean"===t.type?y(n):m(e[`_${t.name}`]||n||"")},O=t.getSchemaByClass(C),M=(e,t)=>{if(e){let n,r="1";if("string"==typeof e)n=e;else{const t=Object.keys(e);n=t[0],r=e[t[0]]}"date"===n&&(r="-1");const i=new Intl.Collator(s,{numeric:!0});return 1==+r?t.sort((e,t)=>i.compare(e[n],t[n])):t.sort((e,t)=>i.compare(t[n],e[n]))}return t};Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(T)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await O;e.eventId===t.id&&(kp(t.class,e.eventId),o(2,N=!o(2,N=!1)))});const P=()=>{o(6,D=!1)};return e.$$set=e=>{"inputList"in e&&o(26,v=e.inputList),"selection"in e&&o(0,$=e.selection),"item"in e&&o(27,I=e.item),"target"in e&&o(28,_=e.target),"className"in e&&o(29,C=e.className),"classId"in e&&o(30,E=e.classId),"recordId"in e&&o(31,A=e.recordId),"stopAggregation"in e&&o(32,b=e.stopAggregation),"shouldNew"in e&&o(1,S=e.shouldNew)},[$,S,N,h,p,g,D,w,a,l,d,u,f,T,!1,x,k,()=>{const e=document.getElementsByName(x),t=Array.from(e).filter(e=>e.checked).map(e=>e.attributes.data.value);if(h){const e=R.filter(e=>!t.find(t=>t==e));o(0,$=t.concat(e)),R=[...$]}else o(0,$=t),R=[];a("choose",{list:$})},async()=>{o(4,p=await O),g||o(5,g=M(p.displaySort,await v||await Np(p.class,p.id)));const{display:e}=p;let n=await(async(e,n,r)=>{if(!e)return;let i=[];for(const o of e){if("_total"===o){i.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){i.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[e,s]=o.split(".");let a=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===s);if(a&&(a={...a},a.name=`${e}_${s}`,r=r.map(t=>(t[e]&&(t[a.name]=t["_"+e]?t["_"+e][s]:t[e][s]),t))),o.endsWith("_from")||o.endsWith("_to")){const t=a=n.items.find(t=>t.name===e.split("_")[0]);t&&(a={name:o,designation:t.designation,type:"date",decimals:0})}if(a||(a=n.items.find(t=>t.name===e)),!a){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===s);r&&(a={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}i.find(t=>t?.name===e)||i.push(a)}return i.length?i:n.items})(e,p,g);return{items:n}},({detail:{value:e}})=>{o(3,h=e)},(e,t,n)=>{if(!e)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const i of t){const t=k(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{o(3,h="")},e=>()=>{document.getElementsByName(x).forEach((e,t)=>{e.checked=!e.checked})},()=>{o(7,w=!1),o(6,D=!0)},async e=>{o(5,g=M(p.displaySort,await Np(p.class,p.id))),e.detail?.row?._id&&$.push(e.detail.row._id),P()},P,v,I,_,C,E,A,b,()=>a("back"),function(e){h=e,o(3,h)}]}class xr extends xe{constructor(e){var t;super(),cr.getElementById("svelte-4visk8-style")||((t=M("style")).id="svelte-4visk8-style",t.textContent=".feather.svelte-4visk8.svelte-4visk8{position:absolute;top:2em;right:0.5em;color:#326173}td .checkbox .selector{border:0.125em solid #326173 !important}.eList.svelte-4visk8.svelte-4visk8{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-4visk8 .editRow.svelte-4visk8{width:1em}.eList.svelte-4visk8 table.svelte-4visk8{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-4visk8 table thead.svelte-4visk8{position:sticky;top:0;background:#326173;color:white}.eList.svelte-4visk8 table thead tr.svelte-4visk8{height:2.3em}.eList.svelte-4visk8 table tbody tr.svelte-4visk8{height:2.75em !important}th.svelte-4visk8.svelte-4visk8,td.svelte-4visk8.svelte-4visk8{padding-left:0.4em;padding-right:0.4em}td.number.svelte-4visk8.svelte-4visk8{text-align:end}tr.active.svelte-4visk8.svelte-4visk8{color:#326173;background-color:#fcebd5}.form--buttons.svelte-4visk8.svelte-4visk8{display:flex;gap:1em;padding:0.5em 0}",R(cr.head,t)),Re(this,e,Rr,Dr,S,{inputList:26,selection:0,item:27,target:28,className:29,classId:30,recordId:31,stopAggregation:32,shouldNew:1},[-1,-1])}}function kr(e,t,n){const r=e.slice();return r[12]=t[n],r[42]=n,r}function Or(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Mr(e){let t,n;return t=new e[17]({props:{outline:!0,$$slots:{default:[Lr]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};36863&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Pr(e){let t,n,r,i,o;return n=new wt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[23]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Br(e){let t,n;return t=new lr({props:{classId:e[5],eventId:e[6],required:e[8],disabled:e[0],formnovalidate:e[11],readonly:e[9],id:e[1]+"."+e[42],item:e[2],desc:e[3],value:e[12],noForm:e[4],praefix:e[10],recordId:e[7],multi:!0+"}"}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};32&n[0]&&(r.classId=e[5]),64&n[0]&&(r.eventId=e[6]),256&n[0]&&(r.required=e[8]),1&n[0]&&(r.disabled=e[0]),2048&n[0]&&(r.formnovalidate=e[11]),512&n[0]&&(r.readonly=e[9]),2&n[0]&&(r.id=e[1]+"."+e[42]),4&n[0]&&(r.item=e[2]),8&n[0]&&(r.desc=e[3]),32768&n[0]&&(r.value=e[12]),16&n[0]&&(r.noForm=e[4]),1024&n[0]&&(r.praefix=e[10]),128&n[0]&&(r.recordId=e[7]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Lr(e){let t,n,r,i=!e[9]&&Pr(e),o=e[15],s=[];for(let t=0;t<o.length;t+=1)s[t]=Br(kr(e,o,t));const a=e=>Ie(s[e],1,1,()=>{s[e]=null});return{c(){i&&i.c(),t=L();for(let e=0;e<s.length;e+=1)s[e].c();n=F()},m(e,o){i&&i.m(e,o),x(e,t,o);for(let t=0;t<s.length;t+=1)s[t].m(e,o);x(e,n,o),r=!0},p(e,r){if(e[9]?i&&(ye(),Ie(i,1,1,()=>{i=null}),ve()):i?(i.p(e,r),512&r[0]&&$e(i,1)):(i=Pr(e),i.c(),$e(i,1),i.m(t.parentNode,t)),36863&r[0]){let t;for(o=e[15],t=0;t<o.length;t+=1){const i=kr(e,o,t);s[t]?(s[t].p(i,r),$e(s[t],1)):(s[t]=Br(i),s[t].c(),$e(s[t],1),s[t].m(n.parentNode,n))}for(ye(),t=o.length;t<s.length;t+=1)a(t);ve()}},i(e){if(!r){$e(i);for(let e=0;e<o.length;e+=1)$e(s[e]);r=!0}},o(e){Ie(i),s=s.filter(Boolean);for(let e=0;e<s.length;e+=1)Ie(s[e]);r=!1},d(e){i&&i.d(e),e&&k(t),O(s,e),e&&k(n)}}}function Fr(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Vr(e){let t,n;return t=new e[19]({props:{title:e[14].designation,class:"eList",$$slots:{default:[Ur]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),82084&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Ur(e){let t,n;return t=new xr({props:{selection:e[16],item:e[2],className:e[14].class,classId:e[5],recordId:e[7],inputList:e[22](),target:e[2].name,shouldNew:!e[20]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};65536&n[0]&&(r.selection=e[16]),4&n[0]&&(r.item=e[2]),16384&n[0]&&(r.className=e[14].class),32&n[0]&&(r.classId=e[5]),128&n[0]&&(r.recordId=e[7]),4&n[0]&&(r.target=e[2].name),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Wr(e){let t,n,r=e[13]&&Vr(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&$e(r,1)):(r=Vr(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function zr(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Fr,then:Mr,catch:Or,value:40,blocks:[,,,]};function s(t){e[34](t)}_e(e[21](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[Wr]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[18]({props:a}),re.push(()=>Se(n,"open",s)),{c(){o.block.c(),t=L(),Ne(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,x(e,t,r),Te(n,e,r),i=!0},p(t,i){Ce(o,e=t,i);const s={};90276&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],ue(()=>r=!1)),n.$set(s)},i(e){i||($e(o.block),$e(n.$$.fragment,e),i=!0)},o(e){for(let e=0;e<3;e+=1){Ie(o.blocks[e])}Ie(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&k(t),De(n,e)}}}function Hr(e,n,r){const i=ee(),{Card:o,Modal:s,Dialog:a,Button:l}=c;let d,u,f,{id:h}=n,{item:m}=n,{record:p}=n,{value:g=[]}=n,{desc:w=""}=n,{noForm:y=!1}=n,{classId:v}=n,{eventId:$}=n,{recordId:I}=n,{withRefValue:_=!1}=n,{refValue:C=""}=n,{required:E}=n,{disabled:A}=n,{readonly:b}=n,{praefix:S}=n,{selectionFields:N}=n,{formnovalidate:T}=n,{selection:D}=n,{deList:R}=n,{isTemplate:x}=n,{noList:k=!1}=n,O=!1;const{lookup:M,refStatus:P,filter:B,constraint:L}=m.properties.multi;A=!0;const F=()=>{r(13,O=!1)};return e.$$set=e=>{"id"in e&&r(1,h=e.id),"item"in e&&r(2,m=e.item),"record"in e&&r(26,p=e.record),"value"in e&&r(12,g=e.value),"desc"in e&&r(3,w=e.desc),"noForm"in e&&r(4,y=e.noForm),"classId"in e&&r(5,v=e.classId),"eventId"in e&&r(6,$=e.eventId),"recordId"in e&&r(7,I=e.recordId),"withRefValue"in e&&r(27,_=e.withRefValue),"refValue"in e&&r(28,C=e.refValue),"required"in e&&r(8,E=e.required),"disabled"in e&&r(0,A=e.disabled),"readonly"in e&&r(9,b=e.readonly),"praefix"in e&&r(10,S=e.praefix),"selectionFields"in e&&r(29,N=e.selectionFields),"formnovalidate"in e&&r(11,T=e.formnovalidate),"selection"in e&&r(30,D=e.selection),"deList"in e&&r(31,R=e.deList),"isTemplate"in e&&r(32,x=e.isTemplate),"noList"in e&&r(33,k=e.noList)},[A,h,m,w,y,v,$,I,E,b,S,T,g,O,d,u,f,o,s,a,M,async()=>{r(15,u=[].concat(g)),r(14,d=await t.getSchemaByClass(m.refClass))},async()=>{let e,n;if(M)if(M.refClass){if(p[M.refClass]){const r=await xp(M.refClass,p[M.refClass]);r&&Array.isArray(r[M.refItem])&&(n=[{$match:{_id:{$in:r[M.refItem]}}}],e=await t.getSectionView(d.class,n,!0))}}else n=[{$match:{[M]:p[M]}}],P&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":P}}])),e=await t.getSectionView(d.class,n,!0);else e=await Np("",d.id);if(!e?.length)return[];if(L&&e?.length){const{refClass:r,refStatus:i}=L,o=d.class===r?"_id":d.class;n=[{$match:{[o]:{$in:e.map(({_id:e})=>e)}}},{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":i}}];const s=await t.getSectionView(r,n,!0);"project"!==r&&(e=e.filter(e=>!!s.find(t=>t.project==e._id)))}if(B)for(const t in B)e=e.filter(e=>{let[n,r]=t.split(".");if(r||(r=n,n=""),n){if(e[n][0]&&e[n][0][r].length)return!0}else if(e[r])return!0;return!1});return e},()=>{b||(r(13,O=!0),r(16,f=u))},({detail:e})=>{p.__id||(r(15,u=e.list),i("change",{value:u}),i("multi",{lookup:M,filter:B,name:m.name,value:u})),F()},F,p,_,C,N,D,R,x,k,function(e){O=e,r(13,O)}]}class jr extends xe{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=M("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",R(document.head,t)),Re(this,e,Hr,zr,S,{id:1,item:2,record:26,value:12,desc:3,noForm:4,classId:5,eventId:6,recordId:7,withRefValue:27,refValue:28,required:8,disabled:0,readonly:9,praefix:10,selectionFields:29,formnovalidate:11,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const qr=/\d+/g,Gr=/%[HMSpPdmyY%]/g;function Xr(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split(Gr);let s=0,a=0;const l=new Date(0);for(const c of o){if(!e.startsWith(c,s))return n;if(s+=c.length,s===e.length){if(a!==t.length)return n;break}if("%"!==t[a+c.length])break;if(a+=c.length+1,"%"===t[a]){if("%"!==e[s])return n;s++}else if("p"===t[a].toLowerCase()){const t=e.substr(s,2).toUpperCase();if("AM"===t)i=!1,l.getHours()>=12&&l.setHours(l.getHours()-12);else{if("PM"!==t)return n;i=!0,l.getHours()<12&&l.setHours(l.getHours()+12)}}else{qr.lastIndex=s;const o=qr.exec(e);if(null==o)return n;switch(t[a]){case"H":l.setHours(parseInt(o[0])+12*i);break;case"M":l.setMinutes(o[0]);break;case"S":l.setSeconds(o[0]);break;case"d":l.setDate(o[0]);break;case"m":l.setMonth(o[0]-1);break;case"y":l.setFullYear(100*r+parseInt(o[0]));break;case"Y":l.setFullYear(o[0])}s+=o[0].length}a++}return isNaN(l.valueOf())?n:l}function Yr(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Zr}=Ee;function Kr(e,t,n){const r=e.slice();return r[17]=t[n],r}function Qr(e,t,n){const r=e.slice();return r[20]=t[n],r}function Jr(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function ei(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m=e[0].items,p=[];for(let t=0;t<m.length;t+=1)p[t]=ni(Qr(e,m,t));const g=e=>Ie(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&ri(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[oi]},$$scope:{ctx:e}}}),l.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[si]},$$scope:{ctx:e}}}),{c(){t=M("form"),n=M("input"),i=L();for(let e=0;e<p.length;e+=1)p[e].c();o=L(),w&&w.c(),s=L(),a=M("div"),Ne(l.$$.fragment),c=L(),Ne(d.$$.fragment),z(n,"class",T(e[6])+" svelte-1phofh5"),z(n,"name","_id"),z(n,"type","hidden"),n.value=r=e[1]._id||"",z(t,"class","fTask svelte-1phofh5"),z(t,"id",e[6]),z(a,"class","form--buttons svelte-1phofh5")},m(r,m){x(r,t,m),R(t,n),R(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);R(t,o),w&&w.m(t,null),x(r,s,m),x(r,a,m),Te(l,a,null),R(a,c),Te(d,a,null),u=!0,f||(h=[V(t,"keydown",e[8]),V(t,"submit",U(e[10]))],f=!0)},p(e,i){if((!u||2&i&&r!==(r=e[1]._id||""))&&(n.value=r),75&i){let n;for(m=e[0].items,n=0;n<m.length;n+=1){const r=Qr(e,m,n);p[n]?(p[n].p(r,i),$e(p[n],1)):(p[n]=ni(r),p[n].c(),$e(p[n],1),p[n].m(t,o))}for(ye(),n=m.length;n<p.length;n+=1)g(n);ve()}e[0].list?w?(w.p(e,i),1&i&&$e(w,1)):(w=ri(e),w.c(),$e(w,1),w.m(t,null)):w&&(ye(),Ie(w,1,1,()=>{w=null}),ve());const s={};8388608&i&&(s.$$scope={dirty:i,ctx:e}),l.$set(s);const a={};4&i&&(a.disabled=e[2]),8388608&i&&(a.$$scope={dirty:i,ctx:e}),d.$set(a)},i(e){if(!u){for(let e=0;e<m.length;e+=1)$e(p[e]);$e(w),$e(l.$$.fragment,e),$e(d.$$.fragment,e),u=!0}},o(e){p=p.filter(Boolean);for(let e=0;e<p.length;e+=1)Ie(p[e]);Ie(w),Ie(l.$$.fragment,e),Ie(d.$$.fragment,e),u=!1},d(e){e&&k(t),O(p,e),w&&w.d(),e&&k(s),e&&k(a),De(l),De(d),f=!1,A(h)}}}function ti(e){let t,n;return t=new Su({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(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.item=e[20]),1&n&&(r.selection=e[20].selection),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),1&n&&(r.eventId=e[0].id),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ni(e){let t,n,r=ci(!0,e[20]),i=r&&ti(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){1&n&&(r=ci(!0,e[20])),r?i?(i.p(e,n),1&n&&$e(i,1)):(i=ti(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function ri(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=ii(Kr(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(75&n){let s;for(r=e[0].list,s=0;s<r.length;s+=1){const o=Kr(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=ii(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}function ii(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new Ii({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(){Ne(t.$$.fragment),n=L(),Ne(r.$$.fragment)},m(e,o){Te(t,e,o),x(e,n,o),Te(r,e,o),i=!0},p(e,n){const i={};1&n&&(i.text=e[17].designation),t.$set(i);const o={};1&n&&(o.list=e[17]),1&n&&(o.eventId=e[0].id),1&n&&(o.schema=e[17].item),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),r.$set(o)},i(e){i||($e(t.$$.fragment,e),$e(r.$$.fragment,e),i=!0)},o(e){Ie(t.$$.fragment,e),Ie(r.$$.fragment,e),i=!1},d(e){De(t,e),e&&k(n),De(r,e)}}}function oi(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function si(e){let t;return{c(){t=B("Speichern")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function ai(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function li(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:ai,then:ei,catch:Jr,value:16,blocks:[,,,]};return _e(e[7](),i),{c(){t=L(),n=M("section"),i.block.c(),Zr.title="Vorgaben",z(n,"class","sTask svelte-1phofh5")},m(e,o){x(e,t,o),x(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){Ce(i,e=t,n)},i(e){r||($e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}r=!1},d(e){e&&k(t),e&&k(n),i.block.d(),i.token=null,i=null}}}const ci=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function di(e,r,s){let l,d,u;N(e,o,e=>s(11,d=e)),N(e,i,e=>s(12,u=e));const{Divider:f,Button:h,FormField:m}=c,p=JSON.parse(n.getItem("Locale"));let{schema:g}=r,{record:w}=r,y="template-"+g.class+Math.floor(9e3*Math.random()+1e3).toString(),v=!1;const $=()=>window.history.back(),I=(e,t,n=!1)=>{const r=t.id,i=e.find(e=>e.name===r);let o=t.value;if(!n&&i&&i.properties?.multi&&(o=w[r]),o&&i&&i.type.startsWith("date"))try{return Xr(o,"%d.%m.%Y").toISOString()}catch{return new Date(o).toISOString()}if(i&&"boolean"===i.type&&(o=!!t.checked),i&&"number"===i.type){const e=Number("1.1").toLocaleString(p.id).substring(1,2);try{o=Number(o.replace(e,".")).toString()}catch{}}return o};return e.$$set=e=>{"schema"in e&&s(0,g=e.schema),"record"in e&&s(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&s(3,l=v)},[g,w,v,l,f,h,y,async()=>{const e=await t.getEvent(g.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some(e=>"Manual"===e.type)&&s(2,v=!0),d.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>u?.find(t=>t===e.role&&"edit"===e.activity));s(2,v||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},$,async e=>{const n={};Array.from(document.querySelectorAll("form#"+y+" ."+y)).map(e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[r,i]=t.split("."),o=g.list.find(e=>e.name===r);n[t]=I(o.item,e)}else n[t]=I(g.items,e)}),await t.saveTemplate(g.class,n),a.success("Die Vorgaben wurden gespeichert.",2e3),$()}]}const{document:ui}=Ee;function fi(e,t,n){const r=e.slice();return r[36]=t[n],r}function hi(e){let t,n;return t=new Su({props:{classId:e[3],item:e[36],listName:e[2].name,eventId:e[4],record:e[0],disabled:e[5],required:e[6],currency:e[9],notifyList:e[1]}}),t.$on("notify",e[15]),t.$on("defPrep",e[17]),t.$on("formula",e[19]),t.$on("task",e[23]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};8&n[0]&&(r.classId=e[3]),4&n[0]&&(r.item=e[36]),4&n[0]&&(r.listName=e[2].name),16&n[0]&&(r.eventId=e[4]),1&n[0]&&(r.record=e[0]),32&n[0]&&(r.disabled=e[5]),64&n[0]&&(r.required=e[6]),512&n[0]&&(r.currency=e[9]),2&n[0]&&(r.notifyList=e[1]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function mi(e){let t,n,r=ci(e[8],e[36]),i=r&&hi(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){260&n[0]&&(r=ci(e[8],e[36])),r?i?(i.p(e,n),260&n[0]&&$e(i,1)):(i=hi(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function pi(e){let t,n,r,i=e[2].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=mi(fi(e,i,t));const s=e=>Ie(o[e],1,1,()=>{o[e]=null});return{c(){t=M("div");for(let e=0;e<o.length;e+=1)o[e].c();z(t,"id",n=`accordion-content-${e[3]}-${e[2].name}`)},m(e,n){x(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(689023&a[0]){let n;for(i=e[2].item,n=0;n<i.length;n+=1){const r=fi(e,i,n);o[n]?(o[n].p(r,a),$e(o[n],1)):(o[n]=mi(r),o[n].c(),$e(o[n],1),o[n].m(t,null))}for(ye(),n=i.length;n<o.length;n+=1)s(n);ve()}(!r||12&a[0]&&n!==(n=`accordion-content-${e[3]}-${e[2].name}`))&&z(t,"id",n)},i(e){if(!r){for(let e=0;e<i.length;e+=1)$e(o[e]);r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)Ie(o[e]);r=!1},d(e){e&&k(t),O(o,e)}}}function gi(e){let t,n,r=e[14](e[10])+"";return{c(){t=M("span"),n=B(r)},m(e,r){x(e,t,r),R(t,n)},p(e,t){1024&t[0]&&r!==(r=e[14](e[10])+"")&&H(n,r)},d(e){e&&k(t)}}}function wi(e){let t,n,r;return n=new e[11]({props:{$$slots:{default:[gi]},$$scope:{ctx:e}}}),n.$on("click",function(){b(e[16](e[35]))&&e[16](e[35]).apply(this,arguments)}),{c(){t=M("div"),Ne(n.$$.fragment),z(t,"class","accordion svelte-148ktt9"),z(t,"slot","handle")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(t,r){e=t;const i={};1024&r[0]|256&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function yi(e){let t,n;return t=new e[13]({props:{open:e[7],$$slots:{handle:[wi,({toggle:e})=>({35:e}),({toggle:e})=>[0,e?16:0]],default:[pi,({toggle:e})=>({35:e}),({toggle:e})=>[0,e?16:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[18]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};128&n[0]&&(r.open=e[7]),1919&n[0]|272&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function vi(e){let t,n,r;return n=new e[12]({props:{$$slots:{default:[yi]},$$scope:{ctx:e}}}),{c(){t=M("div"),Ne(n.$$.fragment),z(t,"class","formList")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};2047&t[0]|256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function $i(e,n,r){const{Button:i,Accordion:o,AccordionSection:s}=c;let{list:a}=n,{schema:l}=n,{record:d}=n,{classId:u}=n,{eventId:f}=n,{disabled:h}=n,{required:w}=n,{open:v=!1}=n,{template:$={}}=n,{isTemplate:I=!1}=n,{currency:_}=n,{update:C=!1}=n,{notifyList:E}=n,A=new Map;const b={};let S=d[a.name]||{};d[a.name]=S;const N=(e,t)=>""===t[e.name]?"":e._attr?T(e,t[e.name]):"object"===e.type?R(t[e.name]):Array.isArray(t[e.name])?D(t[e.name]):"boolean"===e.type?y(t[e.name]):"number"===e.type?x(t[e.name],e.properties?.decimals||0):"dateRange"===e.type?g(e.name,t):"date"===e.type?m(gDate(t[e.name])):"datetime"===e.type?p(t[e.name]):e.properties?.multi?"":t[e.name],T=(e,t)=>b[t]?.split(" • ").at(e._attr),D=e=>e.slice(0,3).join(", "),R=e=>b[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),x=(e,t)=>(t||=0,"number"==typeof e&&e||(e=Number(e||0)),(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t)),k=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)},O=e=>{if(!e)return;const t=e.properties.value.formula,{operator:n,argument:i}=t,o=i.map(e=>d[a.name][e.refItem]);if("$preferred"===n){if(d._id&&void 0!==d[a.name][e.name])return;const t=o.reduce((t,n)=>{let r=t;return"number"===e.type?r=+r||+n:r||=n,r});r(0,d[a.name][e.name]=t,d)}},M=async({item:e,value:t})=>{const n=l.find(t=>t.properties?.value?.formula?.argument?.find(t=>t.refItem===e.name));if(!n)return;const i=n.properties.value.formula,{operator:o,argument:s}=i,c=s.map(n=>n.refItem===e.name?t:S[n.refItem]||d[n.refItem]);let u=0;"$add"===o&&(u=c.reduce((e,t)=>+(e||0)+ +(t||0))),r(0,d[a.name][n.name]=x(u,n.properties?.decimals),d)};return e.$$set=e=>{"list"in e&&r(2,a=e.list),"schema"in e&&r(20,l=e.schema),"record"in e&&r(0,d=e.record),"classId"in e&&r(3,u=e.classId),"eventId"in e&&r(4,f=e.eventId),"disabled"in e&&r(5,h=e.disabled),"required"in e&&r(6,w=e.required),"open"in e&&r(7,v=e.open),"template"in e&&r(21,$=e.template),"isTemplate"in e&&r(8,I=e.isTemplate),"currency"in e&&r(9,_=e.currency),"update"in e&&r(22,C=e.update),"notifyList"in e&&r(1,E=e.notifyList)},e.$$.update=()=>{4194309&e.$$.dirty[0]&&C&&d&&r(10,S=d[a.name]||{})},[d,E,a,u,f,h,w,v,I,_,S,i,o,s,e=>{let t=l;return a.display?.refItem&&(t=a.display.refItem.map(e=>{const[t,n]=e.split("."),r=l.find(e=>e.name===t);if(r)return r._attr=n,r}).filter(e=>!!e)),e&&t.filter(t=>!0!==t.properties?.hidden&&("dateRange"===t.type||void 0!==e[t.name])&&"html"!==t.properties?.format&&"textarea"!==t.properties?.format).map(t=>N(t,e)).filter(e=>!!e).join(" • ")||"+"},({detail:e})=>{const{itemName:t,value:n,desc:i}=e,[o,s]=t.split(".");if(!s)return;const c=l.filter(e=>"$preferred"===e.properties?.value?.formula?.operator);for(const e of c)O(e);r(1,E={listName:a.name,itemName:t,value:n}),i&&(b[s]=i);const u=d[o];r(0,d[o]={...u,[s]:n},d),r(10,S=d[o])},e=>t=>{(()=>{const e=$[a.name]||{};for(const t in e)$[a.name][t]&&!d[a.name][t]&&r(0,d[a.name][t]=$[a.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${a.name} > div.form-field:last-child`;document.querySelector(n),ce().then(()=>{const e=`#accordion-content-${u}-${a.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(k)})},async({detail:{className:e,itemName:n,value:r}})=>{if(A.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===className+"."+a.name)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&A.set(e,o[0])},()=>{setTimeout(()=>{Array.from(A).forEach(([e,t])=>{d[a.name][e]||r(0,d[a.name][e]=t._id,d)})},500)},({detail:e})=>{M(e)},l,$,C,function(t){te(e,t)}]}class Ii extends xe{constructor(e){var t;super(),ui.getElementById("svelte-148ktt9-style")||((t=M("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}}",R(ui.head,t)),Re(this,e,$i,vi,S,{list:2,schema:20,record:0,classId:3,eventId:4,disabled:5,required:6,open:7,template:21,isTemplate:8,currency:9,update:22,notifyList:1},[-1,-1])}}const{document:_i}=Ee;function Ci(e){e[0]=e[23].list,e[22]=e[23].items}function Ei(e,t,n){const r=e.slice();return r[24]=t[n],r}function Ai(e,t,n){const r=e.slice();return r[27]=t[n],r}function bi(e,t,n){const r=e.slice();return r[27]=t[n],r}function Si(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Ni(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[19](t)}Ci(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Ti]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),re.push(()=>Se(s,"value",v)),s.$on("input",e[12]),d=new ot({props:{size:"18"}});let I=e[22]?.length&&function(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=Di(bi(e,r,t));return{c(){t=M("thead"),n=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();z(n,"class","svelte-14hcfjl"),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[22],o=0;o<r.length;o+=1){const s=bi(e,r,o);i[o]?i[o].p(s,t):(i[o]=Di(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&k(t),O(i,e)}}}(e),_=e[0]?.length&&function(e){let t,n=e[0],r=[];for(let t=0;t<n.length;t+=1)r[t]=ki(Ei(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);x(e,t,n)},p(e,i){if(11778&i[0]){let o;for(n=e[0],o=0;o<n.length;o+=1){const s=Ei(e,n,o);r[o]?r[o].p(s,i):(r[o]=ki(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){O(r,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),i=M("div"),o=B("Suchen: "),Ne(s.$$.fragment),l=L(),c=M("span"),Ne(d.$$.fragment),u=L(),f=M("div"),h=M("table"),I&&I.c(),m=L(),p=M("tbody"),_&&_.c(),z(t,"class","form--buttons svelte-14hcfjl"),z(c,"class","feather pointer svelte-14hcfjl"),q(i,"margin-bottom","1em"),q(i,"position","relative"),z(h,"striped",""),z(h,"class","svelte-14hcfjl"),z(f,"class","eList svelte-14hcfjl")},m(a,v){x(a,t,v),Te(n,t,null),x(a,r,v),x(a,i,v),R(i,o),Te(s,i,null),R(i,l),R(i,c),Te(d,c,null),x(a,u,v),x(a,f,v),R(f,h),I&&I.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=V(c,"click",e[14]),w=!0)},p(e,t){Ci(e);const r={};2&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ue(()=>a=!1)),s.$set(i),e[22]?.length&&I.p(e,t),e[0]?.length&&_.p(e,t)},i(e){g||($e(n.$$.fragment,e),$e(s.$$.fragment,e),$e(d.$$.fragment,e),g=!0)},o(e){Ie(n.$$.fragment,e),Ie(s.$$.fragment,e),Ie(d.$$.fragment,e),g=!1},d(e){e&&k(t),De(n),e&&k(r),e&&k(i),De(s),De(d),e&&k(u),e&&k(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function Ti(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Di(e){let t,n,r=e[27]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function Ri(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=xi(Ai(e,r,t));return{c(){t=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=L(),z(t,"class","pointer svelte-14hcfjl")},m(e,r){x(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Ai(e,r,s);i[s]?i[s].p(a,o):(i[s]=xi(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(e){e&&k(t),O(i,e)}}}function xi(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=M("td"),n=B(o),z(t,"class","svelte-14hcfjl")},m(o,s){x(o,t,s),R(t,n),r||(i=V(t,"click",W(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&k(t),r=!1,i()}}}function ki(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&Ri(e);return{c(){r&&r.c(),t=F()},m(e,n){r&&r.m(e,n),x(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[24],e[22],e[1])),n?r?r.p(e,i):(r=Ri(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&k(t)}}}function Oi(e){let t,n;return t=new e[5]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Mi(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:Oi,then:Ni,catch:Si,value:23,blocks:[,,,]};return _e(e[11](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function Pi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Mi]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Bi(e,n,r){const i=ee(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:d}=c;let{item:u}=n,{className:f}=n,{classId:h}=n,{list:p}=n,g="",w=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const v=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?y(n):m(e[`_${t.name}`]||e[t.name]||"")},$=t.getSchemaByClass(f);Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(w)?.focus()},200)});return e.$$set=e=>{"item"in e&&r(15,u=e.item),"className"in e&&r(16,f=e.className),"classId"in e&&r(17,h=e.classId),"list"in e&&r(0,p=e.list)},[p,g,i,o,s,a,l,d,w,v,e=>()=>i("choose",{row:e}),async()=>{const e=await $,t=e.display;let n=await tn(t,e,p);return{list:p,items:n}},({detail:{value:e}})=>{r(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(v(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,g="")},u,f,h,()=>i("back"),function(e){g=e,r(1,g)}]}class Li extends xe{constructor(e){var t;super(),_i.getElementById("svelte-14hcfjl-style")||((t=M("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}",R(_i.head,t)),Re(this,e,Bi,Pi,S,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:Fi}=Ee;function Vi(e,t,n){const r=e.slice();return r[12]=t[n],r}function Ui(e,t,n){const r=e.slice();return r[4]=t[n],r}function Wi(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function zi(e){let t,n,r,i=e[8].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=Xi(Ui(e,i,t));const s=e=>Ie(o[e],1,1,()=>{o[e]=null});let a=e[8].list&&Yi(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=L(),a&&a.c(),n=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);x(e,t,i),a&&a.m(e,i),x(e,n,i),r=!0},p(e,r){if(60655567&r[0]){let n;for(i=e[8].items,n=0;n<i.length;n+=1){const s=Ui(e,i,n);o[n]?(o[n].p(s,r),$e(o[n],1)):(o[n]=Xi(s),o[n].c(),$e(o[n],1),o[n].m(t.parentNode,t))}for(ye(),n=i.length;n<o.length;n+=1)s(n);ve()}e[8].list?a?(a.p(e,r),256&r[0]&&$e(a,1)):(a=Yi(e),a.c(),$e(a,1),a.m(n.parentNode,n)):a&&(ye(),Ie(a,1,1,()=>{a=null}),ve())},i(e){if(!r){for(let e=0;e<i.length;e+=1)$e(o[e]);$e(a),r=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)Ie(o[e]);Ie(a),r=!1},d(e){O(o,e),e&&k(t),a&&a.d(e),e&&k(n)}}}function Hi(e){let t,n,r,i;const o=[qi,ji],s=[];function a(e,t){return e[4].name!==e[15]||e[16]?"lookup"!==e[4].properties?.format?1:-1:0}return~(t=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=F()},m(e,n){~t&&s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){~t&&s[t].d(e),e&&k(r)}}}function ji(e){let t,n;return t=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[4].name===e[15]&&e[16]||e[0],eventId:e[6],notifyList:e[2],currency:e[3],changeValue:e[10]}}),t.$on("notify",e[18]),t.$on("multi",e[19]),t.$on("defPrep",e[20]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};512&n[0]&&(r.classId=e[9]),256&n[0]&&(r.item=e[4]),128&n[0]&&(r.record=e[7]),257&n[0]&&(r.disabled=e[4].name===e[15]&&e[16]||e[0]),64&n[0]&&(r.eventId=e[6]),4&n[0]&&(r.notifyList=e[2]),8&n[0]&&(r.currency=e[3]),1024&n[0]&&(r.changeValue=e[10]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function qi(e){let t,n,r,i;n=new Su({props:{classId:e[9],item:e[4],record:e[7],disabled:e[0]||!!e[1],required:!0,eventId:e[6],notifyList:!0,currency:e[3],changeValue:e[10]}}),n.$on("notify",e[18]),n.$on("multi",e[19]),n.$on("defPrep",e[20]),n.$on("record",e[24]),n.$on("objRecord",e[25]);let o=e[1]&&Gi(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),q(t,"padding-top",".25em"),q(t,"background-color","lightyellow"),q(t,"position","relative")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};512&r[0]&&(i.classId=e[9]),256&r[0]&&(i.item=e[4]),128&r[0]&&(i.record=e[7]),3&r[0]&&(i.disabled=e[0]||!!e[1]),64&r[0]&&(i.eventId=e[6]),8&r[0]&&(i.currency=e[3]),1024&r[0]&&(i.changeValue=e[10]),n.$set(i),e[1]?o?(o.p(e,r),2&r[0]&&$e(o,1)):(o=Gi(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function Gi(e){let t,n,r,i,o;return n=new ot({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[23]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Xi(e){let t,n,r="list"!==e[4].type&&Hi(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){"list"!==e[4].type?r?(r.p(e,n),256&n[0]&&$e(r,1)):(r=Hi(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Yi(e){let t,n,r=e[8].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Ki(Vi(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(973&n[0]){let s;for(r=e[8].list,s=0;s<r.length;s+=1){const o=Vi(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=Ki(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}function Zi(e){let t,n,r,i,o;function s(t){e[31](t)}t=new e[13]({props:{text:e[12].designation}});let a={classId:e[9],list:e[12],eventId:e[6],schema:e[12].item,record:e[7],disabled:e[0],currency:e[3],update:!0};return void 0!==e[2]&&(a.notifyList=e[2]),r=new Ii({props:a}),re.push(()=>Se(r,"notifyList",s)),{c(){Ne(t.$$.fragment),n=L(),Ne(r.$$.fragment)},m(e,i){Te(t,e,i),x(e,n,i),Te(r,e,i),o=!0},p(e,n){const o={};256&n[0]&&(o.text=e[12].designation),t.$set(o);const s={};512&n[0]&&(s.classId=e[9]),256&n[0]&&(s.list=e[12]),64&n[0]&&(s.eventId=e[6]),256&n[0]&&(s.schema=e[12].item),128&n[0]&&(s.record=e[7]),1&n[0]&&(s.disabled=e[0]),8&n[0]&&(s.currency=e[3]),!i&&4&n[0]&&(i=!0,s.notifyList=e[2],ue(()=>i=!1)),r.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(r.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(r.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(n),De(r,e)}}}function Ki(e){let t,n,r="array"!==e[12].type&&Zi(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){"array"!==e[12].type?r?(r.p(e,n),256&n[0]&&$e(r,1)):(r=Zi(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Qi(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function Ji(e){let t,n;return t=new Li({props:{item:e[4],className:e[5],classId:e[9],list:e[12]}}),t.$on("choose",e[21]),t.$on("back",e[22]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16&n[0]&&(r.item=e[4]),32&n[0]&&(r.className=e[5]),512&n[0]&&(r.classId=e[9]),4096&n[0]&&(r.list=e[12]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function eo(e){let t,n,r=e[11]&&Ji(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[11]?r?(r.p(e,n),2048&n[0]&&$e(r,1)):(r=Ji(e),r.c(),$e(r,1),r.m(t.parentNode,t)):r&&(ye(),Ie(r,1,1,()=>{r=null}),ve())},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function to(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:Qi,then:zi,catch:Wi,value:56,blocks:[,,,]};function l(t){e[32](t)}_e(e[17](),a),n=new e[13]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[eo]},$$scope:{ctx:e}};return void 0!==e[11]&&(c.open=e[11]),i=new e[14]({props:c}),re.push(()=>Se(i,"open",l)),{c(){a.block.c(),t=L(),Ne(n.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,x(e,t,o),Te(n,e,o),x(e,r,o),Te(i,e,o),s=!0},p(t,n){Ce(a,e=t,n);const r={};6704&n[0]|1073741824&n[1]&&(r.$$scope={dirty:n,ctx:e}),!o&&2048&n[0]&&(o=!0,r.open=e[11],ue(()=>o=!1)),i.$set(r)},i(e){s||($e(a.block),$e(n.$$.fragment,e),$e(i.$$.fragment,e),s=!0)},o(e){for(let e=0;e<3;e+=1){Ie(a.blocks[e])}Ie(n.$$.fragment,e),Ie(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&k(t),De(n,e),e&&k(r),De(i,e)}}}function no(e,n,r){const{Divider:i,FormField:o,Modal:s}=c,a=ee();let l,d,u,f,h,{required:m}=n,{disabled:p}=n,{readonly:g}=n,{id:w}=n,{item:y}=n,{value:v}=n,{refValue:$}=n,{currency:I}=n,{notifyList:_}=n,C={},E=[],A=[],b={},S=new Map,N=!1,T="";const D=y.checkOn,R=v,x=e=>{l.items.filter(t=>"object"==typeof(t.properties&&t.properties[e])).map(t=>{const n=t.properties[e].refItem||"",[r,i]=n.split(".");E.push({action:e,itemName:t.name,refObj:r,refName:i,op:t.properties[e].invert?"!":""})})},k=()=>{l.items.filter(e=>e.lookup).forEach(e=>{A.push({name:e.name,lookup:e.lookup})}),l.items.filter(e=>e.properties?.lookup).forEach(e=>{A.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})})},O=async e=>{const t=E.filter(t=>t.refObj===e);if(t?.length){r(10,b={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:s}=e;if(!n)break;let a,l,c=!i&&C[n];const u=C[n];u&&i&&(c=(await xp(n,u))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==s&&"readonly"!==s||(s="required"===s?s:"disabled",setTimeout(()=>{a=`#${d} .form-field.${t} .field textarea`,l=document.querySelector(a),l||(a=`#${d} .form-field.${t} .field input`,l=document.querySelector(a)),l&&c&&l.setAttribute(s,""),l&&!c&&l.removeAttribute(s)},0)),"hidden"===s&&(a=`#${d} .form-field.${t}`,l=document.querySelector(a),l?.classList?.toggle("hidden",!!c),c&&r(10,b[t]="",b))}}};Q(()=>{M()});const M=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 E)e.add(t.refObj||u);Array.from(e).forEach(e=>O(e))})(),P())},P=()=>{setTimeout(()=>{Array.from(S).forEach(([e,t])=>{C[e]||r(7,C[e]=t._id,C)})},250)},B=async e=>{if(!e.value)return void F();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},i=await t.getSectionView(u,n);i?.length?(r(12,T=i),r(11,N=!0)):(r(1,v=""),r(26,$=""),a("setRefValue",$))},L=()=>{r(11,N=!1)},F=()=>{r(1,v=""),r(26,$=v),r(7,C={}),a("setRefValue",$)};return e.$$set=e=>{"required"in e&&r(27,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(28,g=e.readonly),"id"in e&&r(29,w=e.id),"item"in e&&r(4,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(26,$=e.refValue),"currency"in e&&r(3,I=e.currency),"notifyList"in e&&r(2,_=e.notifyList)},e.$$.update=()=>{268435457&e.$$.dirty[0]&&r(0,p=p||g),1073742048&e.$$.dirty[0]&&C&&a("safeReference",{record:C,class:u,event:f,taskId:h})},[p,v,_,I,y,u,f,C,l,d,b,N,T,i,s,D,R,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(7,C=e),r(30,h=(await t.getTaskByDocId(e._id,!0))._id)}else r(7,C={})}catch{}return r(8,l=await t.getSchemaByClass(y.refClass)),r(9,d="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(5,u=l.class),l.identity.designation,r(6,f=l.id),["readonly","hidden","required"].map(x),k(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(7,C[t]=n,C),t===D)return B(e);O(t)},async({detail:e})=>{if(!(l.input?.length&&l.input.length>1))return;if(prevSchema?.class!==l.input[0])return;const{value:n,lookup:i,view:o}=e,[s]=i.split(":"),a=(await t.getSectionView(s,{[o]:{$in:n}})).map(e=>e._id);for(const e of l.input.slice(1)){r(7,C[e]=[],C);const n=await t.getSchemaByClass(e);n.id;let i=await t.getTasks(n.id);if(i=i.data.filter(e=>"Ready"===e._task?.status&&a.includes(e[s])),i?.length){const n=i.map(e=>e._id),o=await t.getSectionView(e,{_id:{$in:n}});for(const t of o)t[e]=t._id;r(7,C[e]=o,C)}}},async({detail:{className:e,itemName:n,value:r}})=>{if(S.has(e))return;if(!0!==r&&(r=(r=[].concat(r)).some(e=>e===u)),!r)return;const i={[n]:!0},o=await t.getSectionView(e,i);o?.length&&S.set(e,o[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(r(1,v=n[0]._id),r(26,$=v),a("setRefValue",$),r(7,C=n[0])),L()},L,F,({detail:e})=>{r(7,C[e.itemName]=e.value,C)},({detail:e})=>{for(const t of e.items)r(7,C[e.listName][t.name]=t.value,C)},$,m,g,w,h,function(e){_=e,r(2,_)},function(e){N=e,r(11,N)}]}class ro extends xe{constructor(e){var t;super(),Fi.getElementById("svelte-16mo2c-style")||((t=M("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",R(Fi.head,t)),Re(this,e,no,to,S,{required:27,disabled:0,readonly:28,id:29,item:4,value:1,refValue:26,currency:3,notifyList:2},[-1,-1])}}function io(e){let t,n;return{c(){t=M("span"),n=B(e[5]),z(t,"class","item")},m(e,r){x(e,t,r),R(t,n)},p(e,t){32&t[0]&&H(n,e[5])},d(e){e&&k(t)}}}function oo(e){let t,n,r,i=e[6]&&io(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new Ue({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Übernehmen"),z(t,"class","pointer feather svelte-1fuww0c")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[17]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=L(),o&&o.c(),n=F()},m(e,s){i&&i.m(e,s),x(e,t,s),o&&o.m(e,s),x(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=io(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),e[14]&&o.p(e,n)},i(e){r||($e(o),r=!0)},o(e){Ie(o),r=!1},d(e){i&&i.d(e),e&&k(t),o&&o.d(e),e&&k(n)}}}function so(e){let t,n,r;return n=new e[10]({props:{withItem:!0,itemLeft:!0,lang:e[11].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[9],step:e[12],pattern:e[7],placeholder:e[13],readonly:e[8],disabled:e[3],required:e[4],$$slots:{default:[oo]},$$scope:{ctx:e}}}),n.$on("change",e[15]),n.$on("focus",e[16]),{c(){t=M("div"),Ne(n.$$.fragment),q(t,"position","relative"),q(t,"max-width","10em")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};6&t[0]&&(r.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t[0]&&(r.id=e[0]),1&t[0]&&(r.name=e[0]),512&t[0]&&(r.value=e[9]),128&t[0]&&(r.pattern=e[7]),256&t[0]&&(r.readonly=e[8]),8&t[0]&&(r.disabled=e[3]),16&t[0]&&(r.required=e[4]),96&t[0]|256&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function ao(e,t,r){const i=ee(),{TextField:o}=c;let{id:s}=t,{item:a}=t,{value:l}=t,{noForm:d=!1}=t,{classId:u}=t,{disabled:f}=t,{formnovalidate:h}=t,{currency:m}=t,{ownCurrency:p}=t,{praefix:g}=t,{notifyList:w}=t;const y=JSON.parse(n.getItem("Locale"));let v=m,$=["price","amount","amountValue","taxValue","total","__total"].find(e=>e===a.name?.split("-")[0])||a.properties?.currency;!1===a.properties?.currency&&($=!1),"owner.currency"===a.properties?.currency&&(v=p);const I=Number("1.1").toLocaleString(y.id).substring(1,2),{properties:_={}}=a;let{min:C,max:E,step:A,pattern:b,decimals:S=0,unit:N="",placeholder:T,hint:D,readonly:R,negative:x,required:k=!1,transfer:O}=_,M="";$&&(S=2),l=l?Number(l.toString().replace(",",".")):0,R=!0===R||void 0;const P=e=>function(e,t){return(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t)}(Number(e.toString()),S).replace(".",I);b||(b=S?`[0-9]+([${I}][0-9]{1,${S}})?`:"[0-9]*"),x&&(b="-?"+b);return e.$$set=e=>{"id"in e&&r(0,s=e.id),"item"in e&&r(19,a=e.item),"value"in e&&r(18,l=e.value),"noForm"in e&&r(1,d=e.noForm),"classId"in e&&r(2,u=e.classId),"disabled"in e&&r(3,f=e.disabled),"formnovalidate"in e&&r(20,h=e.formnovalidate),"currency"in e&&r(21,m=e.currency),"ownCurrency"in e&&r(22,p=e.ownCurrency),"praefix"in e&&r(23,g=e.praefix),"notifyList"in e&&r(24,w=e.notifyList)},e.$$.update=()=>{6815744&e.$$.dirty[0]&&m&&("owner.currency"===a.properties?.currency?r(5,v=p):r(5,v=m)),1048592&e.$$.dirty[0]&&r(4,k=k&&!h),262144&e.$$.dirty[0]&&(e=>{r(9,M=P((e||"0").toString().replace(",",".")))})(l),16777216&e.$$.dirty[0]&&(async()=>{const e=a.properties?.value?.formula;if(e)void 0!==g&&""!==g?e?.operator?.multiply&&i("formula",{item:a}):e?.operator&&i("formula",{item:a})})()},[s,d,u,f,k,v,$,b,R,M,o,y,A,T,O,({detail:e})=>{void 0!==g&&""!==g||i("formula",{item:a,value:e.value}),i("blur",{value:P(e.value)})},({detail:e})=>{R||+l||r(9,M="")},({detail:e})=>{const t=[].concat(O.target);if(void 0===g||""===g)for(const e of t)i("record",{itemName:e,value:l});else for(const e of t)i("listRecord",{itemName:e,decimals:a.properties?.decimals,value:l})},l,a,h,m,p,g,w]}class lo extends xe{constructor(e){var t;super(),document.getElementById("svelte-1fuww0c-style")||((t=M("style")).id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",R(document.head,t)),Re(this,e,ao,so,S,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:21,ownCurrency:22,praefix:23,notifyList:24},[-1,-1])}}const{document:co}=Ee;function uo(e){e[34]=e[36].list,e[35]=e[36].items}function fo(e,t,n){const r=e.slice();return r[37]=t[n],r[39]=n,r}function ho(e,t,n){const r=e.slice();return r[40]=t[n],r[42]=n,r}function mo(e,t,n){const r=e.slice();return r[40]=t[n],r}function po(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function go(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v;uo(e),n=new e[9]({props:{outline:!0,$$slots:{default:[wo]},$$scope:{ctx:e}}}),n.$on("click",e[31]);let $=!e[2]&&yo(e);function I(t){e[32](t)}let _={id:e[12]};void 0!==e[3]&&(_.value=e[3]),a=new e[7]({props:_}),re.push(()=>Se(a,"value",I)),a.$on("input",e[15]),u=new ot({props:{size:"18"}});let C=e[35]?.length&&function(e){let t,n,r,i,o=!e[2]&&$o(e),s=e[35],a=[];for(let t=0;t<s.length;t+=1)a[t]=Io(mo(e,s,t));return{c(){t=M("thead"),n=M("tr"),o&&o.c(),r=L();for(let e=0;e<a.length;e+=1)a[e].c();z(n,"class","svelte-1m010ne"),z(t,"class","svelte-1m010ne")},m(e,s){x(e,t,s),R(t,n),o&&o.m(n,null),R(n,r);for(let e=0;e<a.length;e+=1)a[e].m(n,null);i=!0},p(e,t){if(e[2]?o&&(ye(),Ie(o,1,1,()=>{o=null}),ve()):o?(o.p(e,t),4&t[0]&&$e(o,1)):(o=$o(e),o.c(),$e(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[35],r=0;r<s.length;r+=1){const i=mo(e,s,r);a[r]?a[r].p(i,t):(a[r]=Io(i),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=s.length}},i(e){i||($e(o),i=!0)},o(e){Ie(o),i=!1},d(e){e&&k(t),o&&o.d(),O(a,e)}}}(e),E=e[34]?.length&&function(e){let t,n,r=e[34],i=[];for(let t=0;t<r.length;t+=1)i[t]=bo(fo(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);x(e,t,r),n=!0},p(e,n){if(1138717&n[0]){let s;for(r=e[34],s=0;s<r.length;s+=1){const o=fo(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=bo(o),i[s].c(),$e(i[s],1),i[s].m(t.parentNode,t))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){O(i,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),$&&$.c(),i=L(),o=M("div"),s=B("Suchen: "),Ne(a.$$.fragment),c=L(),d=M("span"),Ne(u.$$.fragment),f=L(),h=M("div"),m=M("table"),C&&C.c(),p=L(),g=M("tbody"),E&&E.c(),z(t,"class","form--buttons svelte-1m010ne"),z(d,"class","feather pointer svelte-1m010ne"),q(o,"margin-bottom","1em"),q(o,"position","relative"),z(m,"striped",""),z(m,"class","svelte-1m010ne"),z(h,"class","eList svelte-1m010ne")},m(l,I){x(l,t,I),Te(n,t,null),R(t,r),$&&$.m(t,null),x(l,i,I),x(l,o,I),R(o,s),Te(a,o,null),R(o,c),R(o,d),Te(u,d,null),x(l,f,I),x(l,h,I),R(h,m),C&&C.m(m,null),R(m,p),R(m,g),E&&E.m(g,null),w=!0,y||(v=V(d,"click",e[17]),y=!0)},p(e,r){uo(e);const i={};16384&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?$&&(ye(),Ie($,1,1,()=>{$=null}),ve()):$?($.p(e,r),4&r[0]&&$e($,1)):($=yo(e),$.c(),$e($,1),$.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],ue(()=>l=!1)),a.$set(o),e[35]?.length&&C.p(e,r),e[34]?.length&&E.p(e,r)},i(e){w||($e(n.$$.fragment,e),$e($),$e(a.$$.fragment,e),$e(u.$$.fragment,e),$e(C),$e(E),w=!0)},o(e){Ie(n.$$.fragment,e),Ie($),Ie(a.$$.fragment,e),Ie(u.$$.fragment,e),Ie(C),Ie(E),w=!1},d(e){e&&k(t),De(n),$&&$.d(),e&&k(i),e&&k(o),De(a),De(u),e&&k(f),e&&k(h),C&&C.d(),E&&E.d(),y=!1,v()}}}function wo(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function yo(e){let t,n;return t=new e[9]({props:{disabled:!e[34].length,filled:!0,$$slots:{default:[vo]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[34])),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function vo(e){let t;return{c(){t=B("Bestätigen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function $o(e){let t,n,r,i,o;return n=new Ze({props:{size:"20"}}),{c(){t=M("th"),Ne(n.$$.fragment),z(t,"class","svelte-1m010ne")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[19](e[34])),i=!0)},p(t,n){e=t},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Io(e){let t,n,r=e[40]+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-1m010ne")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function _o(e){let t,n,r,i,o,s,a,l=e[0],c=Eo(e),d=e[35],u=[];for(let t=0;t<d.length;t+=1)u[t]=Ao(ho(e,d,t));return{c(){t=M("tr"),c.c(),n=L();for(let e=0;e<u.length;e+=1)u[e].c();r=L(),z(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),z(t,"title","übernimmt den Wert direkt"),z(t,"class","svelte-1m010ne"),G(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},m(i,l){x(i,t,l),c.m(t,null),R(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,r),o=!0,s||(a=V(t,"click",e[20](e[37])),s=!0)},p(s,a){if(e=s,1&a[0]&&S(l,l=e[0])?(ye(),Ie(c,1,1,_),ve(),c=Eo(e),c.c(),$e(c),c.m(t,n)):c.p(e,a),16400&a[0]){let n;for(d=e[35],n=0;n<d.length;n+=1){const i=ho(e,d,n);u[n]?u[n].p(i,a):(u[n]=Ao(i),u[n].c(),u[n].m(t,r))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!o||4&a[0]&&i!==(i=e[2]?"cursor: default;":"cursor: zoom-in;"))&&z(t,"style",i),16385&a[0]&&G(t,"active",e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]))},i(e){o||($e(c),o=!0)},o(e){Ie(c),o=!1},d(e){e&&k(t),c.d(e),O(u,e),s=!1,a()}}}function Co(e){let t,n,r;return n=new e[11]({props:{name:e[13],data:e[39],checked:e[0].includes(Array.isArray(e[37])?e[37][0]:e[37]),round:!0}}),{c(){t=M("td"),Ne(n.$$.fragment),z(t,"title","Wählt den Wert aus"),z(t,"class","svelte-1m010ne")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};1&t[0]&&(r.checked=e[0].includes(Array.isArray(e[37])?e[37][0]:e[37])),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Eo(e){let t,n,r=!e[2]&&Co(e);return{c(){r&&r.c(),t=F()},m(e,i){r&&r.m(e,i),x(e,t,i),n=!0},p(e,n){e[2]?r&&(ye(),Ie(r,1,1,()=>{r=null}),ve()):r?(r.p(e,n),4&n[0]&&$e(r,1)):(r=Co(e),r.c(),$e(r,1),r.m(t.parentNode,t))},i(e){n||($e(r),n=!0)},o(e){Ie(r),n=!1},d(e){r&&r.d(e),e&&k(t)}}}function Ao(e){let t,n,r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"";return{c(){t=M("td"),n=B(r),z(t,"class","svelte-1m010ne")},m(e,r){x(e,t,r),R(t,n)},p(e,t){16&t[0]&&r!==(r=(Array.isArray(e[37])?e[37][e[42]]:e[4][e[39]]?e[4][e[39]][e[42]]:e[37])+"")&&H(n,r)},d(e){e&&k(t)}}}function bo(e){let t,n,r=e[16](e[37],e[3]),i=r&&_o(e);return{c(){i&&i.c(),t=F()},m(e,r){i&&i.m(e,r),x(e,t,r),n=!0},p(e,n){8&n[0]&&(r=e[16](e[37],e[3])),r?i?(i.p(e,n),8&n[0]&&$e(i,1)):(i=_o(e),i.c(),$e(i,1),i.m(t.parentNode,t)):i&&(ye(),Ie(i,1,1,()=>{i=null}),ve())},i(e){n||($e(i),n=!0)},o(e){Ie(i),n=!1},d(e){i&&i.d(e),e&&k(t)}}}function So(e){let t,n;return t=new e[6]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function No(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:So,then:go,catch:po,value:36,blocks:[,,,]};return _e(e[14](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function To(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[No]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.title=e[1]||"Auswahl"),29&n[0]|16384&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Do(e,n,r){const i=ee(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:d,Checkbox:u}=c;let{classId:f}=n,{id:h}=n,{designation:m}=n,{selection:p}=n,{refDoc:g}=n,{tableName:w}=n,{idName:y}=n,{target:v}=n,{view:$}=n,{unique:I}=n,{uniqueView:_}=n,{status:C}=n,{single:E}=n;p||=[];let A="",b=f+Math.floor(9e3*Math.random()+1e3).toString()+"search",S=[];const N=w+y+v+"checkbox",T=(e,t)=>e>t?1:t>e?-1:0;Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(b)?.focus()},200)});return e.$$set=e=>{"classId"in e&&r(22,f=e.classId),"id"in e&&r(23,h=e.id),"designation"in e&&r(1,m=e.designation),"selection"in e&&r(0,p=e.selection),"refDoc"in e&&r(24,g=e.refDoc),"tableName"in e&&r(25,w=e.tableName),"idName"in e&&r(26,y=e.idName),"target"in e&&r(21,v=e.target),"view"in e&&r(27,$=e.view),"unique"in e&&r(28,I=e.unique),"uniqueView"in e&&r(29,_=e.uniqueView),"status"in e&&r(30,C=e.status),"single"in e&&r(2,E=e.single)},[p,m,E,A,S,i,o,s,a,l,d,u,b,N,async()=>{let e=[],n=[],i={};if(r(4,S=[]),y)if($){if(h){const n=f.split("-")[1].slice(0,-4),r="input."+f+"[name='_id']",o=document.querySelector(r).value;i={[y]:h},C&&(i.$or=[{status:!0},{[n]:o}]),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const r=e=>(e[n]||"z").toString()+e[v];return T(r(e),r(t))})}}else _?h&&(i={[y]:h,status:!0},Object.entries(_).map(([e,t])=>{t?.length&&(i[e]={$in:t}),n.push(e)}),e=await t.getSectionView(w,i),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}),r(4,S=e.map(e=>{const t=[e[v]];return n.map(n=>t.push(e[n])),t}))):I?(e=await t.getSection(w,y,h,I),e=e.sort((e,t)=>T(e,t))):(e=await t.getSection(w,y,h,!1,C),e=e.sort((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return T(n(e),n(t))}));else i={},h&&!Array.isArray(h)&&(i._id=h),e=await t.getSectionView(w,i);const o=await t.getSchemaByClass(w),s=[];if(g){const t=o.items[0].name,n=o.items[1].name,i=o.list[0].name,s=e.find(e=>e[t]===g);e=s?s[i]:[],r(21,v=n)}let a;return e.map(e=>{let t=e[v];if(t||w!==v||(r(21,v=o.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(", ")),s.push(t||[])}else g&&(t=o.list[0].item.map(t=>e[t.name]||"")),s.push(t||[])}),a=g?o.list[0].item.map(e=>e.designation):[o.items.find(e=>e.name===v)?.designation],n=n.map(e=>o.items.find(t=>t.name===e)?.designation),{list:g?s:s.flat(),items:[...a,...n]}},({detail:{value:e}})=>{r(3,A=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,A="")},e=>()=>{const t=document.getElementsByName(N),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(N).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;E?i("choose",{list:[].concat(t)}):(r(0,p=p.includes(t)?p.filter(e=>e!==t):p.concat(t)),i("choose",{list:p}))}},v,f,h,g,w,y,$,I,_,C,()=>i("back"),function(e){A=e,r(3,A)}]}class Ro extends xe{constructor(e){var t;super(),co.getElementById("svelte-1m010ne-style")||((t=M("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}",R(co.head,t)),Re(this,e,Do,To,S,{classId:22,id:23,designation:1,selection:0,refDoc:24,tableName:25,idName:26,target:21,view:27,unique:28,uniqueView:29,status:30,single:2},[-1,-1])}}const{document:xo}=Ee;function ko(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=M("span"),n=B("("),r=B(s),i=B(")"),z(t,"class",o=T(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){x(e,t,o),R(t,n),R(t,r),R(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&H(r,s),2&n[0]&&o!==(o=T(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&z(t,"class",o)},d(e){e&&k(t)}}}function Oo(e){let t;return{c(){t=M("div"),z(t,"class","load-more-options"),z(t,"slot","load-more-options-message")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Mo(e){let t,n,r,i;const o=[Lo,Bo,Po],s=[];function a(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=a(e))&&(n=s[t]=o[t](e)),{c(){n&&n.c(),r=F()},m(e,n){~t&&s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve()),~t?(n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r)):n=null)},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){~t&&s[t].d(e),e&&k(r)}}}function Po(e){let t,n,r,i,o;return n=new Ue({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Übernehmen"),z(t,"class","feather pointer svelte-1rbaejz")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[26]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Bo(e){let t,n,r,i,o;return n=new Je({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title",e[17].title||"Generieren"),z(t,"class","feather pointer svelte-1rbaejz")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[25]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Lo(e){let t,n,r,i,o;return n=new ot({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Löschen"),z(t,"class","feather pointer svelte-1rbaejz")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[27]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Fo(e){let t,n,r;function i(t){e[37](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[Vo]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};53&r[0]|32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),!n&&1024&r[0]&&(n=!0,i.open=e[10],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function Vo(e){let t,n;return t=new Ro({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],designation:e[4].designation,target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4&n[0]&&(r.classId=e[2]),1&n[0]&&(r.selection=e[0]),16&n[0]&&(r.unique=e[16].unique&&e[4].name),32&n[0]&&(r.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(r.id=e[5][e[21]||e[20]]),16&n[0]&&(r.designation=e[4].designation),16&n[0]&&(r.target=e[4].name),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Uo(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&ko(e);function u(t){e[35](t)}function f(t){e[36](t)}let h={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:Wo,minSearchLength:"3",$$slots:{"load-more-options-message":[Oo]},$$scope:{ctx:e}};void 0!==e[7]&&(h.selection=e[7]),void 0!==e[9]&&(h.maxOptions=e[9]),r=new e[12]({props:h}),re.push(()=>Se(r,"selection",u)),re.push(()=>Se(r,"maxOptions",f)),r.$on("change",e[22]);let m=!e[1]&&Mo(e),p=e[10]&&Fo(e);return{c(){t=M("div"),d&&d.c(),n=L(),Ne(r.$$.fragment),s=L(),m&&m.c(),a=L(),p&&p.c(),l=F(),q(t,"position","relative")},m(e,i){x(e,t,i),d&&d.m(t,null),R(t,n),Te(r,t,null),R(t,s),m&&m.m(t,null),x(e,a,i),p&&p.m(e,i),x(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=ko(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const a={};8&s[0]&&(a.id=e[3]),8&s[0]&&(a.name=e[3]),8&s[0]&&(a.class=e[3]),2&s[0]&&(a.disabled=e[1]),64&s[0]&&(a.required=e[6]),256&s[0]&&(a.placeholder=e[8]),32768&s[1]&&(a.$$scope={dirty:s,ctx:e}),!i&&128&s[0]&&(i=!0,a.selection=e[7],ue(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],ue(()=>o=!1)),r.$set(a),e[1]?m&&(ye(),Ie(m,1,1,()=>{m=null}),ve()):m?(m.p(e,s),2&s[0]&&$e(m,1)):(m=Mo(e),m.c(),$e(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&$e(p,1)):(p=Fo(e),p.c(),$e(p,1),p.m(l.parentNode,l)):p&&(ye(),Ie(p,1,1,()=>{p=null}),ve())},i(e){c||($e(r.$$.fragment,e),$e(m),$e(p),c=!0)},o(e){Ie(r.$$.fragment,e),Ie(m),Ie(p),c=!1},d(e){e&&k(t),d&&d.d(),De(r),m&&m.d(),e&&k(a),p&&p.d(e),e&&k(l)}}}async function*Wo(e){yield[{name:e}]}function zo(e,n,r){const i=ee(),{Modal:o,Autocomplete:s}=c;let{classId:a}=n,{id:l}=n,{item:d}=n,{record:u}=n,{value:f}=n,{noForm:h=!1}=n,{disabled:m}=n,{formnovalidate:p}=n,{numberInput:g}=n,{praefix:w}=n,{toDelete:y}=n,{reqQuantity:v}=n,{notifyList:$}=n;const{properties:I={}}=d;let{placeholder:_,hint:C,readonly:E,required:A=!1,lookup:b="",view:S=!1,multi:N,max:T=1e3,generate:D=!1,status:R=!0,refDoc:x}=I;const[k,O]=b.split(":");let M=!1,P=f.map&&f.map(e=>({name:e}))||[];m||=E,m&&(_="");const B=({detail:e})=>{let t=[];e.value.map(e=>{const n=e.name?.split(",");t=t.concat(n)}),r(7,P=t.map(e=>({name:e.trim()})));const n=P.map(e=>e.name);i("blur",{value:n}),i("multi",{view:N.view,lookup:b,name:d.name,value:n})};Q(async()=>{i("multi",{view:N.view,lookup:b,name:d.name,value:f});const e=document.getElementById(l);e.classList.add(a),!E&&b&&e.addEventListener("focus",L)});const L=()=>{if(b){document.getElementById(l).blur();const e=v||T;(N.unique||P.length<e)&&r(10,M=!0)}},F=()=>{r(10,M&&=!1)},V=({detail:e})=>{const t=e.list.map(e=>Array.isArray(e)?e[0]:e);r(7,P=t.map(e=>({name:e}))),i("blur",{value:t}),i("multi",{view:N.view,lookup:b,name:d.name,value:t}),F()},U=async()=>{const e={[O]:u[O]},n=await t.getSectionView(k,e),r=Array.from({length:n.length},(e,t)=>n[t][d.name]);V({detail:{name:d.name,list:r}})},W=(e=!1)=>{if(m||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;r(9,T=!1!==e?e:v||u[t]||0);const n=P?.length!=T,o=document.getElementById(l);o?.classList?.toggle("invalid",n),i("invalid",{idx:w,value:n})};return e.$$set=e=>{"classId"in e&&r(2,a=e.classId),"id"in e&&r(3,l=e.id),"item"in e&&r(4,d=e.item),"record"in e&&r(5,u=e.record),"value"in e&&r(0,f=e.value),"noForm"in e&&r(28,h=e.noForm),"disabled"in e&&r(1,m=e.disabled),"formnovalidate"in e&&r(29,p=e.formnovalidate),"numberInput"in e&&r(30,g=e.numberInput),"praefix"in e&&r(31,w=e.praefix),"toDelete"in e&&r(32,y=e.toDelete),"reqQuantity"in e&&r(33,v=e.reqQuantity),"notifyList"in e&&r(34,$=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&r(7,P=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&r(7,P=u[d.name].map(e=>({name:e}))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&y&&y===d.name&&r(7,P=[]),128&e.$$.dirty[0]&&P&&(r(0,f=P.map&&P.map(e=>e.name)||[]),W()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===N.maxItem&&W(n)})(g),536870976&e.$$.dirty[0]&&r(6,A=A&&!p),8&e.$$.dirty[1]&&(async e=>{if(void 0===w)return;const{itemName:n,value:o}=e||{};if(o){if(d.refItem&&d.refItem?.split(".")[0]===n){let[e,n]=d.refItem.split(".");if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}if(d.refItem2&&d.refItem2?.split(".")[0]===n){let[e,n]=d.refItem2.split(".");if(Array.isArray(o))if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,P=[]);const s={_id:{$in:o}},a=await t.getSectionView(e,s);let l=[];for(const e of a)e[n]&&(l=l.concat(e[n][0][d.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,P=l.map(e=>({name:e}))),B({detail:{value:P}})}else{const s=await t.getTask(e,o);if(!s||!s[n])return;const a=s[n];if(!Array.isArray(a)&&!a.length)return;const l=a[w][d.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,P=l&&l.map(e=>({name:e})))}}setTimeout(W,250)}})($)},[f,m,a,l,d,u,A,P,_,T,M,o,s,E,b,S,N,D,R,x,k,O,B,F,V,()=>{const e=u[D.itemQuantity]||v;if(!e)return;const t=D.prefix||"",n=u[D.variable]||"",r=D.len||5,i=Array.from({length:e},(e,i)=>t+n+"-"+i.toString().padStart(r,"0"));V({detail:{name:d.name,list:i}})},async()=>{if(!0===S)return U();const e=v||u[N.maxItem];if(!e)return;let n={};O&&(n={[O]:u[O]}),R&&(n.status=!0);const r=[].concat(u[N.view]||[]);r.length&&(n[N.view]={$in:r});const i=await t.getSectionView(k,n),o=Array.from({length:e<i.length?e:i.length},(e,t)=>i[t][d.name]);V({detail:{name:d.name,list:o}})},()=>{V({detail:{name:d.name,list:[]}})},h,p,g,w,y,v,$,function(e){P=e,r(7,P),r(5,u),r(4,d),r(32,y)},function(e){T=e,r(9,T)},function(e){M=e,r(10,M)}]}class Ho extends xe{constructor(e){var t;super(),xo.getElementById("svelte-1rbaejz-style")||((t=M("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}",R(xo.head,t)),Re(this,e,zo,Uo,S,{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])}}function jo(e){let t,n,r;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function qo(e){let t,n,r,i,o;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[9]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Go(e){let t,n,r,i,o,s;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 a=[qo,jo],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}const Xo=e("getMapLink",async e=>{const{street:n,houseNo:r,postcode:i,location:o,country:s}=e,a=[n&&r?n+" "+r:n,i&&o?i+" "+o:i||o||"",s&&(await t.getTask("country",s)).designation].filter(e=>!!e).join(", ");return"https://bing.com/maps/default.aspx?where1="+encodeURIComponent(a)});function Yo(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{record:h}=t,{item:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"record"in e&&n(10,h=e.record),"item"in e&&n(11,m=e.item)},[i,o,s,a,l,d,u,f,r,async()=>{if(!f)return;const e=u.includes(".")?h[u.split(".")[0]]:h,t=await Xo(e);window.open(t,"_blank")},h,m,function(t){te(e,t)}]}class Zo extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,Yo,Go,S,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:Ko}=Ee;function Qo(e){let t;return{c(){t=M("div"),z(t,"class","load-more-options"),z(t,"slot","load-more-options-message")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Jo(e){let t,n,r;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-wpjws5")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function es(e){let t,n,r,i,o;return n=new Ct({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-wpjws5")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[8]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function ts(e){let t,n,r,i,o,s,a;function l(t){e[17](t)}function c(t){e[18](t)}function d(t){e[19](t)}let u={id:e[1],name:e[1],class:e[1],minSearchLength:"1",maxOptions:"1",getOptions:e[7],$$slots:{"load-more-options-message":[Qo]},$$scope:{ctx:e}};void 0!==e[0]&&(u.value=e[0]),void 0!==e[2]&&(u.selection=e[2]),void 0!==e[3]&&(u.searchQuery=e[3]),n=new e[4]({props:u}),re.push(()=>Se(n,"value",l)),re.push(()=>Se(n,"selection",c)),re.push(()=>Se(n,"searchQuery",d)),n.$on("change",e[6]);let f=e[5]&&function(e){let t,n,r,i;const o=[es,Jo],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),s=L(),f&&f.c(),q(t,"position","relative"),z(t,"class","inputAutoComplete")},m(e,r){x(e,t,r),Te(n,t,null),R(t,s),f&&f.m(t,null),a=!0},p(e,t){const s={};2&t[0]&&(s.id=e[1]),2&t[0]&&(s.name=e[1]),2&t[0]&&(s.class=e[1]),32&t[1]&&(s.$$scope={dirty:t,ctx:e}),!r&&1&t[0]&&(r=!0,s.value=e[0],ue(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],ue(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],ue(()=>o=!1)),n.$set(s),e[5]&&f.p(e,t)},i(e){a||($e(n.$$.fragment,e),$e(f),a=!0)},o(e){Ie(n.$$.fragment,e),Ie(f),a=!1},d(e){e&&k(t),De(n),f&&f.d()}}}function ns(e,t,n){const{Autocomplete:r}=c,i=ee();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:d}=t,{record:u}=t,{value:f}=t,{noForm:h=!1}=t,{disabled:m}=t,{formnovalidate:p}=t,{autocomplete:{input:g,min:w,url:y,output:v},format:$}=a.properties;y="https://openplzapi.org/";const I=[].concat(g),{name:_}=v,C="map"===$;let E,A=f,b=!1;Q(()=>{const e=document.querySelector("."+a.name+" .autocomplete input");e&&(e.addEventListener("focus",T),e.addEventListener("keyup",N),e.addEventListener("keydown",S));const t=document.getElementById(s);t&&t.classList.add(o)});const S=e=>{b=8===e.keyCode||32===e.keyCode},N=e=>{8===e.keyCode&&""===A&&n(0,f="")},T=async()=>{if(w){const e=I[0].name;if((d?u[d][e]:u[e]).length<w)return}const e=await D();if(e?.length)if(1===e.length){if(f.startsWith(e[0].name))return;n(3,A=n(0,f=e[0].name)),x(f)}else e.find(e=>(A||"").startsWith(e.name))||f||n(3,A=" ");else n(0,f=n(3,A=""))},D=async(e="")=>{const t=await(async()=>{const e=d?u[d].country:u.country;if(e){const t=await xp("country",e);if(t?.countryCode)return t.countryCode?.toLowerCase()}return"ch"})();let n="Streets";"postalCode"===I[0].refItem&&(n="Localities");const r=await fetch(y+t+"/"+n+"?"+R()+"&name=%5E"+e.trim());if(!r.ok)return;const i=r.headers.get("Content-Type").split(";")[0];let o=[];try{if("text/json"===i){const e=await r.text();o=JSON.parse(e||[])}else"application/json"===i&&(o=await r.json())}catch{}return o=o.filter((e,t,n)=>n.findIndex(t=>t.name===e.name)===t),o.map(e=>({name:e[_]}))},R=()=>I.map(({name:e,refItem:t})=>`${t}=${(d?u[d][e]:u[e]).split(" ")[0]}`).join("&"),x=e=>{i("blur",{value:e})};return e.$$set=e=>{"classId"in e&&n(9,o=e.classId),"id"in e&&n(1,s=e.id),"item"in e&&n(10,a=e.item),"name"in e&&n(11,l=e.name),"listName"in e&&n(12,d=e.listName),"record"in e&&n(13,u=e.record),"value"in e&&n(0,f=e.value),"noForm"in e&&n(14,h=e.noForm),"disabled"in e&&n(15,m=e.disabled),"formnovalidate"in e&&n(16,p=e.formnovalidate)},[f,s,E,A,r,C,({detail:{value:e}})=>{e.length&&n(3,A=n(0,f=e[0].name)),n(2,E=[]),x(f)},async function*(e){if(b||f&&e.startsWith(f))return n(0,f=e),void x(f);const t=await D(e);if(!t?.length)return n(0,f=e),void x(f);1===t.length?(n(3,A=n(0,f=t[0].name)),n(2,E=[]),x(f)):yield t},async()=>{if(!f)return;const e=l.includes(".")?u[l.split(".")[0]]:u,t=await Xo(e);window.open(t,"_blank")},o,a,l,d,u,h,m,p,function(e){f=e,n(0,f)},function(e){E=e,n(2,E)},function(e){A=e,n(3,A)}]}class rs extends xe{constructor(e){var t;super(),Ko.getElementById("svelte-wpjws5-style")||((t=M("style")).id="svelte-wpjws5-style",t.textContent=".feather.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:light-gray;margin-left:-2em}.inputAutoComplete .autocomplete .chip,.inputAutoComplete .autocomplete .shown-on-focus{display:none !important}",R(Ko.head,t)),Re(this,e,ns,ts,S,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:is}=Ee;function os(e){e[26]=e[28].list,e[27]=e[28].items}function ss(e,t,n){const r=e.slice();return r[29]=t[n],r}function as(e,t,n){const r=e.slice();return r[32]=t[n],r}function ls(e,t,n){const r=e.slice();return r[32]=t[n],r}function cs(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function ds(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y;function v(t){e[23](t)}os(e),n=new e[7]({props:{outline:!0,$$slots:{default:[us]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),re.push(()=>Se(s,"value",v)),s.$on("input",e[12]),d=new ot({props:{size:"18"}});let I=e[27]?.length&&function(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=fs(ls(e,r,t));return{c(){t=M("thead"),n=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();z(n,"class","svelte-14hcfjl"),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n);for(let e=0;e<i.length;e+=1)i[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(r=e[27],o=0;o<r.length;o+=1){const s=ls(e,r,o);i[o]?i[o].p(s,t):(i[o]=fs(s),i[o].c(),i[o].m(n,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=r.length}},d(e){e&&k(t),O(i,e)}}}(e),_=e[26]?.length&&function(e){let t,n=e[26],r=[];for(let t=0;t<n.length;t+=1)r[t]=ps(ss(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);x(e,t,n)},p(e,i){if(11779&i[0]){let o;for(n=e[26],o=0;o<n.length;o+=1){const s=ss(e,n,o);r[o]?r[o].p(s,i):(r[o]=ps(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){O(r,e),e&&k(t)}}}(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),i=M("div"),o=B("Suchen: "),Ne(s.$$.fragment),l=L(),c=M("span"),Ne(d.$$.fragment),u=L(),f=M("div"),h=M("table"),I&&I.c(),m=L(),p=M("tbody"),_&&_.c(),z(t,"class","form--buttons svelte-14hcfjl"),z(c,"class","feather pointer svelte-14hcfjl"),q(i,"margin-bottom","1em"),q(i,"position","relative"),z(h,"striped",""),z(h,"class","svelte-14hcfjl"),z(f,"class","eList svelte-14hcfjl")},m(a,v){x(a,t,v),Te(n,t,null),x(a,r,v),x(a,i,v),R(i,o),Te(s,i,null),R(i,l),R(i,c),Te(d,c,null),x(a,u,v),x(a,f,v),R(f,h),I&&I.m(h,null),R(h,m),R(h,p),_&&_.m(p,null),g=!0,w||(y=V(c,"click",e[14]),w=!0)},p(e,t){os(e);const r={};64&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);const i={};!a&&2&t[0]&&(a=!0,i.value=e[1],ue(()=>a=!1)),s.$set(i),e[27]?.length&&I.p(e,t),e[26]?.length&&_.p(e,t)},i(e){g||($e(n.$$.fragment,e),$e(s.$$.fragment,e),$e(d.$$.fragment,e),g=!0)},o(e){Ie(n.$$.fragment,e),Ie(s.$$.fragment,e),Ie(d.$$.fragment,e),g=!1},d(e){e&&k(t),De(n),e&&k(r),e&&k(i),De(s),De(d),e&&k(u),e&&k(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function us(e){let t;return{c(){t=B("Abbrechen")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function fs(e){let t,n,r=e[32]?.designation+"";return{c(){t=M("th"),n=B(r),z(t,"class","svelte-14hcfjl")},m(e,r){x(e,t,r),R(t,n)},p:_,d(e){e&&k(t)}}}function hs(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=ms(as(e,r,t));return{c(){t=M("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=L(),z(t,"class","pointer svelte-14hcfjl"),G(t,"active",e[29]._id===e[0])},m(e,r){x(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);R(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=as(e,r,s);i[s]?i[s].p(a,o):(i[s]=ms(a),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}2049&o[0]&&G(t,"active",e[29]._id===e[0])},d(e){e&&k(t),O(i,e)}}}function ms(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=M("td"),n=B(o),z(t,"class","svelte-14hcfjl")},m(o,s){x(o,t,s),R(t,n),r||(i=V(t,"click",W(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&k(t),r=!1,i()}}}function ps(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&hs(e);return{c(){r&&r.c(),t=F()},m(e,n){r&&r.m(e,n),x(e,t,n)},p(e,i){2&i[0]&&(n=e[13](e[29],e[27],e[1])),n?r?r.p(e,i):(r=hs(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&k(t)}}}function gs(e){let t,n;return t=new e[5]({}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p:_,i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function ws(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:gs,then:ds,catch:cs,value:28,blocks:[,,,]};return _e(e[11](),o),{c(){Ne(t.$$.fragment),n=L(),r=F(),o.block.c()},m(e,s){Te(t,e,s),x(e,n,s),x(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ce(o,e=t,n)},i(e){i||($e(t.$$.fragment,e),$e(o.block),i=!0)},o(e){Ie(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ie(o.blocks[e])}i=!1},d(e){De(t,e),e&&k(n),e&&k(r),o.block.d(e),o.token=null,o=null}}}function ys(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[ws]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};3&n[0]|64&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function vs(e,n,i){const o=ee(),{Dialog:s,Divider:a,Loading:l,TextField:d,Button:u}=c;let{item:f}=n,{className:h}=n,{classId:p}=n,{rowId:g}=n,{viewName:w}=n,{viewValue:v}=n,{recordId:$}=n,{filter:I}=n,_="",C=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const E=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?y(n):m(e[`_${t.name}`]||e[t.name]||"")},A=t.getSchemaByClass(h);Q(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(C)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await A;e.eventId===t.id&&kp(t.class,e.eventId)});return e.$$set=e=>{"item"in e&&i(15,f=e.item),"className"in e&&i(16,h=e.className),"classId"in e&&i(17,p=e.classId),"rowId"in e&&i(0,g=e.rowId),"viewName"in e&&i(18,w=e.viewName),"viewValue"in e&&i(19,v=e.viewValue),"recordId"in e&&i(20,$=e.recordId),"filter"in e&&i(21,I=e.filter)},[g,_,o,s,a,l,d,u,C,E,e=>()=>o("choose",{row:e}),async()=>{const e=await A,n="."+p+"#"+w;document.querySelector(n);let r={[w]:v},i=[];r[w]&&(i=await t.getSectionView(e.class,r,!0)),I&&(i=i.filter(e=>e._id!=I));const o=e.display;return{list:i,items:await tn(o,e,i)}},({detail:{value:e}})=>{i(1,_=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(E(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,_="")},f,h,p,w,v,$,I,()=>o("back"),function(e){_=e,i(1,_)}]}class $s extends xe{constructor(e){var t;super(),is.getElementById("svelte-14hcfjl-style")||((t=M("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}",R(is.head,t)),Re(this,e,vs,ys,S,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Is(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function _s(e){let t,n,r,i,o;function s(t){e[21](t)}let a={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]&&(a.value=e[0]),n=new e[10]({props:a}),re.push(()=>Se(n,"value",s));let l=!e[6]&&Cs(e);return{c(){t=M("div"),Ne(n.$$.fragment),i=L(),l&&l.c(),q(t,"position","relative")},m(e,r){x(e,t,r),Te(n,t,null),R(t,i),l&&l.m(t,null),o=!0},p(e,i){const o={};4&i&&(o.id=e[2]),8&i&&(o.name=e[3].name),34&i&&(o.inputClass=e[5]||e[1]),64&i&&(o.disabled=e[6]),128&i&&(o.formnovalidate=e[7]),!r&&1&i&&(r=!0,o.value=e[0],ue(()=>r=!1)),n.$set(o),e[6]?l&&(ye(),Ie(l,1,1,()=>{l=null}),ve()):l?(l.p(e,i),64&i&&$e(l,1)):(l=Cs(e),l.c(),$e(l,1),l.m(t,null))},i(e){o||($e(n.$$.fragment,e),$e(l),o=!0)},o(e){Ie(n.$$.fragment,e),Ie(l),o=!1},d(e){e&&k(t),De(n),l&&l.d()}}}function Cs(e){let t,n,r,i,o;return n=new Mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-wbrqzu")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[17]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Es(e){return{c:_,m:_,p:_,i:_,o:_,d:_}}function As(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[bs]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),re.push(()=>Se(t,"open",i)),{c(){Ne(t.$$.fragment)},m(e,n){Te(t,e,n),r=!0},p(e,r){const i={};268435994&r&&(i.$$scope={dirty:r,ctx:e}),!n&&256&r&&(n=!0,i.open=e[8],ue(()=>n=!1)),t.$set(i)},i(e){r||($e(t.$$.fragment,e),r=!0)},o(e){Ie(t.$$.fragment,e),r=!1},d(e){De(t,e)}}}function bs(e){let t,n;return t=new $s({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(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.item=e[3]),8&n&&(r.className=e[3].refClass),2&n&&(r.classId=e[1]),16&n&&(r.recordId=e[4]._id),512&n&&(r.viewValue=e[9]),16&n&&(r.filter=e[4]._id),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Ss(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Es,then:_s,catch:Is,value:27,blocks:[,,,]};_e(e[16](),i);let o=e[8]&&As(e);return{c(){i.block.c(),t=L(),o&&o.c(),n=F()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,x(e,t,s),o&&o.m(e,s),x(e,n,s),r=!0},p(t,[r]){Ce(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&$e(o,1)):(o=As(e),o.c(),$e(o,1),o.m(n.parentNode,n)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){r||($e(i.block),$e(o),r=!0)},o(e){for(let e=0;e<3;e+=1){Ie(i.blocks[e])}Ie(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&k(t),o&&o.d(e),e&&k(n)}}}function Ns(e,t,n){const{TextField:r,Modal:i}=c;let{classId:o}=t,{id:s}=t,{item:a}=t,{record:l}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:f}=t,{formnovalidate:h}=t,{praefix:m}=t;const{properties:p={}}=a;let g,{pattern:w,placeholder:y,readonly:v,required:$=!1,view:I}=p,_=!1;const C=()=>{n(8,_=!1)};return e.$$set=e=>{"classId"in e&&n(1,o=e.classId),"id"in e&&n(2,s=e.id),"item"in e&&n(3,a=e.item),"record"in e&&n(4,l=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,f=e.disabled),"formnovalidate"in e&&n(7,h=e.formnovalidate),"praefix"in e&&n(20,m=e.praefix)},[d,o,s,a,l,u,f,h,_,g,r,i,w,v,$,I,async()=>(n(9,g=l[I.selection]),!0),()=>{n(8,_=!0)},({detail:e})=>{n(0,d=e.row[I.value?I.value:"_id"]),C()},C,m,function(e){d=e,n(0,d)},function(e){_=e,n(8,_)}]}class Ts extends xe{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=M("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",R(document.head,t)),Re(this,e,Ns,Ss,S,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Ds(e,t,n){const r=e.slice();return r[12]=t[n][0],r[13]=t[n][1],r}function Rs(e){let t;return{c(){t=M("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function xs(e){let t;return{c(){t=M("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function ks(e){let t,n,r,i,o=e[12]+"";return{c(){t=M("option"),n=B(o),t.__value=r=e[13],t.value=t.__value,t.selected=i=e[0]==e[13]},m(e,r){x(e,t,r),R(t,n)},p(e,s){64&s&&o!==(o=e[12]+"")&&H(n,o),64&s&&r!==(r=e[13])&&(t.__value=r,t.value=t.__value),65&s&&i!==(i=e[0]==e[13])&&(t.selected=i)},d(e){e&&k(t)}}}function Os(e){let t,n,r,i,o,s=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?xs:Rs}let r=n(e),i=r(e);return{c(){i.c(),t=F()},m(e,n){i.m(e,n),x(e,t,n)},p(e,o){r!==(r=n(e))&&(i.d(1),i=r(e),i&&(i.c(),i.m(t.parentNode,t)))},d(e){i.d(e),e&&k(t)}}}(e),a=e[6],l=[];for(let t=0;t<a.length;t+=1)l[t]=ks(Ds(e,a,t));return{c(){t=M("select"),s&&s.c(),n=F();for(let e=0;e<l.length;e+=1)l[e].c();z(t,"class",r=T(e[3]||e[4])+" svelte-5xpzvo"),z(t,"id",e[2]),z(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,a){x(r,t,a),s&&s.m(t,null),R(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);i||(o=V(t,"change",e[9]),i=!0)},p(e,[n]){if(e[7]||s.p(e,n),65&n){let r;for(a=e[6],r=0;r<a.length;r+=1){const i=Ds(e,a,r);l[r]?l[r].p(i,n):(l[r]=ks(i),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=a.length}24&n&&r!==(r=T(e[3]||e[4])+" svelte-5xpzvo")&&z(t,"class",r),4&n&&z(t,"id",e[2]),4&n&&z(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:_,o:_,d(e){e&&k(t),s&&s.d(),O(l,e),i=!1,o()}}}function Ms(e,t,n){const r=ee();let{id:i}=t,{item:o}=t,{value:s}=t,{noForm:a=!1}=t,{classId:l}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:f,readonly:h}=o.properties;u&&(u=u.map(e=>[e,e])),"businessMonth"===f&&(s||=1,u=[["Januar",1],["Februar",2],["März",3],["April",4],["Mai",5],["Juni",6],["Juli",7],["August",8],["September",9],["Oktober",10],["November",11],["Dezember",12]]),"financialAccounting"===f&&(s||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===f&&(s||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!0===h,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,i=e.id),"item"in e&&n(10,o=e.item),"value"in e&&n(0,s=e.value),"noForm"in e&&n(3,a=e.noForm),"classId"in e&&n(4,l=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[s,c,i,a,l,d,u,f,h,e=>r("blur",{value:e.srcElement.value}),o]}class Ps extends xe{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=M("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}",R(document.head,t)),Re(this,e,Ms,Os,S,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function Bs(e){let t,n,r,i,o,s,a,l,c;i=new e[8]({props:{id:"dp-"+e[1]+(e[2]?"-"+e[2]:""),value:e[0],readonly:e[5],required:e[7],disabled:e[6],noCalendar:e[9],closeOnSelection:!0}}),i.$on("change",e[11]);let d=e[10]&&function(e){let t,n,r,i,o;return n=new Ue({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"title","Übernehmen"),z(t,"class","pointer feather")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[12]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}(e);return{c(){t=M("input"),r=L(),Ne(i.$$.fragment),o=L(),d&&d.c(),s=F(),z(t,"type","string"),z(t,"class",n=e[3]||e[4]),z(t,"id",e[1]),z(t,"name",e[1]),t.hidden=!0},m(n,u){x(n,t,u),j(t,e[0]),x(n,r,u),Te(i,n,u),x(n,o,u),d&&d.m(n,u),x(n,s,u),a=!0,l||(c=V(t,"input",e[18]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&z(t,"class",n),(!a||2&r)&&z(t,"id",e[1]),(!a||2&r)&&z(t,"name",e[1]),1&r&&j(t,e[0]);const o={};6&r&&(o.id="dp-"+e[1]+(e[2]?"-"+e[2]:"")),1&r&&(o.value=e[0]),32&r&&(o.readonly=e[5]),128&r&&(o.required=e[7]),64&r&&(o.disabled=e[6]),i.$set(o),e[10]&&d.p(e,r)},i(e){a||($e(i.$$.fragment,e),$e(d),a=!0)},o(e){Ie(i.$$.fragment,e),Ie(d),a=!1},d(e){e&&k(t),e&&k(r),De(i,e),e&&k(o),d&&d.d(e),e&&k(s),l=!1,c()}}}let Ls=new Map;function Fs(e,n,r){const i=ee(),{DatePicker:o}=c;let{value:s}=n,{id:a}=n,{item:l}=n,{record:d}=n,{praefix:u}=n,{noForm:f=!1}=n,{classId:h}=n,{eventId:m}=n,{readonly:p}=n,{disabled:g}=n,{required:w}=n,{notifyList:y}=n,{dateInput:v}=n;s||(s=void 0);let $=null;const I=(void 0===u?"":u.toString())+"-"+m+"-"+l.name,_=l.properties?.noCalendar||!1,C=l.properties?.transfer,E=({detail:e})=>{try{r(0,s=Yr(e.value,s)),void 0!==u&&""!==u&&Ls.set(I,new Date(s.valueOf())),A(s)}catch{r(0,s=void 0)}},A=e=>{i("change",{value:new Date(e.valueOf())})};if(void 0!==u&&!s){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);s=Yr(t,s)}return e.$$set=e=>{"value"in e&&r(0,s=e.value),"id"in e&&r(1,a=e.id),"item"in e&&r(13,l=e.item),"record"in e&&r(14,d=e.record),"praefix"in e&&r(2,u=e.praefix),"noForm"in e&&r(3,f=e.noForm),"classId"in e&&r(4,h=e.classId),"eventId"in e&&r(15,m=e.eventId),"readonly"in e&&r(5,p=e.readonly),"disabled"in e&&r(6,g=e.disabled),"required"in e&&r(7,w=e.required),"notifyList"in e&&r(16,y=e.notifyList),"dateInput"in e&&r(17,v=e.dateInput)},e.$$.update=()=>{if(1&e.$$.dirty&&s&&!C&&Ls.has(I)&&r(0,s=Ls.get(I)),65536&e.$$.dirty&&(async e=>{if(null===$){const e=(await t.getEvent(m)).output.class[0].item;$=e.find(e=>e.properties?.value?.formula)}$&&$.properties.value.formula.argument[0].refItem===l.name&&(e&&e.itemName!==l.name&&!$.properties.value.formula.argument[1].value&&e.itemName!==$.properties.value.formula.argument[1].refItem.split(".")[0]||i("formula",{item:$}))})(y),131072&e.$$.dirty&&((e={})=>{let{ref:t,val:n,t:r,l:i,n:o}=e;if(o&&(n=o),!n||isNaN(new Date(n)))return;if(r)return;if(!t)return;const[s,a]=t.split(".");s===i&&a===l.name&&null!=u&&E({detail:{value:new Date(n)}})})(v),24673&e.$$.dirty&&d&&d[l.name])try{g||p||r(0,s=Yr(d[l.name],s))}catch{}},[s,a,u,f,h,p,g,w,o,_,C,E,()=>{i("record",{target:C.target,value:s.toISOString()})},l,d,m,y,v,function(){s=this.value,r(0,s),r(14,d),r(13,l),r(6,g),r(5,p)}]}class Vs extends xe{constructor(e){super(),Re(this,e,Fs,Bs,S,{value:0,id:1,item:13,record:14,praefix:2,noForm:3,classId:4,eventId:15,readonly:5,disabled:6,required:7,notifyList:16,dateInput:17})}}function Us(e){let t;return{c(){t=B("Stunden")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Ws(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[Us]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function zs(e){let t;return{c(){t=B("Minuten")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function Hs(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[zs]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function js(e){let t;return{c(){t=B("Jetzt")},m(e,n){x(e,t,n)},d(e){e&&k(t)}}}function qs(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[js]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function Gs(e){let t,n,r,i,o,s,a,l,c;return i=new e[5]({props:{value:e[0],closeOnSelection:!0}}),i.$on("change",e[8]),s=new e[6]({props:{value:e[0],$$slots:{"now-label":[qs],"minutes-label":[Hs],"hours-label":[Ws]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=M("input"),r=L(),Ne(i.$$.fragment),o=L(),Ne(s.$$.fragment),z(t,"type","string"),z(t,"class",n=e[2]||e[3]),z(t,"id",e[1]),z(t,"name",e[1]),t.hidden=!0},m(n,d){x(n,t,d),j(t,e[0]),x(n,r,d),Te(i,n,d),x(n,o,d),Te(s,n,d),a=!0,l||(c=V(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&z(t,"class",n),(!a||2&r)&&z(t,"id",e[1]),(!a||2&r)&&z(t,"name",e[1]),1&r&&j(t,e[0]);const o={};1&r&&(o.value=e[0]),i.$set(o);const l={};1&r&&(l.value=e[0]),4096&r&&(l.$$scope={dirty:r,ctx:e}),s.$set(l)},i(e){a||($e(i.$$.fragment,e),$e(s.$$.fragment,e),a=!0)},o(e){Ie(i.$$.fragment,e),Ie(s.$$.fragment,e),a=!1},d(e){e&&k(t),e&&k(r),De(i,e),e&&k(o),De(s,e),l=!1,c()}}}function Xs(e,t,n){const r=ee(),{Label:i,DatePicker:o,TimePicker:s}=c;let{value:a}=t,{id:l}=t,{noForm:d=!1}=t,{classId:u}=t;const f=e=>r("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,a=e.value),"id"in e&&n(1,l=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[a,l,d,u,i,o,s,({detail:e})=>{var t,r;n(0,(t=e.value,r=a,a=null==t||null==r?t:(r.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),r))),f(a)},({detail:e})=>{n(0,a=Yr(e.value,a)),f(a)},function(){a=this.value,n(0,a)}]}class Ys extends xe{constructor(e){super(),Re(this,e,Xs,Gs,S,{value:0,id:1,noForm:2,classId:3})}}function Zs(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g;return u=new e[9]({props:{format:e[7],required:e[3],disabled:e[4],value:e[5],noCalendar:e[10],closeOnSelection:!0}}),u.$on("change",e[11]),h=new e[9]({props:{format:e[8],required:e[3],disabled:e[4],value:e[6],noCalendar:e[10],class:"moveLeft",closeOnSelection:!0}}),h.$on("change",e[12]),{c(){t=M("input"),o=L(),s=M("input"),d=L(),Ne(u.$$.fragment),f=B(" /\n"),Ne(h.$$.fragment),z(t,"type","string"),z(t,"class",n=e[1]||e[2]),z(t,"id",r=e[0]+"_from"),z(t,"name",i=e[0]+"_from"),t.hidden=!0,z(s,"type","string"),z(s,"class",a=e[1]||e[2]),z(s,"id",l=e[0]+"_to"),z(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){x(n,t,r),j(t,e[5]),x(n,o,r),x(n,s,r),j(s,e[6]),x(n,d,r),Te(u,n,r),x(n,f,r),Te(h,n,r),m=!0,p||(g=[V(t,"input",e[15]),V(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&z(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&z(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&z(t,"name",i),32&o&&j(t,e[5]),(!m||6&o&&a!==(a=e[1]||e[2]))&&z(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&z(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&z(s,"name",c),64&o&&j(s,e[6]);const d={};128&o&&(d.format=e[7]),8&o&&(d.required=e[3]),16&o&&(d.disabled=e[4]),32&o&&(d.value=e[5]),u.$set(d);const f={};256&o&&(f.format=e[8]),8&o&&(f.required=e[3]),16&o&&(f.disabled=e[4]),64&o&&(f.value=e[6]),h.$set(f)},i(e){m||($e(u.$$.fragment,e),$e(h.$$.fragment,e),m=!0)},o(e){Ie(u.$$.fragment,e),Ie(h.$$.fragment,e),m=!1},d(e){e&&k(t),e&&k(o),e&&k(s),e&&k(d),De(u,e),e&&k(f),De(h,e),p=!1,A(g)}}}function Ks(e,t,n){const r=ee(),{DatePicker:i}=c;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:d}=t,{required:u}=t,{disabled:f}=t;const{noCalendar:h,preset:m}=a.properties||{};let p,g,w="%d.%m.%Y",y="%d.%m.%Y";return e.$$set=e=>{"value"in e&&n(13,o=e.value),"id"in e&&n(0,s=e.id),"item"in e&&n(14,a=e.item),"noForm"in e&&n(1,l=e.noForm),"classId"in e&&n(2,d=e.classId),"required"in e&&n(3,u=e.required),"disabled"in e&&n(4,f=e.disabled)},e.$$.update=()=>{if(8304&e.$$.dirty&&o){if((o?.from||o?.to)&&(n(5,p=o?.from),n(6,g=o?.to)),m){const{first:e,last:t}=function(e){const t=new Date;let n=t.getFullYear();const r=t.getMonth();let i,o;switch(t.getDate(),e){case"currentMonth":i=o=r;break;case"currentYear":i=0,o=i+11;break;case"lastSemiYear":i=r<6?6:0,o=i+5,i>5&&--n;break;case"lastQuarter":i=r<3?9:r<6?0:r<9?3:6,o=i+2,i>8&&--n;break;case"lastMonth":i=o=0===r?11:r-1,11===i&&--n;break;default:i=0,o=i+11,--n}return{first:new Date(n,i,1),last:new Date(n,o+1,0)}}(m);e&&!p&&n(5,p=e),t&&!g&&n(6,g=t)}"Invalid Date"===p?.toString()&&n(5,p=void 0),"Invalid Date"===g?.toString()&&n(6,g=void 0),f&&(n(7,w=void 0===p?"":"%d.%m.%Y"),n(8,y=void 0===g?"":"%d.%m.%Y"))}},[s,l,d,u,f,p,g,w,y,i,h,({detail:e})=>{n(5,p=Yr(e.value,p)),g&&p&&g.valueOf()-p.valueOf()<0&&n(5,p=void 0),n(13,o.from=p,o),r("change",{value:p,range:"_from"})},({detail:e})=>{n(6,g=Yr(e.value,g)),g&&p&&g.valueOf()-p.valueOf()<0&&n(6,g=void 0),n(13,o.to=g,o),r("change",{value:g,range:"_to"})},o,a,function(){p=this.value,n(5,p),n(13,o),n(6,g),n(4,f)},function(){g=this.value,n(6,g),n(13,o),n(5,p),n(4,f)}]}class Qs extends xe{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=M("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",R(document.head,t)),Re(this,e,Ks,Zs,S,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var Js={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function ea(e){return ea="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},ea(e)}function ta(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return na(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return na(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ra={normalizePrecision:function(e){var t=e.reduce(function(e,t){return Math.max(e.getPrecision(),t.getPrecision())});return e.map(function(e){return e.getPrecision()!==t?e.convertPrecision(t):e})},minimum:function(e){var t=ta(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.lessThan(e)?i:e}),i},maximum:function(e){var t=ta(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function ia(e){return!isNaN(parseInt(e))&&isFinite(e)}function oa(e){return e%2==0}function sa(e){return ia(e)&&!Number.isInteger(e)}function aa(e){return Math.abs(e)%1==.5}function la(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(n,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?n(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",e,!0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n])}(i,t.headers),i.send()})}function ca(e){return void 0===e}function da(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n={};return Object.entries(e).forEach(function(e){if("object"===ea(e[1])){var r=da(e[1]);Object.entries(r).forEach(function(r){n[e[0]+t+r[0]]=r[1]})}else n[e[0]]=e[1]}),n}function ua(){var e=function(e,t){var n=function(e){return Math.pow(10,function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}(e))},r=Math.max(n(e),n(t));return Math.round(e*r)*Math.round(t*r)/(r*r)},t={HALF_ODD:function(e){var t=Math.round(e);return aa(e)&&oa(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return aa(e)?oa(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return aa(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return aa(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return aa(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(t,n){return sa(t)||sa(n)?e(t,n):t*n},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(e){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](e)}}}var fa=ua();function ha(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var n in t)e=e.replace("{{".concat(n,"}}"),t[n]);return e};return{getExchangeRate:function(n,r){return(i=e.endpoint,!Boolean(i)||"object"!==ea(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return la(t(e.endpoint,{from:n,to:r}),{headers:e.headers})}(n,r):e.endpoint).then(function(i){return da(i)[t(e.propertyPath,{from:n,to:r})]});var i}}}function ma(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new n(t)}function pa(e){ma(function(e){return ia(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function ga(e){ma(Number.isInteger(e),"You must provide an integer.",TypeError)}var wa=ua(),ya=Object.assign(function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,i=n.currency,o=n.precision;ga(r),ga(o);var s=e.globalLocale,a=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),u=function(t){var n=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:n.amount,currency:n.currency,precision:n.precision}),{locale:n.locale})},f=function(e){ma(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(e){return u.call(this,{locale:e})},getPrecision:function(){return o},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;ga(e);var n=this.getPrecision(),r=e>n,i=r?wa.multiply:wa.divide,o=r?[e,n]:[n,e],s=Math.pow(10,wa.subtract.apply(wa,o));return u.call(this,{amount:wa.round(i(this.getAmount(),s),t),precision:e})},add:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:wa.add(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},subtract:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return u.call(this,{amount:wa.subtract(n[0].getAmount(),n[1].getAmount()),precision:n[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:wa.round(wa.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return u.call(this,{amount:wa.round(wa.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;return pa(e),this.multiply(wa.divide(e,100),t)},allocate:function(e){var t=this;!function(e){ma(function(e){return e.length>0&&e.every(function(e){return e>=0})&&e.some(function(e){return e>0})}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var n=e.reduce(function(e,t){return wa.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(wa.divide(wa.multiply(t.getAmount(),e),n));return r=wa.subtract(r,i),u.call(t,{amount:i})}),o=0;r>0;)e[o]>0&&(i[o]=i[o].add(u.call(this,{amount:1})),r=wa.subtract(r,1)),o+=1;return i},convert:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.endpoint,i=void 0===r?d.endpoint:r,o=n.propertyPath,s=void 0===o?d.propertyPath||"rates.{{to}}":o,a=n.headers,c=void 0===a?d.headers:a,f=n.roundingMode,h=void 0===f?l:f,m=Object.assign({},{endpoint:i,propertyPath:s,headers:c,roundingMode:h});return ha(m).getExchangeRate(this.getCurrency(),e).then(function(n){return ma(!ca(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:wa.round(wa.multiply(t.getAmount(),parseFloat(n)),m.roundingMode),currency:e})})},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<n[1].getAmount()},lessThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()<=n[1].getAmount()},greaterThan:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>n[1].getAmount()},greaterThanOrEqual:function(t){f.call(this,t);var n=e.normalizePrecision([this,t]);return n[0].getAmount()>=n[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==wa.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==wa.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var n=e.normalizePrecision([this,t]);return n[0].getAmount()===n[1].getAmount()},toFormat:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=function(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return null!==t?t.slice(1).filter(function(e){return!ca(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return ca(this.getMatches().find(e))?0:this.getMatches()[fa.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find(function(e){return"USD"===e||"dollar"===e||"$"===e})]},getStyle:function(){return ca(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ca(this.getMatches().find(function(e){return","===e}))}}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:a);return this.toRoundedUnit(t.getMinimumFractionDigits(),e).toLocaleString(this.getLocale(),{currencyDisplay:t.getCurrencyDisplay(),useGrouping:t.getUseGrouping(),minimumFractionDigits:t.getMinimumFractionDigits(),style:t.getStyle(),currency:this.getCurrency()})},toUnit:function(){return wa.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,n=Math.pow(10,e);return wa.divide(wa.round(wa.multiply(this.toUnit(),n),t),n)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Js,ra),va={},$a={};!function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+(t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",r=new RegExp("^"+n+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,n){if(t){const r=Object.keys(t),i=r.length;for(let o=0;o<i;o++)e[r[o]]="strict"===n?[t[r[o]]]:t[r[o]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(e){const t=r.exec(e);return!(null==t)},e.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const i=[];i.startIndex=t.lastIndex-r[0].length;const o=r.length;for(let e=0;e<o;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n},e.nameRegexp=n}($a);const Ia=$a,_a={allowBooleanAttributes:!1,unpairedTags:[]};function Ca(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ea(e,t){const n=t;for(;t<e.length;t++)if("?"==e[t]||" "==e[t]){const r=e.substr(n,t-n);if(t>5&&"xml"===r)return xa("InvalidXml","XML declaration allowed only at the start of the document.",Ma(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function Aa(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}va.validate=function(e,t){t=Object.assign({},_a,t);const n=[];let r=!1,i=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let o=0;o<e.length;o++)if("<"===e[o]&&"?"===e[o+1]){if(o+=2,o=Ea(e,o),o.err)return o}else{if("<"!==e[o]){if(Ca(e[o]))continue;return xa("InvalidChar","char '"+e[o]+"' is not expected.",Ma(e,o))}{let s=o;if(o++,"!"===e[o]){o=Aa(e,o);continue}{let a=!1;"/"===e[o]&&(a=!0,o++);let l="";for(;o<e.length&&">"!==e[o]&&" "!==e[o]&&"\t"!==e[o]&&"\n"!==e[o]&&"\r"!==e[o];o++)l+=e[o];if(l=l.trim(),"/"===l[l.length-1]&&(l=l.substring(0,l.length-1),o--),!Oa(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",xa("InvalidTag",t,Ma(e,o))}const c=Na(e,o);if(!1===c)return xa("InvalidAttr","Attributes for '"+l+"' have open quote.",Ma(e,o));let d=c.value;if(o=c.index,"/"===d[d.length-1]){const n=o-d.length;d=d.substring(0,d.length-1);const i=Da(d,t);if(!0!==i)return xa(i.err.code,i.err.msg,Ma(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return xa("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Ma(e,o));if(d.trim().length>0)return xa("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Ma(e,s));if(0===n.length)return xa("InvalidTag","Closing tag '"+l+"' has not been opened.",Ma(e,s));{const t=n.pop();if(l!==t.tagName){let n=Ma(e,t.tagStartPos);return xa("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",Ma(e,s))}0==n.length&&(i=!0)}}else{const a=Da(d,t);if(!0!==a)return xa(a.err.code,a.err.msg,Ma(e,o-d.length+a.err.line));if(!0===i)return xa("InvalidXml","Multiple possible root nodes found.",Ma(e,o));-1!==t.unpairedTags.indexOf(l)||n.push({tagName:l,tagStartPos:s}),r=!0}for(o++;o<e.length;o++)if("<"===e[o]){if("!"===e[o+1]){o++,o=Aa(e,o);continue}if("?"!==e[o+1])break;if(o=Ea(e,++o),o.err)return o}else if("&"===e[o]){const t=Ra(e,o);if(-1==t)return xa("InvalidChar","char '&' is not expected.",Ma(e,o));o=t}else if(!0===i&&!Ca(e[o]))return xa("InvalidXml","Extra text at the end",Ma(e,o));"<"===e[o]&&o--}}}return r?1==n.length?xa("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Ma(e,n[0].tagStartPos)):!(n.length>0)||xa("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):xa("InvalidXml","Start tag expected.",1)};const ba='"',Sa="'";function Na(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===ba||e[t]===Sa)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}const Ta=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Da(e,t){const n=Ia.getAllMatches(e,Ta),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return xa("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",Pa(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return xa("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",Pa(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return xa("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",Pa(n[e]));const i=n[e][2];if(!ka(i))return xa("InvalidAttr","Attribute '"+i+"' is an invalid name.",Pa(n[e]));if(r.hasOwnProperty(i))return xa("InvalidAttr","Attribute '"+i+"' is repeated.",Pa(n[e]));r[i]=1}return!0}function Ra(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function xa(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function ka(e){return Ia.isName(e)}function Oa(e){return Ia.isName(e)}function Ma(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Pa(e){return e.startIndex+e[1].length}var Ba={};const La={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};Ba.buildOptions=function(e){return Object.assign({},La,e)},Ba.defaultOptions=La;var Fa=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}};const Va=$a;function Ua(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const r=e[t++];let i="";for(;t<e.length&&e[t]!==r;t++)i+=e[t];return[n,i,t]}function Wa(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function za(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function Ha(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function ja(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function qa(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function Ga(e){if(Va.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var Xa=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let r=1,i=!1,o=!1,s="";for(;t<e.length;t++)if("<"!==e[t]||o)if(">"===e[t]){if(o?"-"===e[t-1]&&"-"===e[t-2]&&(o=!1,r--):r--,0===r)break}else"["===e[t]?i=!0:s+=e[t];else{if(i&&za(e,t))t+=7,[entityName,val,t]=Ua(e,t+1),-1===val.indexOf("&")&&(n[Ga(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&Ha(e,t))t+=8;else if(i&&ja(e,t))t+=8;else if(i&&qa(e,t))t+=9;else{if(!Wa)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const Ya=/^[-+]?0x[a-fA-F0-9]+$/,Za=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Ka={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var Qa=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1};const Ja=$a,el=Fa,tl=Xa,nl=function(e,t={}){if(t=Object.assign({},Ka,t),!e||"string"!=typeof e)return e;let n=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(n))return e;if(t.hex&&Ya.test(n))return Number.parseInt(n,16);{const r=Za.exec(n);if(r){const i=r[1],o=r[2];let s=function(e){if(e&&-1!==e.indexOf("."))return"."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e;return e}(r[3]);const a=r[4]||r[6];if(!t.leadingZeros&&o.length>0&&i&&"."!==n[2])return e;if(!t.leadingZeros&&o.length>0&&!i&&"."!==n[1])return e;{const r=Number(n),l=""+r;return-1!==l.search(/[eE]/)||a?t.eNotation?r:e:-1!==n.indexOf(".")?"0"===l&&""===s||l===s||i&&l==="-"+s?r:e:o?s===l||i+s===l?r:e:n===l||n===i+l?r:e}}return e}},rl=Qa;function il(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:e[r]}}}function ol(e,t,n,r,i,o,s){if(void 0!==e&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){s||(e=this.replaceEntitiesValue(e));const r=this.options.tagValueProcessor(t,e,n,i,o);if(null==r)return e;if(typeof r!=typeof e||r!==e)return r;if(this.options.trimValues)return wl(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?wl(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function sl(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const al=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function ll(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=Ja.getAllMatches(e,al),r=n.length,i={};for(let e=0;e<r;e++){const r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let o=n[e][4],s=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==o){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);const e=this.options.attributeValueProcessor(r,o,t);i[s]=null==e?o:typeof e!=typeof o||e!==o?e:wl(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[s]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const cl=function(e){e=e.replace(/\r\n?/g,"\n");const t=new el("!xml");let n=t,r="",i="";for(let o=0;o<e.length;o++){if("<"===e[o])if("/"===e[o+1]){const t=ml(e,">",o,"Closing Tag is not closed.");let s=e.substring(o+2,t).trim();if(this.options.removeNSPrefix){const e=s.indexOf(":");-1!==e&&(s=s.substr(e+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(r=this.saveTextToParentTag(r,n,i));const a=i.substring(i.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=i.lastIndexOf("."),i=i.substring(0,l),n=this.tagsNodeStack.pop(),r="",o=t}else if("?"===e[o+1]){let t=pl(e,o,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,i),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new el(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,i,t.tagName)),this.addChild(n,e,i)}o=t.closeIndex+1}else if("!--"===e.substr(o+1,3)){const t=ml(e,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const s=e.substring(o+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}o=t}else if("!D"===e.substr(o+1,2)){const t=tl(e,o);this.docTypeEntities=t.entities,o=t.i}else if("!["===e.substr(o+1,2)){const t=ml(e,"]]>",o,"CDATA is not closed.")-2,s=e.substring(o+9,t);r=this.saveTextToParentTag(r,n,i);let a=this.parseTextData(s,n.tagname,i,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]):n.add(this.options.textNodeName,a),o=t+2}else{let s=pl(e,o,this.options.removeNSPrefix),a=s.tagName;const l=s.rawTagName;let c=s.tagExp,d=s.attrExpPresent,u=s.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&r&&"!xml"!==n.tagname&&(r=this.saveTextToParentTag(r,n,i,!1));const f=n;if(f&&-1!==this.options.unpairedTags.indexOf(f.tagname)&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==t.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let t="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),o=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=s.closeIndex;else{const n=this.readStopNodeData(e,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,t=n.tagContent}const r=new el(a);a!==c&&d&&(r[":@"]=this.buildAttributesMap(c,i,a)),t&&(t=this.parseTextData(t,a,i,!0,d,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),r.add(this.options.textNodeName,t),this.addChild(n,r,i)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),c=a):c=c.substr(0,c.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const e=new el(a);a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),i=i.substr(0,i.lastIndexOf("."))}else{const e=new el(a);this.tagsNodeStack.push(n),a!==c&&d&&(e[":@"]=this.buildAttributesMap(c,i,a)),this.addChild(n,e,i),n=e}r="",o=u}}else r+=e[o]}return t.child};function dl(e,t,n){const r=this.options.updateTag(t.tagname,n,t[":@"]);!1===r||("string"==typeof r?(t.tagname=r,e.addChild(t)):e.addChild(t))}const ul=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function fl(e,t,n,r){return e&&(void 0===r&&(r=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,r))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function hl(e,t,n){const r="*."+n;for(const n in e){const i=e[n];if(r===i||t===i)return!0}return!1}function ml(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}function pl(e,t,n,r=">"){const i=function(e,t,n=">"){let r,i="";for(let o=t;o<e.length;o++){let t=e[o];if(r)t===r&&(r="");else if('"'===t||"'"===t)r=t;else if(t===n[0]){if(!n[1])return{data:i,index:o};if(e[o+1]===n[1])return{data:i,index:o}}else"\t"===t&&(t=" ");i+=t}}(e,t+1,r);if(!i)return;let o=i.data;const s=i.index,a=o.search(/\s/);let l=o,c=!0;-1!==a&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const d=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==i.data.substr(e+1))}return{tagName:l,tagExp:o,closeIndex:s,attrExpPresent:c,rawTagName:d}}function gl(e,t,n){const r=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const o=ml(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(i--,0===i))return{tagContent:e.substring(r,n),i:o};n=o}else if("?"===e[n+1]){n=ml(e,"?>",n+1,"StopNode is not closed.")}else if("!--"===e.substr(n+1,3)){n=ml(e,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===e.substr(n+1,2)){n=ml(e,"]]>",n,"StopNode is not closed.")-2}else{const r=pl(e,n,">");if(r){(r&&r.tagName)===t&&"/"!==r.tagExp[r.tagExp.length-1]&&i++,n=r.closeIndex}}}function wl(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:nl(e,n))}return Ja.isExist(e)?e:""}var yl=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=il,this.parseXml=cl,this.parseTextData=ol,this.resolveNameSpace=sl,this.buildAttributesMap=ll,this.isItStopNode=hl,this.replaceEntitiesValue=ul,this.readStopNodeData=gl,this.saveTextToParentTag=fl,this.addChild=dl,this.ignoreAttributesFn=rl(this.options.ignoreAttributes)}},vl={};function $l(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=Il(s);let l="";if(l=void 0===n?a:n+"."+a,a===t.textNodeName)void 0===r?r=s[a]:r+=""+s[a];else{if(void 0===a)continue;if(s[a]){let e=$l(s[a],t,l);const n=Cl(e,t);s[":@"]?_l(e,s[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==i[a]&&i.hasOwnProperty(a)?(Array.isArray(i[a])||(i[a]=[i[a]]),i[a].push(e)):t.isArray(a,l,n)?i[a]=[e]:i[a]=e}}}return"string"==typeof r?r.length>0&&(i[t.textNodeName]=r):void 0!==r&&(i[t.textNodeName]=r),i}function Il(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function _l(e,t,n,r){if(t){const i=Object.keys(t),o=i.length;for(let s=0;s<o;s++){const o=i[s];r.isArray(o,n+"."+o,!0,!0)?e[o]=[t[o]]:e[o]=t[o]}}}function Cl(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}vl.prettify=function(e,t){return $l(e,t)};const{buildOptions:El}=Ba,Al=yl,{prettify:bl}=vl,Sl=va;var Nl=class{constructor(e){this.externalEntities={},this.options=El(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=Sl.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Al(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:bl(r,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};function Tl(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=Dl(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];xl(c,t)||(e=t.tagValueProcessor(l,e),e=kl(e,t)),o&&(i+=r),i+=e,o=!1;continue}if(l===t.cdataPropName){o&&(i+=r),i+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,o=!1;continue}if(l===t.commentPropName){i+=r+`\x3c!--${a[l][0][t.textNodeName]}--\x3e`,o=!0;continue}if("?"===l[0]){const e=Rl(a[":@"],t),n="?xml"===l?"":r;let s=a[l][0][t.textNodeName];s=0!==s.length?" "+s:"",i+=n+`<${l}${s}${e}?>`,o=!0;continue}let d=r;""!==d&&(d+=t.indentBy);const u=r+`<${l}${Rl(a[":@"],t)}`,f=Tl(a[l],t,c,d);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?i+=u+">":i+=u+"/>":f&&0!==f.length||!t.suppressEmptyNode?f&&f.endsWith(">")?i+=u+`>${f}${r}</${l}>`:(i+=u+">",f&&""!==r&&(f.includes("/>")||f.includes("</"))?i+=r+t.indentBy+f+r:i+=f,i+=`</${l}>`):i+=u+"/>",o=!0}return i}function Dl(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(e.hasOwnProperty(r)&&":@"!==r)return r}}function Rl(e,t){let n="";if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=kl(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function xl(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]==="*."+n)return!0;return!1}function kl(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const Ol=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Tl(e,t,"",n)},Ml=Qa,Pl={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Bl(e){this.options=Object.assign({},Pl,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ml(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Vl),this.processTextOrObjNode=Ll,this.options.format?(this.indentate=Fl,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Ll(e,t,n,r){const i=this.j2x(e,n+1,r.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function Fl(e){return this.options.indentBy.repeat(e)}function Vl(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Bl.prototype.build=function(e){return this.options.preserveOrder?Ol(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},Bl.prototype.j2x=function(e,t,n){let r="",i="";const o=n.join(".");for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(void 0===e[s])this.isAttribute(s)&&(i+="");else if(null===e[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,"",t);else if("object"!=typeof e[s]){const n=this.isAttribute(s);if(n&&!this.ignoreAttributesFn(n,o))r+=this.buildAttrPairStr(n,""+e[s]);else if(!n)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,""+e[s]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const r=e[s].length;let o="",a="";for(let l=0;l<r;l++){const r=e[s][l];if(void 0===r);else if(null===r)"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if("object"==typeof r)if(this.options.oneListGroup){const e=this.j2x(r,t+1,n.concat(s));o+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else o+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),o+=e}else o+=this.buildTextValNode(r,s,"",t)}this.options.oneListGroup&&(o=this.buildObjectNode(o,s,a,t)),i+=o}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],""+e[s][t[i]])}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},Bl.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},Bl.prototype.buildObjectNode=function(e,t,n,r){if(""===e)return"?"===t[0]?this.indentate(r)+"<"+t+n+"?"+this.tagEndChar:this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,o="";return"?"===t[0]&&(o="?",i=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===o.length?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+"<"+t+n+o+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+"<"+t+n+o+">"+e+i}},Bl.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},Bl.prototype.buildTextValNode=function(e,t,n,r){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(r)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(r)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+"<"+t+n+">"+i+"</"+t+this.tagEndChar}},Bl.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};for(var Ul={XMLParser:Nl,XMLValidator:va,XMLBuilder:Bl},Wl=[],zl=0;zl<256;++zl)Wl.push((zl+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class Hl extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class jl extends Hl{constructor(e){super(e)}}class ql extends Hl{constructor(e){super(e)}}const Gl=e=>e.Id.IBAN?{iban:e.Id.IBAN}:{...e.Id?.Othr?.Id&&{accountNumber:String(e.Id.Othr.Id)},...e.Nm&&{name:e.Nm},...e.Ccy&&{currency:e.Ccy}},Xl=e=>{if(e){if(e.FinInstnId?.BIC)return{bic:e.FinInstnId.BIC};if(e.FinInstnId?.BICFI)return{bic:e.FinInstnId.BICFI};if(e.FinInstnId){const t=e.FinInstnId.Othr?.Id||e.FinInstnId.ClrSysMmbId?.MmbId;if(t)return{abaRoutingNumber:t.toString()}}}},Yl=(e,t="USD")=>{const n=ya({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},Zl=e=>{const t=e.DtTm||e.Dt;return new Date(t)},Kl=e=>{const t=e.Id.toString(),n=e.ElctrncSeqNb,r=e.LglSeqNb,i=new Date(e.CreDtTm);let o,s;e.FrToDt&&(o=new Date(e.FrToDt.FrDtTm),s=new Date(e.FrToDt.ToDtTm));const a=e.TxsSummry?.TtlNtries.NbOfNtries,l=e.TxsSummry?.TtlNtries.Sum,c=e.TxsSummry?.TtlNtries.TtlNetNtryAmt;let d;c&&(d=Yl(c));const u=e.TxsSummry?.TtlCdtNtries.NbOfNtries,f=e.TxsSummry?.TtlCdtNtries.Sum,h=e.TxsSummry?.TtlDbtNtries.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries.Sum,p=Gl(e.Acct),g=Xl(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(Ql):e.Bal&&(w=[Ql(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map(Jl):e.Ntry&&(y=[Jl(e.Ntry)]),{id:t,electronicSequenceNumber:n,legalSequenceNumber:r,creationDate:i,fromDate:o,toDate:s,account:p,agent:g,numOfEntries:a,sumOfEntries:l,netAmountOfEntries:d,numOfCredits:u,sumOfCredits:f,numOfDebits:h,sumOfDebits:m,balances:w,entries:y}},Ql=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=Yl(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:Zl(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},Jl=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=Zl(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=Yl(o,s),l=e.BkTxCd.Prtry?.Cd,c=(e=>{if(e)return Array.isArray(e)?e.join("\n"):e})(e.AddtlNtryInf),d=e.AcctSvcrRef,u=tc(e.BkTxCd);let f=e.NtryDtls||[];Array.isArray(f)||(f=[f]);return{referenceId:t,creditDebitIndicator:n,bookingDate:r,reversal:i,amount:a,currency:s,proprietaryCode:l,transactions:f.map(e=>{let t=e.TxDtls||[];return Array.isArray(t)||(t=[t]),t.map(ec)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},ec=e=>{const t=e.Refs?.MsgId,n=e.Refs?.AcctSvcrRef,r=e.Refs?.PmtInfId,i=e.RmtInf?.Ustrd,o=e.Purp?.Prtry,s=e.RtrInf?.Rsn,a=e.RtrInf?.AddtlInf,l=e.Refs?.EndToEndId,c=e.Amt["@_Ccy"],d=e.Amt["#text"],u=e.RmtInf?.Strd?.CdtrRefInf?.Ref?.toString(),f=e.RmtInf?.Strd?.AddtlRmtInf;let h,m,p,g,w,y,v,$;return e.RltdPties?.Dbtr&&(m=e.RltdPties.Dbtr.Nm||e.RltdPties.Dbtr.Pty?.Nm),e.RltdPties?.DbtrAcct&&(p=Gl(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=Xl(e.RltdAgts.DbtrAgt)),(m||p||g)&&(h={name:m,account:p,agent:g}),e.RltdPties?.Cdtr&&(y=e.RltdPties.Cdtr.Nm||e.RltdPties.Cdtr.Pty?.Nm),e.RltdPties?.CdtrAcct&&(v=Gl(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&($=Xl(e.RltdAgts.CdtrAgt)),(y||v||$)&&(w={name:y,account:v,agent:$}),{messageId:t,accountServicerReferenceId:n,endToEndId:l,currency:c,amount:d,paymentInformationId:r,remittanceInformation:i,proprietaryPurpose:o,returnReason:s,returnAdditionalInformation:a,debtor:h,creditor:w,invoiceRef:u,invoiceRefAdd:f}},tc=e=>{const t=e?.Domn?.Cd,n=e?.Domn?.Fmly?.Cd,r=e?.Domn?.Fmly?.SubFmlyCd,i=e.Prtry?.Cd,o=e.Prtry?.Issr;return{domainCode:t,domainFamilyCode:n,domainSubFamilyCode:r,proprietaryCode:i,proprietaryCodeIssuer:o}};class nc{_messageId;_creationDate;_recipient;_statements;constructor(e){this._messageId=e.messageId,this._creationDate=e.creationDate,this._recipient=e.recipient,this._statements=e.statements}static getParser(){return new Ul.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=nc.getParser().parse(e);if(!t.Document)throw new jl("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new ql("Invalid CAMT.053 namespace");const n=t.Document.BkToCstmrStmt,r=n.GrpHdr.CreDtTm,i=new Date(r);let o=[];o=Array.isArray(n.Stmt)?n.Stmt.map(e=>Kl(e)):[Kl(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new nc({messageId:n.GrpHdr.MsgId.toString(),creationDate:i,recipient:s?(a=s,{id:a.Id?.OrgId?.Othr?.Id,name:a.Nm}):void 0,statements:o});var a}get balances(){return this._statements.flatMap(e=>e.balances)}get transactions(){return this._statements.flatMap(e=>e.entries).flatMap(e=>e.transactions)}get entries(){return this._statements.flatMap(e=>e.entries)}get messageId(){return this._messageId}get recipient(){return this._recipient}get creationDate(){return this._creationDate}get statements(){return this._statements}}function rc(e){let t,n,r,i,o;function s(t){e[17](t)}let a={class:e[0],id:e[1],name:e[2],accept:"text/xml",max:"1",beforeChange:e[13]};return void 0!==e[3]&&(a.files=e[3]),t=new e[7]({props:a}),re.push(()=>Se(t,"files",s)),t.$on("change",e[12]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ne(t.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,n){Te(t,e,n),x(e,r,n),Te(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ue(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(i.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(r),De(i,e)}}}function ic(e){let t,n;return t=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ne(t.$$.fragment)},m(e,r){Te(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.inputClass=e[0]),2&n&&(r.id=e[1]),2&n&&(r.name=e[1]),16&n&&(r.value=e[4]),t.$set(r)},i(e){n||($e(t.$$.fragment,e),n=!0)},o(e){Ie(t.$$.fragment,e),n=!1},d(e){De(t,e)}}}function oc(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[sc]},$$scope:{ctx:e}}}),{c(){t=M("div"),Ne(n.$$.fragment),q(t,"margin-top","1em")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,t){const r={};1073741888&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function sc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=B(e[6]),n=L(),Ne(r.$$.fragment)},m(e,o){x(e,t,o),x(e,n,o),Te(r,e,o),i=!0},p(e,n){(!i||64&n)&&H(t,e[6])},i(e){i||($e(r.$$.fragment,e),i=!0)},o(e){Ie(r.$$.fragment,e),i=!1},d(e){e&&k(t),e&&k(n),De(r,e)}}}function ac(e){let t,n,r,i,o;const s=[ic,rc],a=[];t=function(e){return e[11]?0:1}(e),n=a[t]=s[t](e);let l=e[5]&&oc(e);return{c(){n.c(),r=L(),l&&l.c(),i=F()},m(e,n){a[t].m(e,n),x(e,r,n),l&&l.m(e,n),x(e,i,n),o=!0},p(e,[t]){n.p(e,t),e[5]?l?(l.p(e,t),32&t&&$e(l,1)):(l=oc(e),l.c(),$e(l,1),l.m(i.parentNode,i)):l&&(ye(),Ie(l,1,1,()=>{l=null}),ve())},i(e){o||($e(n),$e(l),o=!0)},o(e){Ie(n),Ie(l),o=!1},d(e){a[t].d(e),e&&k(r),l&&l.d(e),e&&k(i)}}}function lc(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=c,l=ee();let{classId:d}=n,{eventId:u}=n,{record:f}=n,{item:h}=n,{id:m}=n,{name:p}=n;const g="camt53"===h.properties?.type;let w=[],y=f[h.name]||"",v=!!f._id,$=!1,I="In Verarbeitung!";const _=async(e,n,r,i,o,s)=>{try{if("debit"!==e)return"";if(n)return"";let a;if(r&&(a=await t.getSectionView("creditPayment",{creditPaymentId:r.split(".")[0]})),a?.length){let e=a[0].listBill.find(e=>i&&e.reference.replaceAll(" ","")===i);if(!e&&s&&(e=a[0].listBill.find(e=>e.iban.replaceAll(" ","")===s&&+e.amount==+o)),e)return e.bill}}catch{}return""},C=async(e,n,r,i,o,s,a=[])=>{try{if("credit"!==e)return"";let i,o=N(n);if(o.startsWith("R-")||(o=""),!o&&r&&(r=r.toString(),o=N(r.replaceAll(" ","")),o.startsWith("R-")||(o=""),!o&&r.includes("R-"))){o="R-"+r.split("R-")[1].slice(0,8)}const l=+Number.parseFloat(+s-.04).toFixed(2),c=+Number.parseFloat(+s+.04).toFixed(2);if(o&&(i=await t.getSectionView("invoice",{invoiceId:o}),i?.length)){const e=i[0];if(!a.find(t=>t.invoice==e._id)&&e.__total>=l&&e.__total<=c)return e._id}}catch{}return""},E=async(e,n,r)=>{try{if(!e)return;const n=await t.getSectionView("incomingPayment",{invoice:e});if(!n?.length)return;const i=n[0];return r===i._total&&i._id}catch{}},A=async e=>{try{if(!e)return;const n=await t.getSectionView("outgoingPayment",{bill:e});if(n?.length)return n[0]._id}catch{}},b=async e=>{try{const n=await t.getSectionView("accountingPlan",{iban:e});if(n?.length)return n[0]._id}catch{}return""},S=async(e,n)=>{try{const i=n.output.class[0].list,o=await(async e=>{if(!e.includes("xsd:camt.053"))return;let t;try{t=nc.fromXML(e)}catch(e){console.log("error",e)}return t})(e);if(!o||!o.messageId)return r(6,I="Das ist keine camt53 Datei!"),void r(5,$=!0);const s=await t.getSectionView("dailyJournal",{messageId:o.messageId});if(s?.length)return r(6,I="Bereits eingelesen!"),void r(5,$=!0);o._saldo=o.balances[1].amount/100,o._saldoDate_from=o.balances[0].date,o._saldoDate_to=o.balances[1].date;let a=!0;for(const e of n.output.class[0].item.filter(e=>e.properties?.source)){let t=o[e.properties.source];if(e.properties?.required&&!t){a=!1;break}if("dateRange"===e.type){const t=o[e.properties.source+"_from"],n=o[e.properties.source+"_to"];l("record",{itemName:e.name+"_from",value:t}),l("record",{itemName:e.name+"_to",value:n});continue}"[object Date]"===Object.prototype.toString.call(t)&&(t=new Date(t)),l("record",{itemName:e.name,value:t})}if(!a)return r(6,I="Ungültiger Inhalt!"),void r(5,$=!0);l("record",{itemName:"status",value:"offen"}),await Promise.all(i.map(async e=>await(async(e,t,n)=>{if(f._id)return;if(!e.process)return;n.output.class[0].name;const i=e.process.target;if(!i)return;r(6,I="In Verarbeitung!"),r(5,$=!0);const o=[],s=[],{refItem:a,value:c}=e.process.filter;for(const n of t[e.source]){const t=await b(n.account?.iban);for(const r of n.entries){if(r[a]!==c)continue;let l="SALA"===r.bankTransactionCode?.domainSubFamilyCode,d=!1;for(const a of r.transactions){let c=await C(r.creditDebitIndicator,a.invoiceRef,a.remittanceInformation,e.process.creditor,a.debtor,a.amount,s),u=await E(c,r.bookingDate,a.amount);!1===u&&(c=void 0,u=void 0);const f=await _(r.creditDebitIndicator,l,a.paymentInformationId,a.invoiceRef,a.amount,a.creditor?.account?.iban),h=await A(f),m="",p="",g={accountServicerReferenceId:a.accountServicerReferenceId,messageId:a.messageId,account:n.account.iban,accountDebit:t,creditDebitIndicator:r.creditDebitIndicator,bookingDate:r.bookingDate,amount:a.amount,currency:a.currency,debtor:a.debtor?.name||"",debtorAccount:a.debtor?.account?.iban||"",creditor:a.creditor?.name||"",creditorAccount:a.creditor?.account?.iban||"",paymentInformationId:a.paymentInformationId,invoiceRef:a.invoiceRef,invoiceRefAdd:a.invoiceRefAdd,remittanceInformation:a.remittanceInformation,returnAdditionalInformation:a.returnAdditionalInformation,additionalInformation:r.additionalInformation,invoice:c,incomingPayment:u,payDebtorAvis:p,isSalary:l,bill:f,outgoingPayment:h,journalFinAcc:m};if(l){if(d)continue;g.amount=r.amount/100,d=!0}g[i]?o.push(g):s.push(g)}}}o.length&&l("record",{itemName:e.name,value:o}),s.length&&l("record",{itemName:"open"+e.name,value:s})})(e,o,n))),setTimeout(()=>{l("saveFull"),r(5,$=!1)},2e3)}catch{r(6,I="Ungültiger Inhalt!"),r(5,$=!0)}},N=e=>{try{if(!e?.length)return"";if(e.length<14)return"";const t=e.replaceAll(" ","").slice(-14),n=t.slice(-8),r=t.slice(0,4);let i="";for(let e=0;e<r.length/2;e++){const t=2*e,n=r.substring(t,t+2);i+=String.fromCharCode(n)}return i+n}catch{}return""};return e.$$set=e=>{"classId"in e&&r(0,d=e.classId),"eventId"in e&&r(14,u=e.eventId),"record"in e&&r(15,f=e.record),"item"in e&&r(16,h=e.item),"id"in e&&r(1,m=e.id),"name"in e&&r(2,p=e.name)},e.$$.update=()=>{8&e.$$.dirty&&(w.length||r(5,$=!1))},[d,m,p,w,y,$,I,i,o,s,a,v,async()=>{const{list:e}=h.properties,n=w[0],i=await t.getEvent(u);if(n){r(4,y=n.name);const t=await n.text();if(g)return await S(t,i);const o=(e=>{var t={toObj:function(e){var n={};if(1==e.nodeType){if(e.attributes.length)for(var r=0;r<e.attributes.length;r++)n["@"+e.attributes[r].nodeName]=(e.attributes[r].nodeValue||"").toString();if(e.firstChild){for(var i=0,o=0,s=!1,a=e.firstChild;a;a=a.nextSibling)1==a.nodeType?s=!0:3==a.nodeType&&a.nodeValue.match(/[^ \f\n\r\t\v]/)?i++:4==a.nodeType&&o++;if(s)if(i<2&&o<2)for(t.removeWhite(e),a=e.firstChild;a;a=a.nextSibling)3==a.nodeType?n["#text"]=t.escape(a.nodeValue):4==a.nodeType?n["#cdata"]=t.escape(a.nodeValue):n[a.nodeName]?n[a.nodeName]instanceof Array?n[a.nodeName][n[a.nodeName].length]=t.toObj(a):n[a.nodeName]=[n[a.nodeName],t.toObj(a)]:n[a.nodeName]=t.toObj(a);else e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(i)e.attributes.length?n["#text"]=t.escape(t.innerXml(e)):n=t.escape(t.innerXml(e));else if(o)if(o>1)n=t.escape(t.innerXml(e));else for(a=e.firstChild;a;a=a.nextSibling)n["#cdata"]=t.escape(a.nodeValue)}e.attributes.length||e.firstChild||(n=null)}else 9==e.nodeType&&(n=t.toObj(e.documentElement));return n},toJson:function(e,n,r){var i=n?'"'+n+'"':"";if(e instanceof Array){for(var o=0,s=e.length;o<s;o++)e[o]=t.toJson(e[o],"",r+"\t");i+=(n?":[":"[")+(e.length>1?"\n"+r+"\t"+e.join(",\n"+r+"\t")+"\n"+r:e.join(""))+"]"}else if(null==e)i+=(n&&":")+"null";else if("object"==typeof e){var a=[];for(var l in e)a[a.length]=t.toJson(e[l],l,r+"\t");i+=(n?":{":"{")+(a.length>1?"\n"+r+"\t"+a.join(",\n"+r+"\t")+"\n"+r:a.join(""))+"}"}else i+="string"==typeof e?(n&&":")+'"'+e.toString()+'"':(n&&":")+e.toString();return i},innerXml:function(e){var t="";if("innerHTML"in e)t=e.innerHTML;else for(var n=function(e){var t="";if(1==e.nodeType){t+="<"+e.nodeName;for(var r=0;r<e.attributes.length;r++)t+=" "+e.attributes[r].nodeName+'="'+(e.attributes[r].nodeValue||"").toString()+'"';if(e.firstChild){t+=">";for(var i=e.firstChild;i;i=i.nextSibling)t+=n(i);t+="</"+e.nodeName+">"}else t+="/>"}else 3==e.nodeType?t+=e.nodeValue:4==e.nodeType&&(t+="<![CDATA["+e.nodeValue+"]]>");return t},r=e.firstChild;r;r=r.nextSibling)t+=n(r);return t},escape:function(e){return e.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(e){e.normalize();for(var n=e.firstChild;n;)if(3==n.nodeType)if(n.nodeValue.match(/[^ \f\n\r\t\v]/))n=n.nextSibling;else{var r=n.nextSibling;e.removeChild(n),n=r}else 1==n.nodeType?(t.removeWhite(n),n=n.nextSibling):n=n.nextSibling;return e}};return e=(new window.DOMParser).parseFromString(e,"text/xml"),t.toObj(t.removeWhite(e))})(t),s=[],a=o.BkToCstmrDbtCdtNtfctn.Ntfctn,c=[].concat(a.Ntry);for(const e of c){let t=[].concat(e.NtryDtls.TxDtls);for(const n of t){const t=n.RmtInf?.Strd?.CdtrRefInf?.Ref||n.Refs.EndToEndId||"",r={date:e.ValDt.Dt,branchName:n.RltdPties?.Dbtr?.Nm||"",amount:n.AmtDtls?.TxAmt?.Amt["#text"]||n.Amt["#text"],reference:t,invoiceId:N(t),information:n.RmtInf?.Ustrd||""};s.push(r)}}s.length&&l("record",{itemName:e,value:s})}},()=>{r(3,w)},u,f,h,function(e){w=e,r(3,w)}]}class cc extends xe{constructor(e){var t;super(),document.getElementById("svelte-157hlzf-style")||((t=M("style")).id="svelte-157hlzf-style",t.textContent="label.file-dropzone{margin-top:0 !important}",R(document.head,t)),Re(this,e,lc,ac,S,{classId:0,eventId:14,record:15,item:16,id:1,name:2})}}const dc=e=>{const t={},n=e.replaceAll("\r","").split("\n");return n?(t.iban=n[3],t.supplierText=n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9],t.supplier={company:{}},t.supplier.company.companyName=n[5],t.supplier.company.postcode=n[8],t.amount=n[18],t.amountOrg=n[18],t.currency={},t.currency.designation=n[19],t.reference=n[28],t.additionalInfo=n[29],t.extReference=uc(10,n[31]),t.amountVat=fc(!0,uc(32,n[31]),t.amount)||fc(!1,uc(33,n[31]),t.amount),t):t},uc=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},fc=(e,t,n)=>{if(!t)return"";let r=0;if(t.includes(":")){const n=t.split(";");for(const t of n){const[n,i]=t.split(":");r+=e?i/100*n:i}}else r=+n/(+t+100)*+t;return r},{document:hc}=Ee;function mc(e){let t,n,r,i,o;function s(t){e[14](t)}let a={class:e[0],id:e[1],name:e[2],accept:"application/pdf",max:"1",beforeChange:e[10]};return void 0!==e[3]&&(a.files=e[3]),t=new e[5]({props:a}),re.push(()=>Se(t,"files",s)),t.$on("change",e[8]),i=new e[6]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){Ne(t.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,n){Te(t,e,n),x(e,r,n),Te(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),!n&&8&r&&(n=!0,o.files=e[3],ue(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),16&r&&(s.value=e[4]),i.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(i.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(r),De(i,e)}}}function pc(e){let t,n,r,i;n=new e[6]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}});let o=e[4]&&gc(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),q(t,"position","relative")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),16&r&&(i.value=e[4]),n.$set(i),e[4]?o?(o.p(e,r),16&r&&$e(o,1)):(o=gc(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function gc(e){let t,n,r,i,o;return n=new Me({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-o0hiko")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[9]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function wc(e){let t,n,r,i;const o=[pc,mc],s=[];return t=function(e){return e[7]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}let yc;function vc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=ee();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,m=[],p=d[u.name]||"",g=!!d._id;const w={scale:{once:!1,value:3,start:3,step:.4,stop:4},resultOpts:{singleCodeInPage:!0,multiCodesInPage:!1,maxCodesInPage:1},improve:!0,jsQR:{}};var y=async function(e){if(!e.success)return;const n=await t.getSchema(l),i=e.codes?.filter(e=>!!e)?.at(0);if(!i?.length)return;if(!i.startsWith("SPC"))return;const o=dc(i);for(const e in o){if(n.items.find(t=>t.name===e)){if("object"==typeof o[e]){let n={};for(const i in o[e])if("object"==typeof o[e][i])for(const s in o[e][i]){o[e][i][s]&&(n[s]=o[e][i][s]);const a=await t.getSectionView(i,n);if(a?.length){const n=await t.getSectionView(e,{[i]:a[0]._id});n?.length&&r(11,d[e]=n[0]._id,d)}}else{o[e][i]&&(n[i]=o[e][i]);const s=await t.getSectionView(e,n);s?.length&&r(11,d[e]=s[0]._id,d)}}else o[e]&&r(11,d[e]=o[e],d);s("record",{itemName:e,value:d[e]})}}};return Q(()=>{if(yc)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){yc=PDF_QR_JS}}),J(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(12,l=e.eventId),"record"in e&&r(11,d=e.record),"item"in e&&r(13,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name)},[a,f,h,m,p,i,o,g,async e=>{const n=m[0];if(!n){s("record",{itemName:"$file",value:!1});const e=await t.getSchema(l);for(const t of e.items)s("record",{itemName:t.name,value:""});return}const i=URL.createObjectURL(n);r(4,p=n.name),s("record",{itemName:"$file",value:{fileName:p,file:n}}),yc.decodeDocument(i,w,y)},async()=>{if(!d?._id)return;const e=await t.getTaskByDocId(d._id,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;let r="/viewer/doc/index.html?file="+("/api/userreport/"+n[0]._id)+"&type=pdf";window.open(r,"","popup=yes toolbar=no width=800 height=1024")},()=>{r(3,m)},d,l,u,function(e){m=e,r(3,m)}]}class $c extends xe{constructor(e){var t;super(),hc.getElementById("svelte-o0hiko-style")||((t=M("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(hc.head,t)),Re(this,e,vc,wc,S,{classId:0,eventId:12,record:11,item:13,id:1,name:2})}}const{document:Ic}=Ee;function _c(e){let t,n,r,i,o;function s(t){e[18](t)}let a={class:e[0],id:e[1],name:e[2],accept:e[3],max:"1",beforeChange:e[12]};return void 0!==e[4]&&(a.files=e[4]),t=new e[7]({props:a}),re.push(()=>Se(t,"files",s)),t.$on("change",e[9]),i=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[5]}}),{c(){Ne(t.$$.fragment),r=L(),Ne(i.$$.fragment)},m(e,n){Te(t,e,n),x(e,r,n),Te(i,e,n),o=!0},p(e,r){const o={};1&r&&(o.class=e[0]),2&r&&(o.id=e[1]),4&r&&(o.name=e[2]),8&r&&(o.accept=e[3]),!n&&16&r&&(n=!0,o.files=e[4],ue(()=>n=!1)),t.$set(o);const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.id=e[1]),2&r&&(s.name=e[1]),32&r&&(s.value=e[5]),i.$set(s)},i(e){o||($e(t.$$.fragment,e),$e(i.$$.fragment,e),o=!0)},o(e){Ie(t.$$.fragment,e),Ie(i.$$.fragment,e),o=!1},d(e){De(t,e),e&&k(r),De(i,e)}}}function Cc(e){let t,n,r,i;n=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[5]}});let o=e[5]&&Ec(e);return{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o&&o.c(),q(t,"position","relative")},m(e,s){x(e,t,s),Te(n,t,null),R(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r&&(i.inputClass=e[0]),2&r&&(i.id=e[1]),2&r&&(i.name=e[1]),32&r&&(i.value=e[5]),n.$set(i),e[5]?o?(o.p(e,r),32&r&&$e(o,1)):(o=Ec(e),o.c(),$e(o,1),o.m(t,null)):o&&(ye(),Ie(o,1,1,()=>{o=null}),ve())},i(e){i||($e(n.$$.fragment,e),$e(o),i=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),i=!1},d(e){e&&k(t),De(n),o&&o.d()}}}function Ec(e){let t,n,r,i,o;const s=[bc,Ac],a=[];function l(e,n){return 32&n&&(t=!!e[5].endsWith(".mp4")),t?0:1}return n=l(e,-1),r=a[n]=s[n](e),{c(){r.c(),i=F()},m(e,t){a[n].m(e,t),x(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):(ye(),Ie(a[o],1,1,()=>{a[o]=null}),ve(),r=a[n],r?r.p(e,t):(r=a[n]=s[n](e),r.c()),$e(r,1),r.m(i.parentNode,i))},i(e){o||($e(r),o=!0)},o(e){Ie(r),o=!1},d(e){a[n].d(e),e&&k(i)}}}function Ac(e){let t,n,r,i,o;return n=new Me({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-o0hiko")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[10]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function bc(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:Tc,then:Nc,catch:Sc,value:23};return _e(e[11](),n),{c(){t=F(),n.block.c()},m(e,r){x(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){Ce(n,e=t,r)},i:_,o:_,d(e){e&&k(t),n.block.d(e),n.token=null,n=null}}}function Sc(e){return{c:_,m:_,p:_,d:_}}function Nc(e){let t,n,r,i;return{c(){t=M("video"),n=M("source"),i=B("\n Your browser does not support HTML video."),n.src!==(r=e[23])&&z(n,"src",r),z(n,"type","video/mp4"),z(t,"width","500"),t.controls=!0,q(t,"margin-top","1em")},m(e,r){x(e,t,r),R(t,n),R(t,i)},p:_,d(e){e&&k(t)}}}function Tc(e){return{c:_,m:_,p:_,d:_}}function Dc(e){let t,n,r,i;const o=[Cc,_c],s=[];function a(e,t){return e[6]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=F()},m(e,n){s[t].m(e,n),x(e,r,n),i=!0},p(e,[i]){let l=t;t=a(e),t===l?s[t].p(e,i):(ye(),Ie(s[l],1,1,()=>{s[l]=null}),ve(),n=s[t],n?n.p(e,i):(n=s[t]=o[t](e),n.c()),$e(n,1),n.m(r.parentNode,r))},i(e){i||($e(n),i=!0)},o(e){Ie(n),i=!1},d(e){s[t].d(e),e&&k(r)}}}function Rc(e,n,r){const{FileDropzone:i,TextField:o}=c,s=ee();let{classId:a}=n,{eventId:l}=n,{record:d}=n,{item:u}=n,{id:f}=n,{name:h}=n,{praefix:m}=n,{recordId:p}=n,{fileType:g="application/pdf"}=n,w=[],y="",v=!1;return Q(()=>{(async()=>{if(!p)return;const e=await t.getTaskByDocId(p,!0);if(!e)return s("listRecord",{itemName:"fileName",value:"",string:!0});const n=d[u.name];if(!n)return s("listRecord",{itemName:"fileName",value:"",string:!0});const i=await t.getUserReports(e._id);if(!i?.length)return s("listRecord",{itemName:"fileName",value:"",string:!0});let o=i.find(e=>e.fileName===n);if(!o)return s("listRecord",{itemName:"fileName",value:"",string:!0});r(5,y=o.fileName),r(6,v=void 0===m?!!p:!!y)})()}),J(()=>{}),e.$$set=e=>{"classId"in e&&r(0,a=e.classId),"eventId"in e&&r(13,l=e.eventId),"record"in e&&r(14,d=e.record),"item"in e&&r(15,u=e.item),"id"in e&&r(1,f=e.id),"name"in e&&r(2,h=e.name),"praefix"in e&&r(16,m=e.praefix),"recordId"in e&&r(17,p=e.recordId),"fileType"in e&&r(3,g=e.fileType)},[a,f,h,g,w,y,v,i,o,async e=>{const t=w[0];URL.createObjectURL(t),r(5,y=t.name),s("record",{itemName:"$file",value:{fileName:y,file:t}}),void 0!==m&&s("listRecord",{itemName:"fileName",value:y,string:!0})},async()=>{if(!p)return;let e;const n=await t.getTaskByDocId(p,!0);if(!n)return;const r=await t.getUserReports(n._id);if(!r?.length)return;let i=r.find(e=>e.fileName===y);i||(i=r[0]);e="/viewer/doc/index.html?file="+("/api/userreport/"+i._id)+"&type=pdf",window.open(e,"","popup=yes toolbar=no width=800 height=1024")},async()=>{const e=await t.getTaskByDocId(p,!0);if(!e)return"";const n=await t.getUserReports(e._id);if(!n?.length)return"";let r=n.find(e=>e.fileName===y);return r||(r=n[0]),"/api/userreport/"+r._id},()=>{r(4,w)},l,d,u,m,p,function(e){w=e,r(4,w)}]}class xc extends xe{constructor(e){var t;super(),Ic.getElementById("svelte-o0hiko-style")||((t=M("style")).id="svelte-o0hiko-style",t.textContent=".feather.svelte-o0hiko{position:absolute;top:0.75em;left:-1.25em;color:#4300b0}label.file-dropzone{margin-top:0 !important}",R(Ic.head,t)),Re(this,e,Rc,Dc,S,{classId:0,eventId:13,record:14,item:15,id:1,name:2,praefix:16,recordId:17,fileType:3})}}function kc(e){let t,n,r;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:Oc,placeholder:Mc,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=M("div"),Ne(n.$$.fragment),q(t,"max-width","4em")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p(e,[t]){const r={};4&t&&(r.inputClass=e[2]),1&t&&(r.id=e[0]),1&t&&(r.name=e[0]),2&t&&(r.value=e[1]),8&t&&(r.readonly=e[3]),16&t&&(r.disabled=e[4]),n.$set(r)},i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}const Oc="([01][0-9]|2[0-3]):([0-5][0-9])",Mc="";function Pc(e,t,n){const r=ee(),{TextField:i}=c;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:d}=t,{disabled:u}=t,{praefix:f}=t;const h=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,o=e.id),"item"in e&&n(7,s=e.item),"value"in e&&n(1,a=e.value),"inputClass"in e&&n(2,l=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,f=e.praefix)},[o,a,l,d,u,i,({detail:e})=>{r("blur",{value:h(e.value)}),r("checkRange",{idx:f,fieldId:o,value:e.value})},s,f]}class Bc extends xe{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=M("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",R(document.head,t)),Re(this,e,Pc,kc,S,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:Lc}=Ee;function Fc(e,t,n){const r=e.slice();return r[22]=t[n],r}function Vc(e,t,n){const r=e.slice();return r[25]=t[n],r[27]=n,r}function Uc(e){let t,n,r=e[3](e[22],e[25])+"",i=e[27]&&function(){let e;return{c(){e=B(", ")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}();return{c(){t=M("span"),i&&i.c(),n=B(r),z(t,"class","lookupValue")},m(e,r){x(e,t,r),i&&i.m(t,null),R(t,n)},p(e,t){3&t&&r!==(r=e[3](e[22],e[25])+"")&&H(n,r)},d(e){e&&k(t),i&&i.d()}}}function Wc(e){let t,n,r,i,o,s,a,l,c,d=e[0],u=[];for(let t=0;t<d.length;t+=1)u[t]=Uc(Vc(e,d,t));i=new lt({props:{size:"18"}});let f=e[2]&&function(e){let t,n,r,i,o,s,a,l,c;return i=new Me({props:{size:"18"}}),{c(){t=M("span"),t.textContent="  /  ",n=L(),r=M("span"),Ne(i.$$.fragment),o=L(),s=M("span"),s.textContent="Rechnung",z(r,"class","pointer feather2 svelte-1jurfpd")},m(d,u){x(d,t,u),x(d,n,u),x(d,r,u),Te(i,r,null),x(d,o,u),x(d,s,u),a=!0,l||(c=V(r,"click",function(){b(e[5](e[22]._id))&&e[5](e[22]._id).apply(this,arguments)}),l=!0)},p(t,n){e=t},i(e){a||($e(i.$$.fragment,e),a=!0)},o(e){Ie(i.$$.fragment,e),a=!1},d(e){e&&k(t),e&&k(n),e&&k(r),De(i),e&&k(o),e&&k(s),l=!1,c()}}}(e);return{c(){t=M("div");for(let e=0;e<u.length;e+=1)u[e].c();n=L(),r=M("span"),Ne(i.$$.fragment),o=L(),f&&f.c(),s=L(),z(r,"class","feather pointer svelte-1jurfpd"),z(t,"class","lookupItem svelte-1jurfpd")},m(d,h){x(d,t,h);for(let e=0;e<u.length;e+=1)u[e].m(t,null);R(t,n),R(t,r),Te(i,r,null),R(t,o),f&&f.m(t,null),R(t,s),a=!0,l||(c=V(r,"click",function(){b(e[4](e[22]._id))&&e[4](e[22]._id).apply(this,arguments)}),l=!0)},p(r,i){if(e=r,11&i){let r;for(d=e[0],r=0;r<d.length;r+=1){const o=Vc(e,d,r);u[r]?u[r].p(o,i):(u[r]=Uc(o),u[r].c(),u[r].m(t,n))}for(;r<u.length;r+=1)u[r].d(1);u.length=d.length}e[2]&&f.p(e,i)},i(e){a||($e(i.$$.fragment,e),$e(f),a=!0)},o(e){Ie(i.$$.fragment,e),Ie(f),a=!1},d(e){e&&k(t),O(u,e),De(i),f&&f.d(),l=!1,c()}}}function zc(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=Wc(Fc(e,r,t));const o=e=>Ie(i[e],1,1,()=>{i[e]=null});return{c(){t=M("div");for(let e=0;e<i.length;e+=1)i[e].c();z(t,"class","lookup svelte-1jurfpd")},m(e,r){x(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);n=!0},p(e,[n]){if(63&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=Fc(e,r,s);i[s]?(i[s].p(o,n),$e(i[s],1)):(i[s]=Wc(o),i[s].c(),$e(i[s],1),i[s].m(t,null))}for(ye(),s=r.length;s<i.length;s+=1)o(s);ve()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)$e(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)Ie(i[e]);n=!1},d(e){e&&k(t),O(i,e)}}}function Hc(e,n,r){let{id:i}=n,{item:o}=n,{praefix:s}=n,{record:a}=n,{notifyList:l}=n;const{refItem:c,view:d,beforeSave:u,_state:f,addAttachment:h}=o.properties;let p=d.split(","),[g,w]=c.split(":"),y=[];const[v,$]=w.split("."),I=(e,t)=>{const[n,r]=t.split(".");return r?e[n]?e[n][r]:void 0:""},_=(e=!0)=>{ce().then(()=>{const t=document.querySelector("div.form-field."+o.name);if(t&&(t.style.display=e?"none":"flex"),!e&&u){const e=t.querySelector("div label");e&&(e.style.color="red")}})};return Q(_),e.$$set=e=>{"id"in e&&r(6,i=e.id),"item"in e&&r(7,o=e.item),"praefix"in e&&r(8,s=e.praefix),"record"in e&&r(9,a=e.record),"notifyList"in e&&r(10,l=e.notifyList)},e.$$.update=()=>{1024&e.$$.dirty&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==g)return;if(r(1,y=[]),!i)return;if(!!u==!!a._id)return _();if(!a._id&&!a[g])return _();const o=!p.some(e=>e.includes(":")),s=$?$+"."+g:g;let l={[s]:a[g]||a._id};f&&(l=[{$match:l},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":f}}]);let c=!1;if(!s.includes(".")){const e=(await t.getSchemaByClass(v)).items.find(e=>e.name===s);e?.properties?.multi&&(c=!0)}if(r(1,y=await t.getSectionView(v,l,o,!0,c)),!o&&y.length){const e=p.find(e=>e.includes(":")),t=e.split(":")[0];r(1,y=y.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,p=p.map(e=>e.split(":")[1]))}_(!y.length)})(l)},[p,y,h,(e,t)=>"boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||m(e[t])||e[t]||I(e,t),e=>async()=>{const n=await t.getTaskByDocId(e,!0);if(!n)return;const r=n._id,i=`/task/${n.event}/${r}/task?view=standalone`;window.open(i)},e=>async()=>{let n;const r=await t.getTaskByDocId(e,!0);if(!r)return;const i=await t.getUserReports(r._id);if(!i?.length)return;n="/viewer/doc/index.html?file="+("/api/userreport/"+i[0]._id)+"&type=pdf",window.open(n,"","popup=yes toolbar=no width=800 height=1024")},i,o,s,a,l]}class jc extends xe{constructor(e){var t;super(),Lc.getElementById("svelte-1jurfpd-style")||((t=M("style")).id="svelte-1jurfpd-style",t.textContent=".feather.svelte-1jurfpd{position:absolute;top:0;left:-1.5em;color:#4300b0}.feather2.svelte-1jurfpd{color:#4300b0}div.lookup.svelte-1jurfpd{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1jurfpd{position:relative;margin-left:2em;padding-bottom:0.75em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}div.field:has(div.lookup){margin-bottom:0.25em !important}",R(Lc.head,t)),Re(this,e,Hc,zc,S,{id:6,item:7,praefix:8,record:9,notifyList:10})}}function qc(e){let t,n,r;return n=new mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Gc(e){let t,n,r,i,o;return n=new mt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[9]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Xc(e){let t,n,r,i,o,s;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 a=[Gc,qc],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}function Yc(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value)},[i,o,s,a,l,d,u,f,r,async()=>{if(!f)return;let e=f;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){te(e,t)}]}class Zc extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,Yc,Xc,S,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Kc(e){let t,n,r;return n=new bt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function Qc(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[12]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function Jc(e){let t,n,r,i,o,s;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[15]);const a=[Qc,Kc],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};4&r&&(s.inputClass=e[2]),1&r&&(s.pattern=e[0]),2&r&&(s.placeholder=e[1]),8&r&&(s.disabled=e[3]),16&r&&(s.formnovalidate=e[4]),32&r&&(s.readonly=e[5]),64&r&&(s.required=e[6]),128&r&&(s.id=e[7]),256&r&&(s.name=e[8]),512&r&&(s.value=e[9]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}function ed(e,t,r){let i;const{TextField:o}=c,{environment:s}=u;N(e,s,e=>r(16,i=e));const a=JSON.parse(n.getItem("Locale"));let{inputClass:l}=t,{disabled:d}=t,{formnovalidate:f}=t,{readonly:h}=t,{required:m}=t,{id:p}=t,{name:g}=t,{value:w}=t,{pattern:y}=t,{placeholder:v}=t,{notifyList:$}=t,{country:I}=t;y||="(\\+(9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1))?\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*\\d\\W*(\\d{1,2})$",v||="+41 58 234 56 78";const _={ch:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",li:"^(((\\+41|0041)\\s?\\d{2})|0\\d{2})(\\s?\\d){7}$",de:"^((\\+49|0049)\\s?)?(0|\\s?)?\\d{2,5}(\\s?\\d){4,9}$",at:"^((\\+43|0043)\\s?)?(0\\s?)?[1-9]\\d{1,4}(\\s?\\d){4,10}$",us:"^((\\+1|001)\\s?)?(\\d{3}\\s?){2}\\d{4}$",zh:"^((\\+86|0086)\\s?)?((1\\d{10})|(0\\d{2,3}\\s?\\d{7,8}))$"},C={ch:"+41 58 234 5678",li:"+41 58 234 5678",de:"+49 619 1234 5678",at:"+43 800 123 456",us:"+1 2345 678 901",zh:"+86 123 456 7589"};return e.$$set=e=>{"inputClass"in e&&r(2,l=e.inputClass),"disabled"in e&&r(3,d=e.disabled),"formnovalidate"in e&&r(4,f=e.formnovalidate),"readonly"in e&&r(5,h=e.readonly),"required"in e&&r(6,m=e.required),"id"in e&&r(7,p=e.id),"name"in e&&r(8,g=e.name),"value"in e&&r(9,w=e.value),"pattern"in e&&r(0,y=e.pattern),"placeholder"in e&&r(1,v=e.placeholder),"notifyList"in e&&r(13,$=e.notifyList),"country"in e&&r(14,I=e.country)},e.$$.update=()=>{8192&e.$$.dirty&&(async e=>{const{listName:t,itemName:n,value:o}=e||{},s=i?.country?.countryCode?.toLowerCase()||a.lang;I&&n===I&&o?xp("country",o).then(e=>{if(e.phonePattern)r(0,y=e.phonePattern),r(1,v=e.phonePlaceholder||"");else{const t=e.countryCode.toLowerCase();_[t]&&(r(0,y=_[t]),r(1,v=C[t]))}}).catch(()=>{r(0,y=_[s]),r(1,v=C[s])}):I&&(r(0,y=_[s]),r(1,v=C[s]))})($)},[y,v,l,d,f,h,m,p,g,w,o,s,async()=>{if(!w)return;let e="tel:"+w;window.open(e,"_self")},$,I,function(t){te(e,t)}]}class td extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,ed,Jc,S,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1,notifyList:13,country:14})}}function nd(e){let t,n,r;return n=new $t({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather2 svelte-9up2nn")},m(e,i){x(e,t,i),Te(n,t,null),r=!0},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n)}}}function rd(e){let t,n,r,i,o;return n=new $t({props:{size:"18"}}),{c(){t=M("span"),Ne(n.$$.fragment),z(t,"class","feather pointer svelte-9up2nn")},m(s,a){x(s,t,a),Te(n,t,null),r=!0,i||(o=V(t,"click",e[12]),i=!0)},p:_,i(e){r||($e(n.$$.fragment,e),r=!0)},o(e){Ie(n.$$.fragment,e),r=!1},d(e){e&&k(t),De(n),i=!1,o()}}}function id(e){let t,n,r,i,o,s;n=new e[11]({props:{type:"email",inputClass:e[0],pattern:e[9],placeholder:e[10],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],multiple:e[8],value:e[7]}}),n.$on("change",e[13]);const a=[rd,nd],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=M("div"),Ne(n.$$.fragment),r=L(),o.c(),q(t,"position","relative")},m(e,o){x(e,t,o),Te(n,t,null),R(t,r),l[i].m(t,null),s=!0},p(e,[r]){const s={};1&r&&(s.inputClass=e[0]),512&r&&(s.pattern=e[9]),1024&r&&(s.placeholder=e[10]),2&r&&(s.disabled=e[1]),4&r&&(s.formnovalidate=e[2]),8&r&&(s.readonly=e[3]),16&r&&(s.required=e[4]),32&r&&(s.id=e[5]),64&r&&(s.name=e[6]),256&r&&(s.multiple=e[8]),128&r&&(s.value=e[7]),n.$set(s);let d=i;i=c(e),i===d?l[i].p(e,r):(ye(),Ie(l[d],1,1,()=>{l[d]=null}),ve(),o=l[i],o?o.p(e,r):(o=l[i]=a[i](e),o.c()),$e(o,1),o.m(t,null))},i(e){s||($e(n.$$.fragment,e),$e(o),s=!0)},o(e){Ie(n.$$.fragment,e),Ie(o),s=!1},d(e){e&&k(t),De(n),l[i].d()}}}function od(e,t,n){const{TextField:r}=c;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:d}=t,{name:u}=t,{value:f}=t,{multiple:h}=t,{pattern:m}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,i=e.inputClass),"disabled"in e&&n(1,o=e.disabled),"formnovalidate"in e&&n(2,s=e.formnovalidate),"readonly"in e&&n(3,a=e.readonly),"required"in e&&n(4,l=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,f=e.value),"multiple"in e&&n(8,h=e.multiple),"pattern"in e&&n(9,m=e.pattern),"placeholder"in e&&n(10,p=e.placeholder)},[i,o,s,a,l,d,u,f,h,m,p,r,async()=>{if(!f)return;let e="mailto:"+f;window.open(e,"_self")},function(t){te(e,t)}]}class sd extends xe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=M("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}",R(document.head,t)),Re(this,e,od,id,S,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const ad=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","CommentChange","CompositionEnd","CompositionStart","CompositionUpdate","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","Input","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 ld(e){let t;return{c(){t=M("textarea"),z(t,"id",e[0]),q(t,"visibility","hidden")},m(n,r){x(n,t,r),e[20](t)},p(e,n){1&n&&z(t,"id",e[0])},d(n){n&&k(t),e[20](null)}}}function cd(e){let t;return{c(){t=M("div"),z(t,"id",e[0])},m(n,r){x(n,t,r),e[19](t)},p(e,n){1&n&&z(t,"id",e[0])},d(n){n&&k(t),e[19](null)}}}function dd(e){let t;function n(e,t){return e[1]?cd:ld}let r=n(e),i=r(e);return{c(){t=M("div"),i.c(),z(t,"class",e[2])},m(n,r){x(n,t,r),i.m(t,null),e[21](t)},p(e,[o]){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null))),4&o&&z(t,"class",e[2])},i:_,o:_,d(n){n&&k(t),i.d(),e[21](null)}}}const ud=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let fd=(()=>{let e={listeners:[],scriptId:ud("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,r)=>{e.scriptLoaded?r():(e.listeners.push(r),e.injected||((t,n,r,i)=>{e.injected=!0;const o=n.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=r,o.onload=()=>{i()},n.head&&n.head.appendChild(o)})(e.scriptId,t,n,()=>{e.listeners.forEach(e=>e()),e.scriptLoaded=!0}))}}})();function hd(e,t,n){let r,i,o,{id:s=ud("tinymce-svelte")}=t,{inline:a}=t,{disabled:l=!1}=t,{readonly:c=!1}=t,{apiKey:d="no-api-key"}=t,{licenseKey:u}=t,{channel:f="8"}=t,{scriptSrc:h}=t,{conf:m={}}=t,{modelEvents:p="change input undo redo"}=t,{value:g=""}=t,{text:w=""}=t,{cssClass:y="tinymce-wrapper"}=t,v=g,$=l,I=c;const _=(e,t)=>{var n;"function"==typeof(null===(n=e.mode)||void 0===n?void 0:n.set)&&e.mode.set(t?"readonly":"design")},C=(e,t)=>{(e=>"function"==typeof e.options.set&&e.options.isRegistered("disabled"))(e)?e.options.set("disabled",t):e.mode.set(t?"readonly":"design")},E=ee(),A=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},b=()=>{var e;const t=Object.assign(Object.assign({},m),{target:i,inline:void 0!==a?a:void 0!==m.inline&&m.inline,license_key:u,setup:e=>{e.on("PreInit",()=>{C(e,l),_(e,c)}),n(15,o=e),e.on("init",()=>{e.setContent(g),e.on(p,()=>{n(16,v=e.getContent()),v!==g&&(n(5,g=v),n(6,w=e.getContent({format:"text"})))})}),((e,t)=>{ad.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,E),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=A())||void 0===e||e.init(t)};return Q(()=>{if(null!==A())b();else{const e=h||`https://cdn.tiny.cloud/1/${d}/tinymce/${f}/tinymce.min.js`;fd.load(r.ownerDocument,e,()=>{b()})}}),J(()=>{var e;o&&(null===(e=A())||void 0===e||e.remove(o))}),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,l=e.disabled),"readonly"in e&&n(8,c=e.readonly),"apiKey"in e&&n(9,d=e.apiKey),"licenseKey"in e&&n(10,u=e.licenseKey),"channel"in e&&n(11,f=e.channel),"scriptSrc"in e&&n(12,h=e.scriptSrc),"conf"in e&&n(13,m=e.conf),"modelEvents"in e&&n(14,p=e.modelEvents),"value"in e&&n(5,g=e.value),"text"in e&&n(6,w=e.text),"cssClass"in e&&n(2,y=e.cssClass)},e.$$.update=()=>{491936&e.$$.dirty&&(o&&v!==g&&(o.setContent(g),n(6,w=o.getContent({format:"text"}))),o&&c!==I&&(n(18,I=c),_(o,c)),o&&l!==$&&(n(17,$=l),C(o,l)))},[s,a,y,r,i,g,w,l,c,d,u,f,h,m,p,o,v,$,I,function(e){re[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){re[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){re[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class md extends xe{constructor(e){super(),Re(this,e,hd,dd,S,{id:0,inline:1,disabled:7,readonly:8,apiKey:9,licenseKey:10,channel:11,scriptSrc:12,conf:13,modelEvents:14,value:5,text:6,cssClass:2})}}function pd(e){let t,n,r,i,o,s,a;function l(t){e[12](t)}let c={scriptSrc:"/tinymce/tinymce.min.js",licenseKey:"gpl",conf:e[8],disabled:e[5],readonly:e[6]};return void 0!==e[0]&&(c.value=e[0]),n=new md({props:c}),re.push(()=>Se(n,"value",l)),n.$on("init",e[9]),{c(){t=M("div"),Ne(n.$$.fragment),i=L(),o=M("input"),z(o,"class",s=e[1]||e[2]),z(o,"id",e[3]),z(o,"name",e[3]),o.value=e[0],o.hidden=!0,q(t,"min-height","10em"),q(t,"margin-top","-1em"),t.hidden=e[4]},m(e,r){x(e,t,r),Te(n,t,null),R(t,i),R(t,o),a=!0},p(e,[i]){const l={};32&i&&(l.disabled=e[5]),64&i&&(l.readonly=e[6]),!r&&1&i&&(r=!0,l.value=e[0],ue(()=>r=!1)),n.$set(l),(!a||6&i&&s!==(s=e[1]||e[2]))&&z(o,"class",s),(!a||8&i)&&z(o,"id",e[3]),(!a||8&i)&&z(o,"name",e[3]),(!a||1&i&&o.value!==e[0])&&(o.value=e[0]),(!a||16&i)&&(t.hidden=e[4])},i(e){a||($e(n.$$.fragment,e),a=!0)},o(e){Ie(n.$$.fragment,e),a=!1},d(e){e&&k(t),De(n)}}}let gd=!1;function wd(e,t,r){let i;const{environment:o}=u;N(e,o,e=>r(16,i=e));const s=ee();let a=JSON.parse(n.getItem("Locale")).id;a=a.startsWith("fr")?"fr_FR":a.split("-")[0];let l,c,{value:d=""}=t,{noForm:f}=t,{classId:h}=t,{id:m}=t,{record:p}=t,{hidden:g}=t,{disabled:y}=t,{readonly:v}=t,{keepOrigin:I}=t;const _=(e,t,n)=>{const r=e.split("{{").slice(1).map(e=>e.split("}}")[0]);if(r?.length)return r.reduce((e,r)=>{let[i,o,s]=r.split(".");if(!o)return e;if(!t[i]&&!n[i])return e;s&&(o=o+"."+s);const a=e.find(e=>e.table===i);return a?a.attrs=a.attrs.concat(o):e.push({table:i,attrs:[o]}),e},[])},C={plugins:"advlist 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:a};return e.$$set=e=>{"value"in e&&r(0,d=e.value),"noForm"in e&&r(1,f=e.noForm),"classId"in e&&r(2,h=e.classId),"id"in e&&r(3,m=e.id),"record"in e&&r(10,p=e.record),"hidden"in e&&r(4,g=e.hidden),"disabled"in e&&r(5,y=e.disabled),"readonly"in e&&r(6,v=e.readonly),"keepOrigin"in e&&r(11,I=e.keepOrigin)},e.$$.update=()=>{1025&e.$$.dirty&&((e,t)=>{if(I)return;if(!l)return;if(gd)return;if(!e)return;if(!e.includes("{{"))return;const n=_(d,p,c);n?.length&&(gd=!0,Promise.all(n.map(async(e,n)=>{let r;return t[e.table]&&(r=await xp(e.table,t[e.table]).catch(()=>{})),{table:r,def:e}})).then(async t=>{if(t?.length){for(const n of t)for(const t of n.def.attrs){const[r,i]=t.split(".");let o;if(i&&w(n.table&&n.table[r])){const e=await xp(r,n.table[r]);e&&(o=e[i]),console.log("a2",o,e)}else o=$(n.table||c[n.def.table],t);if(o?.endsWith("Z")&&24===o?.length){let[e,t,n]=o.split("-");n=n.slice(0,2),o=`${n}.${t}.${e}`}o&&(e=e.replace(`{{${n.def.table}.${t}}}`,o))}s("blur",{value:e||""})}}).catch(e=>{console.log("error",e)}).finally(()=>{r(0,d=e||""),gd=!1}))})(d,p)},[d,f,h,m,g,y,v,o,C,e=>{c={owner:i.owner},l=!0},p,I,function(e){d=e,r(0,d)}]}class yd extends xe{constructor(e){var t;super(),document.getElementById("svelte-yi7lpi-style")||((t=M("style")).id="svelte-yi7lpi-style",t.textContent="div.tox-statusbar__text-container, div.tox-promotion{display:none !important}div.tox.tox-tinymce{border:1px #808080 solid}.tox-edit-area__iframe{background-color:#f9f3f6 !important}",R(document.head,t)),Re(this,e,wd,pd,S,{value:0,noForm:1,classId:2,id:3,record:10,hidden:4,disabled:5,readonly:6,keepOrigin:11})}}
2
2
  /*!
3
3
  * Signature Pad v5.1.3 | https://github.com/szimek/signature_pad
4
4
  * (c) 2025 Szymon Nowak | Released under the MIT license