@enablerr-ui/detail 0.3.433 → 0.3.434
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 +1 -1
- package/package.json +1 -1
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,h,m;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.TextArea,s=e.settings,a=e.toasts,l=e.activateViewer,c=e.printJS,d=e.Page},function(e){u=e.getAttractions,f=e.PopOver},function(e){h=e.user},function(e){m=e.taskClipboard}],execute:function(){function p(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.433");const g=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(" · ")),w=e=>{try{return new Date(e).toLocaleString()}catch{return e}},y=(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()},v=e=>/^[0-9a-f]{24}/.test(e),$=e=>!0===e?"(ja)":!1===e?"(nein)":"",I=(e,t)=>{if(!e.display&&!e.items)return"";const n={...t},r=e.display?.reduce((t,r)=>{const i=e.items.find(e=>e.name===r.split(":")[0]);if("template"===i?.type)return t.push("$$"+i.refItem.split(".").at(-1)),t;let[o,s]=r.split(".");if(e.list?.find(({name:e})=>e===o)&&s&&void 0!==n[o]){const e=`${o}_${s}`;n[e]=n[o][s],o=e}return t.find(e=>e===o)||t.push(o),t},[]).map(e=>{let t=n[e];if(e.startsWith("$$")){let t=n[e?.slice(2)];const r=[];for(const e in t)Array.isArray(t[e])?r.push(t[e].join(",")):r.push(t[e]);return r?.join(" / ")}if("boolean"==typeof t)return $(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 g(n["_"+e]||t)})||e.items.map(e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name]));return r.map(e=>e?.toString().split(" · ").filter(e=>!!e&&!v(e)).join(" · ")).filter(e=>!!e).join(" • ")},_=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};const C=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 b(){}function A(e){return e()}function E(){return Object.create(null)}function S(e){e.forEach(A)}function N(e){return"function"==typeof e}function T(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function k(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return b;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function D(e){return null==e?"":e}function R(e,t,n=t){return e.set(n),t}function x(e,t){e.appendChild(t)}function O(e,t,n){e.insertBefore(t,n||null)}function M(e){e.parentNode.removeChild(e)}function P(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function B(e){return document.createElement(e)}function L(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function F(e){return document.createTextNode(e)}function V(){return F(" ")}function U(){return F("")}function W(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function z(e){return function(t){return t.preventDefault(),e.call(this,t)}}function q(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function H(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function j(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function G(e,t){e.value=null==t?"":t}function X(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function Y(e,t,n){e.classList[n?"add":"remove"](t)}class Z{constructor(e=null){this.a=e,this.e=this.n=null}m(e,t,n=null){this.e||(this.e=B(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)O(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(M)}}let K;function Q(e){K=e}function J(){if(!K)throw new Error("Function called outside component initialization");return K}function ee(e){J().$$.on_mount.push(e)}function te(e){J().$$.on_destroy.push(e)}function ne(){const e=J();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 re(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const ie=[],oe=[],se=[],ae=[],le=Promise.resolve();let ce=!1;function de(){ce||(ce=!0,le.then(ge))}function ue(){return de(),le}function fe(e){se.push(e)}function he(e){ae.push(e)}let me=!1;const pe=new Set;function ge(){if(!me){me=!0;do{for(let e=0;e<ie.length;e+=1){const t=ie[e];Q(t),we(t.$$)}for(Q(null),ie.length=0;oe.length;)oe.pop()();for(let e=0;e<se.length;e+=1){const t=se[e];pe.has(t)||(pe.add(t),t())}se.length=0}while(ie.length);for(;ae.length;)ae.pop()();ce=!1,me=!1,pe.clear()}}function we(e){if(null!==e.fragment){e.update(),S(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(fe)}}const ye=new Set;let ve;function $e(){ve={r:0,c:[],p:ve}}function Ie(){ve.r||S(ve.c),ve=ve.p}function _e(e,t){e&&e.i&&(ye.delete(e),e.i(t))}function Ce(e,t,n,r){if(e&&e.o){if(ye.has(e))return;ye.add(e),ve&&ve.c.push(()=>{ye.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function be(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&&($e(),Ce(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),Ie())}):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&&ge()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=J();if(e.then(e=>{Q(n),r(t.then,1,t.value,e),Q(null)},e=>{if(Q(n),r(t.catch,2,t.error,e),Q(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 Ae(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 Se(e,t){Ce(e,1,1,()=>{t.delete(e.key)})}function Ne(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 Te(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function ke(e){e&&e.c()}function De(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||fe(()=>{const t=o.map(A).filter(N);s?s.push(...t):S(t),e.$$.on_mount=[]}),a.forEach(fe)}function Re(e,t){const n=e.$$;null!==n.fragment&&(S(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function xe(e,t,n,r,i,o,s=[-1]){const a=K;Q(e);const l=e.$$={fragment:null,ctx:null,props:o,update:b,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]&&(ie.push(e),de(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n}):[],l.update(),c=!0,S(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(M)}else l.fragment&&l.fragment.c();t.intro&&_e(e.$$.fragment),De(e,t.target,t.anchor,t.customElement),ge()}Q(a)}class Oe{$destroy(){Re(this,1),this.$destroy=b}$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 Me(e,t,n){const r=e.slice();return r[14]=t[n][0],r[15]=t[n][1],r}function Pe(e){let t;return{c(){t=B("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Be(e){let t;return{c(){t=B("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Le(e){return{c:b,m:b,p:b,d:b}}function Fe(e){let t,n=e[6],r=[];for(let t=0;t<n.length;t+=1)r[t]=Ve(Me(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);O(e,t,n)},p(e,i){if(1025&i){let o;for(n=e[6],o=0;o<n.length;o+=1){const s=Me(e,n,o);r[o]?r[o].p(s,i):(r[o]=Ve(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){P(r,e),e&&M(t)}}}function Ve(e){let t,n,r,i=e[14]+"";return{c(){t=B("option"),n=F(i),t.__value=e[15],t.value=t.__value,t.selected=r=e[0]==e[15]},m(e,r){O(e,t,r),x(t,n)},p(e,n){1&n&&r!==(r=e[0]==e[15])&&(t.selected=r)},d(e){e&&M(t)}}}function Ue(e){return{c:b,m:b,p:b,d:b}}function We(e){let t,n,r,i,o,s=(!e[7]||e[9])&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Be:Pe}let r=n(e),i=r(e);return{c(){i.c(),t=U()},m(e,n){i.m(e,n),O(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&&M(t)}}}(e),a={ctx:e,current:null,token:null,hasCatch:!1,pending:Ue,then:Fe,catch:Le,value:6};return be(e[10](),a),{c(){t=B("select"),s&&s.c(),n=U(),a.block.c(),H(t,"class",r=D(e[3]||e[4])+" svelte-5xpzvo"),H(t,"id",e[2]),H(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,l){O(r,t,l),s&&s.m(t,null),x(t,n),a.block.m(t,a.anchor=null),a.mount=()=>t,a.anchor=null,i||(o=W(t,"change",e[11]),i=!0)},p(n,[i]){(e=n)[7]&&!e[9]||s.p(e,i),Ae(a,e,i),24&i&&r!==(r=D(e[3]||e[4])+" svelte-5xpzvo")&&H(t,"class",r),4&i&&H(t,"id",e[2]),4&i&&H(t,"name",e[2]),2&i&&(t.disabled=e[1]),32&i&&(t.required=e[5])},i:b,o:b,d(e){e&&M(t),s&&s.d(),a.block.d(),a.token=null,a=null,i=!1,o()}}}const ze=async(e,n,r)=>{if("finYear"===e){const e=(new Date).getFullYear();r||=e,n=[[(e-1).toString(),e-1],[e.toString(),e],[(e+1).toString(),e+1]]}return"canton"===e&&(n=[["Aargau","AG"],["Appenzell Ausserrhoden","AR"],["Appenzell Innerrhoden","AI"],["Basel-Land","BL"],["Basel-Stadt","BS"],["Bern","BE"],["Freiburg","FR"],["Genf","GE"],["Glarus","GL"],["Graubünden","GR"],["Jura","JU"],["Luzern","LU"],["Neuenburg","NE"],["Obwalden","OW"],["Schaffhausen","SH"],["Schwyz","SZ"],["Solothurn","SO"],["Sankt-Gallen","SG"],["Tessin","TI"],["Thurgau","TG"],["Uri","UR"],["Waadt","VD"],["Wallis","VS"],["Zug","ZG"],["Zürich","ZH"],["Expat","EX"]]),"businessMonth"===e&&(r||=1,n=[["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"===e&&(r||=2024,n=[["2024/2025",2024]]),"valueAddedTax"===e&&(r||=0,n=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),"supplierAI"===e&&(r||="Anthropic",n=[["Anthropic","Anthropic"]]),"supplierAIModel"===e&&(r||="claude-opus-4-7",n=[["Claude Opus 4.8","claude-opus-4-8"],["Claude Opus 4.7","claude-opus-4-7"],["Claude Sonnet 4.6","claude-sonnet-4-6"],["Claude Opus 4.6","claude-opus-4-6"],["Claude Haiku 4.5","claude-haiku-4-5"],["Claude Opus 4.5","claude-opus-4-5"]]),"event"===e&&(r||="",n=(async()=>(await t.getEvents()).filter(e=>!(e.output?.type||"ai"===e.output?.subType||e.trigger&&"Manual"!==e.trigger?.startOn?.at(0)?.type)).sort((e,t)=>e.identity.designation.localeCompare(t.identity.designation)).map(e=>[e.identity.designation,e.identity.name]))()),"asonpayrollEmployee"===e&&(r||="",n=[["",""],["Zivilstand ändern","CH.Swissdec.EmployeeCivilStatusData"],["Kontaktdaten ändern","CH.Swissdec.EmployeeContact"],["Adresse ändern","CH.Swissdec.EmployeeAddressData"],["Monatslohn bearbeiten","CH.Swissdec.EmployeeSalaryChange-CH.Swissdec.EmployeeSalaryChangeQuestion-SalaryChangeSalaryChange"],["Bankdaten ändern","CH.Swissdec.EmployeeBankData"],["Persönliche Daten ändern","CH.Swissdec.EmployeePersonalData"],["Berufsbezeichnung ergänzen","CH.Swissdec.EmployeeStatisticsJobTitleCase"],["UVG-Daten verwalten","CH.Swissdec.SocialInsurancesUvg"]]),"asonpayrollOwner"===e&&(r||="",n=[["",""],["Firmendaten ändern","CH.Swissdec.CompanyData"],["Adresse ändern","CH.Swissdec.CompanyAddressData"],["Bankdaten ändern","CH.Swissdec.CompanyBankData"],["Stellvertreter erfassen/ändern","CH.Swissdec.CompanyTrusteeData"],["ELM-Übermittlungen konfigurieren","CH.Swissdec.CompanyElmTransmissionsConfigurations"]]),{value:r,options:n}};function qe(e,t,n){const r=ne();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,source:m}=o.properties;u?.length&&!Array.isArray(u[0])&&(u=u.map(e=>[e,e]));c||=!0===h,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,i=e.id),"item"in e&&n(12,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,m,async()=>{const e=await ze(f,u,s);return n(0,s=e.value),n(6,u=e.options),u},e=>r("blur",{value:e.srcElement.value}),o]}class He extends Oe{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=B("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}",x(document.head,t)),xe(this,e,qe,We,T,{id:2,item:12,value:0,noForm:3,classId:4,disabled:1,required:5})}}function je(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("path"),H(n,"d","M10 3 L11.5 8.5 L17 10 L11.5 11.5 L10 17 L8.5 11.5 L3 10 L8.5 8.5 Z"),H(r,"d","M17 14 L17.75 16.25 L20 17 L17.75 17.75 L17 20 L16.25 17.75 L14 17 L16.25 16.25 Z"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-ai "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-ai "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Ge(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=1}=t,{customClass: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),"customClass"in e&&n(2,o=e.customClass)},[r,i,o]}class Xe extends Oe{constructor(e){super(),xe(this,e,Ge,je,T,{size:0,strokeWidth:1,customClass:2})}}function Ye(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("polygon"),H(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"),H(r,"points","12 15 17 21 7 21 12 15"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-airplay "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(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 Ke extends Oe{constructor(e){super(),xe(this,e,Ze,Ye,T,{size:0,strokeWidth:1,class:2})}}function Qe(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("path"),r=L("line"),i=L("line"),H(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"),H(r,"x1","12"),H(r,"y1","9"),H(r,"x2","12"),H(r,"y2","13"),H(i,"x1","12"),H(i,"y1","17"),H(i,"x2","12.01"),H(i,"y2","17"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Je(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 et extends Oe{constructor(e){super(),xe(this,e,Je,Qe,T,{size:0,strokeWidth:1,class:2})}}function tt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("circle"),r=L("polyline"),i=L("line"),H(n,"cx","12"),H(n,"cy","12"),H(n,"r","10"),H(r,"points","8 12 12 16 16 12"),H(i,"x1","12"),H(i,"y1","8"),H(i,"x2","12"),H(i,"y2","16"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(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 rt extends Oe{constructor(e){super(),xe(this,e,nt,tt,T,{size:0,strokeWidth:1,class:2})}}function it(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("path"),H(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),H(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-book-open "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(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 st extends Oe{constructor(e){super(),xe(this,e,ot,it,T,{size:0,strokeWidth:1,class:2})}}function at(e){let t,n,r,i,o,s;return{c(){t=L("svg"),n=L("rect"),r=L("line"),i=L("line"),o=L("line"),H(n,"x","3"),H(n,"y","4"),H(n,"width","18"),H(n,"height","18"),H(n,"rx","2"),H(n,"ry","2"),H(r,"x1","16"),H(r,"y1","2"),H(r,"x2","16"),H(r,"y2","6"),H(i,"x1","8"),H(i,"y1","2"),H(i,"x2","8"),H(i,"y2","6"),H(o,"x1","3"),H(o,"y1","10"),H(o,"x2","21"),H(o,"y2","10"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",s="feather feather-calendar "+e[2])},m(e,s){O(e,t,s),x(t,n),x(t,r),x(t,i),x(t,o)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-calendar "+e[2])&&H(t,"class",s)},i:b,o:b,d(e){e&&M(t)}}}function lt(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 Oe{constructor(e){super(),xe(this,e,lt,at,T,{size:0,strokeWidth:1,class:2})}}function dt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("circle"),H(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"),H(r,"cx","12"),H(r,"cy","13"),H(r,"r","4"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-camera "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function ut(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 ft extends Oe{constructor(e){super(),xe(this,e,ut,dt,T,{size:0,strokeWidth:1,class:2})}}function ht(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),H(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),H(r,"points","22 4 12 14.01 9 11.01"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function mt(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 pt extends Oe{constructor(e){super(),xe(this,e,mt,ht,T,{size:0,strokeWidth:1,class:2})}}function gt(e){let t,n,r;return{c(){t=L("svg"),n=L("path"),H(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"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",r="feather feather-command "+e[2])},m(e,r){O(e,t,r),x(t,n)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&H(t,"class",r)},i:b,o:b,d(e){e&&M(t)}}}function wt(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 yt extends Oe{constructor(e){super(),xe(this,e,wt,gt,T,{size:0,strokeWidth:1,class:2})}}function vt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("polyline"),r=L("path"),H(n,"points","9 10 4 15 9 20"),H(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(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 It extends Oe{constructor(e){super(),xe(this,e,$t,vt,T,{size:0,strokeWidth:1,class:2})}}function _t(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("path"),r=L("line"),i=L("line"),H(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),H(r,"x1","18"),H(r,"y1","9"),H(r,"x2","12"),H(r,"y2","15"),H(i,"x1","12"),H(i,"y1","9"),H(i,"x2","18"),H(i,"y2","15"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-delete "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Ct(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 Oe{constructor(e){super(),xe(this,e,Ct,_t,T,{size:0,strokeWidth:1,class:2})}}function At(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),i=L("line"),H(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),H(r,"points","15 3 21 3 21 9"),H(i,"x1","10"),H(i,"y1","14"),H(i,"x2","21"),H(i,"y2","3"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-external-link "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Et(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 St extends Oe{constructor(e){super(),xe(this,e,Et,At,T,{size:0,strokeWidth:1,class:2})}}function Nt(e){let t,n,r,i,o,s;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),i=L("line"),o=L("line"),H(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),H(r,"points","14 2 14 8 20 8"),H(i,"x1","12"),H(i,"y1","18"),H(i,"x2","12"),H(i,"y2","12"),H(o,"x1","9"),H(o,"y1","15"),H(o,"x2","15"),H(o,"y2","15"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){O(e,t,s),x(t,n),x(t,r),x(t,i),x(t,o)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&H(t,"class",s)},i:b,o:b,d(e){e&&M(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 kt extends Oe{constructor(e){super(),xe(this,e,Tt,Nt,T,{size:0,strokeWidth:1,class:2})}}function Dt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("circle"),r=L("line"),i=L("path"),H(n,"cx","12"),H(n,"cy","12"),H(n,"r","10"),H(r,"x1","2"),H(r,"y1","12"),H(r,"x2","22"),H(r,"y2","12"),H(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"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-globe "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(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 Oe{constructor(e){super(),xe(this,e,Rt,Dt,T,{size:0,strokeWidth:1,class:2})}}function Ot(e){let t,n,r,i,o,s,a,l;return{c(){t=L("svg"),n=L("line"),r=L("line"),i=L("line"),o=L("line"),s=L("line"),a=L("line"),H(n,"x1","8"),H(n,"y1","6"),H(n,"x2","21"),H(n,"y2","6"),H(r,"x1","8"),H(r,"y1","12"),H(r,"x2","21"),H(r,"y2","12"),H(i,"x1","8"),H(i,"y1","18"),H(i,"x2","21"),H(i,"y2","18"),H(o,"x1","3"),H(o,"y1","6"),H(o,"x2","3.01"),H(o,"y2","6"),H(s,"x1","3"),H(s,"y1","12"),H(s,"x2","3.01"),H(s,"y2","12"),H(a,"x1","3"),H(a,"y1","18"),H(a,"x2","3.01"),H(a,"y2","18"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",l="feather feather-list "+e[2])},m(e,l){O(e,t,l),x(t,n),x(t,r),x(t,i),x(t,o),x(t,s),x(t,a)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&H(t,"class",l)},i:b,o:b,d(e){e&&M(t)}}}function Mt(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 Pt extends Oe{constructor(e){super(),xe(this,e,Mt,Ot,T,{size:0,strokeWidth:1,class:2})}}function Bt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),H(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"),H(r,"points","22,6 12,13 2,6"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-mail "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Lt(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 Ft extends Oe{constructor(e){super(),xe(this,e,Lt,Bt,T,{size:0,strokeWidth:1,class:2})}}function Vt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("circle"),H(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),H(r,"cx","12"),H(r,"cy","10"),H(r,"r","3"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Ut(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 Oe{constructor(e){super(),xe(this,e,Ut,Vt,T,{size:0,strokeWidth:1,class:2})}}function zt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("polyline"),r=L("line"),i=L("path"),H(n,"points","23 7 23 1 17 1"),H(r,"x1","16"),H(r,"y1","8"),H(r,"x2","23"),H(r,"y2","1"),H(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"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function qt(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 Ht extends Oe{constructor(e){super(),xe(this,e,qt,zt,T,{size:0,strokeWidth:1,class:2})}}function jt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("rect"),r=L("line"),i=L("line"),H(n,"x","3"),H(n,"y","3"),H(n,"width","18"),H(n,"height","18"),H(n,"rx","2"),H(n,"ry","2"),H(r,"x1","12"),H(r,"y1","8"),H(r,"x2","12"),H(r,"y2","16"),H(i,"x1","8"),H(i,"y1","12"),H(i,"x2","16"),H(i,"y2","12"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-plus-square "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-plus-square "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(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 Xt extends Oe{constructor(e){super(),xe(this,e,Gt,jt,T,{size:0,strokeWidth:1,class:2})}}function Yt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("polyline"),r=L("path"),i=L("rect"),H(n,"points","6 9 6 2 18 2 18 9"),H(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"),H(i,"x","6"),H(i,"y","14"),H(i,"width","12"),H(i,"height","8"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-printer "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Zt(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 Kt extends Oe{constructor(e){super(),xe(this,e,Zt,Yt,T,{size:0,strokeWidth:1,class:2})}}function Qt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("circle"),r=L("line"),H(n,"cx","11"),H(n,"cy","11"),H(n,"r","8"),H(r,"x1","21"),H(r,"y1","21"),H(r,"x2","16.65"),H(r,"y2","16.65"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-search "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Jt(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 en extends Oe{constructor(e){super(),xe(this,e,Jt,Qt,T,{size:0,strokeWidth:1,class:2})}}function tn(e){let t,n,r,i,o,s;return{c(){t=L("svg"),n=L("polyline"),r=L("path"),i=L("line"),o=L("line"),H(n,"points","3 6 5 6 21 6"),H(r,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),H(i,"x1","10"),H(i,"y1","11"),H(i,"x2","10"),H(i,"y2","17"),H(o,"x1","14"),H(o,"y1","11"),H(o,"x2","14"),H(o,"y2","17"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",s="feather feather-trash-2 "+e[2])},m(e,s){O(e,t,s),x(t,n),x(t,r),x(t,i),x(t,o)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-trash-2 "+e[2])&&H(t,"class",s)},i:b,o:b,d(e){e&&M(t)}}}function nn(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 rn extends Oe{constructor(e){super(),xe(this,e,nn,tn,T,{size:0,strokeWidth:1,class:2})}}const{document:on}=Ee;function sn(e){e[58]=e[59].items}function an(e,t,n){const r=e.slice();return r[60]=t[n],r[62]=n,r}function ln(e,t,n){const r=e.slice();return r[63]=t[n],r}function cn(e,t,n){const r=e.slice();return r[66]=t[n],r}function dn(e,t,n){const r=e.slice();return r[63]=t[n],r}function un(e,t,n){const r=e.slice();return r[66]=t[n],r}function fn(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function hn(e){let t,n,r,i,o,s;sn(e);let a=e[5]?.length&&mn(e),l=e[58]?.length&&gn(e),c=e[5]?.length&&$n(e);return{c(){a&&a.c(),t=V(),n=B("div"),r=B("table"),l&&l.c(),i=V(),o=B("tbody"),c&&c.c(),H(o,"class","svelte-1a9feqg"),H(r,"striped",""),H(r,"class","svelte-1a9feqg"),H(n,"class","eList svelte-1a9feqg")},m(e,d){a&&a.m(e,d),O(e,t,d),O(e,n,d),x(n,r),l&&l.m(r,null),x(r,i),x(r,o),c&&c.m(o,null),s=!0},p(e,n){sn(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&_e(a,1)):(a=mn(e),a.c(),_e(a,1),a.m(t.parentNode,t)):a&&($e(),Ce(a,1,1,()=>{a=null}),Ie()),e[58]?.length?l?l.p(e,n):(l=gn(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=$n(e),c.c(),_e(c,1),c.m(o,null)):c&&($e(),Ce(c,1,1,()=>{c=null}),Ie())},i(e){s||(_e(a),_e(c),s=!0)},o(e){Ce(a),Ce(c),s=!1},d(e){a&&a.d(e),e&&M(t),e&&M(n),l&&l.d(),c&&c.d()}}}function mn(e){let t,n,r,i,o,s,a,l,c,d,u,f=e[6]&&pn(e);function h(t){e[38](t)}let m={id:e[12]};return void 0!==e[3]&&(m.value=e[3]),i=new e[9]({props:m}),oe.push(()=>Te(i,"value",h)),i.$on("input",e[16]),l=new bt({props:{size:"18"}}),{c(){f&&f.c(),t=V(),n=B("div"),r=F("Suchen: "),ke(i.$$.fragment),s=V(),a=B("span"),ke(l.$$.fragment),H(a,"class","feather pointer svelte-1a9feqg"),X(n,"margin-bottom","1em"),X(n,"position","relative")},m(o,h){f&&f.m(o,h),O(o,t,h),O(o,n,h),x(n,r),De(i,n,null),x(n,s),x(n,a),De(l,a,null),c=!0,d||(u=W(a,"click",e[18]),d=!0)},p(e,n){e[6]?f?64&n[0]&&_e(f,1):(f=pn(e),f.c(),_e(f,1),f.m(t.parentNode,t)):f&&($e(),Ce(f,1,1,()=>{f=null}),Ie());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],he(()=>o=!1)),i.$set(r)},i(e){c||(_e(f),_e(i.$$.fragment,e),_e(l.$$.fragment,e),c=!0)},o(e){Ce(f),Ce(i.$$.fragment,e),Ce(l.$$.fragment,e),c=!1},d(e){f&&f.d(e),e&&M(t),e&&M(n),Re(i),Re(l),d=!1,u()}}}function pn(e){let t,n;return t=new e[8]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function gn(e){let t,n,r,i,o=e[4]&&e[0]&&wn(),s=e[7],a=[];for(let t=0;t<s.length;t+=1)a[t]=yn(un(e,s,t));let l=e[58],c=[];for(let t=0;t<l.length;t+=1)c[t]=vn(dn(e,l,t));return{c(){t=B("thead"),n=B("tr"),o&&o.c(),r=V();for(let e=0;e<a.length;e+=1)a[e].c();i=V();for(let e=0;e<c.length;e+=1)c[e].c();H(n,"class","svelte-1a9feqg"),H(t,"class","svelte-1a9feqg")},m(e,s){O(e,t,s),x(t,n),o&&o.m(n,null),x(n,r);for(let e=0;e<a.length;e+=1)a[e].m(n,null);x(n,i);for(let e=0;e<c.length;e+=1)c[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=wn(),o.c(),o.m(n,r)):o&&(o.d(1),o=null),128&t[0]){const t=s.length;let r;for(s=e[7],r=t;r<s.length;r+=1)un(e,s,r),a[r]||(a[r]=yn(),a[r].c(),a[r].m(n,i));for(r=s.length;r<t;r+=1)a[r].d(1);a.length=s.length}if(32772&t[0]){let r;for(l=e[58],r=0;r<l.length;r+=1){const i=dn(e,l,r);c[r]?c[r].p(i,t):(c[r]=vn(i),c[r].c(),c[r].m(n,null))}for(;r<c.length;r+=1)c[r].d(1);c.length=l.length}},d(e){e&&M(t),o&&o.d(),P(a,e),P(c,e)}}}function wn(e){let t;return{c(){t=B("th"),H(t,"class","svelte-1a9feqg")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function yn(e){let t;return{c(){t=B("th"),H(t,"class","svelte-1a9feqg")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function vn(e){let t,n,r=e[63]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-1a9feqg")},m(e,r){O(e,t,r),x(t,n)},p(e,t){4&t[0]&&r!==(r=e[63]?.designation+"")&&j(n,r)},d(e){e&&M(t)}}}function $n(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[60].index||e[60]?._id;for(let t=0;t<o.length;t+=1){let n=an(e,o,t),a=s(n);i.set(a,r[t]=Sn(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);O(e,t,i),n=!0},p(e,n){3858623&n[0]&&(o=e[5],$e(),r=Ne(r,n,s,1,e,o,i,t.parentNode,Se,Sn,t,an),Ie())},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)Ce(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&M(t)}}}function In(e){let t,n,r,i,o,s,a,l=e[4]&&e[0]&&_n(e),c=e[7],d=[];for(let t=0;t<c.length;t+=1)d[t]=An(cn(e,c,t));let u=e[58],f=[];for(let t=0;t<u.length;t+=1)f[t]=En(ln(e,u,t));return{c(){t=B("tr"),l&&l.c(),n=V();for(let e=0;e<d.length;e+=1)d[e].c();r=V();for(let e=0;e<f.length;e+=1)f[e].c();i=V(),H(t,"class","pointer svelte-1a9feqg"),Y(t,"active",e[60]._id===e[1]),Y(t,"blocked",!!e[60].blocked),Y(t,"undeliverable",!!e[60].undeliverable)},m(c,u){O(c,t,u),l&&l.m(t,null),x(t,n);for(let e=0;e<d.length;e+=1)d[e].m(t,null);x(t,r);for(let e=0;e<f.length;e+=1)f[e].m(t,null);x(t,i),o=!0,s||(a=W(t,"click",q(function(){N(e[14](e[60],e[62]))&&e[14](e[60],e[62]).apply(this,arguments)})),s=!0)},p(o,s){if((e=o)[4]&&e[0]?l?(l.p(e,s),17&s[0]&&_e(l,1)):(l=_n(e),l.c(),_e(l,1),l.m(t,n)):l&&($e(),Ce(l,1,1,()=>{l=null}),Ie()),3145888&s[0]){let n;for(c=e[7],n=0;n<c.length;n+=1){const i=cn(e,c,n);d[n]?d[n].p(i,s):(d[n]=An(i),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}if(40996&s[0]){let n;for(u=e[58],n=0;n<u.length;n+=1){const r=ln(e,u,n);f[n]?f[n].p(r,s):(f[n]=En(r),f[n].c(),f[n].m(t,i))}for(;n<f.length;n+=1)f[n].d(1);f.length=u.length}34&s[0]&&Y(t,"active",e[60]._id===e[1]),32&s[0]&&Y(t,"blocked",!!e[60].blocked),32&s[0]&&Y(t,"undeliverable",!!e[60].undeliverable)},i(e){o||(_e(l),o=!0)},o(e){Ce(l),o=!1},d(e){e&&M(t),l&&l.d(),P(d,e),P(f,e),s=!1,a()}}}function _n(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("td"),ke(n.$$.fragment),H(t,"class","editRow svelte-1a9feqg"),X(t,"color","#326173")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",q(function(){N(e[19](e[60]))&&e[19](e[60]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Cn(e){let t;return{c(){t=B("td"),H(t,"class","svelte-1a9feqg")},m(e,n){O(e,t,n)},p:b,d(e){e&&M(t)}}}function bn(e){let t,n,r,i,o=e[66].widget.name+"";return{c(){t=B("td"),n=F(o),H(t,"class","editRow svelte-1a9feqg"),X(t,"color","#326173")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(function(){N(e[21](e[60],e[66]))&&e[21](e[60],e[66]).apply(this,arguments)})),r=!0)},p(t,r){e=t,128&r[0]&&o!==(o=e[66].widget.name+"")&&j(n,o)},d(e){e&&M(t),r=!1,i()}}}function An(e){let t,n;function r(e,n){return(null==t||160&n[0])&&(t=!!e[20](e[60],e[66])),t?bn:Cn}let i=r(e,[-1]),o=i(e);return{c(){o.c(),n=U()},m(e,t){o.m(e,t),O(e,n,t)},p(e,t){i===(i=r(e,t))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n.parentNode,n)))},d(e){o.d(e),e&&M(n)}}}function En(e){let t,n,r,i=e[13](e[60],e[63])+"";return{c(){t=B("td"),n=F(i),H(t,"class",r=D(e[63].type)+" svelte-1a9feqg")},m(e,r){O(e,t,r),x(t,n)},p(e,o){36&o[0]&&i!==(i=e[13](e[60],e[63])+"")&&j(n,i),4&o[0]&&r!==(r=D(e[63].type)+" svelte-1a9feqg")&&H(t,"class",r)},d(e){e&&M(t)}}}function Sn(e,t){let n,r,i,o=t[17](t[60],t[58],t[3]),s=o&&In(t);return{key:e,first:null,c(){n=U(),s&&s.c(),r=U(),this.first=n},m(e,t){O(e,n,t),s&&s.m(e,t),O(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[17](t[60],t[58],t[3])),o?s?(s.p(t,n),44&n[0]&&_e(s,1)):(s=In(t),s.c(),_e(s,1),s.m(r.parentNode,r)):s&&($e(),Ce(s,1,1,()=>{s=null}),Ie())},i(e){i||(_e(s),i=!0)},o(e){Ce(s),i=!1},d(e){e&&M(n),s&&s.d(e),e&&M(r)}}}function Nn(e){let t,n;return t=new e[8]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Tn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Nn,then:hn,catch:fn,value:59,blocks:[,,,]};return be(n=e[2]&&e[15](),i),{c(){t=U(),i.block.c()},m(e,n){O(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[15]())&&be(n,i)||Ae(i,e,r)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),i.block.d(e),i.token=null,i=null}}}const kn=e("getDisplayItems",async(e,n,r)=>{if(!e)return;const i=await t.getEvent(n.id),o=i.output?.class?.at(0)?.display?.find(e=>e.merge)?.merge;let s=[];for(let i of e){if(o?.item?.find(e=>e.refItem===i))continue;if(i.includes(":")&&(i=i.split(":")[0]),"_total"===i){s.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===i){s.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}let[e,a]=i.split("."),l=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===a);if(l&&(l={...l},l.name=`${e}_${a}`,r=r.map(t=>(t[e]&&(t[l.name]=t["_"+e]?t["_"+e][a]:t[e][a]),t))),i.endsWith("_from")||i.endsWith("_to")){e=e.split("_")[0];const t=l=n.items.find(t=>t.name===e);t&&(l={name:a?e:i,designation:t.designation,type:"date",decimals:0})}if(l||(l=n.items.find(t=>t.name===e)),!l){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===a);r&&(l={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}s.find(t=>t?.name===e)||s.push(l)}return o&&(s.push({name:o.item,designation:o.titleType,type:"string",decimals:0,isTitle:!0}),s.push({name:o.item,designation:o.title,type:"string",decimals:0})),s.length?s:n.items});function Dn(e,o,s){let a,l,c;k(e,i,e=>s(44,l=e));let d=JSON.parse(n.getItem("Locale")).id;const f=ne(),{Loading:m,TextField:p}=u,{currentTasks:w,loggedIn:y}=h;k(e,w,e=>s(43,a=e)),k(e,y,e=>s(45,c=e));let v,I,_,C,b,{inputList:A}=o,{eventId:E}=o,{prevEventId:S}=o,{record:N}=o,{className:T}=o,{rowId:D}=o,{filterForReady:R=!1}=o,{filter:x}=o,{query:O}=o,{refStatus:M}=o,{refFilter:P}=o,{showEdit:B=!1}=o,{praefix:L=""}=o,{selectionFields:F=!1}=o,{deList:V}=o,{stopAggregation:U=!1}=o,{shouldBlock:W}=o,{inputSearch:z=""}=o,q=!0,H=z,j=T+Math.floor(9e3*Math.random()+1e3).toString()+"search",G=!1,X=!0,Y=[];const Z=(e,t)=>{if(!t)return;if(Array.isArray(t.name)){let n="";for(const r of t.name)if(e[r.refItem])if(t.isTitle)n=r.refType;else{const t=e["_"+r.refItem]||e[r.refItem];t&&(n=t)}return g(n||"")}let n=!1,r=e[t.name];if("template"===t.type){const n=[],i=e[t.refItem.split(".").at(-1)];if("object"==typeof i){for(const e in i)n.push(i[e]?.join(","));r=n?.join(" / ")}}if(t.properties?.multi&&t.refClass){const i=e[t.name];r=e["_"+t.name],r&&(r+=Array.isArray(i)&&i.length>1?" (...)":"",n=!0)}if("__total"===t.name&&void 0===r&&(r=1.081*e._total),!r&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[n,i]=t.name.split("_");try{r=e[n][i]}catch{}}if(Array.isArray(r)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(r.length&&Array.isArray(r[0].serialno)){let t=[];for(const n of r)t=t.concat(n.serialno.map(e));r=t.join(", ")}else r=r.map(e),r.length>3&&(r=r.slice(0,3),r=r.concat("...")),r=r.join(", ")}if(!r&&t.name.split("_").length>1){const[n,i]=t.name.split("_");try{r=e[n][0][i],Array.isArray(r)&&(r=r.join(", "))}catch{}}return"number"===t.type&&(r||(r=e[`_${t.name}`]),r=Number(r)?Number(r).toLocaleString(d,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===r&&(r=!1),"number"===t.type||"template"===t.type||n?r:"boolean"==typeof r||"boolean"===t.type?$(r):g(e[`_${t.name}`]||r||"")},K=t.getSchemaByClass(T),Q=async(e,n)=>{if(!e)return[];if(x)if("string"==typeof x){let n=x;const r=x.startsWith("!");r&&(n=x.replace("!",""));const i=x.startsWith("$");if(n&&!i&&(e=e.filter(e=>r?!e[n]:!!e[n])),i){n=x.replace("$","");const[r,i]=n.split(".");if(N[i]){const n=await t.getSectionView(r,{[i]:N[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}else{const{refItem:n,refValue:r}=x;e=await t.getSectionView(T,{[n]:r})||[]}if(M||P&&!O){let t=e;return M&&(s(22,M=[].concat(M)),t=t.filter(e=>!!M.find(t=>e._task.status===t))),P&&(t=t.filter(e=>!!e[P])),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===T)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)},J=(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(d,{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},te=async e=>{let n,r=0;X=!1;const i=e=>new Promise(t=>setTimeout(t,e)),o=await K;for(;r++<200&&!U&&!(n=await re(e,o.id));)await i(500);s(6,G=!1),U&&t.readTasksByAggregationId(e,!0),n&&(s(5,_=J(I.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),X=!0,document.getElementById(j)?.focus()},100))},re=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),ie=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(L),c=l&&await bw(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&&_w(o+r._id.toString(),r),r}):e};ee(()=>{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 K;e.eventId===t.id&&(Aw(t.class,e.eventId),s(2,q=!s(2,q=!1)))});const oe=(e,t)=>I.class===t.class?e._id:e[t.class];return e.$$set=e=>{"inputList"in e&&s(24,A=e.inputList),"eventId"in e&&s(25,E=e.eventId),"prevEventId"in e&&s(26,S=e.prevEventId),"record"in e&&s(27,N=e.record),"className"in e&&s(28,T=e.className),"rowId"in e&&s(1,D=e.rowId),"filterForReady"in e&&s(29,R=e.filterForReady),"filter"in e&&s(30,x=e.filter),"query"in e&&s(31,O=e.query),"refStatus"in e&&s(22,M=e.refStatus),"refFilter"in e&&s(32,P=e.refFilter),"showEdit"in e&&s(0,B=e.showEdit),"praefix"in e&&s(33,L=e.praefix),"selectionFields"in e&&s(34,F=e.selectionFields),"deList"in e&&s(35,V=e.deList),"stopAggregation"in e&&s(23,U=e.stopAggregation),"shouldBlock"in e&&s(36,W=e.shouldBlock),"inputSearch"in e&&s(37,z=e.inputSearch)},[B,D,q,H,v,_,G,Y,m,p,w,y,j,Z,(e,t)=>n=>{s(23,U=!0);const r=X?e:C[t];f("choose",{row:r})},async()=>{I=await K,s(7,Y=await(async e=>{const n=await t.getEvents(),r=n?.filter(t=>t.output.widgetType&&(e.class===t.output?.class[0].name||e.items.find(e=>e.refClass===t.output?.class[0].name))).map(e=>({class:e.output.class[0].name,widget:e.output.widgetType}));return r||[]})(I)),s(4,v=(e=>!a?.length||!!a.find(t=>t===e))(I.id)),O&&s(5,_=C=await t.getTasksFiltered(I.class,O)),_||s(5,_=C=J(I.displaySort,await A||await $w(I.class,I.id))),500!==_?.length||O||(s(6,G=!0),await t.getTasksList(I.id,!1,!0).then(({aggregationId:e})=>te(e)));let e,n=!1,r="";const i=F&&F?.find(e=>I.class===e.refClass.split(":")[0]),o=i?.value?.get&&i.value.get(L);if(o){const[a,l]=i.refClass.split(":");I.class===a&&s(5,_=await ie(_,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,B&&=!i),!i&&(x||R||M)&&s(5,_=await Q(_,I)),b=I.authorization?.find(e=>"employee"===e.constraint)&&!l.some(e=>I.authorization?.find(t=>t.role===e&&"employee"!==t.constraint));const{display:d}=I;let u=await kn(d,I,_);if(!B&&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)}}),f("init",_)):V&&s(5,_=_.filter(e=>!V.find(t=>t?._id===e._id))),W&&s(5,_=_.filter(e=>!e[W])),b){const e={businessEmail:c.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=Z(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{s(3,H="")},async e=>{let t=e._task;t||(t=await Iw(T,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},oe,async(e,t)=>{const n=oe(e,t);n&&window.open(`/widget/${t.widget.id}/${n}?view=standalone`)},M,U,A,E,S,N,T,R,x,O,P,L,F,V,W,z,function(e){H=e,s(3,H)}]}class Rn extends Oe{constructor(e){var t;super(),on.getElementById("svelte-1a9feqg-style")||((t=B("style")).id="svelte-1a9feqg-style",t.textContent=".feather.svelte-1a9feqg.svelte-1a9feqg{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1a9feqg.svelte-1a9feqg{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1a9feqg .editRow.svelte-1a9feqg{width:1em}.eList.svelte-1a9feqg table.svelte-1a9feqg{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1a9feqg table thead.svelte-1a9feqg{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1a9feqg table thead tr.svelte-1a9feqg{height:2.3em}.eList.svelte-1a9feqg table tbody.svelte-1a9feqg{color:black}.eList.svelte-1a9feqg table tbody tr.svelte-1a9feqg{height:2.75em !important}th.svelte-1a9feqg.svelte-1a9feqg,td.svelte-1a9feqg.svelte-1a9feqg{padding-left:0.4em;padding-right:0.4em}td.number.svelte-1a9feqg.svelte-1a9feqg{text-align:end}td.string.svelte-1a9feqg.svelte-1a9feqg{min-width:6em}td.object.svelte-1a9feqg.svelte-1a9feqg{min-width:8em}tr.pointer.svelte-1a9feqg.svelte-1a9feqg:hover{background-color:#DAE1E5}tr.active.svelte-1a9feqg.svelte-1a9feqg{color:#326173;background-color:#fcebd5}tr.blocked.svelte-1a9feqg.svelte-1a9feqg{color:red !important}tr.undeliverable.svelte-1a9feqg.svelte-1a9feqg{color:orange}",x(on.head,t)),xe(this,e,Dn,Tn,T,{inputList:24,eventId:25,prevEventId:26,record:27,className:28,rowId:1,filterForReady:29,filter:30,query:31,refStatus:22,refFilter:32,showEdit:0,praefix:33,selectionFields:34,deList:35,stopAggregation:23,shouldBlock:36,inputSearch:37},[-1,-1,-1])}}function xn(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function On(e){let t,n,r=e[46]&&Mn(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[46]?r?(r.p(e,n),16&n[0]&&_e(r,1)):(r=Mn(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function Mn(e){let t,n;return t=new e[26]({props:{title:e[21]?"Auswahl":e[0],class:"eList "+(e[19]?"form":""),$$slots:{default:[Hn]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2097153&n[0]&&(r.title=e[21]?"Auswahl":e[0]),524288&n[0]&&(r.class="eList "+(e[19]?"form":"")),67108862&n[0]|65536&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Pn(e){let t,n;return t=new Rw({props:{schema:e[2],recID:e[1],readonly:e[20],closeThis:!0}}),t.$on("choose",function(){N(e[35](e[46]))&&e[35](e[46]).apply(this,arguments)}),t.$on("back",e[32]),{c(){ke(t.$$.fragment)},m(e,r){De(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]),1048576&r[0]&&(i.readonly=e[20]),t.$set(i)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Bn(e){let t,n,r,i,o,s,a;t=new e[27]({props:{text:e[21]?"Zusätzliche Auswahl":""}});const l=[Fn,Ln],c=[];function d(e,t){return e[21]?0:1}return r=d(e),i=c[r]=l[r](e),s=new Rn({props:{inputSearch:e[16],record:e[3],eventId:e[2].id,className:e[2].class,prevEventId:e[15],filterForReady:e[5],filter:e[6],query:e[7],refStatus:e[8],refFilter:e[9],praefix:e[10],selectionFields:e[11],rowId:e[1],shouldBlock:e[17],deList:e[13],stopAggregation:e[25],showEdit:e[12]}}),s.$on("edit",e[36]),s.$on("choose",e[39]),s.$on("init",e[37]),{c(){ke(t.$$.fragment),n=V(),i.c(),o=V(),ke(s.$$.fragment)},m(e,i){De(t,e,i),O(e,n,i),c[r].m(e,i),O(e,o,i),De(s,e,i),a=!0},p(e,n){const a={};2097152&n[0]&&(a.text=e[21]?"Zusätzliche Auswahl":""),t.$set(a);let u=r;r=d(e),r===u?c[r].p(e,n):($e(),Ce(c[u],1,1,()=>{c[u]=null}),Ie(),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={};65536&n[0]&&(f.inputSearch=e[16]),8&n[0]&&(f.record=e[3]),4&n[0]&&(f.eventId=e[2].id),4&n[0]&&(f.className=e[2].class),32768&n[0]&&(f.prevEventId=e[15]),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.refFilter=e[9]),1024&n[0]&&(f.praefix=e[10]),2048&n[0]&&(f.selectionFields=e[11]),2&n[0]&&(f.rowId=e[1]),131072&n[0]&&(f.shouldBlock=e[17]),8192&n[0]&&(f.deList=e[13]),33554432&n[0]&&(f.stopAggregation=e[25]),4096&n[0]&&(f.showEdit=e[12]),s.$set(f)},i(e){a||(_e(t.$$.fragment,e),_e(i),_e(s.$$.fragment,e),a=!0)},o(e){Ce(t.$$.fragment,e),Ce(i),Ce(s.$$.fragment,e),a=!1},d(e){Re(t,e),e&&M(n),c[r].d(e),e&&M(o),Re(s,e)}}}function Ln(e){let t,n,r,i;n=new e[28]({props:{outline:!0,$$slots:{default:[Vn]},$$scope:{ctx:e}}}),n.$on("click",e[33]);let o=e[30]&&e[14]&&Un(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),H(t,"class","form--buttons svelte-jb5mrh")},m(e,s){O(e,t,s),De(n,t,null),x(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};65536&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[30]&&e[14]?o?(o.p(e,r),16384&r[0]&&_e(o,1)):(o=Un(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Fn(e){let t,n,r,i,o,s,a=e[24]&&zn(e);return r=new e[28]({props:{outline:!0,$$slots:{default:[qn]},$$scope:{ctx:e}}}),r.$on("click",e[33]),o=new e[27]({props:{text:"Liste aus "+e[18]}}),{c(){a&&a.c(),t=V(),n=B("div"),ke(r.$$.fragment),i=V(),ke(o.$$.fragment),H(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),O(e,t,l),O(e,n,l),De(r,n,null),O(e,i,l),De(o,e,l),s=!0},p(e,n){e[24]?a?(a.p(e,n),16777216&n[0]&&_e(a,1)):(a=zn(e),a.c(),_e(a,1),a.m(t.parentNode,t)):a&&($e(),Ce(a,1,1,()=>{a=null}),Ie());const i={};65536&n[1]&&(i.$$scope={dirty:n,ctx:e}),r.$set(i);const s={};262144&n[0]&&(s.text="Liste aus "+e[18]),o.$set(s)},i(e){s||(_e(a),_e(r.$$.fragment,e),_e(o.$$.fragment,e),s=!0)},o(e){Ce(a),Ce(r.$$.fragment,e),Ce(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&M(t),e&&M(n),Re(r),e&&M(i),Re(o,e)}}}function Vn(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Un(e){let t,n;return t=new e[28]({props:{filled:!0,$$slots:{default:[Wn]},$$scope:{ctx:e}}}),t.$on("click",e[34]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};65536&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Wn(e){let t;return{c(){t=F("Neu")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function zn(e){let t,n;return t=new ah({props:{item:e[22],record:{_id:"",[e[22].name]:""},noForm:"true",classId:"sel_"+e[22].name,eventId:e[23],required:!1,hidden:!1,readonly:!1,deList:e[24]}}),t.$on("notify",e[38]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};4194304&n[0]&&(r.item=e[22]),4194304&n[0]&&(r.record={_id:"",[e[22].name]:""}),4194304&n[0]&&(r.classId="sel_"+e[22].name),8388608&n[0]&&(r.eventId=e[23]),16777216&n[0]&&(r.deList=e[24]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function qn(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Hn(e){let t,n,r,i;const o=[Bn,Pn],s=[];function a(e,t){return e[46].length&&!e[19]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function jn(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Gn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:jn,then:On,catch:xn,value:46,blocks:[,,,]};return be(n=e[31](e[4]),i),{c(){t=U(),i.block.c()},m(e,n){O(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[31](e[4]))&&be(n,i)||Ae(i,e,r)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),i.block.d(e),i.token=null,i=null}}}function Xn(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=u,l=ne(),{currentTasks:c}=h;k(e,c,e=>r(42,i=e));let{title:d}=n,{schema:f}=n,{record:m}=n,{recID:p}=n,{isOpening:g=!0}=n,{filterForReady:w=!1}=n,{filter:y}=n,{query:v}=n,{refStatus:$}=n,{refFilter:I}=n,{praefix:_=""}=n,{selectionFields:C=!1}=n,{showEdit:b=!0}=n,{deList:A}=n,{newAllowed:E=!0}=n,{prevEventId:S}=n,{inputSearch:N}=n,{shouldBlock:T}=n,D=f.id;f.class;let R,x,O,M,P,B,L,F="",V=!1,U=!1;d??=f.identity.designation;const W=!i?.length||i.find(e=>e===D);return e.$$set=e=>{"title"in e&&r(0,d=e.title),"schema"in e&&r(2,f=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),"refFilter"in e&&r(9,I=e.refFilter),"praefix"in e&&r(10,_=e.praefix),"selectionFields"in e&&r(11,C=e.selectionFields),"showEdit"in e&&r(12,b=e.showEdit),"deList"in e&&r(13,A=e.deList),"newAllowed"in e&&r(14,E=e.newAllowed),"prevEventId"in e&&r(15,S=e.prevEventId),"inputSearch"in e&&r(16,N=e.inputSearch),"shouldBlock"in e&&r(17,T=e.shouldBlock)},[d,p,f,m,g,w,y,v,$,I,_,C,b,A,E,S,N,T,F,V,R,O,P,B,L,U,o,s,a,c,W,async e=>{if(!e)return!1;const n=await $w(f.class,f.id);if(x=C&&C?.find(e=>f.class===e.refClass.split(":")[0]),r(21,O=x?.value?.get&&x.value.get(_)),O){M=x.refClass;const[e,n]=M.split(":"),[i]=n.split(".");r(22,P=x.parentClass.find(t=>t.name===e));const o=await t.getSchemaByClass(P.refClass);r(23,B=o.id),r(18,F=x.parentClass.find(e=>e.name===i).designation)}return n},()=>{r(19,V=!1),p||l("back"),b||l("back")},()=>{r(25,U=!0),r(19,V=!1),l("back")},()=>{r(25,U=!0),r(1,p=!1),r(20,R=!1),r(19,V=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=f.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(20,R=!!e._task.visum||"Closed"===e._task.status),r(1,p=e._docId),r(19,V=!0)},({detail:e})=>{O&&r(24,L=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){re(e,t)}]}class Yn extends Oe{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=B("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",x(document.head,t)),xe(this,e,Xn,Gn,T,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,refFilter:9,praefix:10,selectionFields:11,showEdit:12,deList:13,newAllowed:14,prevEventId:15,inputSearch:16,shouldBlock:17},[-1,-1])}}const{document:Zn}=Ee;function Kn(e){e[28]=e[30].list,e[29]=e[30].items}function Qn(e,t,n){const r=e.slice();return r[31]=t[n],r}function Jn(e,t,n){const r=e.slice();return r[34]=t[n],r}function er(e,t,n){const r=e.slice();return r[34]=t[n],r}function tr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function nr(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)}Kn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[rr]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let $={id:e[8]};void 0!==e[0]&&($.value=e[0]),s=new e[6]({props:$}),oe.push(()=>Te(s,"value",v)),s.$on("input",e[12]),d=new bt({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]=ir(er(e,o,t));return{c(){t=B("thead"),n=B("tr"),r=B("th"),i=V();for(let e=0;e<s.length;e+=1)s[e].c();H(r,"class","svelte-14hcfjl"),H(n,"class","svelte-14hcfjl"),H(t,"class","svelte-14hcfjl")},m(e,o){O(e,t,o),x(t,n),x(n,r),x(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=er(e,o,r);s[r]?s[r].p(i,t):(s[r]=ir(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&&M(t),P(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]=ar(Qn(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(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=Qn(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=ar(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("div"),o=F("Suchen: "),ke(s.$$.fragment),l=V(),c=B("span"),ke(d.$$.fragment),u=V(),f=B("div"),h=B("table"),I&&I.c(),m=V(),p=B("tbody"),_&&_.c(),H(t,"class","form--buttons svelte-14hcfjl"),H(c,"class","feather pointer svelte-14hcfjl"),X(i,"margin-bottom","1em"),X(i,"position","relative"),H(h,"striped",""),H(h,"class","svelte-14hcfjl"),H(f,"class","eList svelte-14hcfjl")},m(a,v){O(a,t,v),De(n,t,null),O(a,r,v),O(a,i,v),x(i,o),De(s,i,null),x(i,l),x(i,c),De(d,c,null),O(a,u,v),O(a,f,v),x(f,h),I&&I.m(h,null),x(h,m),x(h,p),_&&_.m(p,null),g=!0,w||(y=W(c,"click",e[14]),w=!0)},p(e,t){Kn(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],he(()=>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){Ce(n.$$.fragment,e),Ce(s.$$.fragment,e),Ce(d.$$.fragment,e),Ce(_),g=!1},d(e){e&&M(t),Re(n),e&&M(r),e&&M(i),Re(s),Re(d),e&&M(u),e&&M(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function rr(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ir(e){let t,n,r=e[34]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function or(e){let t,n,r,i,o,s,a,l;r=new St({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=sr(Jn(e,c,t));return{c(){t=B("tr"),n=B("td"),ke(r.$$.fragment),i=V();for(let e=0;e<d.length;e+=1)d[e].c();o=V(),H(n,"class","editRow svelte-14hcfjl"),H(t,"class","pointer svelte-14hcfjl"),Y(t,"active",e[31]._id===e[1])},m(c,u){O(c,t,u),x(t,n),De(r,n,null),x(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);x(t,o),s=!0,a||(l=W(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=Jn(e,c,n);d[n]?d[n].p(i,r):(d[n]=sr(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]&&Y(t,"active",e[31]._id===e[1])},i(e){s||(_e(r.$$.fragment,e),s=!0)},o(e){Ce(r.$$.fragment,e),s=!1},d(e){e&&M(t),Re(r),P(d,e),a=!1,l()}}}function sr(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=B("td"),n=F(o),H(t,"class","svelte-14hcfjl")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&M(t),r=!1,i()}}}function ar(e){let t,n,r=e[13](e[31],e[29],e[0]),i=r&&or(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(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=or(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function lr(e){let t,n;return t=new e[5]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function cr(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:lr,then:nr,catch:tr,value:30,blocks:[,,,]};return be(e[11](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function dr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[cr]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ur(e,n,i){const o=ne(),{Dialog:s,Divider:a,Loading:l,TextField:c,Button:d}=u;let{item:f}=n,{classId:h}=n,{className:m}=n,{rowId:p}=n,{viewName:w}=n,{viewValue:y}=n,{recordId:v}=n,{filter:I}=n,{multiValues:_}=n,{searchValue:C=""}=n,b=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?$(n):g(e[`_${t.name}`]||e[t.name]||"")},E=t.getSchemaByClass(m);ee(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(b)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await E;e.eventId===t.id&&Aw(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,m=e.className),"rowId"in e&&i(1,p=e.rowId),"viewName"in e&&i(19,w=e.viewName),"viewValue"in e&&i(20,y=e.viewValue),"recordId"in e&&i(21,v=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,p,o,s,a,l,c,d,b,A,e=>()=>o("choose",{row:e}),async()=>{const e=await E;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||v,_.has(f.lookup)){const r=_.get(f.lookup)[0];n=r?await t.getSectionView(f.name,{[f.lookup]:r},!0):await $w(f.name,e.id)}else if(o&&24===o.toString().length){const e=await bw(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||v,o){let e=await t.getDocById(a,o);if(e&&l&&(e=await t.getDocById(l,e[l])),e&&e[s]){e[s]=e[s].map((e,t)=>(e.__index=t,e));const r=e[s].map(e=>e[f.name]);n=await t.getSectionView(f.name,{_id:{$in:r}},!0),n=n.sort((t,n)=>e[s].find(e=>e[f.name]===t._id).__index-e[s].find(e=>e[f.name]===n._id).__index)}}}}else{const r="."+h+"#"+w.split(":")[0],i=document.querySelector(r);let o={[w]:i?.value||v};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 kn(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,m,w,y,v,I,_,()=>o("back"),function(e){C=e,i(0,C)}]}class fr extends Oe{constructor(e){var t;super(),Zn.getElementById("svelte-14hcfjl-style")||((t=B("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}",x(Zn.head,t)),xe(this,e,ur,dr,T,{item:16,classId:17,className:18,rowId:1,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23,searchValue:0},[-1,-1])}}const{document:hr}=Ee;function mr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function pr(e){let t,n,r=e[85]&&function(e){let t,n,r,i,s,a,l,c,d,u,f,h,m,p,g,w,y,v,$,I;function _(t){e[65](t)}function C(t){e[66](t)}let b={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]&&(b.value=e[1]);void 0!==e[27]&&(b.overwrite=e[27]);n=new o({props:b}),oe.push(()=>Te(n,"value",_)),oe.push(()=>Te(n,"overwrite",C)),n.$on("click",e[40]()),n.$on("blur",e[49]);const A=[yr,wr,gr],E=[];function S(e,t){return e[36]?0:!e[3]||e[16]?1:e[22]&&e[0]?2:-1}~(a=S(e))&&(l=E[a]=A[a](e));let N=(!e[3]||e[16])&&e[0]&&!e[17]&&!e[36]&&_r(e);function T(t){e[67](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[Er]},$$scope:{ctx:e}};void 0!==e[19]&&(k.open=e[19]);m=new e[30]({props:k}),oe.push(()=>Te(m,"open",T));let R=e[20]&&Sr(e),P=e[24]&&kr(e);return{c(){t=B("div"),ke(n.$$.fragment),s=V(),l&&l.c(),c=V(),d=B("input"),f=V(),N&&N.c(),h=V(),ke(m.$$.fragment),g=V(),R&&R.c(),w=V(),P&&P.c(),y=U(),H(d,"class",u=D(e[9]||e[10])+" svelte-10ggg6v"),H(d,"id",e[5]),H(d,"name",e[5]),d.value=e[0],d.required=e[2],d.hidden=!0,X(t,"position","relative")},m(r,i){O(r,t,i),De(n,t,null),x(t,s),~a&&E[a].m(t,null),x(t,c),x(t,d),x(t,f),N&&N.m(t,null),O(r,h,i),De(m,r,i),O(r,g,i),R&&R.m(r,i),O(r,w,i),P&&P.m(r,i),O(r,y,i),v=!0,$||(I=W(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],he(()=>r=!1)),!i&&134217728&o[0]&&(i=!0,s.overwrite=e[27],he(()=>i=!1)),n.$set(s);let f=a;a=S(e),a===f?~a&&E[a].p(e,o):(l&&($e(),Ce(E[f],1,1,()=>{E[f]=null}),Ie()),~a?(l=E[a],l?l.p(e,o):(l=E[a]=A[a](e),l.c()),_e(l,1),l.m(t,c)):l=null),(!v||1536&o[0]&&u!==(u=D(e[9]||e[10])+" svelte-10ggg6v"))&&H(d,"class",u),(!v||32&o[0])&&H(d,"id",e[5]),(!v||32&o[0])&&H(d,"name",e[5]),(!v||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),(!v||4&o[0])&&(d.required=e[2]),e[3]&&!e[16]||!e[0]||e[17]||e[36]?N&&($e(),Ce(N,1,1,()=>{N=null}),Ie()):N?(N.p(e,o),196617&o[0]&&_e(N,1)):(N=_r(e),N.c(),_e(N,1),N.m(t,null));const h={};344784337&o[0]|16777216&o[2]&&(h.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,h.open=e[19],he(()=>p=!1)),m.$set(h),e[20]?R?(R.p(e,o),1048576&o[0]&&_e(R,1)):(R=Sr(e),R.c(),_e(R,1),R.m(w.parentNode,w)):R&&($e(),Ce(R,1,1,()=>{R=null}),Ie()),e[24]?P?(P.p(e,o),16777216&o[0]&&_e(P,1)):(P=kr(e),P.c(),_e(P,1),P.m(y.parentNode,y)):P&&($e(),Ce(P,1,1,()=>{P=null}),Ie())},i(e){v||(_e(n.$$.fragment,e),_e(l),_e(N),_e(m.$$.fragment,e),_e(R),_e(P),v=!0)},o(e){Ce(n.$$.fragment,e),Ce(l),Ce(N),Ce(m.$$.fragment,e),Ce(R),Ce(P),v=!1},d(e){e&&M(t),Re(n),~a&&E[a].d(),N&&N.d(),e&&M(h),Re(m,e),e&&M(g),R&&R.d(e),e&&M(w),P&&P.d(e),e&&M(y),$=!1,I()}}}(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,t){e[85]&&r.p(e,t)},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function gr(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[48]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function wr(e){let t,n,r,i,o;return n=new en({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=[W(t,"click",e[40](!0)),W(t,"choose",e[44])],i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,S(o)}}}function yr(e){let t,n,r,i;const o=[Ir,$r,vr],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=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function vr(e){let t,n,r;return n=new Xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather3 svelte-10ggg6v")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function $r(e){let t,n,r,i,o;return n=new Xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[50]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Ir(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[48]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function _r(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[47]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Cr(e){let t,n,r,i;const o=[Ar,br],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=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function br(e){let t,n;return t=new Yn({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,refFilter:e[6].refFilter,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(){ke(t.$$.fragment)},m(e,r){De(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),64&n[0]&&(r.refFilter=e[6].refFilter),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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ar(e){let t,n;return t=new fr({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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Er(e){let t,n,r=e[19]&&Cr(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&_e(r,1)):(r=Cr(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function Sr(e){let t,n,r;function i(t){e[68](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}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|16777216&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function Nr(e){let t,n;return t=new Rw({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[45]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Tr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[Nr]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|16777216&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function kr(e){let t,n,r;function i(t){e[69](t)}let o={class:"tModal2",noClickaway:!0,$$slots:{default:[Rr]},$$scope:{ctx:e}};return void 0!==e[24]&&(o.open=e[24]),t=new e[30]({props:o}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(t,e,n),r=!0},p(e,r){const i={};35913728&r[0]|16777216&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&16777216&r[0]&&(n=!0,i.open=e[24],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function Dr(e){let t,n;return t=new Rw({props:{schema:e[18],dialogAttr:e[25]}}),t.$on("back",e[46]),t.$on("choose",e[43]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Rr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[Dr]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),33816576&n[0]|16777216&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function xr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Or(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:xr,then:pr,catch:mr,value:85,blocks:[,,,]};return be(e[39](),r),{c(){t=U(),r.block.c()},m(e,i){O(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){Ae(r,e=t,n)},i(e){n||(_e(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){Ce(r.blocks[e])}n=!1},d(e){e&&M(t),r.block.d(e),r.token=null,r=null}}}function Mr(e,n,r){let o,a,l,c,d;k(e,i,e=>r(64,o=e)),k(e,s,e=>r(74,d=e));const f=ne(),{Dialog:m,Modal:p}=u,{currentTasks:g,environment:w,loggedIn:y}=h;k(e,g,e=>r(71,a=e)),k(e,w,e=>r(73,c=e)),k(e,y,e=>r(72,l=e));let{id:v}=n,{item:$}=n,{record:_}=n,{fullRecord:C}=n,{value:b=""}=n,{multiValues:A}=n,{desc:E=""}=n,{noForm:S=!1}=n,{classId:N}=n,{eventId:T}=n,{recordId:D}=n,{withRefValue:R=!1}=n,{refValue:x=""}=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:q=!1}=n,{multi:H=!1}=n,{initFinished:j}=n,{listName:G=""}=n,{isScreen:X}=n;const Y="comment_"+v,Z=$.filter,K=$.properties?.startDialog;let Q,J,ee,te,re,ie,oe,se,ae=!1,le=!0,ce=!1,de=!0,ue=!0,fe=!1,he="";!U&&$.selection&&1===$.selection.split(":").length&&(U=$.selection);const me=B||P||$.lookup||U&&!$.constraint?"":"Suchbegriff ⏎",pe=(e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}},ge=()=>{if($.refItem&&$.refItem.startsWith("owner")){let e=c.owner[$.refClass];e||(e=pe($.refItem,c)),e&&(r(52,x=e),r(51,R=!0),f("change",{value:x}))}},we=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{const[n,r]=t.properties.default?.split?t.properties.default.split("."):[t.properties.default,!1];f("defPrep",{className:e.class,itemName:t.name,value:n,valueItem:r})})},ye=async e=>{const n=()=>{r(19,ae=!0)};if(9==e.which)return;if(b)return e.preventDefault();if(13!=e.which)return;if(e.preventDefault(),$.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,b=g[0]._id)},ve=e=>{e&&(r(63,he=r(1,E=I(te,e))),f("setRefDesc",E.split(" •")[0]),f("change",{value:b,description:E}),f("task",{row:e,eventId:te.id,item:$}),X&&f("screenList",{item:$,row:e,eventId:te.id}))},$e=()=>{r(19,ae=!1),r(20,J=!1)},Ie=()=>{r(24,ce=!1)};return e.$$set=e=>{"id"in e&&r(5,v=e.id),"item"in e&&r(6,$=e.item),"record"in e&&r(55,_=e.record),"fullRecord"in e&&r(7,C=e.fullRecord),"value"in e&&r(0,b=e.value),"multiValues"in e&&r(8,A=e.multiValues),"desc"in e&&r(1,E=e.desc),"noForm"in e&&r(9,S=e.noForm),"classId"in e&&r(10,N=e.classId),"eventId"in e&&r(11,T=e.eventId),"recordId"in e&&r(12,D=e.recordId),"withRefValue"in e&&r(51,R=e.withRefValue),"refValue"in e&&r(52,x=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,q=e.noList),"multi"in e&&r(17,H=e.multi),"initFinished"in e&&r(54,j=e.initFinished),"listName"in e&&r(59,G=e.listName),"isScreen"in e&&r(60,X=e.isScreen)},e.$$.update=()=>{if(4&e.$$.dirty[0]|67108864&e.$$.dirty[1]&&r(2,M="boolean"==typeof M&&(M&&!V)),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(3,P||=B),3145728&e.$$.dirty[1]&&R&&r(0,b=x),3&e.$$.dirty[0]|2&e.$$.dirty[2]&&!E&&b&&he&&r(1,E=he),399425&e.$$.dirty[0]|1484783616&e.$$.dirty[1]&&b&&te){let e=!1;if(!Array.isArray(b)){if(D||$.asInput||$.upate||!1!==$.refItem||!0===H||!1===$.refItem&&j){const t="p$"+G+"$"+$.refClass+"$"+T,n=vw(t);n?.then?n.then(e=>{const t=e.find(({_id:e})=>e===b);t?ve(t):Iw($.refClass,te.id,b,!!$.lookup||q).then(ve)}):e=!0}let t="";const n=Q.input?.class?.find(e=>e.name===$.refClass);n?.refStatus&&(t=n.refStatus),e&&te?.id&&Iw($.refClass,te.id,b,!!$.lookup||q,t).then(ve),r(54,j=!0)}}if(65&e.$$.dirty[0]|5&e.$$.dirty[2]&&b&&re&&$.name===re.input?.at(0)&&re.inputLookup?.length){const{domain:e}=re.inputLookup[0]||{};"user"===e&&(o.some(e=>re.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0))}262145&e.$$.dirty[0]&&!b&&te&&ve({})},[b,E,M,P,U,v,$,C,A,S,N,T,D,L,F,W,z,H,te,ae,J,ee,ie,le,ce,oe,de,ue,fe,m,p,g,w,y,Y,Z,K,me,()=>{if(X||!$.query)return;const[e,t]=$.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]}}],$.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":$.refStatus}}])),n},async()=>{try{if(r(61,Q=await t.getEvent(T)),r(53,B||=(()=>{if(D){if($.asInput)return!0;if(Q?.input?.class?.find(e=>e.name===$.refClass))return!0}return!1})()),se="report"===Q.output.type,r(26,de=!$.asInput),r(23,le=Q.output?.class[0].name!==$.refClass),r(18,te=await t.getSchemaByClass($.refClass)),te?.blocked)return f("initFail",!0),!1;if(se||r(28,fe=((e,t)=>{if(!t)return!1;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===$.name);if(t?.properties?.blocking)return n.name}return!1})(Q,te)),r(22,ie=(e=>!a?.length||!!a.find(t=>t===e))(te.id)),r(62,re=await t.getSchema(T)),T&&D&&b&&!P&&re.input?.find(e=>e===$.refClass)&&r(3,P=!0),Q.input?.class&&Q.input.class[0]&&(Q.input.class[0].name===$.refClass&&Q.input.class[0].readonly&&r(3,P=!0),D&&Q.input.class[0].name===$.refClass&&Q.input.class[0].writeState)){(await t.getTaskByDocId(D,!0)).status===Q.input.class[0].writeState&&r(3,P=r(53,B=!1))}if(P)return!0;if($.refStatus&&!$.query){const e=[].concat($.refStatus);let n={event:te.id,status:{$in:e}};const i=await t.getSectionView("_task",n);1===i?.length&&(r(52,x=i[0].docId),r(51,R=!0),f("change",{value:x}))}if($.properties?.query?.lookup){const{domain:e,value:n}=$.properties.query.lookup;if("user"===e){const e=l.user,i={[n]:e},s=await t.getSectionView($.refClass,i);if(s?.length){const[{_id:e}]=s;e&&(r(52,x=e),r(51,R=!0),f("change",{value:x}))}o.some(e=>te.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0)}}else ge();if(!P&&!x&&$.filter&&(""===L||void 0===L)){let e=$.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly($.refClass,{[$.filter]:n});i&&(r(52,x=i._id),r(51,R=!0),f("change",{value:x}))}return r(21,ee=te.identity.designation),b||we(te),!0}catch(e){return f("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!K){if(!0===e&&r(19,ae=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}($.lookup||U&&!$.constraint||b)&&r(19,ae=!0)}},ye,()=>{if(b)return"";r(1,E="");const e="#"+N+(G?" ."+N+G:"")+" #"+Y,t=document.querySelectorAll(e)[0];return t?.value?t.value:""},async({detail:e})=>{if(e.className=te.class,r(0,b=e.row._id),""===L||void 0===L?f("saveDialog",{itemName:$.name,value:b,add:add,closeTask:$.properties?.closeTask}):(e.add=$.properties?.add,f("listChange",e)),$.properties?.closeTask&&Q.output?.approval){const e=await t.getTaskByDocId(_._id),n=Q.output.approval.flatMap(({refRole:e})=>e),r={eventId:T,eventDesignation:Q.identity.designation,docId:_._id,role:n.filter(e=>o.find(t=>t===e)).join(", "),user:d.email,timeStamp:(new Date).toISOString()};await t.setTaskVisum(e._id,r)}Ie()},({detail:e})=>{r(0,b=e.row._id),$e()},$e,Ie,()=>{(se||ie)&&(H?f("change",{value:b,delete:!0}):(r(0,b=""),r(1,E=""),r(27,ue=!0),f("change",{value:b,description:E}),f("task",{row:{_task:{event:te.id},_id:!1},eventId:te.id,item:$})))},async()=>{if(!b)return;let e=await Iw($.refClass,te.id,b);e._task||(e={_task:await t.getTaskByDocId(b,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{b||E&&ye({which:13,preventDefault:()=>{},srcElement:{value:E}})},async e=>{r(25,oe={});for(const e in K){let n=K[e],i="";if(n.startsWith("owner"))i=pe(n,c);else if(n.startsWith("+")){const[e,r]=n.slice(1).split(".");n=e;const o=await t.getSchemaByClass(n),s=_[n];let a=await $w("",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,oe[e]=i,oe)}r(24,ce=!0)},R,x,B,j,_,O,V,q,G,X,Q,re,he,o,function(e){E=e,r(1,E),r(0,b),r(63,he),r(51,R),r(52,x)},function(e){ue=e,r(27,ue)},function(e){ae=e,r(19,ae)},function(e){J=e,r(20,J)},function(e){ce=e,r(24,ce)}]}class Pr extends Oe{constructor(e){var t;super(),hr.getElementById("svelte-10ggg6v-style")||((t=B("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}",x(hr.head,t)),xe(this,e,Mr,Or,T,{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,isScreen:60},[-1,-1,-1])}}const{document:Br}=Ee;function Lr(e){e[46]=e[47].items}function Fr(e,t,n){const r=e.slice();return r[48]=t[n],r[50]=n,r}function Vr(e,t,n){const r=e.slice();return r[51]=t[n],r[53]=n,r}function Ur(e,t,n){const r=e.slice();return r[51]=t[n],r}function Wr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function zr(e){let t,n,r,i;Lr(e);const o=[Hr,qr],s=[];function a(e,t){return e[6]?1:0}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){Lr(e);let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function qr(e){let t,n;return t=new Rw({props:{schema:e[4],recID:e[7]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Hr(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:[jr]},$$scope:{ctx:e}}}),n.$on("click",e[34]);let C=e[1]&&Gr(e);o=new e[12]({props:{disabled:!e[5].length,filled:!0,$$slots:{default:[Yr]},$$scope:{ctx:e}}}),o.$on("click",e[17]);let b=e[14]&&function(e){let t,n;return t=new e[9]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}(e);function A(t){e[35](t)}let E={id:e[13]};void 0!==e[3]&&(E.value=e[3]),d=new e[10]({props:E}),oe.push(()=>Te(d,"value",A)),d.$on("input",e[19]),m=new bt({props:{size:"18"}});let S=e[46]?.length&&Zr(e),N=e[5]?.length&&Qr(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),C&&C.c(),i=V(),ke(o.$$.fragment),s=V(),b&&b.c(),a=V(),l=B("div"),c=F("Suchen: "),ke(d.$$.fragment),f=V(),h=B("span"),ke(m.$$.fragment),p=V(),g=B("div"),w=B("table"),S&&S.c(),y=V(),v=B("tbody"),N&&N.c(),H(t,"class","form--buttons svelte-4visk8"),H(h,"class","feather pointer svelte-4visk8"),X(l,"margin-bottom","1em"),X(l,"position","relative"),H(w,"striped",""),H(w,"class","svelte-4visk8"),H(g,"class","eList svelte-4visk8")},m(u,A){O(u,t,A),De(n,t,null),x(t,r),C&&C.m(t,null),x(t,i),De(o,t,null),O(u,s,A),b&&b.m(u,A),O(u,a,A),O(u,l,A),x(l,c),De(d,l,null),x(l,f),x(l,h),De(m,h,null),O(u,p,A),O(u,g,A),x(g,w),S&&S.m(w,null),x(w,y),x(w,v),N&&N.m(v,null),$=!0,I||(_=W(h,"click",e[21]),I=!0)},p(e,r){const s={};33554432&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=Gr(e),C.c(),_e(C,1),C.m(t,i)):C&&($e(),Ce(C,1,1,()=>{C=null}),Ie());const a={};32&r[0]&&(a.disabled=!e[5].length),33554432&r[1]&&(a.$$scope={dirty:r,ctx:e}),o.$set(a);const l={};!u&&8&r[0]&&(u=!0,l.value=e[3],he(()=>u=!1)),d.$set(l),e[46]?.length?S?(S.p(e,r),4&r[0]&&_e(S,1)):(S=Zr(e),S.c(),_e(S,1),S.m(w,y)):S&&($e(),Ce(S,1,1,()=>{S=null}),Ie()),e[5]?.length?N?(N.p(e,r),32&r[0]&&_e(N,1)):(N=Qr(e),N.c(),_e(N,1),N.m(v,null)):N&&($e(),Ce(N,1,1,()=>{N=null}),Ie())},i(e){$||(_e(n.$$.fragment,e),_e(C),_e(o.$$.fragment,e),_e(b),_e(d.$$.fragment,e),_e(m.$$.fragment,e),_e(S),_e(N),$=!0)},o(e){Ce(n.$$.fragment,e),Ce(C),Ce(o.$$.fragment,e),Ce(b),Ce(d.$$.fragment,e),Ce(m.$$.fragment,e),Ce(S),Ce(N),$=!1},d(e){e&&M(t),Re(n),C&&C.d(),Re(o),e&&M(s),b&&b.d(e),e&&M(a),e&&M(l),Re(d),Re(m),e&&M(p),e&&M(g),S&&S.d(),N&&N.d(),I=!1,_()}}}function jr(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Gr(e){let t,n;return t=new e[12]({props:{filled:!0,$$slots:{default:[Xr]},$$scope:{ctx:e}}}),t.$on("click",e[23]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};33554432&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Xr(e){let t;return{c(){t=F("Neu")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Yr(e){let t;return{c(){t=F("Bestätigen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Zr(e){let t,n,r,i,o,s,a,l;i=new pt({props:{size:"20",style:"color: #326173;"}});let c=e[46],d=[];for(let t=0;t<c.length;t+=1)d[t]=Kr(Ur(e,c,t));return{c(){t=B("thead"),n=B("tr"),r=B("th"),ke(i.$$.fragment),o=V();for(let e=0;e<d.length;e+=1)d[e].c();H(r,"class","svelte-4visk8"),H(n,"class","svelte-4visk8"),H(t,"class","svelte-4visk8")},m(c,u){O(c,t,u),x(t,n),x(n,r),De(i,r,null),x(n,o);for(let e=0;e<d.length;e+=1)d[e].m(n,null);s=!0,a||(l=W(r,"click",function(){N(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[46],t=0;t<c.length;t+=1){const i=Ur(e,c,t);d[t]?d[t].p(i,r):(d[t]=Kr(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){Ce(i.$$.fragment,e),s=!1},d(e){e&&M(t),Re(i),P(d,e),a=!1,l()}}}function Kr(e){let t,n,r=e[51]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-4visk8")},m(e,r){O(e,t,r),x(t,n)},p(e,t){4&t[0]&&r!==(r=e[51]?.designation+"")&&j(n,r)},d(e){e&&M(t)}}}function Qr(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[48]._id;for(let t=0;t<o.length;t+=1){let n=Fr(e,o,t),a=s(n);i.set(a,r[t]=ni(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);O(e,t,i),n=!0},p(e,n){1409069&n[0]&&(o=e[5],$e(),r=Ne(r,n,s,1,e,o,i,t.parentNode,Se,ni,t,Fr),Ie())},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)Ce(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&M(t)}}}function Jr(e){let t,n,r,i,o=e[0],s=ei(e),a=e[46],l=[];for(let t=0;t<a.length;t+=1)l[t]=ti(Vr(e,a,t));return{c(){t=B("tr"),s.c(),n=V();for(let e=0;e<l.length;e+=1)l[e].c();r=V(),H(t,"class","svelte-4visk8"),Y(t,"active",e[0].includes(e[48]._id))},m(e,o){O(e,t,o),s.m(t,null),x(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);x(t,r),i=!0},p(e,i){if(1&i[0]&&T(o,o=e[0])?($e(),Ce(s,1,1,b),Ie(),s=ei(e),s.c(),_e(s),s.m(t,n)):s.p(e,i),327716&i[0]){let n;for(a=e[46],n=0;n<a.length;n+=1){const o=Vr(e,a,n);l[n]?l[n].p(o,i):(l[n]=ti(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]&&Y(t,"active",e[0].includes(e[48]._id))},i(e){i||(_e(s),i=!0)},o(e){Ce(s),i=!1},d(e){e&&M(t),s.d(e),P(l,e)}}}function ei(e){let t,n,r;return n=new e[11]({props:{name:e[15],data:e[48]._id,checked:e[0].includes(e[48]._id),round:!0}}),{c(){t=B("td"),ke(n.$$.fragment),H(t,"title","Wählt den Wert aus"),H(t,"class","svelte-4visk8")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};32&t[0]&&(r.data=e[48]._id),33&t[0]&&(r.checked=e[0].includes(e[48]._id)),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function ti(e){let t,n,r,i=e[16](e[48],e[51])+"";return{c(){t=B("td"),n=F(i),H(t,"class",r=D(e[51].type)+" svelte-4visk8")},m(e,r){O(e,t,r),x(t,n)},p(e,o){36&o[0]&&i!==(i=e[16](e[48],e[51])+"")&&j(n,i),4&o[0]&&r!==(r=D(e[51].type)+" svelte-4visk8")&&H(t,"class",r)},d(e){e&&M(t)}}}function ni(e,t){let n,r,i,o=t[20](t[48],t[46],t[3]),s=o&&Jr(t);return{key:e,first:null,c(){n=U(),s&&s.c(),r=U(),this.first=n},m(e,t){O(e,n,t),s&&s.m(e,t),O(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[20](t[48],t[46],t[3])),o?s?(s.p(t,n),44&n[0]&&_e(s,1)):(s=Jr(t),s.c(),_e(s,1),s.m(r.parentNode,r)):s&&($e(),Ce(s,1,1,()=>{s=null}),Ie())},i(e){i||(_e(s),i=!0)},o(e){Ce(s),i=!1},d(e){e&&M(n),s&&s.d(e),e&&M(r)}}}function ri(e){let t,n;return t=new e[9]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ii(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:ri,then:zr,catch:Wr,value:47,blocks:[,,,]};return be(n=e[2]&&e[18](),i),{c(){t=U(),i.block.c()},m(e,n){O(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]())&&be(n,i)||Ae(i,e,r)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),i.block.d(e),i.token=null,i=null}}}function oi(e,i,o){let s=JSON.parse(n.getItem("Locale")).id;const a=ne(),{Loading:l,TextField:c,Checkbox:d,Button:f}=u;let h,m,p,w,{inputList:y}=i,{selection:v}=i,{item:I}=i,{target:_}=i,{className:C}=i,{classId:b}=i,{recordId:A}=i,{stopAggregation:E=!1}=i,{shouldNew:S}=i,{sort:N}=i,T=!0,k=C+Math.floor(9e3*Math.random()+1e3).toString()+"search",D=!1;v||=[];let R=v;const x=C+_+"checkbox",O=(e,t)=>{if(!t)return;let n=e[t.name];if("template"===t.type){const r=[],i=e[t.refItem.split(".").at(-1)];if("object"==typeof i){for(const e in i)r.push(i[e]?.join(","));n=r?.join(" / ")}}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?$(n):g(e[`_${t.name}`]||n||"")},M=t.getSchemaByClass(C),P=(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};ee(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(k)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await M;e.eventId===t.id&&(Aw(t.class,e.eventId),o(2,T=!o(2,T=!1)))});const B=()=>{o(6,D=!1)};return e.$$set=e=>{"inputList"in e&&o(26,y=e.inputList),"selection"in e&&o(0,v=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,b=e.classId),"recordId"in e&&o(31,A=e.recordId),"stopAggregation"in e&&o(32,E=e.stopAggregation),"shouldNew"in e&&o(1,S=e.shouldNew),"sort"in e&&o(33,N=e.sort)},[v,S,T,h,m,p,D,w,a,l,c,d,f,k,!1,x,O,()=>{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,v=t.concat(e)),R=[...v]}else o(0,v=t),R=[];a("choose",{list:v})},async()=>{o(4,m=await M),p||o(5,p=P(N||m.displaySort,await y||await $w(m.class,m.id)));const{display:e}=m;let n=await(async(e,n,r)=>{if(!e)return;let i=[];for(let o of e){if(o.includes(":")&&(o=o.split(":")[0]),"_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,m,p);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=O(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,p=P(N||m.displaySort,await $w(m.class,m.id))),e.detail?.row?._id&&v.push(e.detail.row._id),B()},B,y,I,_,C,b,A,E,N,()=>a("back"),function(e){h=e,o(3,h)}]}class si extends Oe{constructor(e){var t;super(),Br.getElementById("svelte-4visk8-style")||((t=B("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}",x(Br.head,t)),xe(this,e,oi,ii,T,{inputList:26,selection:0,item:27,target:28,className:29,classId:30,recordId:31,stopAggregation:32,shouldNew:1,sort:33},[-1,-1])}}function ai(e,t,n){const r=e.slice();return r[12]=t[n],r[45]=n,r}function li(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ci(e){let t,n;return t=new e[17]({props:{outline:!0,$$slots:{default:[ui]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};36863&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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function di(e){let t,n;return t=new Pr({props:{classId:e[5],eventId:e[6],required:e[8],disabled:e[0],formnovalidate:e[11],readonly:e[9],id:e[1]+"."+e[45],item:e[2],desc:e[3],value:e[12],noForm:e[4],praefix:e[10],recordId:e[7],multi:!0}}),{c(){ke(t.$$.fragment)},m(e,r){De(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[45]),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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ui(e){let t,n,r,i,o,s,a;n=new Pt({props:{size:"18"}});let l=e[15],c=[];for(let t=0;t<l.length;t+=1)c[t]=di(ai(e,l,t));const d=e=>Ce(c[e],1,1,()=>{c[e]=null});return{c(){t=B("span"),ke(n.$$.fragment),r=V();for(let e=0;e<c.length;e+=1)c[e].c();i=U(),H(t,"class","feather pointer")},m(l,d){O(l,t,d),De(n,t,null),O(l,r,d);for(let e=0;e<c.length;e+=1)c[e].m(l,d);O(l,i,d),o=!0,s||(a=W(t,"click",e[24]),s=!0)},p(e,t){if(36863&t[0]){let n;for(l=e[15],n=0;n<l.length;n+=1){const r=ai(e,l,n);c[n]?(c[n].p(r,t),_e(c[n],1)):(c[n]=di(r),c[n].c(),_e(c[n],1),c[n].m(i.parentNode,i))}for($e(),n=l.length;n<c.length;n+=1)d(n);Ie()}},i(e){if(!o){_e(n.$$.fragment,e);for(let e=0;e<l.length;e+=1)_e(c[e]);o=!0}},o(e){Ce(n.$$.fragment,e),c=c.filter(Boolean);for(let e=0;e<c.length;e+=1)Ce(c[e]);o=!1},d(e){e&&M(t),Re(n),e&&M(r),P(c,e),e&&M(i),s=!1,a()}}}function fi(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function hi(e){let t,n;return t=new e[19]({props:{title:e[14].designation,class:"eList",$$slots:{default:[mi]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),82084&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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function mi(e){let t,n;return t=new si({props:{selection:e[16],item:e[2],className:e[14].class,classId:e[5],recordId:e[7],inputList:e[23](),target:e[2].name,shouldNew:!e[20]+",",sort:e[21]}}),t.$on("choose",e[25]),t.$on("back",e[26]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function pi(e){let t,n,r=e[13]&&hi(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&_e(r,1)):(r=hi(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function gi(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:fi,then:ci,catch:li,value:43,blocks:[,,,]};function s(t){e[35](t)}be(e[22](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[pi]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[18]({props:a}),oe.push(()=>Te(n,"open",s)),{c(){o.block.c(),t=V(),ke(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,O(e,t,r),De(n,e,r),i=!0},p(t,i){Ae(o,e=t,i);const s={};90276&i[0]|32768&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],he(()=>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){Ce(o.blocks[e])}Ce(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&M(t),Re(n,e)}}}function wi(e,r,i){const o=ne(),{Card:s,Modal:a,Dialog:l,Button:c}=u;JSON.parse(n.getItem("Locale")).id;let d,f,h,{id:m}=r,{item:p}=r,{record:g}=r,{value:w=[]}=r,{desc:y=""}=r,{noForm:v=!1}=r,{classId:$}=r,{eventId:I}=r,{recordId:_}=r,{withRefValue:C=!1}=r,{refValue:b=""}=r,{required:A}=r,{disabled:E}=r,{readonly:S}=r,{praefix:N}=r,{selectionFields:T}=r,{formnovalidate:k}=r,{selection:D}=r,{deList:R}=r,{isTemplate:x}=r,{noList:O=!1}=r,M=!1;const{lookup:P,refStatus:B,filter:L,constraint:F,sort:V}=p.properties.multi;E=!0;const U=()=>{i(13,M=!1)};return e.$$set=e=>{"id"in e&&i(1,m=e.id),"item"in e&&i(2,p=e.item),"record"in e&&i(27,g=e.record),"value"in e&&i(12,w=e.value),"desc"in e&&i(3,y=e.desc),"noForm"in e&&i(4,v=e.noForm),"classId"in e&&i(5,$=e.classId),"eventId"in e&&i(6,I=e.eventId),"recordId"in e&&i(7,_=e.recordId),"withRefValue"in e&&i(28,C=e.withRefValue),"refValue"in e&&i(29,b=e.refValue),"required"in e&&i(8,A=e.required),"disabled"in e&&i(0,E=e.disabled),"readonly"in e&&i(9,S=e.readonly),"praefix"in e&&i(10,N=e.praefix),"selectionFields"in e&&i(30,T=e.selectionFields),"formnovalidate"in e&&i(11,k=e.formnovalidate),"selection"in e&&i(31,D=e.selection),"deList"in e&&i(32,R=e.deList),"isTemplate"in e&&i(33,x=e.isTemplate),"noList"in e&&i(34,O=e.noList)},e.$$.update=()=>{if(134217860&e.$$.dirty[0]&&g&&!_&&!p.properties.multi.lookup){const e=g[p.name];Array.isArray(e)&&0===e.length&&i(15,f=[])}},[E,m,p,y,v,$,I,_,A,S,N,k,w,M,d,f,h,s,a,l,P,V,async()=>{if(i(15,f=[].concat(w)),p.refEvent){const e=await t.getSchemas();i(14,d=e.find(e=>e.identity.name===p.refEvent))}else i(14,d=await t.getSchemaByClass(p.refClass))},async()=>{let e,n;if(P)if(P.refClass){if(g[P.refClass]){const r=await bw(P.refClass,g[P.refClass]);r&&Array.isArray(r[P.refItem])&&(n=[{$match:{_id:{$in:r[P.refItem]}}}],e=await t.getSectionView(d.class,n,!0))}}else n=[{$match:{[P]:g[P]}}],B&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":B}}])),e=await t.getSectionView(d.class,n,!0);else if(B){const n=await t.getTasksListStatus(d.id,B);n?.data?.length&&(e=n.data)}else e=await $w("",d.id);if(!e?.length)return[];if(F&&e?.length){const{refClass:r,refStatus:i}=F;if(i){const 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)))}else e=e.filter(e=>e[r]===g[r])}if(L)for(const t in L)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},()=>{S||(i(13,M=!0),i(16,h=f))},({detail:e})=>{g.__id||(i(15,f=e.list),o("change",{value:f}),o("multi",{lookup:P,filter:L,name:p.name,value:f})),U()},U,g,C,b,T,D,R,x,O,function(e){M=e,i(13,M)}]}class yi extends Oe{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=B("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",x(document.head,t)),xe(this,e,wi,gi,T,{id:1,item:2,record:27,value:12,desc:3,noForm:4,classId:5,eventId:6,recordId:7,withRefValue:28,refValue:29,required:8,disabled:0,readonly:9,praefix:10,selectionFields:30,formnovalidate:11,selection:31,deList:32,isTemplate:33,noList:34},[-1,-1])}}const vi=/\d+/g,$i=/%[HMSpPdmyY%]/g;function Ii(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split($i);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{vi.lastIndex=s;const o=vi.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 _i(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Ci}=Ee;function bi(e,t,n){const r=e.slice();return r[17]=t[n],r}function Ai(e,t,n){const r=e.slice();return r[20]=t[n],r}function Ei(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Si(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]=Ti(Ai(e,m,t));const g=e=>Ce(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&ki(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[Ri]},$$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:[xi]},$$scope:{ctx:e}}}),{c(){t=B("form"),n=B("input"),i=V();for(let e=0;e<p.length;e+=1)p[e].c();o=V(),w&&w.c(),s=V(),a=B("div"),ke(l.$$.fragment),c=V(),ke(d.$$.fragment),H(n,"class",D(e[6])+" svelte-1phofh5"),H(n,"name","_id"),H(n,"type","hidden"),n.value=r=e[1]._id||"",H(t,"class","fTask svelte-1phofh5"),H(t,"id",e[6]),H(a,"class","form--buttons svelte-1phofh5")},m(r,m){O(r,t,m),x(t,n),x(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);x(t,o),w&&w.m(t,null),O(r,s,m),O(r,a,m),De(l,a,null),x(a,c),De(d,a,null),u=!0,f||(h=[W(t,"keydown",e[8]),W(t,"submit",z(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=Ai(e,m,n);p[n]?(p[n].p(r,i),_e(p[n],1)):(p[n]=Ti(r),p[n].c(),_e(p[n],1),p[n].m(t,o))}for($e(),n=m.length;n<p.length;n+=1)g(n);Ie()}e[0].list?w?(w.p(e,i),1&i&&_e(w,1)):(w=ki(e),w.c(),_e(w,1),w.m(t,null)):w&&($e(),Ce(w,1,1,()=>{w=null}),Ie());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)Ce(p[e]);Ce(w),Ce(l.$$.fragment,e),Ce(d.$$.fragment,e),u=!1},d(e){e&&M(t),P(p,e),w&&w.d(),e&&M(s),e&&M(a),Re(l),Re(d),f=!1,S(h)}}}function Ni(e){let t,n;return t=new ah({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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ti(e){let t,n,r=Pi(!0,e[20]),i=r&&Ni(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(e,t,r),n=!0},p(e,n){1&n&&(r=Pi(!0,e[20])),r?i?(i.p(e,n),1&n&&_e(i,1)):(i=Ni(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function ki(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Di(bi(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(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=bi(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=Di(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}function Di(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new Xi({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(){ke(t.$$.fragment),n=V(),ke(r.$$.fragment)},m(e,o){De(t,e,o),O(e,n,o),De(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){Ce(t.$$.fragment,e),Ce(r.$$.fragment,e),i=!1},d(e){Re(t,e),e&&M(n),Re(r,e)}}}function Ri(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function xi(e){let t;return{c(){t=F("Speichern")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Oi(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Mi(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Oi,then:Si,catch:Ei,value:16,blocks:[,,,]};return be(e[7](),i),{c(){t=V(),n=B("section"),i.block.c(),Ci.title="Vorgaben",H(n,"class","sTask svelte-1phofh5")},m(e,o){O(e,t,o),O(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){Ae(i,e=t,n)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),e&&M(n),i.block.d(),i.token=null,i=null}}}const Pi=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Bi(e,r,o){let l,c,d;k(e,s,e=>o(11,c=e)),k(e,i,e=>o(12,d=e));const{Divider:f,Button:h,FormField:m}=u,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 Ii(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&&o(0,g=e.schema),"record"in e&&o(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&o(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)&&o(2,v=!0),c.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>d?.find(t=>t===e.role&&"edit"===e.activity));o(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:Li}=Ee;function Fi(e,t,n){const r=e.slice();return r[52]=t[n],r}function Vi(e){let t,n;return t=new ah({props:{classId:e[6],item:e[52],listName:e[3].name,allowFutureUpdate:e[12],eventId:e[7],record:e[0],multiValues:e[4],allowedValues:e[5]&&e[5][e[52].name],disabled:e[8],required:e[9],currency:e[11],notifyList:e[1]}}),t.$on("notify",e[20]),t.$on("notify2",e[19]),t.$on("defPrep",e[22]),t.$on("formula",e[24]),t.$on("task",e[30]),t.$on("multi",e[25]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.classId=e[6]),8&n[0]&&(r.item=e[52]),8&n[0]&&(r.listName=e[3].name),4096&n[0]&&(r.allowFutureUpdate=e[12]),128&n[0]&&(r.eventId=e[7]),1&n[0]&&(r.record=e[0]),16&n[0]&&(r.multiValues=e[4]),40&n[0]&&(r.allowedValues=e[5]&&e[5][e[52].name]),256&n[0]&&(r.disabled=e[8]),512&n[0]&&(r.required=e[9]),2048&n[0]&&(r.currency=e[11]),2&n[0]&&(r.notifyList=e[1]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ui(e){let t,n,r=Pi(e[10],e[52]),i=r&&Vi(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(e,t,r),n=!0},p(e,n){1032&n[0]&&(r=Pi(e[10],e[52])),r?i?(i.p(e,n),1032&n[0]&&_e(i,1)):(i=Vi(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function Wi(e){let t,n,r,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Ui(Fi(e,i,t));const s=e=>Ce(o[e],1,1,()=>{o[e]=null});return{c(){t=B("div");for(let e=0;e<o.length;e+=1)o[e].c();H(t,"id",n=`accordion-content-${e[6]}-${e[3].name}`)},m(e,n){O(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(56107003&a[0]){let n;for(i=e[3].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]=Ui(r),o[n].c(),_e(o[n],1),o[n].m(t,null))}for($e(),n=i.length;n<o.length;n+=1)s(n);Ie()}(!r||72&a[0]&&n!==(n=`accordion-content-${e[6]}-${e[3].name}`))&&H(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)Ce(o[e]);r=!1},d(e){e&&M(t),P(o,e)}}}function zi(e){let t,n,r=e[18](e[13])+"";return{c(){t=B("span"),n=F(r)},m(e,r){O(e,t,r),x(t,n)},p(e,t){8192&t[0]&&r!==(r=e[18](e[13])+"")&&j(n,r)},d(e){e&&M(t)}}}function qi(e){let t,n,r;return n=new e[15]({props:{$$slots:{default:[zi]},$$scope:{ctx:e}}}),n.$on("click",function(){N(e[21](e[51]))&&e[21](e[51]).apply(this,arguments)}),{c(){t=B("div"),ke(n.$$.fragment),H(t,"class","accordion svelte-p2ws74"),H(t,"slot","handle")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(t,r){e=t;const i={};8192&r[0]|16777216&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Hi(e){let t,n;return t=new e[17]({props:{class:e[14],open:e[2],$$slots:{handle:[qi,({toggle:e})=>({51:e}),({toggle:e})=>[0,e?1048576:0]],default:[Wi,({toggle:e})=>({51:e}),({toggle:e})=>[0,e?1048576:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[23]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.class=e[14]),4&n[0]&&(r.open=e[2]),16379&n[0]|17825792&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ji(e){let t,n,r;return n=new e[16]({props:{$$slots:{default:[Hi]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),H(t,"class","formList")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};32767&t[0]|16777216&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Gi(e,n,r){const{Button:i,Accordion:o,AccordionSection:s}=u,a=ne();let{list:l}=n,{multiValues:c}=n,{allowedValues:d}=n,{schema:f}=n,{record:h}=n,{classId:m}=n,{eventId:p}=n,{disabled:v}=n,{required:I}=n,{open:_=!1}=n,{template:C={}}=n,{isTemplate:b=!1}=n,{currency:A}=n,{update:E=!1}=n,{notifyList:S}=n,{allowFutureUpdate:N}=n,{updateRec:T}=n;_||=void 0!==T;let k=new Map;const D={};let R,x=h[l.name]||{},O=[];h[l.name]=x;const M=(e,t)=>""===t[e.name]?"":e._attr?P(e,t[e.name]):"object"===e.type?L(t[e.name]):Array.isArray(t[e.name])?B(t[e.name]):"boolean"===e.type?$(t[e.name]):"number"===e.type?F(t[e.name],e.properties?.decimals||0):"dateRange"===e.type?y(e.name,t):"date"===e.type?g(((e,t=!1)=>{if(!e)return"";try{if(e.split&&3===e.split("-").length)return new Date(e)?.toISOString();if(e.split&&3===e.split(".").length){const[t,n,r]=e.split("."),i=new Date(r,n-1,t);if(!isNaN(i))return i.toISOString()}}catch{}return t?e:""})(t[e.name])):"datetime"===e.type?w(t[e.name]):e.properties?.multi?"":t[e.name],P=(e,t)=>D[t]?.split(" • ").at(e._attr),B=e=>e.slice(0,3).join(", "),L=e=>D[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),F=(e,t)=>(t||=0,"number"==typeof e&&e||(e=Number(e||0)),isNaN(e)&&(e=0),(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t));["readonly","hidden","required"].map(e=>{f.filter(t=>"object"==typeof(t.properties&&t.properties[e])).forEach(t=>{const n=t.properties[e].refItem||"",r=t.properties[e].refValue,i=t.properties[e].refContent;let[o,s]=n.split(".");s||(s=o,o=void 0),o||f.find(e=>e.name===s)?O.push({action:e,itemName:t.name,refObj:o,refName:s,refValue:r,refContent:i,op:t.properties[e].invert?"!":""}):O.push({action:e,itemName:s,refObj:o,refName:t.name,refValue:r,refContent:i,op:t.properties[e].invert?"!":"",revert:!0})})});const V=async e=>{const t=e.split(".")[1]||e,n=O.filter(n=>n.refObj===e||n.refName===t||n.itemName===n.refName);if(n?.length)for(const e of n){const{refObj:t,refName:n,refValue:r,refContent:i,op:o,revert:s}=e;let a,c,{itemName:d,action:u}=e,f=!1,p=h[l.name+"."+n];if(t){const e=h[t];e&&(f=await getTaskFull(t,e))}i?p=void 0===p||p==i:!s&&f&&(p=f[n],Array.isArray(p)&&0===p.length?p=!1:r&&(p=p==(f[r]||h[r]))),!p&&s&&void 0!==h[d]&&(p=h[d]),void 0===p&&(p=h[l.name][n]),"!"===o&&(p=!p),s&&(d=n);const g=`#accordion-content-${m}-${l.name} .form-field.${d}`;"required"!==u&&"readonly"!==u||(u="required"===u?u:"disabled",setTimeout(()=>{if(a=`${g} .field textarea`,c=document.querySelector(a),c){const e=`${g} .field input`,t=document.querySelector(e);t&&p&&t.setAttribute(u,""),t&&!p&&t.removeAttribute(u)}c||(a=`${g} .field input#${"dp-"+d}`,c=document.querySelector(a)),c||(a=`${g} .field input`,c=document.querySelector(a)),c&&p&&c.setAttribute(u,""),c&&!p&&c.removeAttribute(u)},0)),"hidden"===u&&(c=document.querySelector(g),c?.classList&&c.classList.toggle("hidden",p))}},U=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)},W=()=>{for(const e of f)e.ocr||h[l.name][e.name]||("boolean"==typeof e.properties?.value&&r(0,h[l.name][e.name]=e.properties.value,h),"string"==typeof e.properties?.value&&r(0,h[l.name][e.name]=e.properties.value,h),"number"==typeof e.properties?.value&&r(0,h[l.name][e.name]=e.properties.value,h))},z=e=>{if(!e)return;const t=e.properties.value.formula,{operator:n,argument:i}=t,o=i.map(e=>h[l.name][e.refItem]);if("$preferred"===n){if(h._id&&void 0!==h[l.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,h[l.name][e.name]=t,h)}},q=async({item:e,value:t})=>{const n=f.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,a=s.map(n=>n.refItem===e.name?t:x[n.refItem]||h[n.refItem]);let c=0;"$add"===o&&(c=a.reduce((e,t)=>+(e||0)+ +(t||0))),r(0,h[l.name][n.name]=F(c,n.properties?.decimals),h)},H=()=>{setTimeout(()=>{const e=f.find(e=>e.properties?.checkOnValid);if(e&&!x[e.name])return void r(14,R="");let t=`#accordion-content-${m}-${l.name} .form-field:not(.hidden) .field :required:not(:disabled)`;const n=document.querySelectorAll(t);let i=!1;n.forEach(e=>{!e.id.startsWith("dp-")&&e.required&&""===e.value&&(i=!0)}),i||(t=`#accordion-content-${m}-${l.name} :not(.form-field.hidden) .field input.invalid`,document.querySelector(t)&&(i=!0)),r(14,R=i?"invalid":"")},0)};return ee(()=>(O?.length&&Array.from(new Set(O.map(e=>e.refName))).forEach(V),H())),e.$$set=e=>{"list"in e&&r(3,l=e.list),"multiValues"in e&&r(4,c=e.multiValues),"allowedValues"in e&&r(5,d=e.allowedValues),"schema"in e&&r(26,f=e.schema),"record"in e&&r(0,h=e.record),"classId"in e&&r(6,m=e.classId),"eventId"in e&&r(7,p=e.eventId),"disabled"in e&&r(8,v=e.disabled),"required"in e&&r(9,I=e.required),"open"in e&&r(2,_=e.open),"template"in e&&r(27,C=e.template),"isTemplate"in e&&r(10,b=e.isTemplate),"currency"in e&&r(11,A=e.currency),"update"in e&&r(28,E=e.update),"notifyList"in e&&r(1,S=e.notifyList),"allowFutureUpdate"in e&&r(12,N=e.allowFutureUpdate),"updateRec"in e&&r(29,T=e.updateRec)},e.$$.update=()=>{268435465&e.$$.dirty[0]&&E&&h&&r(13,x=h[l.name]||{}),2&e.$$.dirty[0]&&S&&H(),536870912&e.$$.dirty[0]&&(e=>{if(W(),e)for(const t of f)e[l.name]?void 0!==e[l.name][t.name]&&r(0,h[l.name][t.name]=e[l.name][t.name],h):r(0,h[l.name][t.name]="",h)})(T)},[h,S,_,l,c,d,m,p,v,I,b,A,N,x,R,i,o,s,e=>{let t=f;return l.display?.refItem&&(t=l.display.refItem.map(e=>{const[t,n]=e.split("."),r=f.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=>M(t,e)).filter(e=>!!e).join(" • ")||"+"},({detail:e})=>{ue().then(()=>{const{itemName:t,value:n}=e;r(13,x={...x,[t]:n})})},({detail:e})=>{const{itemName:t,value:n,desc:i}=e,[o,s]=t.split(".");if(!s)return;const a=f.filter(e=>"$preferred"===e.properties?.value?.formula?.operator);for(const e of a)z(e);V(t),r(1,S={listName:l.name,itemName:t,value:n}),i&&(D[s]=i);const c=h[o];r(0,h[o]={...c,[s]:n},h),f.filter(e=>!e.refItem&&e.refInput===s).forEach(e=>{const t=h[o];r(0,h[o]={...t,[e.name]:n},h)}),r(13,x=h[o]),H()},e=>t=>{(()=>{const e=C[l.name]||{};for(const t in e)C[l.name][t]&&!h[l.name][t]&&r(0,h[l.name][t]=C[l.name][t],h)})(),e(t);const n=`#accordion-content-${m}-${l.name} > div.form-field:last-child`;document.querySelector(n),ue().then(()=>{const e=`#accordion-content-${m}-${l.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(U)})},async({detail:{className:e,itemName:n,value:r,valueItem:i}})=>{if(k.has(e))return;if(i&&(r+="."+i),!0!==r&&(r=(r=[].concat(r)).some(e=>e===className+"."+l.name)),!r)return;const o={[n]:!0},s=await t.getSectionView(e,o);s?.length&&k.set(e,s[0])},()=>{setTimeout(()=>{Array.from(k).forEach(([e,t])=>{h[l.name][e]||r(0,h[l.name][e]=t._id,h)})},200)},({detail:e})=>{q(e)},({detail:e})=>{e.objectName=l.name,a("multi",e)},f,C,E,T,function(t){re(e,t)}]}class Xi extends Oe{constructor(e){var t;super(),Li.getElementById("svelte-p2ws74-style")||((t=B("style")).id="svelte-p2ws74-style",t.textContent=".accordion.svelte-p2ws74{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}}.panel.invalid .btn{border:1px #b80000 solid}",x(Li.head,t)),xe(this,e,Gi,ji,T,{list:3,multiValues:4,allowedValues:5,schema:26,record:0,classId:6,eventId:7,disabled:8,required:9,open:2,template:27,isTemplate:10,currency:11,update:28,notifyList:1,allowFutureUpdate:12,updateRec:29},[-1,-1])}}const{document:Yi}=Ee;function Zi(e){e[0]=e[23].list,e[22]=e[23].items}function Ki(e,t,n){const r=e.slice();return r[24]=t[n],r}function Qi(e,t,n){const r=e.slice();return r[27]=t[n],r}function Ji(e,t,n){const r=e.slice();return r[27]=t[n],r}function eo(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function to(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)}Zi(e),n=new e[7]({props:{outline:!0,$$slots:{default:[no]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),oe.push(()=>Te(s,"value",v)),s.$on("input",e[12]),d=new bt({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]=ro(Ji(e,r,t));return{c(){t=B("thead"),n=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();H(n,"class","svelte-14hcfjl"),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(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=Ji(e,r,o);i[o]?i[o].p(s,t):(i[o]=ro(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&&M(t),P(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]=so(Ki(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);O(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=Ki(e,n,o);r[o]?r[o].p(s,i):(r[o]=so(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){P(r,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("div"),o=F("Suchen: "),ke(s.$$.fragment),l=V(),c=B("span"),ke(d.$$.fragment),u=V(),f=B("div"),h=B("table"),I&&I.c(),m=V(),p=B("tbody"),_&&_.c(),H(t,"class","form--buttons svelte-14hcfjl"),H(c,"class","feather pointer svelte-14hcfjl"),X(i,"margin-bottom","1em"),X(i,"position","relative"),H(h,"striped",""),H(h,"class","svelte-14hcfjl"),H(f,"class","eList svelte-14hcfjl")},m(a,v){O(a,t,v),De(n,t,null),O(a,r,v),O(a,i,v),x(i,o),De(s,i,null),x(i,l),x(i,c),De(d,c,null),O(a,u,v),O(a,f,v),x(f,h),I&&I.m(h,null),x(h,m),x(h,p),_&&_.m(p,null),g=!0,w||(y=W(c,"click",e[14]),w=!0)},p(e,t){Zi(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],he(()=>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){Ce(n.$$.fragment,e),Ce(s.$$.fragment,e),Ce(d.$$.fragment,e),g=!1},d(e){e&&M(t),Re(n),e&&M(r),e&&M(i),Re(s),Re(d),e&&M(u),e&&M(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function no(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ro(e){let t,n,r=e[27]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function io(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=oo(Qi(e,r,t));return{c(){t=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=V(),H(t,"class","pointer svelte-14hcfjl")},m(e,r){O(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);x(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Qi(e,r,s);i[s]?i[s].p(a,o):(i[s]=oo(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&&M(t),P(i,e)}}}function oo(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=B("td"),n=F(o),H(t,"class","svelte-14hcfjl")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&M(t),r=!1,i()}}}function so(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&io(e);return{c(){r&&r.c(),t=U()},m(e,n){r&&r.m(e,n),O(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=io(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&M(t)}}}function ao(e){let t,n;return t=new e[5]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function lo(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:ao,then:to,catch:eo,value:23,blocks:[,,,]};return be(e[11](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function co(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[lo]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function uo(e,n,r){const i=ne(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:c}=u;let{item:d}=n,{className:f}=n,{classId:h}=n,{list:m}=n,p="",w=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):g(e[`_${t.name}`]||e[t.name]||"")},v=t.getSchemaByClass(f);ee(()=>{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,d=e.item),"className"in e&&r(16,f=e.className),"classId"in e&&r(17,h=e.classId),"list"in e&&r(0,m=e.list)},[m,p,i,o,s,a,l,c,w,y,e=>()=>i("choose",{row:e}),async()=>{const e=await v,t=e.display;let n=await kn(t,e,m);return{list:m,items:n}},({detail:{value:e}})=>{r(1,p=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(y(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,p="")},d,f,h,()=>i("back"),function(e){p=e,r(1,p)}]}class fo extends Oe{constructor(e){var t;super(),Yi.getElementById("svelte-14hcfjl-style")||((t=B("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}",x(Yi.head,t)),xe(this,e,uo,co,T,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:ho}=Ee;function mo(e,t,n){const r=e.slice();return r[12]=t[n],r}function po(e,t,n){const r=e.slice();return r[4]=t[n],r}function go(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function wo(e){let t,n,r,i=e[8].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=Co(po(e,i,t));const s=e=>Ce(o[e],1,1,()=>{o[e]=null});let a=e[8].list&&bo(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=V(),a&&a.c(),n=U()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);O(e,t,i),a&&a.m(e,i),O(e,n,i),r=!0},p(e,r){if(127764431&r[0]){let n;for(i=e[8].items,n=0;n<i.length;n+=1){const s=po(e,i,n);o[n]?(o[n].p(s,r),_e(o[n],1)):(o[n]=Co(s),o[n].c(),_e(o[n],1),o[n].m(t.parentNode,t))}for($e(),n=i.length;n<o.length;n+=1)s(n);Ie()}e[8].list?a?(a.p(e,r),256&r[0]&&_e(a,1)):(a=bo(e),a.c(),_e(a,1),a.m(n.parentNode,n)):a&&($e(),Ce(a,1,1,()=>{a=null}),Ie())},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)Ce(o[e]);Ce(a),r=!1},d(e){P(o,e),e&&M(t),a&&a.d(e),e&&M(n)}}}function yo(e){let t,n,r,i;const o=[$o,vo],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=U()},m(e,n){~t&&s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie()),~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){Ce(n),i=!1},d(e){~t&&s[t].d(e),e&&M(r)}}}function vo(e){let t,n,r,i;n=new ah({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]}}),n.$on("notify",e[18]),n.$on("multi",e[19]),n.$on("defPrep",e[20]);let o=e[4].name===e[15]&&!!e[1]&&Io(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(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]),257&r[0]&&(i.disabled=e[4].name===e[15]&&e[16]||e[0]),64&r[0]&&(i.eventId=e[6]),4&r[0]&&(i.notifyList=e[2]),8&r[0]&&(i.currency=e[3]),1024&r[0]&&(i.changeValue=e[10]),n.$set(i),e[4].name===e[15]&&e[1]?o?(o.p(e,r),258&r[0]&&_e(o,1)):(o=Io(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function $o(e){let t,n,r,i;n=new ah({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]&&_o(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"padding-top",".25em"),X(t,"background-color","lightyellow"),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(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=_o(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Io(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[26]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function _o(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[23]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Co(e){let t,n,r="list"!==e[4].type&&yo(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){"list"!==e[4].type?r?(r.p(e,n),256&n[0]&&_e(r,1)):(r=yo(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function bo(e){let t,n,r=e[8].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Eo(mo(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(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=mo(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=Eo(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}function Ao(e){let t,n,r,i,o;function s(t){e[32](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 Xi({props:a}),oe.push(()=>Te(r,"notifyList",s)),{c(){ke(t.$$.fragment),n=V(),ke(r.$$.fragment)},m(e,i){De(t,e,i),O(e,n,i),De(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],he(()=>i=!1)),r.$set(s)},i(e){o||(_e(t.$$.fragment,e),_e(r.$$.fragment,e),o=!0)},o(e){Ce(t.$$.fragment,e),Ce(r.$$.fragment,e),o=!1},d(e){Re(t,e),e&&M(n),Re(r,e)}}}function Eo(e){let t,n,r="array"!==e[12].type&&Ao(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){"array"!==e[12].type?r?(r.p(e,n),256&n[0]&&_e(r,1)):(r=Ao(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function So(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function No(e){let t,n;return t=new fo({props:{item:e[4],className:e[5],classId:e[9],list:e[12]}}),t.$on("choose",e[21]),t.$on("back",e[22]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function To(e){let t,n,r=e[11]&&No(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[11]?r?(r.p(e,n),2048&n[0]&&_e(r,1)):(r=No(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function ko(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:So,then:wo,catch:go,value:57,blocks:[,,,]};function l(t){e[33](t)}be(e[17](),a),n=new e[13]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[To]},$$scope:{ctx:e}};return void 0!==e[11]&&(c.open=e[11]),i=new e[14]({props:c}),oe.push(()=>Te(i,"open",l)),{c(){a.block.c(),t=V(),ke(n.$$.fragment),r=V(),ke(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,O(e,t,o),De(n,e,o),O(e,r,o),De(i,e,o),s=!0},p(t,n){Ae(a,e=t,n);const r={};6704&n[0]|1&n[2]&&(r.$$scope={dirty:n,ctx:e}),!o&&2048&n[0]&&(o=!0,r.open=e[11],he(()=>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){Ce(a.blocks[e])}Ce(n.$$.fragment,e),Ce(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&M(t),Re(n,e),e&&M(r),Re(i,e)}}}function Do(e,n,r){const{Divider:i,FormField:o,Modal:s}=u,a=ne();let l,c,d,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={},b=[],A=[],E={},S=new Map,N=!1,T="";const k=y.checkOn,D=v,R=e=>{l.items.filter(t=>"object"==typeof(t.properties&&t.properties[e])).map(t=>{const n=t.properties[e].refItem||"",[r,i]=n.split(".");b.push({action:e,itemName:t.name,refObj:r,refName:i,op:t.properties[e].invert?"!":""})})},x=()=>{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=b.filter(t=>t.refObj===e);if(t?.length){r(10,E={});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,d=!i&&C[n];const u=C[n];u&&i&&(d=(await bw(n,u))[i]),Array.isArray(d)&&0===d.length&&(d=!1),"!"===o&&(d=!d),"required"!==s&&"readonly"!==s||(s="required"===s?s:"disabled",setTimeout(()=>{a=`#${c} .form-field.${t} .field textarea`,l=document.querySelector(a),l||(a=`#${c} .form-field.${t} .field input`,l=document.querySelector(a)),l&&d&&l.setAttribute(s,""),l&&!d&&l.removeAttribute(s)},0)),"hidden"===s&&(a=`#${c} .form-field.${t}`,l=document.querySelector(a),l?.classList?.toggle("hidden",!!d),d&&r(10,E[t]="",E))}}};ee(()=>{M()});const M=async()=>{const e=e=>new Promise(t=>setTimeout(t,e));let t,n=0;for(;!(t=document.getElementById(c))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of b)e.add(t.refObj||d);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(d,n);i?.length?(r(12,T=i),r(11,N=!0)):(r(1,v=""),r(27,$=""),a("setRefValue",$))},L=()=>{r(11,N=!1)},F=()=>{r(1,v=""),r(27,$=v),r(7,C={}),a("setRefValue",$)};return e.$$set=e=>{"required"in e&&r(28,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(29,g=e.readonly),"id"in e&&r(30,w=e.id),"item"in e&&r(4,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(27,$=e.refValue),"currency"in e&&r(3,I=e.currency),"notifyList"in e&&r(2,_=e.notifyList)},e.$$.update=()=>{536870913&e.$$.dirty[0]&&r(0,p=p||g),224&e.$$.dirty[0]|1&e.$$.dirty[1]&&C&&a("safeReference",{record:C,class:d,event:f,taskId:h})},[p,v,_,I,y,d,f,C,l,c,E,N,T,i,s,k,D,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(7,C=e),r(31,h=(await t.getTaskByDocId(e._id,!0))._id)}else r(7,C={})}catch{}return r(8,l=await t.getSchemaByClass(y.refClass)),r(9,c="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(5,d=l.class),l.identity.designation,r(6,f=l.id),["readonly","hidden","required"].map(R),x(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(7,C[t]=n,C),t===k)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===d)),!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(d,{_id:e.row._id});n?.length&&(r(1,v=n[0]._id),r(27,$=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)},async()=>{if(!v)return;let e=await Iw(y.refClass,l.id,v);e._task||(e={_task:await t.getTaskByDocId(v,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},$,m,g,w,h,function(e){_=e,r(2,_)},function(e){N=e,r(11,N)}]}class Ro extends Oe{constructor(e){var t;super(),ho.getElementById("svelte-16mo2c-style")||((t=B("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",x(ho.head,t)),xe(this,e,Do,ko,T,{required:28,disabled:0,readonly:29,id:30,item:4,value:1,refValue:27,currency:3,notifyList:2},[-1,-1,-1])}}function xo(e){let t,n;return{c(){t=B("span"),n=F(e[5]),H(t,"class","item")},m(e,r){O(e,t,r),x(t,n)},p(e,t){32&t[0]&&j(n,e[5])},d(e){e&&M(t)}}}function Oo(e){let t,n,r,i=e[6]&&xo(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Übernehmen"),H(t,"class","pointer feather svelte-1fuww0c")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[17]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=V(),o&&o.c(),n=U()},m(e,s){i&&i.m(e,s),O(e,t,s),o&&o.m(e,s),O(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=xo(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){Ce(o),r=!1},d(e){i&&i.d(e),e&&M(t),o&&o.d(e),e&&M(n)}}}function Mo(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=B("div"),ke(n.$$.fragment),X(t,"position","relative"),X(t,"max-width","10em")},m(e,i){O(e,t,i),De(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]|262144&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Po(e,r,i){const o=ne(),{TextField:s}=u;let{id:a}=r,{item:l}=r,{widget:c}=r,{value:d}=r,{record:f}=r,{noForm:h=!1}=r,{classId:m}=r,{disabled:p}=r,{formnovalidate:g}=r,{currency:w}=r,{ownCurrency:y}=r,{praefix:v}=r,{notifyList:$}=r,{isNew:I}=r;const C=JSON.parse(n.getItem("Locale"));let b=w,A=["price","amount","amountValue","taxValue","total","__total"].find(e=>e===l.name?.split("-")[0])||l.properties?.currency;!1===l.properties?.currency&&(A=!1),"owner.currency"===l.properties?.currency&&(b=y);const E=Number("1.1").toLocaleString(C.id).substring(1,2),{properties:S={}}=l;let{min:N,max:T,step:k,pattern:D,decimals:R=0,unit:x="",placeholder:O,hint:M,readonly:P,negative:B,required:L=!1,transfer:F,zeroNotAllowed:V=!1,showNative:U}=S,W="";A&&void 0===S?.decimals&&(R=2),d=d?Number(d.toString().replace(",",".")):0;let z,q=!1;P=!0===P||void 0;var H=new Intl.NumberFormat(C.id,{minimumFractionDigits:R});const j=async(e,n)=>{if(!c)return n;if(z)return z;if(q)return n;if(q=!0,!e.properties?.filter)return n;const{_state:r,_date:i,_diff:o,_lt:s,_count:a,_compare:l,value:d}=e.properties.filter,u=[{$match:{[c.schema.class]:c.value}}];if(l){const{refItem:e,value:t,op:n}=l;""===t&&"ne"===n?u.push({$match:{[e]:{$nin:["",void 0]}}}):u.push({$match:{[e]:{["$"+n]:t}}})}if(r&&u.push({$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":r}}),i){const{refItem:e,operator:t}=i,{first:n,last:r}=X(t);u.push({$match:{[e]:{$gte:n,$lte:r}}})}else s&&u.push({$match:{[s]:{$lt:(new Date).toISOString()}}});let f=[];if(o){for(const e of o)e.includes(".")&&f.push(e.split(".")[0]);for(const t of f)u.push({$lookup:{from:t,localField:"_id",foreignField:e.refClass,as:t}},{$unwind:{path:"$"+t,preserveNullAndEmptyArrays:!0}},{$match:{[t]:{$exists:!0}}})}let h=await t.getTasksWidgetFiltered(e.refClass,u);if(h?.length)if(a)n=h.length;else if(o)n=h.map(e=>function(e,t){if(!e||!t)return 0;const n=new Date(e),r=new Date(t).getTime()-n.getTime();return Math.round(r/864e5)}(_(e,o[0]),_(e,o[1]))).reduce((e,t)=>e+t,0)/h.length;else if(d.includes(".")){const[e,t]=d.split(".");n=h.reduce((n,r)=>n+r[e].reduce((e,n)=>e+ +(n[t]||0),0),0)}else n=h.reduce((e,t)=>e+ +(t[d]||0),0);else n="";return z=n,n},G=e=>function(e,t){return(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t)}(Number(e.toString()),R).replace(".",E);D||(D=R?`[0-9]+([${E}][0-9]{1,${R}})?`:"[0-9]*"),B&&(D="-?"+D);const X=(e,t=0)=>{const n=new Date;n.setDate(n.getDate()-t);let r=n.getFullYear();const i=n.getMonth(),o=n.getDate();let s,a,l=r,c=0;switch(e){case"currentSemiYear":s=i<6?0:6,a=s+5;break;case"currentQuarter":s=i<3?0:i>6?3:i<9?6:9,a=s+2;break;case"currentMonth":s=a=i;break;case"currentDay":l=2e3,s=0,a=i-1,c=o;break;case"prevYear":l-=1,r-=1,s=0,a=s+11;break;default:s=0,a=s+11}return{first:new Date(l,s,1).toISOString(),last:new Date(r,a+1,c).toISOString()}};return e.$$set=e=>{"id"in e&&i(0,a=e.id),"item"in e&&i(19,l=e.item),"widget"in e&&i(20,c=e.widget),"value"in e&&i(18,d=e.value),"record"in e&&i(21,f=e.record),"noForm"in e&&i(1,h=e.noForm),"classId"in e&&i(2,m=e.classId),"disabled"in e&&i(3,p=e.disabled),"formnovalidate"in e&&i(22,g=e.formnovalidate),"currency"in e&&i(23,w=e.currency),"ownCurrency"in e&&i(24,y=e.ownCurrency),"praefix"in e&&i(25,v=e.praefix),"notifyList"in e&&i(26,$=e.notifyList),"isNew"in e&&i(27,I=e.isNew)},e.$$.update=()=>{25690112&e.$$.dirty[0]&&w&&("owner.currency"===l.properties?.currency?i(5,b=y):i(5,b=w)),4194320&e.$$.dirty[0]&&i(4,L=L&&!g),262144&e.$$.dirty[0]&&(async e=>{e=await j(l,e),i(9,W=V&&!+e||I&&L&&!+e?"":G((e||"0").toString().replace(",","."))),(c||!0===p&&!U)&&i(9,W=isNaN(e)?"":H.format(W)),d!==e&&i(18,d=e)})(d),67108864&e.$$.dirty[0]&&(async()=>{const e=l.properties?.value?.formula;if(e)void 0!==v&&""!==v?e?.operator?.multiply&&o("formula",{item:l}):e?.operator&&o("formula",{item:l})})()},[a,h,m,p,L,b,A,D,P,W,s,C,k,O,F,e=>{const{detail:t}=e;void 0!==v&&""!==v||o("formula",{item:l,value:t.value}),o("blur",{value:G(t.value)})},({detail:e})=>{P||+d||i(9,W="")},({detail:e})=>{const t=[].concat(F.target);if(void 0===v||""===v)for(const e of t)o("record",{itemName:e,value:d});else for(const e of t)o("listRecord",{itemName:e,decimals:l.properties?.decimals,value:d})},d,l,c,f,g,w,y,v,$,I]}class Bo extends Oe{constructor(e){var t;super(),document.getElementById("svelte-1fuww0c-style")||((t=B("style")).id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",x(document.head,t)),xe(this,e,Po,Mo,T,{id:0,item:19,widget:20,value:18,record:21,noForm:1,classId:2,disabled:3,formnovalidate:22,currency:23,ownCurrency:24,praefix:25,notifyList:26,isNew:27},[-1,-1])}}const{document:Lo}=Ee;function Fo(e){e[35]=e[37].list,e[36]=e[37].items}function Vo(e,t,n){const r=e.slice();return r[38]=t[n],r[40]=n,r}function Uo(e,t,n){const r=e.slice();return r[41]=t[n],r[43]=n,r}function Wo(e,t,n){const r=e.slice();return r[41]=t[n],r}function zo(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function qo(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v;Fo(e),n=new e[9]({props:{outline:!0,$$slots:{default:[Ho]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let $=!e[2]&&jo(e);function I(t){e[33](t)}let _={id:e[12]};void 0!==e[3]&&(_.value=e[3]),a=new e[7]({props:_}),oe.push(()=>Te(a,"value",I)),a.$on("input",e[15]),u=new bt({props:{size:"18"}});let C=e[36]?.length&&function(e){let t,n,r,i,o=!e[2]&&Xo(e),s=e[36],a=[];for(let t=0;t<s.length;t+=1)a[t]=Yo(Wo(e,s,t));return{c(){t=B("thead"),n=B("tr"),o&&o.c(),r=V();for(let e=0;e<a.length;e+=1)a[e].c();H(n,"class","svelte-1m010ne"),H(t,"class","svelte-1m010ne")},m(e,s){O(e,t,s),x(t,n),o&&o.m(n,null),x(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&&($e(),Ce(o,1,1,()=>{o=null}),Ie()):o?(o.p(e,t),4&t[0]&&_e(o,1)):(o=Xo(e),o.c(),_e(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[36],r=0;r<s.length;r+=1){const i=Wo(e,s,r);a[r]?a[r].p(i,t):(a[r]=Yo(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){Ce(o),i=!1},d(e){e&&M(t),o&&o.d(),P(a,e)}}}(e),b=e[35]?.length&&function(e){let t,n,r=e[35],i=[];for(let t=0;t<r.length;t+=1)i[t]=es(Vo(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(e,t,r),n=!0},p(e,n){if(1138717&n[0]){let s;for(r=e[35],s=0;s<r.length;s+=1){const o=Vo(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=es(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),$&&$.c(),i=V(),o=B("div"),s=F("Suchen: "),ke(a.$$.fragment),c=V(),d=B("span"),ke(u.$$.fragment),f=V(),h=B("div"),m=B("table"),C&&C.c(),p=V(),g=B("tbody"),b&&b.c(),H(t,"class","form--buttons svelte-1m010ne"),H(d,"class","feather pointer svelte-1m010ne"),X(o,"margin-bottom","1em"),X(o,"position","relative"),H(m,"striped",""),H(m,"class","svelte-1m010ne"),H(h,"class","eList svelte-1m010ne")},m(l,I){O(l,t,I),De(n,t,null),x(t,r),$&&$.m(t,null),O(l,i,I),O(l,o,I),x(o,s),De(a,o,null),x(o,c),x(o,d),De(u,d,null),O(l,f,I),O(l,h,I),x(h,m),C&&C.m(m,null),x(m,p),x(m,g),b&&b.m(g,null),w=!0,y||(v=W(d,"click",e[17]),y=!0)},p(e,r){Fo(e);const i={};32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?$&&($e(),Ce($,1,1,()=>{$=null}),Ie()):$?($.p(e,r),4&r[0]&&_e($,1)):($=jo(e),$.c(),_e($,1),$.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],he(()=>l=!1)),a.$set(o),e[36]?.length&&C.p(e,r),e[35]?.length&&b.p(e,r)},i(e){w||(_e(n.$$.fragment,e),_e($),_e(a.$$.fragment,e),_e(u.$$.fragment,e),_e(C),_e(b),w=!0)},o(e){Ce(n.$$.fragment,e),Ce($),Ce(a.$$.fragment,e),Ce(u.$$.fragment,e),Ce(C),Ce(b),w=!1},d(e){e&&M(t),Re(n),$&&$.d(),e&&M(i),e&&M(o),Re(a),Re(u),e&&M(f),e&&M(h),C&&C.d(),b&&b.d(),y=!1,v()}}}function Ho(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function jo(e){let t,n;return t=new e[9]({props:{disabled:!e[35].length,filled:!0,$$slots:{default:[Go]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[35])),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Go(e){let t;return{c(){t=F("Bestätigen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Xo(e){let t,n,r,i,o;return n=new pt({props:{size:"20"}}),{c(){t=B("th"),ke(n.$$.fragment),H(t,"class","svelte-1m010ne")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[19](e[35])),i=!0)},p(t,n){e=t},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Yo(e){let t,n,r=e[41]+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-1m010ne")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function Zo(e){let t,n,r,i,o,s,a,l=e[0],c=Qo(e),d=e[36],u=[];for(let t=0;t<d.length;t+=1)u[t]=Jo(Uo(e,d,t));return{c(){t=B("tr"),c.c(),n=V();for(let e=0;e<u.length;e+=1)u[e].c();r=V(),H(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),H(t,"title","übernimmt den Wert direkt"),H(t,"class","svelte-1m010ne"),Y(t,"active",e[0].includes(Array.isArray(e[38])?e[38][0]:e[38]))},m(i,l){O(i,t,l),c.m(t,null),x(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);x(t,r),o=!0,s||(a=W(t,"click",e[20](e[38])),s=!0)},p(s,a){if(e=s,1&a[0]&&T(l,l=e[0])?($e(),Ce(c,1,1,b),Ie(),c=Qo(e),c.c(),_e(c),c.m(t,n)):c.p(e,a),16400&a[0]){let n;for(d=e[36],n=0;n<d.length;n+=1){const i=Uo(e,d,n);u[n]?u[n].p(i,a):(u[n]=Jo(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;"))&&H(t,"style",i),16385&a[0]&&Y(t,"active",e[0].includes(Array.isArray(e[38])?e[38][0]:e[38]))},i(e){o||(_e(c),o=!0)},o(e){Ce(c),o=!1},d(e){e&&M(t),c.d(e),P(u,e),s=!1,a()}}}function Ko(e){let t,n,r;return n=new e[11]({props:{name:e[13],data:e[40],checked:e[0].includes(Array.isArray(e[38])?e[38][0]:e[38]),round:!0}}),{c(){t=B("td"),ke(n.$$.fragment),H(t,"title","Wählt den Wert aus"),H(t,"class","svelte-1m010ne")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};1&t[0]&&(r.checked=e[0].includes(Array.isArray(e[38])?e[38][0]:e[38])),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Qo(e){let t,n,r=!e[2]&&Ko(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[2]?r&&($e(),Ce(r,1,1,()=>{r=null}),Ie()):r?(r.p(e,n),4&n[0]&&_e(r,1)):(r=Ko(e),r.c(),_e(r,1),r.m(t.parentNode,t))},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function Jo(e){let t,n,r=(Array.isArray(e[38])?e[38][e[43]]:e[4][e[40]]?e[4][e[40]][e[43]]:e[38])+"";return{c(){t=B("td"),n=F(r),H(t,"class","svelte-1m010ne")},m(e,r){O(e,t,r),x(t,n)},p(e,t){16&t[0]&&r!==(r=(Array.isArray(e[38])?e[38][e[43]]:e[4][e[40]]?e[4][e[40]][e[43]]:e[38])+"")&&j(n,r)},d(e){e&&M(t)}}}function es(e){let t,n,r=e[16](e[38],e[3]),i=r&&Zo(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(e,t,r),n=!0},p(e,n){8&n[0]&&(r=e[16](e[38],e[3])),r?i?(i.p(e,n),8&n[0]&&_e(i,1)):(i=Zo(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function ts(e){let t,n;return t=new e[6]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ns(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:ts,then:qo,catch:zo,value:37,blocks:[,,,]};return be(e[14](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function rs(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[ns]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.title=e[1]||"Auswahl"),29&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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function is(e,n,r){const i=ne(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:c,Checkbox:d}=u;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:b}=n,{allowedValues:A}=n;p||=[];let E="",S=f+Math.floor(9e3*Math.random()+1e3).toString()+"search",N=[];const T=w+y+v+"checkbox",k=(e,t)=>e>t?1:t>e?-1:0;ee(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(S)?.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,b=e.single),"allowedValues"in e&&r(31,A=e.allowedValues)},[p,m,b,E,N,i,o,s,a,l,c,d,S,T,async()=>{let e=[],n=[],i={};if(r(4,N=[]),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 k(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 k(n(e),n(t))}),r(4,N=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)=>k(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 k(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);let s=[];const a=o.items[0].name,l=o.items[1].name,c=o.list[0].name;if(g){if("$self"===g){const t=e.map(e=>({designation:e.auxTableId,description:e.designation}));e=t.length?t:[]}else{const t=e.find(e=>e[a]===g);e=t?t[c]:[]}r(21,v=l)}let d;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&&(s=A),d=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:[...d,...n]}},({detail:{value:e}})=>{r(3,E=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,E="")},e=>()=>{const t=document.getElementsByName(T),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(T).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;b?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,A,()=>i("back"),function(e){E=e,r(3,E)}]}class os extends Oe{constructor(e){var t;super(),Lo.getElementById("svelte-1m010ne-style")||((t=B("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}",x(Lo.head,t)),xe(this,e,is,rs,T,{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,allowedValues:31},[-1,-1])}}const{document:ss}=Ee;function as(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=B("span"),n=F("("),r=F(s),i=F(")"),H(t,"class",o=D(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&j(r,s),2&n[0]&&o!==(o=D(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&H(t,"class",o)},d(e){e&&M(t)}}}function ls(e){let t;return{c(){t=B("div"),H(t,"class","load-more-options"),H(t,"slot","load-more-options-message")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function cs(e){let t,n,r,i;const o=[fs,us,ds],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=U()},m(e,n){~t&&s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie()),~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){Ce(n),i=!1},d(e){~t&&s[t].d(e),e&&M(r)}}}function ds(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Übernehmen"),H(t,"class","feather pointer svelte-1rbaejz")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[26]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function us(e){let t,n,r,i,o;return n=new yt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title",e[17].title||"Generieren"),H(t,"class","feather pointer svelte-1rbaejz")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[25]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function fs(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Löschen"),H(t,"class","feather pointer svelte-1rbaejz")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[27]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function hs(e){let t,n,r;function i(t){e[38](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[ms]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(t,e,n),r=!0},p(e,r){const i={};117&r[0]|65536&r[1]&&(i.$$scope={dirty:r,ctx:e}),!n&&1024&r[0]&&(n=!0,i.open=e[10],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function ms(e){let t,n;return t=new os({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,allowedValues:e[6]}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){ke(t.$$.fragment)},m(e,r){De(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),64&n[0]&&(r.allowedValues=e[6]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ps(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&as(e);function u(t){e[36](t)}function f(t){e[37](t)}let h={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],placeholder:e[8],getOptions:gs,minSearchLength:"3",$$slots:{"load-more-options-message":[ls]},$$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}),oe.push(()=>Te(r,"selection",u)),oe.push(()=>Te(r,"maxOptions",f)),r.$on("change",e[22]);let m=!e[1]&&cs(e),p=e[10]&&hs(e);return{c(){t=B("div"),d&&d.c(),n=V(),ke(r.$$.fragment),s=V(),m&&m.c(),a=V(),p&&p.c(),l=U(),X(t,"position","relative")},m(e,i){O(e,t,i),d&&d.m(t,null),x(t,n),De(r,t,null),x(t,s),m&&m.m(t,null),O(e,a,i),p&&p.m(e,i),O(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=as(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]),256&s[0]&&(a.placeholder=e[8]),65536&s[1]&&(a.$$scope={dirty:s,ctx:e}),!i&&128&s[0]&&(i=!0,a.selection=e[7],he(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],he(()=>o=!1)),r.$set(a),e[1]?m&&($e(),Ce(m,1,1,()=>{m=null}),Ie()):m?(m.p(e,s),2&s[0]&&_e(m,1)):(m=cs(e),m.c(),_e(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&_e(p,1)):(p=hs(e),p.c(),_e(p,1),p.m(l.parentNode,l)):p&&($e(),Ce(p,1,1,()=>{p=null}),Ie())},i(e){c||(_e(r.$$.fragment,e),_e(m),_e(p),c=!0)},o(e){Ce(r.$$.fragment,e),Ce(m),Ce(p),c=!1},d(e){e&&M(t),d&&d.d(),Re(r),m&&m.d(),e&&M(a),p&&p.d(e),e&&M(l)}}}async function*gs(e){yield[{name:e}]}function ws(e,n,r){const i=ne(),{Modal:o,Autocomplete:s}=u;let{classId:a}=n,{id:l}=n,{item:c}=n,{record:d}=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,{allowedValues:I}=n;const{properties:_={}}=c;let{placeholder:C,hint:b,readonly:A,required:E=!1,lookup:S="",view:N=!1,multi:T,max:k=1e3,generate:D=!1,status:R=!0,refDoc:x}=_;const[O,M]=S.split(":");let P=!1,B=f.map&&f.map(e=>({name:e}))||[];m||=A,m&&(C="");const L=({detail:e})=>{let t=[];e.value.map(e=>{const n=e.name?.split(",");t=t.concat(n)}),r(7,B=t.map(e=>({name:e.trim()})));const n=B.map(e=>e.name);i("blur",{value:n}),i("multi",{view:T.view,lookup:S,name:c.name,value:n})};ee(async()=>{i("multi",{view:T.view,lookup:S,name:c.name,value:f});const e=document.getElementById(l);e.classList.add(a),!A&&S&&e.addEventListener("focus",F)});const F=()=>{if(S){document.getElementById(l).blur();const e=v||k;(T.unique||B.length<e)&&r(10,P=!0)}},V=()=>{r(10,P&&=!1)},U=({detail:e})=>{const t=e.list.map(e=>Array.isArray(e)?e[0]:e);r(7,B=t.map(e=>({name:e}))),i("blur",{value:t}),i("multi",{view:T.view,lookup:S,name:c.name,value:t}),V()},W=async()=>{const e={[M]:d[M]},n=await t.getSectionView(O,e),r=Array.from({length:n.length},(e,t)=>n[t][c.name]);U({detail:{name:c.name,list:r}})},z=(e=!1)=>{if(E){const e=!B?.length,t=document.getElementById(l);return t?.classList?.toggle("invalid",e),void i("invalid",{idx:w,value:e})}if(m||!T.required)return;const t=T.maxItem;if(!t||T.unique)return;r(9,k=!1!==e?e:v||d[t]||0);const n=B?.length!=k,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,c=e.item),"record"in e&&r(5,d=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),"allowedValues"in e&&r(6,I=e.allowedValues)},e.$$.update=()=>{48&e.$$.dirty[0]&&d&&""===d[c.name]&&r(7,B=[]),48&e.$$.dirty[0]&&d&&Array.isArray(d[c.name])&&r(7,B=d[c.name].map(e=>({name:e}))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&y&&y===c.name&&r(7,B=[]),128&e.$$.dirty[0]&&B&&(r(0,f=B.map&&B.map(e=>e.name)||[]),z()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===T.maxItem&&z(n)})(g),536870912&e.$$.dirty[0]|16&e.$$.dirty[1]&&r(35,E=E&&!p),8&e.$$.dirty[1]&&(async e=>{if(void 0===w)return;const{itemName:n,value:o}=e||{};if(o){if(c.refItem&&c.refItem?.split(".")[0]===n){let[e,n]=c.refItem.split(".");if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,B=[]);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][c.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,B=l.map(e=>({name:e}))),L({detail:{value:B}})}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][c.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,B=l&&l.map(e=>({name:e})))}}if(c.refItem2&&c.refItem2?.split(".")[0]===n){let[e,n]=c.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,B=[]);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][c.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,B=l.map(e=>({name:e}))),L({detail:{value:B}})}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][c.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,B=l&&l.map(e=>({name:e})))}}setTimeout(z,250)}})($)},[f,m,a,l,c,d,I,B,C,k,P,o,s,A,S,N,T,D,R,x,O,M,L,V,U,()=>{const e=d[D.itemQuantity]||v;if(!e)return;const t=D.prefix||"",n=d[D.variable]||"",r=D.len||5,i=Array.from({length:e},(e,i)=>t+n+"-"+i.toString().padStart(r,"0"));U({detail:{name:c.name,list:i}})},async()=>{if(!0===N)return W();const e=v||d[T.maxItem];if(!e)return;let n={};M&&(n={[M]:d[M]}),R&&(n.status=!0);const r=[].concat(d[T.view]||[]);r.length&&(n[T.view]={$in:r});const i=await t.getSectionView(O,n),o=Array.from({length:e<i.length?e:i.length},(e,t)=>i[t][c.name]);U({detail:{name:c.name,list:o}})},()=>{U({detail:{name:c.name,list:[]}})},h,p,g,w,y,v,$,E,function(e){B=e,r(7,B),r(5,d),r(4,c),r(32,y)},function(e){k=e,r(9,k)},function(e){P=e,r(10,P)}]}class ys extends Oe{constructor(e){var t;super(),ss.getElementById("svelte-1rbaejz-style")||((t=B("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}",x(ss.head,t)),xe(this,e,ws,ps,T,{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,allowedValues:6},[-1,-1])}}function vs(e){let t,n,r;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function $s(e){let t,n,r,i,o;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[9]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Is(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=[$s,vs],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}const _s=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://www.google.com/maps/dir/Current%20Location/"+encodeURIComponent(a)});function Cs(e,t,n){const{TextField:r}=u;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:c}=t,{name:d}=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,c=e.id),"name"in e&&n(6,d=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,c,d,f,r,async()=>{if(!f)return;const e=d.includes(".")?h[d.split(".")[0]]:h,t=await _s(e);window.open(t,"_blank")},h,m,function(t){re(e,t)}]}class bs extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,Cs,Is,T,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:As}=Ee;function Es(e){let t;return{c(){t=B("div"),H(t,"class","load-more-options"),H(t,"slot","load-more-options-message")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Ss(e){let t,n,r;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-wpjws5")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Ns(e){let t,n,r,i,o;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-wpjws5")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[8]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(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":[Es]},$$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}),oe.push(()=>Te(n,"value",l)),oe.push(()=>Te(n,"selection",c)),oe.push(()=>Te(n,"searchQuery",d)),n.$on("change",e[6]);let f=e[5]&&function(e){let t,n,r,i;const o=[Ns,Ss],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),s=V(),f&&f.c(),X(t,"position","relative"),H(t,"class","inputAutoComplete")},m(e,r){O(e,t,r),De(n,t,null),x(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],he(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],he(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],he(()=>o=!1)),n.$set(s),e[5]&&f.p(e,t)},i(e){a||(_e(n.$$.fragment,e),_e(f),a=!0)},o(e){Ce(n.$$.fragment,e),Ce(f),a=!1},d(e){e&&M(t),Re(n),f&&f.d()}}}function ks(e,t,n){const{Autocomplete:r}=u,i=ne();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:c}=t,{record:d}=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 b,A=f,E=!1;ee(()=>{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=>{E=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((c?d[c][e]:d[e]).length<w)return}const e=await k();if(e?.length)if(1===e.length){if(f.startsWith(e[0].name))return;n(3,A=n(0,f=e[0].name)),R(f)}else e.find(e=>(A||"").startsWith(e.name))||f||n(3,A=" ");else n(0,f=n(3,A=""))},k=async(e="")=>{const t=await(async()=>{const e=c?d[c].country:d.country;if(e){const t=await bw("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+"?"+D()+"&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[_]}))},D=()=>I.map(({name:e,refItem:t})=>`${t}=${(c?d[c][e]:d[e]).split(" ")[0]}`).join("&"),R=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,c=e.listName),"record"in e&&n(13,d=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,b,A,r,C,({detail:{value:e}})=>{e.length&&n(3,A=n(0,f=e[0].name)),n(2,b=[]),R(f)},async function*(e){if(E||f&&e.startsWith(f))return n(0,f=e),void R(f);const t=await k(e);if(!t?.length)return n(0,f=e),void R(f);1===t.length?(n(3,A=n(0,f=t[0].name)),n(2,b=[]),R(f)):yield t},async()=>{if(!f)return;const e=l.includes(".")?d[l.split(".")[0]]:d,t=await _s(e);window.open(t,"_blank")},o,a,l,c,d,h,m,p,function(e){f=e,n(0,f)},function(e){b=e,n(2,b)},function(e){A=e,n(3,A)}]}class Ds extends Oe{constructor(e){var t;super(),As.getElementById("svelte-wpjws5-style")||((t=B("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}",x(As.head,t)),xe(this,e,ks,Ts,T,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:Rs}=Ee;function xs(e){e[26]=e[28].list,e[27]=e[28].items}function Os(e,t,n){const r=e.slice();return r[29]=t[n],r}function Ms(e,t,n){const r=e.slice();return r[32]=t[n],r}function Ps(e,t,n){const r=e.slice();return r[32]=t[n],r}function Bs(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Ls(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)}xs(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Fs]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),oe.push(()=>Te(s,"value",v)),s.$on("input",e[12]),d=new bt({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]=Vs(Ps(e,r,t));return{c(){t=B("thead"),n=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();H(n,"class","svelte-14hcfjl"),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(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=Ps(e,r,o);i[o]?i[o].p(s,t):(i[o]=Vs(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&&M(t),P(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]=zs(Os(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);O(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=Os(e,n,o);r[o]?r[o].p(s,i):(r[o]=zs(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){P(r,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("div"),o=F("Suchen: "),ke(s.$$.fragment),l=V(),c=B("span"),ke(d.$$.fragment),u=V(),f=B("div"),h=B("table"),I&&I.c(),m=V(),p=B("tbody"),_&&_.c(),H(t,"class","form--buttons svelte-14hcfjl"),H(c,"class","feather pointer svelte-14hcfjl"),X(i,"margin-bottom","1em"),X(i,"position","relative"),H(h,"striped",""),H(h,"class","svelte-14hcfjl"),H(f,"class","eList svelte-14hcfjl")},m(a,v){O(a,t,v),De(n,t,null),O(a,r,v),O(a,i,v),x(i,o),De(s,i,null),x(i,l),x(i,c),De(d,c,null),O(a,u,v),O(a,f,v),x(f,h),I&&I.m(h,null),x(h,m),x(h,p),_&&_.m(p,null),g=!0,w||(y=W(c,"click",e[14]),w=!0)},p(e,t){xs(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],he(()=>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){Ce(n.$$.fragment,e),Ce(s.$$.fragment,e),Ce(d.$$.fragment,e),g=!1},d(e){e&&M(t),Re(n),e&&M(r),e&&M(i),Re(s),Re(d),e&&M(u),e&&M(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function Fs(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Vs(e){let t,n,r=e[32]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function Us(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=Ws(Ms(e,r,t));return{c(){t=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=V(),H(t,"class","pointer svelte-14hcfjl"),Y(t,"active",e[29]._id===e[0])},m(e,r){O(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);x(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=Ms(e,r,s);i[s]?i[s].p(a,o):(i[s]=Ws(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]&&Y(t,"active",e[29]._id===e[0])},d(e){e&&M(t),P(i,e)}}}function Ws(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=B("td"),n=F(o),H(t,"class","svelte-14hcfjl")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&M(t),r=!1,i()}}}function zs(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&Us(e);return{c(){r&&r.c(),t=U()},m(e,n){r&&r.m(e,n),O(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=Us(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&M(t)}}}function qs(e){let t,n;return t=new e[5]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Hs(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:qs,then:Ls,catch:Bs,value:28,blocks:[,,,]};return be(e[11](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function js(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Hs]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Gs(e,n,i){const o=ne(),{Dialog:s,Divider:a,Loading:l,TextField:c,Button:d}=u;let{item:f}=n,{className:h}=n,{classId:m}=n,{rowId:p}=n,{viewName:w}=n,{viewValue:y}=n,{recordId:v}=n,{filter:I}=n,_="",C=m+Math.floor(9e3*Math.random()+1e3).toString()+"search";const b=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):g(e[`_${t.name}`]||e[t.name]||"")},A=t.getSchemaByClass(h);ee(()=>{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&&Aw(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,m=e.classId),"rowId"in e&&i(0,p=e.rowId),"viewName"in e&&i(18,w=e.viewName),"viewValue"in e&&i(19,y=e.viewValue),"recordId"in e&&i(20,v=e.recordId),"filter"in e&&i(21,I=e.filter)},[p,_,o,s,a,l,c,d,C,b,e=>()=>o("choose",{row:e}),async()=>{const e=await A,n="."+m+"#"+w;document.querySelector(n);let r={[w]:y},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 kn(o,e,i)}},({detail:{value:e}})=>{i(1,_=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(b(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,_="")},f,h,m,w,y,v,I,()=>o("back"),function(e){_=e,i(1,_)}]}class Xs extends Oe{constructor(e){var t;super(),Rs.getElementById("svelte-14hcfjl-style")||((t=B("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}",x(Rs.head,t)),xe(this,e,Gs,js,T,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Ys(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Zs(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}),oe.push(()=>Te(n,"value",s));let l=!e[6]&&Ks(e);return{c(){t=B("div"),ke(n.$$.fragment),i=V(),l&&l.c(),X(t,"position","relative")},m(e,r){O(e,t,r),De(n,t,null),x(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],he(()=>r=!1)),n.$set(o),e[6]?l&&($e(),Ce(l,1,1,()=>{l=null}),Ie()):l?(l.p(e,i),64&i&&_e(l,1)):(l=Ks(e),l.c(),_e(l,1),l.m(t,null))},i(e){o||(_e(n.$$.fragment,e),_e(l),o=!0)},o(e){Ce(n.$$.fragment,e),Ce(l),o=!1},d(e){e&&M(t),Re(n),l&&l.d()}}}function Ks(e){let t,n,r,i,o;return n=new en({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-wbrqzu")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[17]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Qs(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Js(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[ea]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(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],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function ea(e){let t,n;return t=new Xs({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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ta(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Qs,then:Zs,catch:Ys,value:27,blocks:[,,,]};be(e[16](),i);let o=e[8]&&Js(e);return{c(){i.block.c(),t=V(),o&&o.c(),n=U()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,O(e,t,s),o&&o.m(e,s),O(e,n,s),r=!0},p(t,[r]){Ae(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&_e(o,1)):(o=Js(e),o.c(),_e(o,1),o.m(n.parentNode,n)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){r||(_e(i.block),_e(o),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}Ce(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&M(t),o&&o.d(e),e&&M(n)}}}function na(e,t,n){const{TextField:r,Modal:i}=u;let{classId:o}=t,{id:s}=t,{item:a}=t,{record:l}=t,{value:c}=t,{noForm:d=!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,c=e.value),"noForm"in e&&n(5,d=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)},[c,o,s,a,l,d,f,h,_,g,r,i,w,v,$,I,async()=>(n(9,g=l[I.selection]),!0),()=>{n(8,_=!0)},({detail:e})=>{n(0,c=e.row[I.value?I.value:"_id"]),C()},C,m,function(e){c=e,n(0,c)},function(e){_=e,n(8,_)}]}class ra extends Oe{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=B("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",x(document.head,t)),xe(this,e,na,ta,T,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function ia(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 rt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Übernehmen"),H(t,"class","pointer feather")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[12]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}(e);return{c(){t=B("input"),r=V(),ke(i.$$.fragment),o=V(),d&&d.c(),s=U(),H(t,"type","string"),H(t,"class",n=e[3]||e[4]),H(t,"id",e[1]),H(t,"name",e[1]),t.hidden=!0},m(n,u){O(n,t,u),G(t,e[0]),O(n,r,u),De(i,n,u),O(n,o,u),d&&d.m(n,u),O(n,s,u),a=!0,l||(c=W(t,"input",e[19]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&H(t,"class",n),(!a||2&r)&&H(t,"id",e[1]),(!a||2&r)&&H(t,"name",e[1]),1&r&&G(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){Ce(i.$$.fragment,e),Ce(d),a=!1},d(e){e&&M(t),e&&M(r),Re(i,e),e&&M(o),d&&d.d(e),e&&M(s),l=!1,c()}}}let oa=new Map;function sa(e,n,r){const i=ne(),{DatePicker:o}=u;let{value:s}=n,{id:a}=n,{item:l}=n,{record:c}=n,{widget:d}=n,{praefix:f}=n,{noForm:h=!1}=n,{classId:m}=n,{eventId:p}=n,{readonly:g}=n,{disabled:w}=n,{required:y}=n,{notifyList:v}=n,{dateInput:$}=n;s||(s=void 0),c._id||""!==l.properties?.value||(s=void 0);let I=null;const _=(void 0===f?"":f.toString())+"-"+p+"-"+l.name,C=l.properties?.noCalendar||!1,b=l.properties?.transfer,A=({detail:e})=>{try{r(0,s=_i(e.value,s)),void 0!==f&&""!==f&&oa.set(_,new Date(s.valueOf())),E(s)}catch{r(0,s=void 0)}},E=e=>{i("change",{value:new Date(e.valueOf())})};if(void 0!==f&&!s&&void 0!==s){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);s=_i(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,c=e.record),"widget"in e&&r(15,d=e.widget),"praefix"in e&&r(2,f=e.praefix),"noForm"in e&&r(3,h=e.noForm),"classId"in e&&r(4,m=e.classId),"eventId"in e&&r(16,p=e.eventId),"readonly"in e&&r(5,g=e.readonly),"disabled"in e&&r(6,w=e.disabled),"required"in e&&r(7,y=e.required),"notifyList"in e&&r(17,v=e.notifyList),"dateInput"in e&&r(18,$=e.dateInput)},e.$$.update=()=>{if(1&e.$$.dirty&&s&&!b&&oa.has(_)&&r(0,s=oa.get(_)),16384&e.$$.dirty&&(async()=>{if(!d)return;if(!l?.properties?.filter)return;const{_last:e,value:n}=l.properties.filter;if(e){const e=[{$match:{[d.schema.class]:d.value}},{$sort:{[n]:-1}},{$limit:1}],i=await t.getTasksWidgetFiltered(l.refClass,e);r(0,s=i?.length?new Date(i[0][n]):void 0)}})(),131072&e.$$.dirty&&(async e=>{if(null===I){const e=(await t.getEvent(p)).output.class[0].item;I=e.find(e=>e.properties?.value?.formula)}I&&I.properties.value.formula.argument[0].refItem===l.name&&(e&&e.itemName!==l.name&&!I.properties.value.formula.argument[1].value&&e.itemName!==I.properties.value.formula.argument[1].refItem.split(".")[0]||i("formula",{item:I}))})(v),262144&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!=f&&A({detail:{value:new Date(n)}})})($),24673&e.$$.dirty&&c&&c[l.name]){let e=c[l.name];"string"==typeof e&&e?.includes("-")&&r(0,s=new Date(e));try{w||g||r(0,s=_i(c[l.name],s))}catch{}}},[s,a,f,h,m,g,w,y,o,C,b,A,()=>{i("record",{target:b.target,value:s.toISOString()})},l,c,d,p,v,$,function(){s=this.value,r(0,s),r(14,c),r(13,l),r(6,w),r(5,g)}]}class aa extends Oe{constructor(e){super(),xe(this,e,sa,ia,T,{value:0,id:1,item:13,record:14,widget:15,praefix:2,noForm:3,classId:4,eventId:16,readonly:5,disabled:6,required:7,notifyList:17,dateInput:18})}}function la(e){let t;return{c(){t=F("Stunden")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ca(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[la]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function da(e){let t;return{c(){t=F("Minuten")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ua(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[da]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function fa(e){let t;return{c(){t=F("Jetzt")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ha(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[fa]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ma(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":[ha],"minutes-label":[ua],"hours-label":[ca]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=B("input"),r=V(),ke(i.$$.fragment),o=V(),ke(s.$$.fragment),H(t,"type","string"),H(t,"class",n=e[2]||e[3]),H(t,"id",e[1]),H(t,"name",e[1]),t.hidden=!0},m(n,d){O(n,t,d),G(t,e[0]),O(n,r,d),De(i,n,d),O(n,o,d),De(s,n,d),a=!0,l||(c=W(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&H(t,"class",n),(!a||2&r)&&H(t,"id",e[1]),(!a||2&r)&&H(t,"name",e[1]),1&r&&G(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){Ce(i.$$.fragment,e),Ce(s.$$.fragment,e),a=!1},d(e){e&&M(t),e&&M(r),Re(i,e),e&&M(o),Re(s,e),l=!1,c()}}}function pa(e,t,n){const r=ne(),{Label:i,DatePicker:o,TimePicker:s}=u;let{value:a}=t,{id:l}=t,{noForm:c=!1}=t,{classId:d}=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,c=e.noForm),"classId"in e&&n(3,d=e.classId)},[a,l,c,d,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=_i(e.value,a)),f(a)},function(){a=this.value,n(0,a)}]}class ga extends Oe{constructor(e){super(),xe(this,e,pa,ma,T,{value:0,id:1,noForm:2,classId:3})}}function wa(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=B("input"),o=V(),s=B("input"),d=V(),ke(u.$$.fragment),f=F(" /\n"),ke(h.$$.fragment),H(t,"type","string"),H(t,"class",n=e[1]||e[2]),H(t,"id",r=e[0]+"_from"),H(t,"name",i=e[0]+"_from"),t.hidden=!0,H(s,"type","string"),H(s,"class",a=e[1]||e[2]),H(s,"id",l=e[0]+"_to"),H(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){O(n,t,r),G(t,e[5]),O(n,o,r),O(n,s,r),G(s,e[6]),O(n,d,r),De(u,n,r),O(n,f,r),De(h,n,r),m=!0,p||(g=[W(t,"input",e[15]),W(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&H(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&H(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&H(t,"name",i),32&o&&G(t,e[5]),(!m||6&o&&a!==(a=e[1]||e[2]))&&H(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&H(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&H(s,"name",c),64&o&&G(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){Ce(u.$$.fragment,e),Ce(h.$$.fragment,e),m=!1},d(e){e&&M(t),e&&M(o),e&&M(s),e&&M(d),Re(u,e),e&&M(f),Re(h,e),p=!1,S(g)}}}function ya(e,t,n){const r=ne(),{DatePicker:i}=u;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:c}=t,{required:d}=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,c=e.classId),"required"in e&&n(3,d=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,c,d,f,p,g,w,y,i,h,({detail:e})=>{n(5,p=_i(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=_i(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 va extends Oe{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=B("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",x(document.head,t)),xe(this,e,ya,wa,T,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var $a={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 Ia(e){return Ia="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},Ia(e)}function _a(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 Ca(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 Ca(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 Ca(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 ba={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=_a(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=_a(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function Aa(e){return!isNaN(parseInt(e))&&isFinite(e)}function Ea(e){return e%2==0}function Sa(e){return Aa(e)&&!Number.isInteger(e)}function Na(e){return Math.abs(e)%1==.5}function Ta(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 ka(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"===Ia(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 Ra(){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 Na(e)&&Ea(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return Na(e)?Ea(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return Na(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return Na(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return Na(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 xa=Ra();function Oa(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"!==Ia(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return Ta(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 Aa(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Ba(e){Ma(Number.isInteger(e),"You must provide an integer.",TypeError)}var La=Ra(),Fa=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;Ba(r),Ba(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;Ba(e);var n=this.getPrecision(),r=e>n,i=r?La.multiply:La.divide,o=r?[e,n]:[n,e],s=Math.pow(10,La.subtract.apply(La,o));return u.call(this,{amount:La.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:La.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:La.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:La.round(La.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:La.round(La.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(La.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 La.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(La.divide(La.multiply(t.getAmount(),e),n));return r=La.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=La.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 Oa(m).getExchangeRate(this.getCurrency(),e).then(function(n){return Ma(!ka(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:La.round(La.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!==La.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==La.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!ka(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return ka(this.getMatches().find(e))?0:this.getMatches()[xa.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 ka(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ka(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 La.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 La.divide(La.round(La.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},$a,ba),Va={},Ua={};!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}(Ua);const Wa=Ua,za={allowBooleanAttributes:!1,unpairedTags:[]};function qa(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ha(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 Ja("InvalidXml","XML declaration allowed only at the start of the document.",nl(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function ja(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({},za,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=Ha(e,o),o.err)return o}else{if("<"!==e[o]){if(qa(e[o]))continue;return Ja("InvalidChar","char '"+e[o]+"' is not expected.",nl(e,o))}{let s=o;if(o++,"!"===e[o]){o=ja(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--),!tl(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Ja("InvalidTag",t,nl(e,o))}const c=Ya(e,o);if(!1===c)return Ja("InvalidAttr","Attributes for '"+l+"' have open quote.",nl(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=Ka(d,t);if(!0!==i)return Ja(i.err.code,i.err.msg,nl(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return Ja("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",nl(e,o));if(d.trim().length>0)return Ja("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",nl(e,s));if(0===n.length)return Ja("InvalidTag","Closing tag '"+l+"' has not been opened.",nl(e,s));{const t=n.pop();if(l!==t.tagName){let n=nl(e,t.tagStartPos);return Ja("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",nl(e,s))}0==n.length&&(i=!0)}}else{const a=Ka(d,t);if(!0!==a)return Ja(a.err.code,a.err.msg,nl(e,o-d.length+a.err.line));if(!0===i)return Ja("InvalidXml","Multiple possible root nodes found.",nl(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=ja(e,o);continue}if("?"!==e[o+1])break;if(o=Ha(e,++o),o.err)return o}else if("&"===e[o]){const t=Qa(e,o);if(-1==t)return Ja("InvalidChar","char '&' is not expected.",nl(e,o));o=t}else if(!0===i&&!qa(e[o]))return Ja("InvalidXml","Extra text at the end",nl(e,o));"<"===e[o]&&o--}}}return r?1==n.length?Ja("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",nl(e,n[0].tagStartPos)):!(n.length>0)||Ja("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ja("InvalidXml","Start tag expected.",1)};const Ga='"',Xa="'";function Ya(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===Ga||e[t]===Xa)""===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 Za=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Ka(e,t){const n=Wa.getAllMatches(e,Za),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return Ja("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",rl(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return Ja("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",rl(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return Ja("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",rl(n[e]));const i=n[e][2];if(!el(i))return Ja("InvalidAttr","Attribute '"+i+"' is an invalid name.",rl(n[e]));if(r.hasOwnProperty(i))return Ja("InvalidAttr","Attribute '"+i+"' is repeated.",rl(n[e]));r[i]=1}return!0}function Qa(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 Ja(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function el(e){return Wa.isName(e)}function tl(e){return Wa.isName(e)}function nl(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function rl(e){return e.startIndex+e[1].length}var il={};const ol={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}};il.buildOptions=function(e){return Object.assign({},ol,e)},il.defaultOptions=ol;var sl=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 al=Ua;function ll(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 cl(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function dl(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 ul(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 fl(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 hl(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 ml(e){if(al.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var pl=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&&dl(e,t))t+=7,[entityName,val,t]=ll(e,t+1),-1===val.indexOf("&")&&(n[ml(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&ul(e,t))t+=8;else if(i&&fl(e,t))t+=8;else if(i&&hl(e,t))t+=9;else{if(!cl)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const gl=/^[-+]?0x[a-fA-F0-9]+$/,wl=/^([\-\+])?(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 yl={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var vl=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 $l=Ua,Il=sl,_l=pl,Cl=function(e,t={}){if(t=Object.assign({},yl,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&&gl.test(n))return Number.parseInt(n,16);{const r=wl.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}},bl=vl;function Al(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 El(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 Ll(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?Ll(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 Nl=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Tl(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=$l.getAllMatches(e,Nl),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:Ll(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 kl=function(e){e=e.replace(/\r\n?/g,"\n");const t=new Il("!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 Il(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=_l(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 Il(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 Il(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 Il(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 Rl=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 xl(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 Ol(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 Bl(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 Ll(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:Cl(e,n))}return $l.isExist(e)?e:""}var Fl=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=Al,this.parseXml=kl,this.parseTextData=El,this.resolveNameSpace=Sl,this.buildAttributesMap=Tl,this.isItStopNode=Ol,this.replaceEntitiesValue=Rl,this.readStopNodeData=Bl,this.saveTextToParentTag=xl,this.addChild=Dl,this.ignoreAttributesFn=bl(this.options.ignoreAttributes)}},Vl={};function Ul(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=Wl(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=Ul(s[a],t,l);const n=ql(e,t);s[":@"]?zl(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 Wl(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function zl(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 ql(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 Ul(e,t)};const{buildOptions:Hl}=il,jl=Fl,{prettify:Gl}=Vl,Xl=Va;var Yl=class{constructor(e){this.externalEntities={},this.options=Hl(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=Xl.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new jl(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:Gl(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 '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};function Zl(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=Kl(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];Jl(c,t)||(e=t.tagValueProcessor(l,e),e=ec(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=Ql(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}${Ql(a[":@"],t)}`,f=Zl(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 Kl(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 Ql(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=ec(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function Jl(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 ec(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 tc=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Zl(e,t,"",n)},nc=vl,rc={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:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ic(e){this.options=Object.assign({},rc,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=nc(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ac),this.processTextOrObjNode=oc,this.options.format?(this.indentate=sc,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function oc(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 sc(e){return this.options.indentBy.repeat(e)}function ac(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}ic.prototype.build=function(e){return this.options.preserveOrder?tc(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},ic.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}},ic.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},ic.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}},ic.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},ic.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}},ic.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 lc={XMLParser:Yl,XMLValidator:Va,XMLBuilder:ic},cc=[],dc=0;dc<256;++dc)cc.push((dc+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class uc extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class fc extends uc{constructor(e){super(e)}}class hc extends uc{constructor(e){super(e)}}const mc=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}},pc=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()}}}},gc=(e,t="USD")=>{const n=Fa({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},wc=e=>{const t=e.DtTm||e.Dt;return new Date(t)},yc=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=gc(c));const u=e.TxsSummry?.TtlCdtNtries?.NbOfNtries,f=e.TxsSummry?.TtlCdtNtries?.Sum,h=e.TxsSummry?.TtlDbtNtries?.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries?.Sum,p=mc(e.Acct),g=pc(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(vc):e.Bal&&(w=[vc(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map($c):e.Ntry&&(y=[$c(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}},vc=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=gc(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:wc(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},$c=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=wc(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=gc(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=_c(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(Ic)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},Ic=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=mc(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=pc(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=mc(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&($=pc(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}},_c=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 Cc{_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 lc.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=Cc.getParser().parse(e);if(!t.Document)throw new fc("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new hc("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=>yc(e)):[yc(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new Cc({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 bc(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}),oe.push(()=>Te(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(){ke(t.$$.fragment),r=V(),ke(i.$$.fragment)},m(e,n){De(t,e,n),O(e,r,n),De(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],he(()=>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){Ce(t.$$.fragment,e),Ce(i.$$.fragment,e),o=!1},d(e){Re(t,e),e&&M(r),Re(i,e)}}}function Ac(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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ec(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[Sc]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),X(t,"margin-top","1em")},m(e,i){O(e,t,i),De(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){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Sc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=F(e[6]),n=V(),ke(r.$$.fragment)},m(e,o){O(e,t,o),O(e,n,o),De(r,e,o),i=!0},p(e,n){(!i||64&n)&&j(t,e[6])},i(e){i||(_e(r.$$.fragment,e),i=!0)},o(e){Ce(r.$$.fragment,e),i=!1},d(e){e&&M(t),e&&M(n),Re(r,e)}}}function Nc(e){let t,n,r,i,o;const s=[Ac,bc],a=[];t=function(e){return e[11]?0:1}(e),n=a[t]=s[t](e);let l=e[5]&&Ec(e);return{c(){n.c(),r=V(),l&&l.c(),i=U()},m(e,n){a[t].m(e,n),O(e,r,n),l&&l.m(e,n),O(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=Ec(e),l.c(),_e(l,1),l.m(i.parentNode,i)):l&&($e(),Ce(l,1,1,()=>{l=null}),Ie())},i(e){o||(_e(n),_e(l),o=!0)},o(e){Ce(n),Ce(l),o=!1},d(e){a[t].d(e),e&&M(r),l&&l.d(e),e&&M(i)}}}function Tc(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=u,l=ne();let{classId:c}=n,{eventId:d}=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=T(n),s=!1;if(o.startsWith("R-")||(o=""),!o&&r&&(s=!0,r=r.toString(),o=T(r.replaceAll(" ","")),o.startsWith("R-")||(o=""),!o&&r.includes("R-"))){o="R-"+r.split("R-")[1].slice(0,8)}if(o&&(i=await t.getSectionView("invoice",{invoiceId:o}),i?.length)){const e=i[0];if(!a.find(t=>t.invoice==e._id))return e._id}}catch(e){console.log("error",e)}return""},b=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{}},E=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 S(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 b(c,r.bookingDate,a.amount);!1===u&&(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||a.accountServicerReferenceId,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,listInput:!0}),s.length&&l("record",{itemName:"open"+e.name,value:s,listInput:!0})},S=async e=>{try{const n=await t.getSectionView("accountingPlan",{iban:e});if(n?.length)return n[0]._id}catch{}return""},N=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=Cc.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"});for(const e of i)await E(e,o,n);setTimeout(()=>{l("saveFull"),r(5,$=!1)},2e3)}catch(e){console.log("Error",e),r(6,I="Ungültiger Inhalt!"),r(5,$=!0)}},T=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(e){console.log("error",e)}return""};return e.$$set=e=>{"classId"in e&&r(0,c=e.classId),"eventId"in e&&r(14,d=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))},[c,m,p,w,y,$,I,i,o,s,a,v,async()=>{const{list:e}=h.properties,n=w[0],i=await t.getEvent(d);if(n){r(4,y=n.name);const t=await n.text();if(g)return await N(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:T(t),information:n.RmtInf?.Ustrd||""};s.push(r)}}s.length&&l("record",{itemName:e,value:s})}},()=>{r(3,w)},d,f,h,function(e){w=e,r(3,w)}]}class kc extends Oe{constructor(e){var t;super(),document.getElementById("svelte-157hlzf-style")||((t=B("style")).id="svelte-157hlzf-style",t.textContent="label.file-dropzone{margin-top:0 !important}",x(document.head,t)),xe(this,e,Tc,Nc,T,{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=Rc(10,n[31]),t.amountVat=xc(!0,Rc(32,n[31]),t.amount)||xc(!1,Rc(33,n[31]),t.amount),t):t},Rc=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},xc=(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:Oc}=Ee;function Mc(e){let t,n,r,i,o,s,a;function l(t){e[18](t)}let c={class:e[0],id:e[1],name:e[2],accept:"application/pdf",max:"1",beforeChange:e[14]};void 0!==e[3]&&(c.files=e[3]),t=new e[7]({props:c}),oe.push(()=>Te(t,"files",l)),t.$on("change",e[12]);const d=[Lc,Bc],u=[];function f(e,t){return e[5]?0:1}return i=f(e),o=u[i]=d[i](e),{c(){ke(t.$$.fragment),r=V(),o.c(),s=U()},m(e,n){De(t,e,n),O(e,r,n),u[i].m(e,n),O(e,s,n),a=!0},p(e,r){const a={};1&r&&(a.class=e[0]),2&r&&(a.id=e[1]),4&r&&(a.name=e[2]),!n&&8&r&&(n=!0,a.files=e[3],he(()=>n=!1)),t.$set(a);let l=i;i=f(e),i===l?u[i].p(e,r):($e(),Ce(u[l],1,1,()=>{u[l]=null}),Ie(),o=u[i],o?o.p(e,r):(o=u[i]=d[i](e),o.c()),_e(o,1),o.m(s.parentNode,s))},i(e){a||(_e(t.$$.fragment,e),_e(o),a=!0)},o(e){Ce(t.$$.fragment,e),Ce(o),a=!1},d(e){Re(t,e),e&&M(r),u[i].d(e),e&&M(s)}}}function Pc(e){let t,n,r,i;n=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}});let o=e[4]&&Vc(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(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=Vc(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Bc(e){let t,n;return t=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Lc(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[Fc]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),X(t,"margin-top","1em")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};67108928&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Fc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=F(e[6]),n=V(),ke(r.$$.fragment)},m(e,o){O(e,t,o),O(e,n,o),De(r,e,o),i=!0},p(e,n){(!i||64&n)&&j(t,e[6])},i(e){i||(_e(r.$$.fragment,e),i=!0)},o(e){Ce(r.$$.fragment,e),i=!1},d(e){e&&M(t),e&&M(n),Re(r,e)}}}function Vc(e){let t,n,r,i,o;return n=new Ke({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-o0hiko")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[13]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Uc(e){let t,n,r,i;const o=[Pc,Mc],s=[];return t=function(e){return e[11]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(_e(n),i=!0)},o(e){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}let Wc;function zc(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=u,l=ne();let c,d,{classId:f}=n,{eventId:h}=n,{record:m}=n,{item:p}=n,{id:g}=n,{name:w}=n,y=[],v=m[p.name]||"",$=!!m._id;const I={scale:{once:!1,value:3,start:3,step:.4,stop:4},resultOpts:{singleCodeInPage:!0,multiCodesInPage:!1,maxCodesInPage:1},improve:!0,jsQR:{}},_=e=>async n=>{if(!n.success)return;const i=await t.getSchema(h),o=n.codes?.filter(e=>!!e)?.at(0);if(!o?.length||!o.startsWith("SPC")){const n=await t.getSectionView("serviceAI",{event:i.identity.name});if(!n?.length)return;r(6,d="OCR Erkennung läuft, bitte warten."),r(5,c=!0);const o=new FormData;o.append("file",e);const s={headers:{"Content-Type":"multipart/mixed"}},a=await t.retrieveOCR(h,o,s);for(const e in a){let t=a[e];if(t?.split&&3===t.split("-").length&&24===t.length){const[e,n,r]=t.split("T")[0].split("-");t=new Date(e,n-1,r)}r(15,m[e]=t,m),l("record",{itemName:e,value:t})}return void r(5,c=!1)}const s=Dc(o);for(const e in s){if(i.items.find(t=>t.name===e)){if("object"==typeof s[e]){let n={};for(const i in s[e])if("object"==typeof s[e][i])for(const o in s[e][i]){s[e][i][o]&&(n[o]=s[e][i][o]);const a=await t.getSectionView(i,n);if(a?.length){const n=await t.getSectionView(e,{[i]:a[0]._id});n?.length&&r(15,m[e]=n[0]._id,m)}}else{s[e][i]&&(n[i]=s[e][i]);const o=await t.getSectionView(e,n);o?.length&&r(15,m[e]=o[0]._id,m)}}else s[e]&&r(15,m[e]=s[e],m);l("record",{itemName:e,value:m[e]})}}};return ee(()=>{if(Wc)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){Wc=PDF_QR_JS}}),te(()=>{}),e.$$set=e=>{"classId"in e&&r(0,f=e.classId),"eventId"in e&&r(16,h=e.eventId),"record"in e&&r(15,m=e.record),"item"in e&&r(17,p=e.item),"id"in e&&r(1,g=e.id),"name"in e&&r(2,w=e.name)},[f,g,w,y,v,c,d,i,o,s,a,$,async e=>{const n=y[0];if(!n){l("record",{itemName:"$file",value:!1});const e=await t.getSchema(h);for(const t of e.items)l("record",{itemName:t.name,value:""});return}const i=URL.createObjectURL(n);r(4,v=n.name),l("record",{itemName:"$file",value:{fileName:v,file:n}}),Wc.decodeDocument(i,I,_(n))},async()=>{if(!m?._id)return;const e=await t.getTaskByDocId(m._id,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;const r="/api/userreport/"+n[0]._id,i=await window.fetch(r),o=await i.blob(),s=window.URL.createObjectURL(o);window.open(s,"_blank")},()=>{r(3,y)},m,h,p,function(e){y=e,r(3,y)}]}class qc extends Oe{constructor(e){var t;super(),Oc.getElementById("svelte-o0hiko-style")||((t=B("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}",x(Oc.head,t)),xe(this,e,zc,Uc,T,{classId:0,eventId:16,record:15,item:17,id:1,name:2})}}const{document:Hc}=Ee;function jc(e){let t,n,r,i,o,s,a;function l(t){e[23](t)}let c={class:e[0],id:e[2],name:e[3],accept:e[4],max:"1",beforeChange:e[18]};void 0!==e[5]&&(c.files=e[5]),t=new e[10]({props:c}),oe.push(()=>Te(t,"files",l)),t.$on("change",e[14]);const d=[Zc,Yc],u=[];function f(e,t){return e[6]?0:1}return i=f(e),o=u[i]=d[i](e),{c(){ke(t.$$.fragment),r=V(),o.c(),s=U()},m(e,n){De(t,e,n),O(e,r,n),u[i].m(e,n),O(e,s,n),a=!0},p(e,r){const a={};1&r[0]&&(a.class=e[0]),4&r[0]&&(a.id=e[2]),8&r[0]&&(a.name=e[3]),16&r[0]&&(a.accept=e[4]),!n&&32&r[0]&&(n=!0,a.files=e[5],he(()=>n=!1)),t.$set(a);let l=i;i=f(e),i===l?u[i].p(e,r):($e(),Ce(u[l],1,1,()=>{u[l]=null}),Ie(),o=u[i],o?o.p(e,r):(o=u[i]=d[i](e),o.c()),_e(o,1),o.m(s.parentNode,s))},i(e){a||(_e(t.$$.fragment,e),_e(o),a=!0)},o(e){Ce(t.$$.fragment,e),Ce(o),a=!1},d(e){Re(t,e),e&&M(r),u[i].d(e),e&&M(s)}}}function Gc(e){let t,n,r,i;n=new e[11]({props:{inputClass:e[0],readonly:!0,id:e[2],name:e[2],value:e[8]}});let o=e[8]&&Qc(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r[0]&&(i.inputClass=e[0]),4&r[0]&&(i.id=e[2]),4&r[0]&&(i.name=e[2]),256&r[0]&&(i.value=e[8]),n.$set(i),e[8]?o?(o.p(e,r),256&r[0]&&_e(o,1)):(o=Qc(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Xc(e){let t,n,r,i,o,s,a,l;return n=new e[11]({props:{inputClass:e[0],disabled:!0,id:e[2],name:e[2],value:e[1].properties.file.desc}}),o=new Ke({props:{size:"18"}}),{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("span"),ke(o.$$.fragment),H(i,"class","feather pointer svelte-o0hiko"),X(t,"position","relative")},m(c,d){O(c,t,d),De(n,t,null),x(t,r),x(t,i),De(o,i,null),s=!0,a||(l=W(i,"click",e[16]),a=!0)},p(e,t){const r={};1&t[0]&&(r.inputClass=e[0]),4&t[0]&&(r.id=e[2]),4&t[0]&&(r.name=e[2]),2&t[0]&&(r.value=e[1].properties.file.desc),n.$set(r)},i(e){s||(_e(n.$$.fragment,e),_e(o.$$.fragment,e),s=!0)},o(e){Ce(n.$$.fragment,e),Ce(o.$$.fragment,e),s=!1},d(e){e&&M(t),Re(n),Re(o),a=!1,l()}}}function Yc(e){let t,n;return t=new e[11]({props:{inputClass:e[0],hidden:!0,id:e[2],name:e[2],value:e[8]}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};1&n[0]&&(r.inputClass=e[0]),4&n[0]&&(r.id=e[2]),4&n[0]&&(r.name=e[2]),256&n[0]&&(r.value=e[8]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Zc(e){let t,n,r;return n=new e[12]({props:{outline:!0,$$slots:{default:[Kc]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),X(t,"margin-top","1em")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};128&t[0]|4&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Kc(e){let t,n,r,i;return r=new e[13]({}),{c(){t=F(e[7]),n=V(),ke(r.$$.fragment)},m(e,o){O(e,t,o),O(e,n,o),De(r,e,o),i=!0},p(e,n){(!i||128&n[0])&&j(t,e[7])},i(e){i||(_e(r.$$.fragment,e),i=!0)},o(e){Ce(r.$$.fragment,e),i=!1},d(e){e&&M(t),e&&M(n),Re(r,e)}}}function Qc(e){let t,n,r,i,o;const s=[ed,Jc],a=[];function l(e,n){return 256&n[0]&&(t=!!e[8].endsWith(".mp4")),t?0:1}return n=l(e,[-1]),r=a[n]=s[n](e),{c(){r.c(),i=U()},m(e,t){a[n].m(e,t),O(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):($e(),Ce(a[o],1,1,()=>{a[o]=null}),Ie(),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){Ce(r),o=!1},d(e){a[n].d(e),e&&M(i)}}}function Jc(e){let t,n,r,i,o;return n=new Ke({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-o0hiko")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[15]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function ed(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:rd,then:nd,catch:td,value:32};return be(e[17](),n),{c(){t=U(),n.block.c()},m(e,r){O(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){Ae(n,e=t,r)},i:b,o:b,d(e){e&&M(t),n.block.d(e),n.token=null,n=null}}}function td(e){return{c:b,m:b,p:b,d:b}}function nd(e){let t,n,r,i;return{c(){t=B("video"),n=B("source"),i=F("\n Your browser does not support HTML video."),n.src!==(r=e[32])&&H(n,"src",r),H(n,"type","video/mp4"),H(t,"width","500"),t.controls=!0,X(t,"margin-top","1em")},m(e,r){O(e,t,r),x(t,n),x(t,i)},p:b,d(e){e&&M(t)}}}function rd(e){return{c:b,m:b,p:b,d:b}}function id(e){let t,n,r,i;const o=[Xc,Gc,jc],s=[];function a(e,t){return e[1].properties?.file?0:e[9]?1:2}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}let od=new Array(201),sd="";function ad(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=u,l=ne();let{classId:c}=n,{eventId:d}=n,{record:f}=n,{item:h}=n,{id:m}=n,{name:p}=n,{praefix:g}=n,{recordId:w}=n,{fileType:y="application/pdf"}=n;const v=void 0===g||""===g?200:+g;let $,I,_=[],C="",b=!1;const A=async e=>{const n=await t.getSchema(d),i=await t.getSectionView("serviceAI",{event:n.identity.name});if(!i?.length)return;r(7,I="OCR Erkennung läuft, bitte warten."),r(6,$=!0);const o=new FormData;o.append("file",e);const s=await t.retrieveOCR(d,o,{headers:{"Content-Type":"multipart/mixed"}});for(const e in s){let t=s[e];if(Array.isArray(t))r(19,f[e]=t,f);else{if(t?.split&&3===t.split("-").length&&24===t.length){const[e,n,r]=t.split("T")[0].split("-");t=new Date(e,n-1,r)}r(19,f[e]=t,f),l("record",{itemName:e,value:t})}}r(6,$=!1)};return ee(()=>{sd!==c&&(od=new Array(201),r(5,_=[]),r(8,C="")),(async()=>{if(!w)return;const e=await t.getTaskByDocId(w,!0);if(!e)return l("listRecord",{itemName:"fileName",value:"",string:!0});const n=f[h.name];if(!n)return l("listRecord",{itemName:"fileName",value:"",string:!0});const i=await t.getUserReports(e._id);if(!i?.length)return l("listRecord",{itemName:"fileName",value:"",string:!0});let o=i.find(e=>e.fileName===n);if(!o)return l("listRecord",{itemName:"fileName",value:"",string:!0});r(8,C=o.fileName),r(9,b=void 0===g?!!w:!!C)})(),sd=c}),te(()=>{}),e.$$set=e=>{"classId"in e&&r(0,c=e.classId),"eventId"in e&&r(20,d=e.eventId),"record"in e&&r(19,f=e.record),"item"in e&&r(1,h=e.item),"id"in e&&r(2,m=e.id),"name"in e&&r(3,p=e.name),"praefix"in e&&r(21,g=e.praefix),"recordId"in e&&r(22,w=e.recordId),"fileType"in e&&r(4,y=e.fileType)},e.$$.update=()=>{524288&e.$$.dirty[0]&&(C||od[v]&&od[v].length&&(_?.length||r(5,_=od[v]),r(8,C=_[0].name)))},[c,h,m,p,y,_,$,I,C,b,i,o,s,a,async e=>{let t="";const n=_[0];n?(r(8,C=t=n.name),od[v]=_):(r(8,C=""),t=od[v][0].name,od[v]=[]),l("record",{itemName:"$file",value:{fileName:t,file:n}}),200!=v?l("listRecord",{itemName:h.name,value:n?t:"",string:!0}):await A(n)},async()=>{if(!w)return;const e=await t.getTaskByDocId(w,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;let r=n.find(e=>e.fileName===C);r||(r=n[0])},async()=>{const{service:e,name:n,fileName:r}=h.properties.file,i=await t.getServiceReport(n,e,f[r],"payslip.pdf"),o=new Uint8Array(Object.values(i)),s=new Blob([o],{type:"application/pdf"}),a=URL.createObjectURL(s);window.open(a,"_blank")},async()=>{const e=await t.getTaskByDocId(w,!0);if(!e)return"";const n=await t.getUserReports(e._id);if(!n?.length)return"";let r=n.find(e=>e.fileName===C);return r||(r=n[0]),"/api/userreport/"+r._id},e=>{r(5,_)},f,d,g,w,function(e){_=e,r(5,_)}]}class ld extends Oe{constructor(e){var t;super(),Hc.getElementById("svelte-o0hiko-style")||((t=B("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}",x(Hc.head,t)),xe(this,e,ad,id,T,{classId:0,eventId:20,record:19,item:1,id:2,name:3,praefix:21,recordId:22,fileType:4},[-1,-1])}}function cd(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:dd,placeholder:ud,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=B("div"),ke(n.$$.fragment),X(t,"max-width","4em")},m(e,i){O(e,t,i),De(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){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}const dd="([01][0-9]|2[0-3]):([0-5][0-9])",ud="";function fd(e,t,n){const r=ne(),{TextField:i}=u;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:c}=t,{disabled:d}=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,c=e.readonly),"disabled"in e&&n(4,d=e.disabled),"praefix"in e&&n(8,f=e.praefix)},[o,a,l,c,d,i,({detail:e})=>{r("blur",{value:h(e.value)}),r("checkRange",{idx:f,fieldId:o,value:e.value})},s,f]}class hd extends Oe{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=B("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",x(document.head,t)),xe(this,e,fd,cd,T,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:md}=Ee;function pd(e,t,n){const r=e.slice();return r[29]=t[n],r}function gd(e,t,n){const r=e.slice();return r[32]=t[n],r[34]=n,r}function wd(e){return{c:b,m:b,p:b,d:b}}function yd(e){let t,n,r=e[35]+"",i=e[34]&&function(){let e;return{c(){e=F(", ")},m(t,n){O(t,e,n)},d(t){t&&M(e)}}}();return{c(){t=B("span"),i&&i.c(),n=F(r),H(t,"class","lookupValue")},m(e,r){O(e,t,r),i&&i.m(t,null),x(t,n)},p(e,t){3&t[0]&&r!==(r=e[35]+"")&&j(n,r)},d(e){e&&M(t),i&&i.d()}}}function vd(e){return{c:b,m:b,p:b,d:b}}function $d(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:vd,then:yd,catch:wd,value:35};return be(n=e[3](e[29],e[32]),r),{c(){t=U(),r.block.c()},m(e,n){O(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t},p(t,i){e=t,r.ctx=e,3&i[0]&&n!==(n=e[3](e[29],e[32]))&&be(n,r)||Ae(r,e,i)},d(e){e&&M(t),r.block.d(e),r.token=null,r=null}}}function Id(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]=$d(gd(e,d,t));i=new St({props:{size:"18"}});let f=e[2]&&function(e){let t,n,r,i,o,s,a,l,c;return i=new Ke({props:{size:"18"}}),{c(){t=B("span"),t.textContent=" / ",n=V(),r=B("span"),ke(i.$$.fragment),o=V(),s=B("span"),s.textContent="Rechnung",H(r,"class","pointer feather2 svelte-1jurfpd")},m(d,u){O(d,t,u),O(d,n,u),O(d,r,u),De(i,r,null),O(d,o,u),O(d,s,u),a=!0,l||(c=W(r,"click",function(){N(e[5](e[29]._id))&&e[5](e[29]._id).apply(this,arguments)}),l=!0)},p(t,n){e=t},i(e){a||(_e(i.$$.fragment,e),a=!0)},o(e){Ce(i.$$.fragment,e),a=!1},d(e){e&&M(t),e&&M(n),e&&M(r),Re(i),e&&M(o),e&&M(s),l=!1,c()}}}(e);return{c(){t=B("div");for(let e=0;e<u.length;e+=1)u[e].c();n=V(),r=B("span"),ke(i.$$.fragment),o=V(),f&&f.c(),s=V(),H(r,"class","feather pointer svelte-1jurfpd"),H(t,"class","lookupItem svelte-1jurfpd")},m(d,h){O(d,t,h);for(let e=0;e<u.length;e+=1)u[e].m(t,null);x(t,n),x(t,r),De(i,r,null),x(t,o),f&&f.m(t,null),x(t,s),a=!0,l||(c=W(r,"click",function(){N(e[4](e[29]._id))&&e[4](e[29]._id).apply(this,arguments)}),l=!0)},p(r,i){if(e=r,11&i[0]){let r;for(d=e[0],r=0;r<d.length;r+=1){const o=gd(e,d,r);u[r]?u[r].p(o,i):(u[r]=$d(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){Ce(i.$$.fragment,e),Ce(f),a=!1},d(e){e&&M(t),P(u,e),Re(i),f&&f.d(),l=!1,c()}}}function _d(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=Id(pd(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){t=B("div");for(let e=0;e<i.length;e+=1)i[e].c();H(t,"class","lookup svelte-1jurfpd")},m(e,r){O(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[0]){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=pd(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=Id(o),i[s].c(),_e(i[s],1),i[s].m(t,null))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){e&&M(t),P(i,e)}}}function Cd(e,n,r){let{id:i}=n,{item:o}=n,{praefix:s}=n,{record:a}=n,{fullRecord:c}=n,{notifyList:d}=n,{classId:u}=n,{_listName:f}=n;const{refItem:h,refClass:m,view:p,beforeSave:w,showAlways:y,_state:$,addAttachment:I}=o.properties;let _=p.split(","),[C,b]=h.split(":");const[A,E]=C.split(",");let S=[];const[N,T]=b.split("."),k=(e,t)=>{const[n,r]=t.split(".");return r?e[n]?e[n][r]:void 0:""},D=(e=!0)=>{ue().then(()=>{let t;if(t=""===s||void 0===s?document.querySelector("div.form-field."+o.name):document.querySelector(`#accordion-content-${u}-${f}-${s} .form-field.${o.name}`),t&&(t.style.display=e?"none":"flex"),!e&&w){const e=t.querySelector("div label");e&&(e.style.color="red")}})};return ee(D),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),"fullRecord"in e&&r(10,c=e.fullRecord),"notifyList"in e&&r(11,d=e.notifyList),"classId"in e&&r(12,u=e.classId),"_listName"in e&&r(13,f=e._listName)},e.$$.update=()=>{2048&e.$$.dirty[0]&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==A&&n!==E)return;if(r(1,S=[]),!i)return;if(void 0===s||""===s){if(!y&&!!w==!!a._id)return D();if(!a._id&&!a[A])return D()}const o=!_.some(e=>e.includes(":")),l=T?T+"."+A:A;let d={[l]:a[A]||a._id};if(E){if(!a[E]&&!c[E])return D();const e=u.split("-")[1].slice(0,-4),n=await t.getSchemaByClass(e);let r=n?.items?.find(e=>e.name===E);r||(r=n.list?.at(0)?.item.find(e=>e.name===E)),r?.refClass&&(d[r.refClass]=a[E]||c[E])}$&&(d=[{$match:d},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":$}}]);let f=!1;if(!l.includes(".")){const e=await t.getSchemaByClass(N),n=e?.items?.find(e=>e.name===l);n?.properties?.multi&&(f=!0)}if(r(1,S=await t.getSectionView(N,d,o,!0,f)),!o&&S.length){const e=_.find(e=>e.includes(":")),t=e.split(":")[0];r(1,S=S.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,_=_.map(e=>e.split(":")[1]))}D(!S.length)})(d)},[_,S,I,async(e,t)=>{let n="boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||g(e[t])||e[t]||k(e,t);if(v(n)){const e=await bw(m,n);e?.designation&&(n=e.designation)}return n},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()=>{const n=await t.getTaskByDocId(e,!0);if(!n)return;const r=await t.getUserReports(n._id);if(!r?.length)return;let i=r[0];l(i)},i,o,s,a,c,d,u,f]}class bd extends Oe{constructor(e){var t;super(),md.getElementById("svelte-1jurfpd-style")||((t=B("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}",x(md.head,t)),xe(this,e,Cd,_d,T,{id:6,item:7,praefix:8,record:9,fullRecord:10,notifyList:11,classId:12,_listName:13},[-1,-1])}}function Ad(e){let t,n,r;return n=new xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Ed(e){let t,n,r,i,o;return n=new xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[9]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Sd(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=[Ed,Ad],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}function Nd(e,t,n){const{TextField:r}=u;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:c}=t,{name:d}=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,c=e.id),"name"in e&&n(6,d=e.name),"value"in e&&n(7,f=e.value)},[i,o,s,a,l,c,d,f,r,async()=>{if(!f)return;let e=f;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){re(e,t)}]}class Td extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,Nd,Sd,T,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function kd(e){let t,n,r;return n=new Ht({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Dd(e){let t,n,r,i,o;return n=new Ht({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[12]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Rd(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=[Dd,kd],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}function xd(e,t,r){let i;const{TextField:o}=u,{environment:s}=h;k(e,s,e=>r(16,i=e));const a=JSON.parse(n.getItem("Locale"));let{inputClass:l}=t,{disabled:c}=t,{formnovalidate:d}=t,{readonly:f}=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"},b=e=>{const t=e?.split("-")?.at(-1)?.toLowerCase();return t||"ch"};return e.$$set=e=>{"inputClass"in e&&r(2,l=e.inputClass),"disabled"in e&&r(3,c=e.disabled),"formnovalidate"in e&&r(4,d=e.formnovalidate),"readonly"in e&&r(5,f=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=>{let t,n,o;const{listName:s,itemName:l,value:c}=e||{};I&&l===I&&c?t=c:i?.owner?.address?.country?t=i.owner.address.country:i?.owner?.country&&(t=i.owner.country),t&&(n=await bw("country",t)),o=n?.countryCode?.toLowerCase()||b(a.id),n?.phonePattern?(r(0,y=n.phonePattern),r(1,v=n.phonePlaceholder||"")):o&&_[o]&&(r(0,y=_[o]),r(1,v=C[o]))})($)},[y,v,l,c,d,f,m,p,g,w,o,s,async()=>{if(!w)return;let e="tel:"+w;window.open(e,"_self")},$,I,function(t){re(e,t)}]}class Od extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,xd,Rd,T,{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 Md(e){let t,n,r;return n=new Ft({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Pd(e){let t,n,r,i,o;return n=new Ft({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[12]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Bd(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=[Pd,Md],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}function Ld(e,t,n){const{TextField:r}=u;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:c}=t,{name:d}=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,c=e.id),"name"in e&&n(6,d=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,c,d,f,h,m,p,r,async()=>{if(!f)return;let e="mailto:"+f;window.open(e,"_self")},function(t){re(e,t)}]}class Fd extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,Ld,Bd,T,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const Vd=["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 Ud(e){let t;return{c(){t=B("textarea"),H(t,"id",e[0]),X(t,"visibility","hidden")},m(n,r){O(n,t,r),e[20](t)},p(e,n){1&n&&H(t,"id",e[0])},d(n){n&&M(t),e[20](null)}}}function Wd(e){let t;return{c(){t=B("div"),H(t,"id",e[0])},m(n,r){O(n,t,r),e[19](t)},p(e,n){1&n&&H(t,"id",e[0])},d(n){n&&M(t),e[19](null)}}}function zd(e){let t;function n(e,t){return e[1]?Wd:Ud}let r=n(e),i=r(e);return{c(){t=B("div"),i.c(),H(t,"class",e[2])},m(n,r){O(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&&H(t,"class",e[2])},i:b,o:b,d(n){n&&M(t),i.d(),e[21](null)}}}const qd=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let Hd=(()=>{let e={listeners:[],scriptId:qd("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 jd(e,t,n){let r,i,o,{id:s=qd("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")},b=ne(),A=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},E=()=>{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)=>{Vd.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,b),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=A())||void 0===e||e.init(t)};return ee(()=>{if(null!==A())E();else{const e=h||`https://cdn.tiny.cloud/1/${d}/tinymce/${f}/tinymce.min.js`;Hd.load(r.ownerDocument,e,()=>{E()})}}),te(()=>{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){oe[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){oe[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){oe[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class Gd extends Oe{constructor(e){super(),xe(this,e,jd,zd,T,{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 Xd(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 Gd({props:c}),oe.push(()=>Te(n,"value",l)),n.$on("init",e[9]),{c(){t=B("div"),ke(n.$$.fragment),i=V(),o=B("input"),H(o,"class",s=e[1]||e[2]),H(o,"id",e[3]),H(o,"name",e[3]),o.value=e[0],o.hidden=!0,X(t,"min-height","10em"),X(t,"margin-top","-1em"),t.hidden=e[4]},m(e,r){O(e,t,r),De(n,t,null),x(t,i),x(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],he(()=>r=!1)),n.$set(l),(!a||6&i&&s!==(s=e[1]||e[2]))&&H(o,"class",s),(!a||8&i)&&H(o,"id",e[3]),(!a||8&i)&&H(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){Ce(n.$$.fragment,e),a=!1},d(e){e&&M(t),Re(n)}}}let Yd,Zd=!1;function Kd(e,t,r){let i;const{environment:o}=h;k(e,o,e=>r(16,i=e));const s=ne();let a=JSON.parse(n.getItem("Locale")).id;a=a.startsWith("fr")?"fr_FR":a.split("-")[0];let l,c,{value:d=""}=t,{noForm:u}=t,{classId:f}=t,{id:m}=t,{record:p}=t,{hidden:g}=t,{disabled:w}=t,{readonly:y}=t,{keepOrigin:$}=t;const I=(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,u=e.noForm),"classId"in e&&r(2,f=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,w=e.disabled),"readonly"in e&&r(6,y=e.readonly),"keepOrigin"in e&&r(11,$=e.keepOrigin)},e.$$.update=()=>{1024&e.$$.dirty&&(async e=>{if(Zd)return;if($)return;if(!l)return;if(Yd&&!Yd.includes("{{"))return void r(0,d=Yd);Yd=d;const t=I(d,e,c);if(!t?.length)return;Zd=!0;const n=await Promise.all(t.map(async(t,n)=>{let r;return e[t.table]&&(r=await bw(t.table,e[t.table]).catch(()=>{})),{table:r,def:t}}));for(const e of n)for(const t of e.def.attrs){const[n,r]=t.split(".");let i;if(r&&v(e.table&&e.table[n])){const t=await bw(n,e.table[n]);t&&(i=t[r])}else i=_(e.table||c[e.def.table],t);if(i?.endsWith("Z")&&24===i?.length){let[e,t,n]=i.split("-");n=n.slice(0,2),i=`${n}.${t}.${e}`}Yd=Yd.replace(`{{${e.def.table}.${t}}}`,i||"")}r(0,d=Yd||""),s("blur",{value:d}),Zd=!1})(p)},[d,u,f,m,g,w,y,o,C,e=>{c={owner:i.owner},l=!0,Yd=void 0},p,$,function(e){d=e,r(0,d)}]}class Qd extends Oe{constructor(e){var t;super(),document.getElementById("svelte-yi7lpi-style")||((t=B("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}",x(document.head,t)),xe(this,e,Kd,Xd,T,{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,h,m;return{setters:[function(e){t=e.Request,n=e.Storage,r=e.task_notification,i=e.currentRoles,o=e.TextArea,s=e.settings,a=e.toasts,l=e.activateViewer,c=e.printJS,d=e.Page},function(e){u=e.getAttractions,f=e.PopOver},function(e){h=e.user},function(e){m=e.taskClipboard}],execute:function(){function p(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.434");const g=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(" · ")),w=e=>{try{return new Date(e).toLocaleString()}catch{return e}},y=(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()},v=e=>/^[0-9a-f]{24}/.test(e),$=e=>!0===e?"(ja)":!1===e?"(nein)":"",I=(e,t)=>{if(!e.display&&!e.items)return"";const n={...t},r=e.display?.reduce((t,r)=>{const i=e.items.find(e=>e.name===r.split(":")[0]);if("template"===i?.type)return t.push("$$"+i.refItem.split(".").at(-1)),t;let[o,s]=r.split(".");if(e.list?.find(({name:e})=>e===o)&&s&&void 0!==n[o]){const e=`${o}_${s}`;n[e]=n[o][s],o=e}return t.find(e=>e===o)||t.push(o),t},[]).map(e=>{let t=n[e];if(e.startsWith("$$")){let t=n[e?.slice(2)];const r=[];for(const e in t)Array.isArray(t[e])?r.push(t[e].join(",")):r.push(t[e]);return r?.join(" / ")}if("boolean"==typeof t)return $(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 g(n["_"+e]||t)})||e.items.map(e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name]));return r.map(e=>e?.toString().split(" · ").filter(e=>!!e&&!v(e)).join(" · ")).filter(e=>!!e).join(" • ")},_=(e,t)=>{try{return t.split(".").reduce((e,t)=>e[t],e)??""}catch{return""}};const C=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 b(){}function A(e){return e()}function E(){return Object.create(null)}function S(e){e.forEach(A)}function N(e){return"function"==typeof e}function T(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function k(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return b;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function D(e){return null==e?"":e}function R(e,t,n=t){return e.set(n),t}function x(e,t){e.appendChild(t)}function O(e,t,n){e.insertBefore(t,n||null)}function M(e){e.parentNode.removeChild(e)}function P(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function B(e){return document.createElement(e)}function L(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function F(e){return document.createTextNode(e)}function V(){return F(" ")}function U(){return F("")}function W(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function z(e){return function(t){return t.preventDefault(),e.call(this,t)}}function q(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function H(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function j(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function G(e,t){e.value=null==t?"":t}function X(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function Y(e,t,n){e.classList[n?"add":"remove"](t)}class Z{constructor(e=null){this.a=e,this.e=this.n=null}m(e,t,n=null){this.e||(this.e=B(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)O(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(M)}}let K;function Q(e){K=e}function J(){if(!K)throw new Error("Function called outside component initialization");return K}function ee(e){J().$$.on_mount.push(e)}function te(e){J().$$.on_destroy.push(e)}function ne(){const e=J();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 re(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(e=>e(t))}const ie=[],oe=[],se=[],ae=[],le=Promise.resolve();let ce=!1;function de(){ce||(ce=!0,le.then(ge))}function ue(){return de(),le}function fe(e){se.push(e)}function he(e){ae.push(e)}let me=!1;const pe=new Set;function ge(){if(!me){me=!0;do{for(let e=0;e<ie.length;e+=1){const t=ie[e];Q(t),we(t.$$)}for(Q(null),ie.length=0;oe.length;)oe.pop()();for(let e=0;e<se.length;e+=1){const t=se[e];pe.has(t)||(pe.add(t),t())}se.length=0}while(ie.length);for(;ae.length;)ae.pop()();ce=!1,me=!1,pe.clear()}}function we(e){if(null!==e.fragment){e.update(),S(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(fe)}}const ye=new Set;let ve;function $e(){ve={r:0,c:[],p:ve}}function Ie(){ve.r||S(ve.c),ve=ve.p}function _e(e,t){e&&e.i&&(ye.delete(e),e.i(t))}function Ce(e,t,n,r){if(e&&e.o){if(ye.has(e))return;ye.add(e),ve&&ve.c.push(()=>{ye.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}}function be(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&&($e(),Ce(e,1,1,()=>{t.blocks[n]===e&&(t.blocks[n]=null)}),Ie())}):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&&ge()}if((i=e)&&"object"==typeof i&&"function"==typeof i.then){const n=J();if(e.then(e=>{Q(n),r(t.then,1,t.value,e),Q(null)},e=>{if(Q(n),r(t.catch,2,t.error,e),Q(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 Ae(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 Se(e,t){Ce(e,1,1,()=>{t.delete(e.key)})}function Ne(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 Te(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function ke(e){e&&e.c()}function De(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:s,after_update:a}=e.$$;i&&i.m(t,n),r||fe(()=>{const t=o.map(A).filter(N);s?s.push(...t):S(t),e.$$.on_mount=[]}),a.forEach(fe)}function Re(e,t){const n=e.$$;null!==n.fragment&&(S(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function xe(e,t,n,r,i,o,s=[-1]){const a=K;Q(e);const l=e.$$={fragment:null,ctx:null,props:o,update:b,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]&&(ie.push(e),de(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n}):[],l.update(),c=!0,S(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(M)}else l.fragment&&l.fragment.c();t.intro&&_e(e.$$.fragment),De(e,t.target,t.anchor,t.customElement),ge()}Q(a)}class Oe{$destroy(){Re(this,1),this.$destroy=b}$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 Me(e,t,n){const r=e.slice();return r[14]=t[n][0],r[15]=t[n][1],r}function Pe(e){let t;return{c(){t=B("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Be(e){let t;return{c(){t=B("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Le(e){return{c:b,m:b,p:b,d:b}}function Fe(e){let t,n=e[6],r=[];for(let t=0;t<n.length;t+=1)r[t]=Ve(Me(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);O(e,t,n)},p(e,i){if(1025&i){let o;for(n=e[6],o=0;o<n.length;o+=1){const s=Me(e,n,o);r[o]?r[o].p(s,i):(r[o]=Ve(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){P(r,e),e&&M(t)}}}function Ve(e){let t,n,r,i=e[14]+"";return{c(){t=B("option"),n=F(i),t.__value=e[15],t.value=t.__value,t.selected=r=e[0]==e[15]},m(e,r){O(e,t,r),x(t,n)},p(e,n){1&n&&r!==(r=e[0]==e[15])&&(t.selected=r)},d(e){e&&M(t)}}}function Ue(e){return{c:b,m:b,p:b,d:b}}function We(e){let t,n,r,i,o,s=(!e[7]||e[9])&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Be:Pe}let r=n(e),i=r(e);return{c(){i.c(),t=U()},m(e,n){i.m(e,n),O(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&&M(t)}}}(e),a={ctx:e,current:null,token:null,hasCatch:!1,pending:Ue,then:Fe,catch:Le,value:6};return be(e[10](),a),{c(){t=B("select"),s&&s.c(),n=U(),a.block.c(),H(t,"class",r=D(e[3]||e[4])+" svelte-5xpzvo"),H(t,"id",e[2]),H(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(r,l){O(r,t,l),s&&s.m(t,null),x(t,n),a.block.m(t,a.anchor=null),a.mount=()=>t,a.anchor=null,i||(o=W(t,"change",e[11]),i=!0)},p(n,[i]){(e=n)[7]&&!e[9]||s.p(e,i),Ae(a,e,i),24&i&&r!==(r=D(e[3]||e[4])+" svelte-5xpzvo")&&H(t,"class",r),4&i&&H(t,"id",e[2]),4&i&&H(t,"name",e[2]),2&i&&(t.disabled=e[1]),32&i&&(t.required=e[5])},i:b,o:b,d(e){e&&M(t),s&&s.d(),a.block.d(),a.token=null,a=null,i=!1,o()}}}const ze=async(e,n,r)=>{if("finYear"===e){const e=(new Date).getFullYear();r||=e,n=[[(e-1).toString(),e-1],[e.toString(),e],[(e+1).toString(),e+1]]}return"canton"===e&&(n=[["Aargau","AG"],["Appenzell Ausserrhoden","AR"],["Appenzell Innerrhoden","AI"],["Basel-Land","BL"],["Basel-Stadt","BS"],["Bern","BE"],["Freiburg","FR"],["Genf","GE"],["Glarus","GL"],["Graubünden","GR"],["Jura","JU"],["Luzern","LU"],["Neuenburg","NE"],["Obwalden","OW"],["Schaffhausen","SH"],["Schwyz","SZ"],["Solothurn","SO"],["Sankt-Gallen","SG"],["Tessin","TI"],["Thurgau","TG"],["Uri","UR"],["Waadt","VD"],["Wallis","VS"],["Zug","ZG"],["Zürich","ZH"],["Expat","EX"]]),"businessMonth"===e&&(r||=1,n=[["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"===e&&(r||=2024,n=[["2024/2025",2024]]),"valueAddedTax"===e&&(r||=0,n=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),"supplierAI"===e&&(r||="Anthropic",n=[["Anthropic","Anthropic"]]),"supplierAIModel"===e&&(r||="claude-opus-4-7",n=[["Claude Opus 4.8","claude-opus-4-8"],["Claude Opus 4.7","claude-opus-4-7"],["Claude Sonnet 4.6","claude-sonnet-4-6"],["Claude Opus 4.6","claude-opus-4-6"],["Claude Haiku 4.5","claude-haiku-4-5"],["Claude Opus 4.5","claude-opus-4-5"]]),"event"===e&&(r||="",n=(async()=>(await t.getEvents()).filter(e=>!(e.output?.type||"ai"===e.output?.subType||e.trigger&&"Manual"!==e.trigger?.startOn?.at(0)?.type)).sort((e,t)=>e.identity.designation.localeCompare(t.identity.designation)).map(e=>[e.identity.designation,e.identity.name]))()),"asonpayrollEmployee"===e&&(r||="",n=[["",""],["Zivilstand ändern","CH.Swissdec.EmployeeCivilStatusData"],["Kontaktdaten ändern","CH.Swissdec.EmployeeContact"],["Adresse ändern","CH.Swissdec.EmployeeAddressData"],["Monatslohn bearbeiten","CH.Swissdec.EmployeeSalaryChange-CH.Swissdec.EmployeeSalaryChangeQuestion-SalaryChangeSalaryChange"],["Bankdaten ändern","CH.Swissdec.EmployeeBankData"],["Persönliche Daten ändern","CH.Swissdec.EmployeePersonalData"],["Berufsbezeichnung ergänzen","CH.Swissdec.EmployeeStatisticsJobTitleCase"],["UVG-Daten verwalten","CH.Swissdec.SocialInsurancesUvg"]]),"asonpayrollOwner"===e&&(r||="",n=[["",""],["Firmendaten ändern","CH.Swissdec.CompanyData"],["Adresse ändern","CH.Swissdec.CompanyAddressData"],["Bankdaten ändern","CH.Swissdec.CompanyBankData"],["Stellvertreter erfassen/ändern","CH.Swissdec.CompanyTrusteeData"],["ELM-Übermittlungen konfigurieren","CH.Swissdec.CompanyElmTransmissionsConfigurations"]]),{value:r,options:n}};function qe(e,t,n){const r=ne();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,source:m}=o.properties;u?.length&&!Array.isArray(u[0])&&(u=u.map(e=>[e,e]));c||=!0===h,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,i=e.id),"item"in e&&n(12,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,m,async()=>{const e=await ze(f,u,s);return n(0,s=e.value),n(6,u=e.options),u},e=>r("blur",{value:e.srcElement.value}),o]}class He extends Oe{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=B("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}",x(document.head,t)),xe(this,e,qe,We,T,{id:2,item:12,value:0,noForm:3,classId:4,disabled:1,required:5})}}function je(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("path"),H(n,"d","M10 3 L11.5 8.5 L17 10 L11.5 11.5 L10 17 L8.5 11.5 L3 10 L8.5 8.5 Z"),H(r,"d","M17 14 L17.75 16.25 L20 17 L17.75 17.75 L17 20 L16.25 17.75 L14 17 L16.25 16.25 Z"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-ai "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-ai "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Ge(e,t,n){let{size:r="100%"}=t,{strokeWidth:i=1}=t,{customClass: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),"customClass"in e&&n(2,o=e.customClass)},[r,i,o]}class Xe extends Oe{constructor(e){super(),xe(this,e,Ge,je,T,{size:0,strokeWidth:1,customClass:2})}}function Ye(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("polygon"),H(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"),H(r,"points","12 15 17 21 7 21 12 15"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-airplay "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-airplay "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(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 Ke extends Oe{constructor(e){super(),xe(this,e,Ze,Ye,T,{size:0,strokeWidth:1,class:2})}}function Qe(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("path"),r=L("line"),i=L("line"),H(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"),H(r,"x1","12"),H(r,"y1","9"),H(r,"x2","12"),H(r,"y2","13"),H(i,"x1","12"),H(i,"y1","17"),H(i,"x2","12.01"),H(i,"y2","17"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-alert-triangle "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-alert-triangle "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Je(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 et extends Oe{constructor(e){super(),xe(this,e,Je,Qe,T,{size:0,strokeWidth:1,class:2})}}function tt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("circle"),r=L("polyline"),i=L("line"),H(n,"cx","12"),H(n,"cy","12"),H(n,"r","10"),H(r,"points","8 12 12 16 16 12"),H(i,"x1","12"),H(i,"y1","8"),H(i,"x2","12"),H(i,"y2","16"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-arrow-down-circle "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-arrow-down-circle "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(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 rt extends Oe{constructor(e){super(),xe(this,e,nt,tt,T,{size:0,strokeWidth:1,class:2})}}function it(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("path"),H(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),H(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-book-open "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-book-open "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(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 st extends Oe{constructor(e){super(),xe(this,e,ot,it,T,{size:0,strokeWidth:1,class:2})}}function at(e){let t,n,r,i,o,s;return{c(){t=L("svg"),n=L("rect"),r=L("line"),i=L("line"),o=L("line"),H(n,"x","3"),H(n,"y","4"),H(n,"width","18"),H(n,"height","18"),H(n,"rx","2"),H(n,"ry","2"),H(r,"x1","16"),H(r,"y1","2"),H(r,"x2","16"),H(r,"y2","6"),H(i,"x1","8"),H(i,"y1","2"),H(i,"x2","8"),H(i,"y2","6"),H(o,"x1","3"),H(o,"y1","10"),H(o,"x2","21"),H(o,"y2","10"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",s="feather feather-calendar "+e[2])},m(e,s){O(e,t,s),x(t,n),x(t,r),x(t,i),x(t,o)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-calendar "+e[2])&&H(t,"class",s)},i:b,o:b,d(e){e&&M(t)}}}function lt(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 Oe{constructor(e){super(),xe(this,e,lt,at,T,{size:0,strokeWidth:1,class:2})}}function dt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("circle"),H(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"),H(r,"cx","12"),H(r,"cy","13"),H(r,"r","4"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-camera "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-camera "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function ut(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 ft extends Oe{constructor(e){super(),xe(this,e,ut,dt,T,{size:0,strokeWidth:1,class:2})}}function ht(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),H(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),H(r,"points","22 4 12 14.01 9 11.01"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-check-circle "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-check-circle "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function mt(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 pt extends Oe{constructor(e){super(),xe(this,e,mt,ht,T,{size:0,strokeWidth:1,class:2})}}function gt(e){let t,n,r;return{c(){t=L("svg"),n=L("path"),H(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"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",r="feather feather-command "+e[2])},m(e,r){O(e,t,r),x(t,n)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-command "+e[2])&&H(t,"class",r)},i:b,o:b,d(e){e&&M(t)}}}function wt(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 yt extends Oe{constructor(e){super(),xe(this,e,wt,gt,T,{size:0,strokeWidth:1,class:2})}}function vt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("polyline"),r=L("path"),H(n,"points","9 10 4 15 9 20"),H(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-corner-down-left "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-corner-down-left "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(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 It extends Oe{constructor(e){super(),xe(this,e,$t,vt,T,{size:0,strokeWidth:1,class:2})}}function _t(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("path"),r=L("line"),i=L("line"),H(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),H(r,"x1","18"),H(r,"y1","9"),H(r,"x2","12"),H(r,"y2","15"),H(i,"x1","12"),H(i,"y1","9"),H(i,"x2","18"),H(i,"y2","15"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-delete "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-delete "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Ct(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 Oe{constructor(e){super(),xe(this,e,Ct,_t,T,{size:0,strokeWidth:1,class:2})}}function At(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),i=L("line"),H(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),H(r,"points","15 3 21 3 21 9"),H(i,"x1","10"),H(i,"y1","14"),H(i,"x2","21"),H(i,"y2","3"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-external-link "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-external-link "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Et(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 St extends Oe{constructor(e){super(),xe(this,e,Et,At,T,{size:0,strokeWidth:1,class:2})}}function Nt(e){let t,n,r,i,o,s;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),i=L("line"),o=L("line"),H(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),H(r,"points","14 2 14 8 20 8"),H(i,"x1","12"),H(i,"y1","18"),H(i,"x2","12"),H(i,"y2","12"),H(o,"x1","9"),H(o,"y1","15"),H(o,"x2","15"),H(o,"y2","15"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",s="feather feather-file-plus "+e[2])},m(e,s){O(e,t,s),x(t,n),x(t,r),x(t,i),x(t,o)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-file-plus "+e[2])&&H(t,"class",s)},i:b,o:b,d(e){e&&M(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 kt extends Oe{constructor(e){super(),xe(this,e,Tt,Nt,T,{size:0,strokeWidth:1,class:2})}}function Dt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("circle"),r=L("line"),i=L("path"),H(n,"cx","12"),H(n,"cy","12"),H(n,"r","10"),H(r,"x1","2"),H(r,"y1","12"),H(r,"x2","22"),H(r,"y2","12"),H(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"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-globe "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-globe "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(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 Oe{constructor(e){super(),xe(this,e,Rt,Dt,T,{size:0,strokeWidth:1,class:2})}}function Ot(e){let t,n,r,i,o,s,a,l;return{c(){t=L("svg"),n=L("line"),r=L("line"),i=L("line"),o=L("line"),s=L("line"),a=L("line"),H(n,"x1","8"),H(n,"y1","6"),H(n,"x2","21"),H(n,"y2","6"),H(r,"x1","8"),H(r,"y1","12"),H(r,"x2","21"),H(r,"y2","12"),H(i,"x1","8"),H(i,"y1","18"),H(i,"x2","21"),H(i,"y2","18"),H(o,"x1","3"),H(o,"y1","6"),H(o,"x2","3.01"),H(o,"y2","6"),H(s,"x1","3"),H(s,"y1","12"),H(s,"x2","3.01"),H(s,"y2","12"),H(a,"x1","3"),H(a,"y1","18"),H(a,"x2","3.01"),H(a,"y2","18"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",l="feather feather-list "+e[2])},m(e,l){O(e,t,l),x(t,n),x(t,r),x(t,i),x(t,o),x(t,s),x(t,a)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&l!==(l="feather feather-list "+e[2])&&H(t,"class",l)},i:b,o:b,d(e){e&&M(t)}}}function Mt(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 Pt extends Oe{constructor(e){super(),xe(this,e,Mt,Ot,T,{size:0,strokeWidth:1,class:2})}}function Bt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("polyline"),H(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"),H(r,"points","22,6 12,13 2,6"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-mail "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-mail "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Lt(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 Ft extends Oe{constructor(e){super(),xe(this,e,Lt,Bt,T,{size:0,strokeWidth:1,class:2})}}function Vt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("path"),r=L("circle"),H(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),H(r,"cx","12"),H(r,"cy","10"),H(r,"r","3"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-map-pin "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-map-pin "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Ut(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 Oe{constructor(e){super(),xe(this,e,Ut,Vt,T,{size:0,strokeWidth:1,class:2})}}function zt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("polyline"),r=L("line"),i=L("path"),H(n,"points","23 7 23 1 17 1"),H(r,"x1","16"),H(r,"y1","8"),H(r,"x2","23"),H(r,"y2","1"),H(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"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-phone-outgoing "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-phone-outgoing "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function qt(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 Ht extends Oe{constructor(e){super(),xe(this,e,qt,zt,T,{size:0,strokeWidth:1,class:2})}}function jt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("rect"),r=L("line"),i=L("line"),H(n,"x","3"),H(n,"y","3"),H(n,"width","18"),H(n,"height","18"),H(n,"rx","2"),H(n,"ry","2"),H(r,"x1","12"),H(r,"y1","8"),H(r,"x2","12"),H(r,"y2","16"),H(i,"x1","8"),H(i,"y1","12"),H(i,"x2","16"),H(i,"y2","12"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-plus-square "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-plus-square "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(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 Xt extends Oe{constructor(e){super(),xe(this,e,Gt,jt,T,{size:0,strokeWidth:1,class:2})}}function Yt(e){let t,n,r,i,o;return{c(){t=L("svg"),n=L("polyline"),r=L("path"),i=L("rect"),H(n,"points","6 9 6 2 18 2 18 9"),H(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"),H(i,"x","6"),H(i,"y","14"),H(i,"width","12"),H(i,"height","8"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",o="feather feather-printer "+e[2])},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-printer "+e[2])&&H(t,"class",o)},i:b,o:b,d(e){e&&M(t)}}}function Zt(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 Kt extends Oe{constructor(e){super(),xe(this,e,Zt,Yt,T,{size:0,strokeWidth:1,class:2})}}function Qt(e){let t,n,r,i;return{c(){t=L("svg"),n=L("circle"),r=L("line"),H(n,"cx","11"),H(n,"cy","11"),H(n,"r","8"),H(r,"x1","21"),H(r,"y1","21"),H(r,"x2","16.65"),H(r,"y2","16.65"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",i="feather feather-search "+e[2])},m(e,i){O(e,t,i),x(t,n),x(t,r)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-search "+e[2])&&H(t,"class",i)},i:b,o:b,d(e){e&&M(t)}}}function Jt(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 en extends Oe{constructor(e){super(),xe(this,e,Jt,Qt,T,{size:0,strokeWidth:1,class:2})}}function tn(e){let t,n,r,i,o,s;return{c(){t=L("svg"),n=L("polyline"),r=L("path"),i=L("line"),o=L("line"),H(n,"points","3 6 5 6 21 6"),H(r,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),H(i,"x1","10"),H(i,"y1","11"),H(i,"x2","10"),H(i,"y2","17"),H(o,"x1","14"),H(o,"y1","11"),H(o,"x2","14"),H(o,"y2","17"),H(t,"xmlns","http://www.w3.org/2000/svg"),H(t,"width",e[0]),H(t,"height",e[0]),H(t,"fill","none"),H(t,"viewBox","0 0 24 24"),H(t,"stroke","currentColor"),H(t,"stroke-width",e[1]),H(t,"stroke-linecap","round"),H(t,"stroke-linejoin","round"),H(t,"class",s="feather feather-trash-2 "+e[2])},m(e,s){O(e,t,s),x(t,n),x(t,r),x(t,i),x(t,o)},p(e,[n]){1&n&&H(t,"width",e[0]),1&n&&H(t,"height",e[0]),2&n&&H(t,"stroke-width",e[1]),4&n&&s!==(s="feather feather-trash-2 "+e[2])&&H(t,"class",s)},i:b,o:b,d(e){e&&M(t)}}}function nn(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 rn extends Oe{constructor(e){super(),xe(this,e,nn,tn,T,{size:0,strokeWidth:1,class:2})}}const{document:on}=Ee;function sn(e){e[58]=e[59].items}function an(e,t,n){const r=e.slice();return r[60]=t[n],r[62]=n,r}function ln(e,t,n){const r=e.slice();return r[63]=t[n],r}function cn(e,t,n){const r=e.slice();return r[66]=t[n],r}function dn(e,t,n){const r=e.slice();return r[63]=t[n],r}function un(e,t,n){const r=e.slice();return r[66]=t[n],r}function fn(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function hn(e){let t,n,r,i,o,s;sn(e);let a=e[5]?.length&&mn(e),l=e[58]?.length&&gn(e),c=e[5]?.length&&$n(e);return{c(){a&&a.c(),t=V(),n=B("div"),r=B("table"),l&&l.c(),i=V(),o=B("tbody"),c&&c.c(),H(o,"class","svelte-1a9feqg"),H(r,"striped",""),H(r,"class","svelte-1a9feqg"),H(n,"class","eList svelte-1a9feqg")},m(e,d){a&&a.m(e,d),O(e,t,d),O(e,n,d),x(n,r),l&&l.m(r,null),x(r,i),x(r,o),c&&c.m(o,null),s=!0},p(e,n){sn(e),e[5]?.length?a?(a.p(e,n),32&n[0]&&_e(a,1)):(a=mn(e),a.c(),_e(a,1),a.m(t.parentNode,t)):a&&($e(),Ce(a,1,1,()=>{a=null}),Ie()),e[58]?.length?l?l.p(e,n):(l=gn(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=$n(e),c.c(),_e(c,1),c.m(o,null)):c&&($e(),Ce(c,1,1,()=>{c=null}),Ie())},i(e){s||(_e(a),_e(c),s=!0)},o(e){Ce(a),Ce(c),s=!1},d(e){a&&a.d(e),e&&M(t),e&&M(n),l&&l.d(),c&&c.d()}}}function mn(e){let t,n,r,i,o,s,a,l,c,d,u,f=e[6]&&pn(e);function h(t){e[38](t)}let m={id:e[12]};return void 0!==e[3]&&(m.value=e[3]),i=new e[9]({props:m}),oe.push(()=>Te(i,"value",h)),i.$on("input",e[16]),l=new bt({props:{size:"18"}}),{c(){f&&f.c(),t=V(),n=B("div"),r=F("Suchen: "),ke(i.$$.fragment),s=V(),a=B("span"),ke(l.$$.fragment),H(a,"class","feather pointer svelte-1a9feqg"),X(n,"margin-bottom","1em"),X(n,"position","relative")},m(o,h){f&&f.m(o,h),O(o,t,h),O(o,n,h),x(n,r),De(i,n,null),x(n,s),x(n,a),De(l,a,null),c=!0,d||(u=W(a,"click",e[18]),d=!0)},p(e,n){e[6]?f?64&n[0]&&_e(f,1):(f=pn(e),f.c(),_e(f,1),f.m(t.parentNode,t)):f&&($e(),Ce(f,1,1,()=>{f=null}),Ie());const r={};!o&&8&n[0]&&(o=!0,r.value=e[3],he(()=>o=!1)),i.$set(r)},i(e){c||(_e(f),_e(i.$$.fragment,e),_e(l.$$.fragment,e),c=!0)},o(e){Ce(f),Ce(i.$$.fragment,e),Ce(l.$$.fragment,e),c=!1},d(e){f&&f.d(e),e&&M(t),e&&M(n),Re(i),Re(l),d=!1,u()}}}function pn(e){let t,n;return t=new e[8]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function gn(e){let t,n,r,i,o=e[4]&&e[0]&&wn(),s=e[7],a=[];for(let t=0;t<s.length;t+=1)a[t]=yn(un(e,s,t));let l=e[58],c=[];for(let t=0;t<l.length;t+=1)c[t]=vn(dn(e,l,t));return{c(){t=B("thead"),n=B("tr"),o&&o.c(),r=V();for(let e=0;e<a.length;e+=1)a[e].c();i=V();for(let e=0;e<c.length;e+=1)c[e].c();H(n,"class","svelte-1a9feqg"),H(t,"class","svelte-1a9feqg")},m(e,s){O(e,t,s),x(t,n),o&&o.m(n,null),x(n,r);for(let e=0;e<a.length;e+=1)a[e].m(n,null);x(n,i);for(let e=0;e<c.length;e+=1)c[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=wn(),o.c(),o.m(n,r)):o&&(o.d(1),o=null),128&t[0]){const t=s.length;let r;for(s=e[7],r=t;r<s.length;r+=1)un(e,s,r),a[r]||(a[r]=yn(),a[r].c(),a[r].m(n,i));for(r=s.length;r<t;r+=1)a[r].d(1);a.length=s.length}if(32772&t[0]){let r;for(l=e[58],r=0;r<l.length;r+=1){const i=dn(e,l,r);c[r]?c[r].p(i,t):(c[r]=vn(i),c[r].c(),c[r].m(n,null))}for(;r<c.length;r+=1)c[r].d(1);c.length=l.length}},d(e){e&&M(t),o&&o.d(),P(a,e),P(c,e)}}}function wn(e){let t;return{c(){t=B("th"),H(t,"class","svelte-1a9feqg")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function yn(e){let t;return{c(){t=B("th"),H(t,"class","svelte-1a9feqg")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function vn(e){let t,n,r=e[63]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-1a9feqg")},m(e,r){O(e,t,r),x(t,n)},p(e,t){4&t[0]&&r!==(r=e[63]?.designation+"")&&j(n,r)},d(e){e&&M(t)}}}function $n(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[60].index||e[60]?._id;for(let t=0;t<o.length;t+=1){let n=an(e,o,t),a=s(n);i.set(a,r[t]=Sn(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);O(e,t,i),n=!0},p(e,n){3858623&n[0]&&(o=e[5],$e(),r=Ne(r,n,s,1,e,o,i,t.parentNode,Se,Sn,t,an),Ie())},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)Ce(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&M(t)}}}function In(e){let t,n,r,i,o,s,a,l=e[4]&&e[0]&&_n(e),c=e[7],d=[];for(let t=0;t<c.length;t+=1)d[t]=An(cn(e,c,t));let u=e[58],f=[];for(let t=0;t<u.length;t+=1)f[t]=En(ln(e,u,t));return{c(){t=B("tr"),l&&l.c(),n=V();for(let e=0;e<d.length;e+=1)d[e].c();r=V();for(let e=0;e<f.length;e+=1)f[e].c();i=V(),H(t,"class","pointer svelte-1a9feqg"),Y(t,"active",e[60]._id===e[1]),Y(t,"blocked",!!e[60].blocked),Y(t,"undeliverable",!!e[60].undeliverable)},m(c,u){O(c,t,u),l&&l.m(t,null),x(t,n);for(let e=0;e<d.length;e+=1)d[e].m(t,null);x(t,r);for(let e=0;e<f.length;e+=1)f[e].m(t,null);x(t,i),o=!0,s||(a=W(t,"click",q(function(){N(e[14](e[60],e[62]))&&e[14](e[60],e[62]).apply(this,arguments)})),s=!0)},p(o,s){if((e=o)[4]&&e[0]?l?(l.p(e,s),17&s[0]&&_e(l,1)):(l=_n(e),l.c(),_e(l,1),l.m(t,n)):l&&($e(),Ce(l,1,1,()=>{l=null}),Ie()),3145888&s[0]){let n;for(c=e[7],n=0;n<c.length;n+=1){const i=cn(e,c,n);d[n]?d[n].p(i,s):(d[n]=An(i),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}if(40996&s[0]){let n;for(u=e[58],n=0;n<u.length;n+=1){const r=ln(e,u,n);f[n]?f[n].p(r,s):(f[n]=En(r),f[n].c(),f[n].m(t,i))}for(;n<f.length;n+=1)f[n].d(1);f.length=u.length}34&s[0]&&Y(t,"active",e[60]._id===e[1]),32&s[0]&&Y(t,"blocked",!!e[60].blocked),32&s[0]&&Y(t,"undeliverable",!!e[60].undeliverable)},i(e){o||(_e(l),o=!0)},o(e){Ce(l),o=!1},d(e){e&&M(t),l&&l.d(),P(d,e),P(f,e),s=!1,a()}}}function _n(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("td"),ke(n.$$.fragment),H(t,"class","editRow svelte-1a9feqg"),X(t,"color","#326173")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",q(function(){N(e[19](e[60]))&&e[19](e[60]).apply(this,arguments)})),i=!0)},p(t,n){e=t},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Cn(e){let t;return{c(){t=B("td"),H(t,"class","svelte-1a9feqg")},m(e,n){O(e,t,n)},p:b,d(e){e&&M(t)}}}function bn(e){let t,n,r,i,o=e[66].widget.name+"";return{c(){t=B("td"),n=F(o),H(t,"class","editRow svelte-1a9feqg"),X(t,"color","#326173")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(function(){N(e[21](e[60],e[66]))&&e[21](e[60],e[66]).apply(this,arguments)})),r=!0)},p(t,r){e=t,128&r[0]&&o!==(o=e[66].widget.name+"")&&j(n,o)},d(e){e&&M(t),r=!1,i()}}}function An(e){let t,n;function r(e,n){return(null==t||160&n[0])&&(t=!!e[20](e[60],e[66])),t?bn:Cn}let i=r(e,[-1]),o=i(e);return{c(){o.c(),n=U()},m(e,t){o.m(e,t),O(e,n,t)},p(e,t){i===(i=r(e,t))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n.parentNode,n)))},d(e){o.d(e),e&&M(n)}}}function En(e){let t,n,r,i=e[13](e[60],e[63])+"";return{c(){t=B("td"),n=F(i),H(t,"class",r=D(e[63].type)+" svelte-1a9feqg")},m(e,r){O(e,t,r),x(t,n)},p(e,o){36&o[0]&&i!==(i=e[13](e[60],e[63])+"")&&j(n,i),4&o[0]&&r!==(r=D(e[63].type)+" svelte-1a9feqg")&&H(t,"class",r)},d(e){e&&M(t)}}}function Sn(e,t){let n,r,i,o=t[17](t[60],t[58],t[3]),s=o&&In(t);return{key:e,first:null,c(){n=U(),s&&s.c(),r=U(),this.first=n},m(e,t){O(e,n,t),s&&s.m(e,t),O(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[17](t[60],t[58],t[3])),o?s?(s.p(t,n),44&n[0]&&_e(s,1)):(s=In(t),s.c(),_e(s,1),s.m(r.parentNode,r)):s&&($e(),Ce(s,1,1,()=>{s=null}),Ie())},i(e){i||(_e(s),i=!0)},o(e){Ce(s),i=!1},d(e){e&&M(n),s&&s.d(e),e&&M(r)}}}function Nn(e){let t,n;return t=new e[8]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Tn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Nn,then:hn,catch:fn,value:59,blocks:[,,,]};return be(n=e[2]&&e[15](),i),{c(){t=U(),i.block.c()},m(e,n){O(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[15]())&&be(n,i)||Ae(i,e,r)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),i.block.d(e),i.token=null,i=null}}}const kn=e("getDisplayItems",async(e,n,r)=>{if(!e)return;const i=await t.getEvent(n.id),o=i.output?.class?.at(0)?.display?.find(e=>e.merge)?.merge;let s=[];for(let i of e){if(o?.item?.find(e=>e.refItem===i))continue;if(i.includes(":")&&(i=i.split(":")[0]),"_total"===i){s.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===i){s.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}let[e,a]=i.split("."),l=n.list?.find(t=>t.name===e)?.item?.find(e=>e.name===a);if(l&&(l={...l},l.name=`${e}_${a}`,r=r.map(t=>(t[e]&&(t[l.name]=t["_"+e]?t["_"+e][a]:t[e][a]),t))),i.endsWith("_from")||i.endsWith("_to")){e=e.split("_")[0];const t=l=n.items.find(t=>t.name===e);t&&(l={name:a?e:i,designation:t.designation,type:"date",decimals:0})}if(l||(l=n.items.find(t=>t.name===e)),!l){const n=await t.getSchemaByClass(e),r=n.items?.find(e=>e.name===a);r&&(l={name:e,designation:r.designation,type:r.type,decimals:r.properties?.decimals||0})}s.find(t=>t?.name===e)||s.push(l)}return o&&(s.push({name:o.item,designation:o.titleType,type:"string",decimals:0,isTitle:!0}),s.push({name:o.item,designation:o.title,type:"string",decimals:0})),s.length?s:n.items});function Dn(e,o,s){let a,l,c;k(e,i,e=>s(44,l=e));let d=JSON.parse(n.getItem("Locale")).id;const f=ne(),{Loading:m,TextField:p}=u,{currentTasks:w,loggedIn:y}=h;k(e,w,e=>s(43,a=e)),k(e,y,e=>s(45,c=e));let v,I,_,C,b,{inputList:A}=o,{eventId:E}=o,{prevEventId:S}=o,{record:N}=o,{className:T}=o,{rowId:D}=o,{filterForReady:R=!1}=o,{filter:x}=o,{query:O}=o,{refStatus:M}=o,{refFilter:P}=o,{showEdit:B=!1}=o,{praefix:L=""}=o,{selectionFields:F=!1}=o,{deList:V}=o,{stopAggregation:U=!1}=o,{shouldBlock:W}=o,{inputSearch:z=""}=o,q=!0,H=z,j=T+Math.floor(9e3*Math.random()+1e3).toString()+"search",G=!1,X=!0,Y=[];const Z=(e,t)=>{if(!t)return;if(Array.isArray(t.name)){let n="";for(const r of t.name)if(e[r.refItem])if(t.isTitle)n=r.refType;else{const t=e["_"+r.refItem]||e[r.refItem];t&&(n=t)}return g(n||"")}let n=!1,r=e[t.name];if("template"===t.type){const n=[],i=e[t.refItem.split(".").at(-1)];if("object"==typeof i){for(const e in i)n.push(i[e]?.join(","));r=n?.join(" / ")}}if(t.properties?.multi&&t.refClass){const i=e[t.name];r=e["_"+t.name],r&&(r+=Array.isArray(i)&&i.length>1?" (...)":"",n=!0)}if("__total"===t.name&&void 0===r&&(r=1.081*e._total),!r&&t.name.includes("_")&&!t.name.startsWith("_")&&!t.name.endsWith("_from")&&!t.name.endsWith("_to")){const[n,i]=t.name.split("_");try{r=e[n][i]}catch{}}if(Array.isArray(r)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));if(r.length&&Array.isArray(r[0].serialno)){let t=[];for(const n of r)t=t.concat(n.serialno.map(e));r=t.join(", ")}else r=r.map(e),r.length>3&&(r=r.slice(0,3),r=r.concat("...")),r=r.join(", ")}if(!r&&t.name.split("_").length>1){const[n,i]=t.name.split("_");try{r=e[n][0][i],Array.isArray(r)&&(r=r.join(", "))}catch{}}return"number"===t.type&&(r||(r=e[`_${t.name}`]),r=Number(r)?Number(r).toLocaleString(d,{minimumFractionDigits:t.properties?.decimals||t.decimals||0,maximumFractionDigits:t.properties?.decimals||t.decimals||0}):""),"boolean"===t.type&&"Aktiv"===r&&(r=!1),"number"===t.type||"template"===t.type||n?r:"boolean"==typeof r||"boolean"===t.type?$(r):g(e[`_${t.name}`]||r||"")},K=t.getSchemaByClass(T),Q=async(e,n)=>{if(!e)return[];if(x)if("string"==typeof x){let n=x;const r=x.startsWith("!");r&&(n=x.replace("!",""));const i=x.startsWith("$");if(n&&!i&&(e=e.filter(e=>r?!e[n]:!!e[n])),i){n=x.replace("$","");const[r,i]=n.split(".");if(N[i]){const n=await t.getSectionView(r,{[i]:N[i]});e=e.filter(e=>n.find(t=>t._id==e[r]))}else e=[]}}else{const{refItem:n,refValue:r}=x;e=await t.getSectionView(T,{[n]:r})||[]}if(M||P&&!O){let t=e;return M&&(s(22,M=[].concat(M)),t=t.filter(e=>!!M.find(t=>e._task.status===t))),P&&(t=t.filter(e=>!!e[P])),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===T)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)},J=(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(d,{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},te=async e=>{let n,r=0;X=!1;const i=e=>new Promise(t=>setTimeout(t,e)),o=await K;for(;r++<200&&!U&&!(n=await re(e,o.id));)await i(500);s(6,G=!1),U&&t.readTasksByAggregationId(e,!0),n&&(s(5,_=J(I.displaySort,n.data)),window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),X=!0,document.getElementById(j)?.focus()},100))},re=async(e,n)=>await t.readTasksByAggregationId(e,!1,n),ie=async(e,t,n,r)=>{const{value:i,refClass:o}=r,[s,a]=n.split("."),l=i?.get(L),c=l&&await bw(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&&_w(o+r._id.toString(),r),r}):e};ee(()=>{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 K;e.eventId===t.id&&(Aw(t.class,e.eventId),s(2,q=!s(2,q=!1)))});const oe=(e,t)=>I.class===t.class?e._id:e[t.class];return e.$$set=e=>{"inputList"in e&&s(24,A=e.inputList),"eventId"in e&&s(25,E=e.eventId),"prevEventId"in e&&s(26,S=e.prevEventId),"record"in e&&s(27,N=e.record),"className"in e&&s(28,T=e.className),"rowId"in e&&s(1,D=e.rowId),"filterForReady"in e&&s(29,R=e.filterForReady),"filter"in e&&s(30,x=e.filter),"query"in e&&s(31,O=e.query),"refStatus"in e&&s(22,M=e.refStatus),"refFilter"in e&&s(32,P=e.refFilter),"showEdit"in e&&s(0,B=e.showEdit),"praefix"in e&&s(33,L=e.praefix),"selectionFields"in e&&s(34,F=e.selectionFields),"deList"in e&&s(35,V=e.deList),"stopAggregation"in e&&s(23,U=e.stopAggregation),"shouldBlock"in e&&s(36,W=e.shouldBlock),"inputSearch"in e&&s(37,z=e.inputSearch)},[B,D,q,H,v,_,G,Y,m,p,w,y,j,Z,(e,t)=>n=>{s(23,U=!0);const r=X?e:C[t];f("choose",{row:r})},async()=>{I=await K,s(7,Y=await(async e=>{const n=await t.getEvents(),r=n?.filter(t=>t.output.widgetType&&(e.class===t.output?.class[0].name||e.items.find(e=>e.refClass===t.output?.class[0].name))).map(e=>({class:e.output.class[0].name,widget:e.output.widgetType}));return r||[]})(I)),s(4,v=(e=>!a?.length||!!a.find(t=>t===e))(I.id)),O&&s(5,_=C=await t.getTasksFiltered(I.class,O)),_||s(5,_=C=J(I.displaySort,await A||await $w(I.class,I.id))),500!==_?.length||O||(s(6,G=!0),await t.getTasksList(I.id,!1,!0).then(({aggregationId:e})=>te(e)));let e,n=!1,r="";const i=F&&F?.find(e=>I.class===e.refClass.split(":")[0]),o=i?.value?.get&&i.value.get(L);if(o){const[a,l]=i.refClass.split(":");I.class===a&&s(5,_=await ie(_,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,B&&=!i),!i&&(x||R||M)&&s(5,_=await Q(_,I)),b=I.authorization?.find(e=>"employee"===e.constraint)&&!l.some(e=>I.authorization?.find(t=>t.role===e&&"employee"!==t.constraint));const{display:d}=I;let u=await kn(d,I,_);if(!B&&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)}}),f("init",_)):V&&s(5,_=_.filter(e=>!V.find(t=>t?._id===e._id))),W&&s(5,_=_.filter(e=>!e[W])),b){const e={businessEmail:c.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=Z(e,i).toLowerCase();!r&&t.includes(n)&&(r=!0)}return r},()=>{s(3,H="")},async e=>{let t=e._task;t||(t=await Iw(T,"",e._id,!0),t=t._task),window.open(`/task/${t.event}/${t.task_id||t._id}/task?view=standalone`,"_blank")},oe,async(e,t)=>{const n=oe(e,t);n&&window.open(`/widget/${t.widget.id}/${n}?view=standalone`)},M,U,A,E,S,N,T,R,x,O,P,L,F,V,W,z,function(e){H=e,s(3,H)}]}class Rn extends Oe{constructor(e){var t;super(),on.getElementById("svelte-1a9feqg-style")||((t=B("style")).id="svelte-1a9feqg-style",t.textContent=".feather.svelte-1a9feqg.svelte-1a9feqg{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1a9feqg.svelte-1a9feqg{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1a9feqg .editRow.svelte-1a9feqg{width:1em}.eList.svelte-1a9feqg table.svelte-1a9feqg{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1a9feqg table thead.svelte-1a9feqg{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1a9feqg table thead tr.svelte-1a9feqg{height:2.3em}.eList.svelte-1a9feqg table tbody.svelte-1a9feqg{color:black}.eList.svelte-1a9feqg table tbody tr.svelte-1a9feqg{height:2.75em !important}th.svelte-1a9feqg.svelte-1a9feqg,td.svelte-1a9feqg.svelte-1a9feqg{padding-left:0.4em;padding-right:0.4em}td.number.svelte-1a9feqg.svelte-1a9feqg{text-align:end}td.string.svelte-1a9feqg.svelte-1a9feqg{min-width:6em}td.object.svelte-1a9feqg.svelte-1a9feqg{min-width:8em}tr.pointer.svelte-1a9feqg.svelte-1a9feqg:hover{background-color:#DAE1E5}tr.active.svelte-1a9feqg.svelte-1a9feqg{color:#326173;background-color:#fcebd5}tr.blocked.svelte-1a9feqg.svelte-1a9feqg{color:red !important}tr.undeliverable.svelte-1a9feqg.svelte-1a9feqg{color:orange}",x(on.head,t)),xe(this,e,Dn,Tn,T,{inputList:24,eventId:25,prevEventId:26,record:27,className:28,rowId:1,filterForReady:29,filter:30,query:31,refStatus:22,refFilter:32,showEdit:0,praefix:33,selectionFields:34,deList:35,stopAggregation:23,shouldBlock:36,inputSearch:37},[-1,-1,-1])}}function xn(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function On(e){let t,n,r=e[46]&&Mn(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[46]?r?(r.p(e,n),16&n[0]&&_e(r,1)):(r=Mn(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function Mn(e){let t,n;return t=new e[26]({props:{title:e[21]?"Auswahl":e[0],class:"eList "+(e[19]?"form":""),$$slots:{default:[Hn]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2097153&n[0]&&(r.title=e[21]?"Auswahl":e[0]),524288&n[0]&&(r.class="eList "+(e[19]?"form":"")),67108862&n[0]|65536&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Pn(e){let t,n;return t=new Rw({props:{schema:e[2],recID:e[1],readonly:e[20],closeThis:!0}}),t.$on("choose",function(){N(e[35](e[46]))&&e[35](e[46]).apply(this,arguments)}),t.$on("back",e[32]),{c(){ke(t.$$.fragment)},m(e,r){De(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]),1048576&r[0]&&(i.readonly=e[20]),t.$set(i)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Bn(e){let t,n,r,i,o,s,a;t=new e[27]({props:{text:e[21]?"Zusätzliche Auswahl":""}});const l=[Fn,Ln],c=[];function d(e,t){return e[21]?0:1}return r=d(e),i=c[r]=l[r](e),s=new Rn({props:{inputSearch:e[16],record:e[3],eventId:e[2].id,className:e[2].class,prevEventId:e[15],filterForReady:e[5],filter:e[6],query:e[7],refStatus:e[8],refFilter:e[9],praefix:e[10],selectionFields:e[11],rowId:e[1],shouldBlock:e[17],deList:e[13],stopAggregation:e[25],showEdit:e[12]}}),s.$on("edit",e[36]),s.$on("choose",e[39]),s.$on("init",e[37]),{c(){ke(t.$$.fragment),n=V(),i.c(),o=V(),ke(s.$$.fragment)},m(e,i){De(t,e,i),O(e,n,i),c[r].m(e,i),O(e,o,i),De(s,e,i),a=!0},p(e,n){const a={};2097152&n[0]&&(a.text=e[21]?"Zusätzliche Auswahl":""),t.$set(a);let u=r;r=d(e),r===u?c[r].p(e,n):($e(),Ce(c[u],1,1,()=>{c[u]=null}),Ie(),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={};65536&n[0]&&(f.inputSearch=e[16]),8&n[0]&&(f.record=e[3]),4&n[0]&&(f.eventId=e[2].id),4&n[0]&&(f.className=e[2].class),32768&n[0]&&(f.prevEventId=e[15]),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.refFilter=e[9]),1024&n[0]&&(f.praefix=e[10]),2048&n[0]&&(f.selectionFields=e[11]),2&n[0]&&(f.rowId=e[1]),131072&n[0]&&(f.shouldBlock=e[17]),8192&n[0]&&(f.deList=e[13]),33554432&n[0]&&(f.stopAggregation=e[25]),4096&n[0]&&(f.showEdit=e[12]),s.$set(f)},i(e){a||(_e(t.$$.fragment,e),_e(i),_e(s.$$.fragment,e),a=!0)},o(e){Ce(t.$$.fragment,e),Ce(i),Ce(s.$$.fragment,e),a=!1},d(e){Re(t,e),e&&M(n),c[r].d(e),e&&M(o),Re(s,e)}}}function Ln(e){let t,n,r,i;n=new e[28]({props:{outline:!0,$$slots:{default:[Vn]},$$scope:{ctx:e}}}),n.$on("click",e[33]);let o=e[30]&&e[14]&&Un(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),H(t,"class","form--buttons svelte-jb5mrh")},m(e,s){O(e,t,s),De(n,t,null),x(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};65536&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[30]&&e[14]?o?(o.p(e,r),16384&r[0]&&_e(o,1)):(o=Un(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Fn(e){let t,n,r,i,o,s,a=e[24]&&zn(e);return r=new e[28]({props:{outline:!0,$$slots:{default:[qn]},$$scope:{ctx:e}}}),r.$on("click",e[33]),o=new e[27]({props:{text:"Liste aus "+e[18]}}),{c(){a&&a.c(),t=V(),n=B("div"),ke(r.$$.fragment),i=V(),ke(o.$$.fragment),H(n,"class","form--buttons svelte-jb5mrh")},m(e,l){a&&a.m(e,l),O(e,t,l),O(e,n,l),De(r,n,null),O(e,i,l),De(o,e,l),s=!0},p(e,n){e[24]?a?(a.p(e,n),16777216&n[0]&&_e(a,1)):(a=zn(e),a.c(),_e(a,1),a.m(t.parentNode,t)):a&&($e(),Ce(a,1,1,()=>{a=null}),Ie());const i={};65536&n[1]&&(i.$$scope={dirty:n,ctx:e}),r.$set(i);const s={};262144&n[0]&&(s.text="Liste aus "+e[18]),o.$set(s)},i(e){s||(_e(a),_e(r.$$.fragment,e),_e(o.$$.fragment,e),s=!0)},o(e){Ce(a),Ce(r.$$.fragment,e),Ce(o.$$.fragment,e),s=!1},d(e){a&&a.d(e),e&&M(t),e&&M(n),Re(r),e&&M(i),Re(o,e)}}}function Vn(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Un(e){let t,n;return t=new e[28]({props:{filled:!0,$$slots:{default:[Wn]},$$scope:{ctx:e}}}),t.$on("click",e[34]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};65536&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Wn(e){let t;return{c(){t=F("Neu")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function zn(e){let t,n;return t=new ah({props:{item:e[22],record:{_id:"",[e[22].name]:""},noForm:"true",classId:"sel_"+e[22].name,eventId:e[23],required:!1,hidden:!1,readonly:!1,deList:e[24]}}),t.$on("notify",e[38]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};4194304&n[0]&&(r.item=e[22]),4194304&n[0]&&(r.record={_id:"",[e[22].name]:""}),4194304&n[0]&&(r.classId="sel_"+e[22].name),8388608&n[0]&&(r.eventId=e[23]),16777216&n[0]&&(r.deList=e[24]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function qn(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Hn(e){let t,n,r,i;const o=[Bn,Pn],s=[];function a(e,t){return e[46].length&&!e[19]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function jn(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Gn(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:jn,then:On,catch:xn,value:46,blocks:[,,,]};return be(n=e[31](e[4]),i),{c(){t=U(),i.block.c()},m(e,n){O(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[31](e[4]))&&be(n,i)||Ae(i,e,r)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),i.block.d(e),i.token=null,i=null}}}function Xn(e,n,r){let i;const{Dialog:o,Divider:s,Button:a}=u,l=ne(),{currentTasks:c}=h;k(e,c,e=>r(42,i=e));let{title:d}=n,{schema:f}=n,{record:m}=n,{recID:p}=n,{isOpening:g=!0}=n,{filterForReady:w=!1}=n,{filter:y}=n,{query:v}=n,{refStatus:$}=n,{refFilter:I}=n,{praefix:_=""}=n,{selectionFields:C=!1}=n,{showEdit:b=!0}=n,{deList:A}=n,{newAllowed:E=!0}=n,{prevEventId:S}=n,{inputSearch:N}=n,{shouldBlock:T}=n,D=f.id;f.class;let R,x,O,M,P,B,L,F="",V=!1,U=!1;d??=f.identity.designation;const W=!i?.length||i.find(e=>e===D);return e.$$set=e=>{"title"in e&&r(0,d=e.title),"schema"in e&&r(2,f=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),"refFilter"in e&&r(9,I=e.refFilter),"praefix"in e&&r(10,_=e.praefix),"selectionFields"in e&&r(11,C=e.selectionFields),"showEdit"in e&&r(12,b=e.showEdit),"deList"in e&&r(13,A=e.deList),"newAllowed"in e&&r(14,E=e.newAllowed),"prevEventId"in e&&r(15,S=e.prevEventId),"inputSearch"in e&&r(16,N=e.inputSearch),"shouldBlock"in e&&r(17,T=e.shouldBlock)},[d,p,f,m,g,w,y,v,$,I,_,C,b,A,E,S,N,T,F,V,R,O,P,B,L,U,o,s,a,c,W,async e=>{if(!e)return!1;const n=await $w(f.class,f.id);if(x=C&&C?.find(e=>f.class===e.refClass.split(":")[0]),r(21,O=x?.value?.get&&x.value.get(_)),O){M=x.refClass;const[e,n]=M.split(":"),[i]=n.split(".");r(22,P=x.parentClass.find(t=>t.name===e));const o=await t.getSchemaByClass(P.refClass);r(23,B=o.id),r(18,F=x.parentClass.find(e=>e.name===i).designation)}return n},()=>{r(19,V=!1),p||l("back"),b||l("back")},()=>{r(25,U=!0),r(19,V=!1),l("back")},()=>{r(25,U=!0),r(1,p=!1),r(20,R=!1),r(19,V=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map(t=>{const[n,r]=t.split(".");let i=f.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(20,R=!!e._task.visum||"Closed"===e._task.status),r(1,p=e._docId),r(19,V=!0)},({detail:e})=>{O&&r(24,L=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};l("choose",{row:t})},function(t){re(e,t)}]}class Yn extends Oe{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=B("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",x(document.head,t)),xe(this,e,Xn,Gn,T,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,refFilter:9,praefix:10,selectionFields:11,showEdit:12,deList:13,newAllowed:14,prevEventId:15,inputSearch:16,shouldBlock:17},[-1,-1])}}const{document:Zn}=Ee;function Kn(e){e[28]=e[30].list,e[29]=e[30].items}function Qn(e,t,n){const r=e.slice();return r[31]=t[n],r}function Jn(e,t,n){const r=e.slice();return r[34]=t[n],r}function er(e,t,n){const r=e.slice();return r[34]=t[n],r}function tr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function nr(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)}Kn(e),n=new e[7]({props:{outline:!0,$$slots:{default:[rr]},$$scope:{ctx:e}}}),n.$on("click",e[24]);let $={id:e[8]};void 0!==e[0]&&($.value=e[0]),s=new e[6]({props:$}),oe.push(()=>Te(s,"value",v)),s.$on("input",e[12]),d=new bt({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]=ir(er(e,o,t));return{c(){t=B("thead"),n=B("tr"),r=B("th"),i=V();for(let e=0;e<s.length;e+=1)s[e].c();H(r,"class","svelte-14hcfjl"),H(n,"class","svelte-14hcfjl"),H(t,"class","svelte-14hcfjl")},m(e,o){O(e,t,o),x(t,n),x(n,r),x(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=er(e,o,r);s[r]?s[r].p(i,t):(s[r]=ir(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&&M(t),P(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]=ar(Qn(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(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=Qn(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=ar(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("div"),o=F("Suchen: "),ke(s.$$.fragment),l=V(),c=B("span"),ke(d.$$.fragment),u=V(),f=B("div"),h=B("table"),I&&I.c(),m=V(),p=B("tbody"),_&&_.c(),H(t,"class","form--buttons svelte-14hcfjl"),H(c,"class","feather pointer svelte-14hcfjl"),X(i,"margin-bottom","1em"),X(i,"position","relative"),H(h,"striped",""),H(h,"class","svelte-14hcfjl"),H(f,"class","eList svelte-14hcfjl")},m(a,v){O(a,t,v),De(n,t,null),O(a,r,v),O(a,i,v),x(i,o),De(s,i,null),x(i,l),x(i,c),De(d,c,null),O(a,u,v),O(a,f,v),x(f,h),I&&I.m(h,null),x(h,m),x(h,p),_&&_.m(p,null),g=!0,w||(y=W(c,"click",e[14]),w=!0)},p(e,t){Kn(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],he(()=>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){Ce(n.$$.fragment,e),Ce(s.$$.fragment,e),Ce(d.$$.fragment,e),Ce(_),g=!1},d(e){e&&M(t),Re(n),e&&M(r),e&&M(i),Re(s),Re(d),e&&M(u),e&&M(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function rr(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ir(e){let t,n,r=e[34]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function or(e){let t,n,r,i,o,s,a,l;r=new St({props:{size:"18"}});let c=e[29],d=[];for(let t=0;t<c.length;t+=1)d[t]=sr(Jn(e,c,t));return{c(){t=B("tr"),n=B("td"),ke(r.$$.fragment),i=V();for(let e=0;e<d.length;e+=1)d[e].c();o=V(),H(n,"class","editRow svelte-14hcfjl"),H(t,"class","pointer svelte-14hcfjl"),Y(t,"active",e[31]._id===e[1])},m(c,u){O(c,t,u),x(t,n),De(r,n,null),x(t,i);for(let e=0;e<d.length;e+=1)d[e].m(t,null);x(t,o),s=!0,a||(l=W(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=Jn(e,c,n);d[n]?d[n].p(i,r):(d[n]=sr(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]&&Y(t,"active",e[31]._id===e[1])},i(e){s||(_e(r.$$.fragment,e),s=!0)},o(e){Ce(r.$$.fragment,e),s=!1},d(e){e&&M(t),Re(r),P(d,e),a=!1,l()}}}function sr(e){let t,n,r,i,o=e[9](e[31],e[34])+"";return{c(){t=B("td"),n=F(o),H(t,"class","svelte-14hcfjl")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(e[10](e[31]))),r=!0)},p(t,n){e=t},d(e){e&&M(t),r=!1,i()}}}function ar(e){let t,n,r=e[13](e[31],e[29],e[0]),i=r&&or(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(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=or(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function lr(e){let t,n;return t=new e[5]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function cr(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:lr,then:nr,catch:tr,value:30,blocks:[,,,]};return be(e[11](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function dr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[cr]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ur(e,n,i){const o=ne(),{Dialog:s,Divider:a,Loading:l,TextField:c,Button:d}=u;let{item:f}=n,{classId:h}=n,{className:m}=n,{rowId:p}=n,{viewName:w}=n,{viewValue:y}=n,{recordId:v}=n,{filter:I}=n,{multiValues:_}=n,{searchValue:C=""}=n,b=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?$(n):g(e[`_${t.name}`]||e[t.name]||"")},E=t.getSchemaByClass(m);ee(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(b)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await E;e.eventId===t.id&&Aw(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,m=e.className),"rowId"in e&&i(1,p=e.rowId),"viewName"in e&&i(19,w=e.viewName),"viewValue"in e&&i(20,y=e.viewValue),"recordId"in e&&i(21,v=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,p,o,s,a,l,c,d,b,A,e=>()=>o("choose",{row:e}),async()=>{const e=await E;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||v,_.has(f.lookup)){const r=_.get(f.lookup)[0];n=r?await t.getSectionView(f.name,{[f.lookup]:r},!0):await $w(f.name,e.id)}else if(o&&24===o.toString().length){const e=await bw(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||v,o){let e=await t.getDocById(a,o);if(e&&l&&(e=await t.getDocById(l,e[l])),e&&e[s]){e[s]=e[s].map((e,t)=>(e.__index=t,e));const r=e[s].map(e=>e[f.name]);n=await t.getSectionView(f.name,{_id:{$in:r}},!0),n=n.sort((t,n)=>e[s].find(e=>e[f.name]===t._id).__index-e[s].find(e=>e[f.name]===n._id).__index)}}}}else{const r="."+h+"#"+w.split(":")[0],i=document.querySelector(r);let o={[w]:i?.value||v};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 kn(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,m,w,y,v,I,_,()=>o("back"),function(e){C=e,i(0,C)}]}class fr extends Oe{constructor(e){var t;super(),Zn.getElementById("svelte-14hcfjl-style")||((t=B("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}",x(Zn.head,t)),xe(this,e,ur,dr,T,{item:16,classId:17,className:18,rowId:1,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23,searchValue:0},[-1,-1])}}const{document:hr}=Ee;function mr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function pr(e){let t,n,r=e[85]&&function(e){let t,n,r,i,s,a,l,c,d,u,f,h,m,p,g,w,y,v,$,I;function _(t){e[65](t)}function C(t){e[66](t)}let b={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]&&(b.value=e[1]);void 0!==e[27]&&(b.overwrite=e[27]);n=new o({props:b}),oe.push(()=>Te(n,"value",_)),oe.push(()=>Te(n,"overwrite",C)),n.$on("click",e[40]()),n.$on("blur",e[49]);const A=[yr,wr,gr],E=[];function S(e,t){return e[36]?0:!e[3]||e[16]?1:e[22]&&e[0]?2:-1}~(a=S(e))&&(l=E[a]=A[a](e));let N=(!e[3]||e[16])&&e[0]&&!e[17]&&!e[36]&&_r(e);function T(t){e[67](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[Er]},$$scope:{ctx:e}};void 0!==e[19]&&(k.open=e[19]);m=new e[30]({props:k}),oe.push(()=>Te(m,"open",T));let R=e[20]&&Sr(e),P=e[24]&&kr(e);return{c(){t=B("div"),ke(n.$$.fragment),s=V(),l&&l.c(),c=V(),d=B("input"),f=V(),N&&N.c(),h=V(),ke(m.$$.fragment),g=V(),R&&R.c(),w=V(),P&&P.c(),y=U(),H(d,"class",u=D(e[9]||e[10])+" svelte-10ggg6v"),H(d,"id",e[5]),H(d,"name",e[5]),d.value=e[0],d.required=e[2],d.hidden=!0,X(t,"position","relative")},m(r,i){O(r,t,i),De(n,t,null),x(t,s),~a&&E[a].m(t,null),x(t,c),x(t,d),x(t,f),N&&N.m(t,null),O(r,h,i),De(m,r,i),O(r,g,i),R&&R.m(r,i),O(r,w,i),P&&P.m(r,i),O(r,y,i),v=!0,$||(I=W(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],he(()=>r=!1)),!i&&134217728&o[0]&&(i=!0,s.overwrite=e[27],he(()=>i=!1)),n.$set(s);let f=a;a=S(e),a===f?~a&&E[a].p(e,o):(l&&($e(),Ce(E[f],1,1,()=>{E[f]=null}),Ie()),~a?(l=E[a],l?l.p(e,o):(l=E[a]=A[a](e),l.c()),_e(l,1),l.m(t,c)):l=null),(!v||1536&o[0]&&u!==(u=D(e[9]||e[10])+" svelte-10ggg6v"))&&H(d,"class",u),(!v||32&o[0])&&H(d,"id",e[5]),(!v||32&o[0])&&H(d,"name",e[5]),(!v||1&o[0]&&d.value!==e[0])&&(d.value=e[0]),(!v||4&o[0])&&(d.required=e[2]),e[3]&&!e[16]||!e[0]||e[17]||e[36]?N&&($e(),Ce(N,1,1,()=>{N=null}),Ie()):N?(N.p(e,o),196617&o[0]&&_e(N,1)):(N=_r(e),N.c(),_e(N,1),N.m(t,null));const h={};344784337&o[0]|16777216&o[2]&&(h.$$scope={dirty:o,ctx:e}),!p&&524288&o[0]&&(p=!0,h.open=e[19],he(()=>p=!1)),m.$set(h),e[20]?R?(R.p(e,o),1048576&o[0]&&_e(R,1)):(R=Sr(e),R.c(),_e(R,1),R.m(w.parentNode,w)):R&&($e(),Ce(R,1,1,()=>{R=null}),Ie()),e[24]?P?(P.p(e,o),16777216&o[0]&&_e(P,1)):(P=kr(e),P.c(),_e(P,1),P.m(y.parentNode,y)):P&&($e(),Ce(P,1,1,()=>{P=null}),Ie())},i(e){v||(_e(n.$$.fragment,e),_e(l),_e(N),_e(m.$$.fragment,e),_e(R),_e(P),v=!0)},o(e){Ce(n.$$.fragment,e),Ce(l),Ce(N),Ce(m.$$.fragment,e),Ce(R),Ce(P),v=!1},d(e){e&&M(t),Re(n),~a&&E[a].d(),N&&N.d(),e&&M(h),Re(m,e),e&&M(g),R&&R.d(e),e&&M(w),P&&P.d(e),e&&M(y),$=!1,I()}}}(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,t){e[85]&&r.p(e,t)},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function gr(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[48]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function wr(e){let t,n,r,i,o;return n=new en({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=[W(t,"click",e[40](!0)),W(t,"choose",e[44])],i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,S(o)}}}function yr(e){let t,n,r,i;const o=[Ir,$r,vr],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=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function vr(e){let t,n,r;return n=new Xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather3 svelte-10ggg6v")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function $r(e){let t,n,r,i,o;return n=new Xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[50]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Ir(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[48]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function _r(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 pointer svelte-10ggg6v")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[47]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Cr(e){let t,n,r,i;const o=[Ar,br],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=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function br(e){let t,n;return t=new Yn({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,refFilter:e[6].refFilter,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(){ke(t.$$.fragment)},m(e,r){De(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),64&n[0]&&(r.refFilter=e[6].refFilter),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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ar(e){let t,n;return t=new fr({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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Er(e){let t,n,r=e[19]&&Cr(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[19]?r?(r.p(e,n),524288&n[0]&&_e(r,1)):(r=Cr(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function Sr(e){let t,n,r;function i(t){e[68](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}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(t,e,n),r=!0},p(e,r){const i={};2359297&r[0]|16777216&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&1048576&r[0]&&(n=!0,i.open=e[20],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function Nr(e){let t,n;return t=new Rw({props:{schema:e[18],recID:e[0],readonly:!0}}),t.$on("back",e[45]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Tr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[Nr]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),262145&n[0]|16777216&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function kr(e){let t,n,r;function i(t){e[69](t)}let o={class:"tModal2",noClickaway:!0,$$slots:{default:[Rr]},$$scope:{ctx:e}};return void 0!==e[24]&&(o.open=e[24]),t=new e[30]({props:o}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(t,e,n),r=!0},p(e,r){const i={};35913728&r[0]|16777216&r[2]&&(i.$$scope={dirty:r,ctx:e}),!n&&16777216&r[0]&&(n=!0,i.open=e[24],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function Dr(e){let t,n;return t=new Rw({props:{schema:e[18],dialogAttr:e[25]}}),t.$on("back",e[46]),t.$on("choose",e[43]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Rr(e){let t,n;return t=new e[29]({props:{title:e[21],$$slots:{default:[Dr]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2097152&n[0]&&(r.title=e[21]),33816576&n[0]|16777216&n[2]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function xr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Or(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:xr,then:pr,catch:mr,value:85,blocks:[,,,]};return be(e[39](),r),{c(){t=U(),r.block.c()},m(e,i){O(e,t,i),r.block.m(e,r.anchor=i),r.mount=()=>t.parentNode,r.anchor=t,n=!0},p(t,n){Ae(r,e=t,n)},i(e){n||(_e(r.block),n=!0)},o(e){for(let e=0;e<3;e+=1){Ce(r.blocks[e])}n=!1},d(e){e&&M(t),r.block.d(e),r.token=null,r=null}}}function Mr(e,n,r){let o,a,l,c,d;k(e,i,e=>r(64,o=e)),k(e,s,e=>r(74,d=e));const f=ne(),{Dialog:m,Modal:p}=u,{currentTasks:g,environment:w,loggedIn:y}=h;k(e,g,e=>r(71,a=e)),k(e,w,e=>r(73,c=e)),k(e,y,e=>r(72,l=e));let{id:v}=n,{item:$}=n,{record:_}=n,{fullRecord:C}=n,{value:b=""}=n,{multiValues:A}=n,{desc:E=""}=n,{noForm:S=!1}=n,{classId:N}=n,{eventId:T}=n,{recordId:D}=n,{withRefValue:R=!1}=n,{refValue:x=""}=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:q=!1}=n,{multi:H=!1}=n,{initFinished:j}=n,{listName:G=""}=n,{isScreen:X}=n;const Y="comment_"+v,Z=$.filter,K=$.properties?.startDialog;let Q,J,ee,te,re,ie,oe,se,ae=!1,le=!0,ce=!1,de=!0,ue=!0,fe=!1,he="";!U&&$.selection&&1===$.selection.split(":").length&&(U=$.selection);const me=B||P||$.lookup||U&&!$.constraint?"":"Suchbegriff ⏎",pe=(e,t)=>{try{return e.split(".").reduce((e,t)=>e[t],t)}catch(e){return""}},ge=()=>{if($.refItem&&$.refItem.startsWith("owner")){let e=c.owner[$.refClass];e||(e=pe($.refItem,c)),e&&(r(52,x=e),r(51,R=!0),f("change",{value:x}))}},we=async e=>{e.items.filter(e=>e.properties?.default).forEach(t=>{const[n,r]=t.properties.default?.split?t.properties.default.split("."):[t.properties.default,!1];f("defPrep",{className:e.class,itemName:t.name,value:n,valueItem:r})})},ye=async e=>{const n=()=>{r(19,ae=!0)};if(9==e.which)return;if(b)return e.preventDefault();if(13!=e.which)return;if(e.preventDefault(),$.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,b=g[0]._id)},ve=e=>{e&&(r(63,he=r(1,E=I(te,e))),f("setRefDesc",E.split(" •")[0]),f("change",{value:b,description:E}),f("task",{row:e,eventId:te.id,item:$}),X&&f("screenList",{item:$,row:e,eventId:te.id}))},$e=()=>{r(19,ae=!1),r(20,J=!1)},Ie=()=>{r(24,ce=!1)};return e.$$set=e=>{"id"in e&&r(5,v=e.id),"item"in e&&r(6,$=e.item),"record"in e&&r(55,_=e.record),"fullRecord"in e&&r(7,C=e.fullRecord),"value"in e&&r(0,b=e.value),"multiValues"in e&&r(8,A=e.multiValues),"desc"in e&&r(1,E=e.desc),"noForm"in e&&r(9,S=e.noForm),"classId"in e&&r(10,N=e.classId),"eventId"in e&&r(11,T=e.eventId),"recordId"in e&&r(12,D=e.recordId),"withRefValue"in e&&r(51,R=e.withRefValue),"refValue"in e&&r(52,x=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,q=e.noList),"multi"in e&&r(17,H=e.multi),"initFinished"in e&&r(54,j=e.initFinished),"listName"in e&&r(59,G=e.listName),"isScreen"in e&&r(60,X=e.isScreen)},e.$$.update=()=>{if(4&e.$$.dirty[0]|67108864&e.$$.dirty[1]&&r(2,M="boolean"==typeof M&&(M&&!V)),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&r(3,P||=B),3145728&e.$$.dirty[1]&&R&&r(0,b=x),3&e.$$.dirty[0]|2&e.$$.dirty[2]&&!E&&b&&he&&r(1,E=he),399425&e.$$.dirty[0]|1484783616&e.$$.dirty[1]&&b&&te){let e=!1;if(!Array.isArray(b)){if(D||$.asInput||$.upate||!1!==$.refItem||!0===H||!1===$.refItem&&j){const t="p$"+G+"$"+$.refClass+"$"+T,n=vw(t);n?.then?n.then(e=>{const t=e.find(({_id:e})=>e===b);t?ve(t):Iw($.refClass,te.id,b,!!$.lookup||q).then(ve)}):e=!0}let t="";const n=Q.input?.class?.find(e=>e.name===$.refClass);n?.refStatus&&(t=n.refStatus),e&&te?.id&&Iw($.refClass,te.id,b,!!$.lookup||q,t).then(ve),r(54,j=!0)}}if(65&e.$$.dirty[0]|5&e.$$.dirty[2]&&b&&re&&$.name===re.input?.at(0)&&re.inputLookup?.length){const{domain:e}=re.inputLookup[0]||{};"user"===e&&(o.some(e=>re.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0))}262145&e.$$.dirty[0]&&!b&&te&&ve({})},[b,E,M,P,U,v,$,C,A,S,N,T,D,L,F,W,z,H,te,ae,J,ee,ie,le,ce,oe,de,ue,fe,m,p,g,w,y,Y,Z,K,me,()=>{if(X||!$.query)return;const[e,t]=$.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]}}],$.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":$.refStatus}}])),n},async()=>{try{if(r(61,Q=await t.getEvent(T)),r(53,B||=(()=>{if(D){if($.asInput)return!0;if(Q?.input?.class?.find(e=>e.name===$.refClass))return!0}return!1})()),se="report"===Q.output.type,r(26,de=!$.asInput),r(23,le=Q.output?.class[0].name!==$.refClass),r(18,te=await t.getSchemaByClass($.refClass)),te?.blocked)return f("initFail",!0),!1;if(se||r(28,fe=((e,t)=>{if(!t)return!1;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===$.name);if(t?.properties?.blocking)return n.name}return!1})(Q,te)),r(22,ie=(e=>!a?.length||!!a.find(t=>t===e))(te.id)),r(62,re=await t.getSchema(T)),T&&D&&b&&!P&&re.input?.find(e=>e===$.refClass)&&r(3,P=!0),Q.input?.class&&Q.input.class[0]&&(Q.input.class[0].name===$.refClass&&Q.input.class[0].readonly&&r(3,P=!0),D&&Q.input.class[0].name===$.refClass&&Q.input.class[0].writeState)){(await t.getTaskByDocId(D,!0)).status===Q.input.class[0].writeState&&r(3,P=r(53,B=!1))}if(P)return!0;if($.refStatus&&!$.query){const e=[].concat($.refStatus);let n={event:te.id,status:{$in:e}};const i=await t.getSectionView("_task",n);1===i?.length&&(r(52,x=i[0].docId),r(51,R=!0),f("change",{value:x}))}if($.properties?.query?.lookup){const{domain:e,value:n}=$.properties.query.lookup;if("user"===e){const e=l.user,i={[n]:e},s=await t.getSectionView($.refClass,i);if(s?.length){const[{_id:e}]=s;e&&(r(52,x=e),r(51,R=!0),f("change",{value:x}))}o.some(e=>te.authorization?.find(t=>t.role===e&&!t.constraint))||r(3,P=!0)}}else ge();if(!P&&!x&&$.filter&&(""===L||void 0===L)){let e=$.filter,n=!0;e.startsWith("!")&&(n=!1,e=e.slice(1));const i=await t.getOneAndOnly($.refClass,{[$.filter]:n});i&&(r(52,x=i._id),r(51,R=!0),f("change",{value:x}))}return r(21,ee=te.identity.designation),b||we(te),!0}catch(e){return f("initFail",!0),!1}},e=>t=>{if(t.stopPropagation(),!K){if(!0===e&&r(19,ae=!0),e&&"BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}($.lookup||U&&!$.constraint||b)&&r(19,ae=!0)}},ye,()=>{if(b)return"";r(1,E="");const e="#"+N+(G?" ."+N+G:"")+" #"+Y,t=document.querySelectorAll(e)[0];return t?.value?t.value:""},async({detail:e})=>{if(e.className=te.class,r(0,b=e.row._id),""===L||void 0===L?f("saveDialog",{itemName:$.name,value:b,add:add,closeTask:$.properties?.closeTask}):(e.add=$.properties?.add,f("listChange",e)),$.properties?.closeTask&&Q.output?.approval){const e=await t.getTaskByDocId(_._id),n=Q.output.approval.flatMap(({refRole:e})=>e),r={eventId:T,eventDesignation:Q.identity.designation,docId:_._id,role:n.filter(e=>o.find(t=>t===e)).join(", "),user:d.email,timeStamp:(new Date).toISOString()};await t.setTaskVisum(e._id,r)}Ie()},({detail:e})=>{r(0,b=e.row._id),$e()},$e,Ie,()=>{(se||ie)&&(H?f("change",{value:b,delete:!0}):(r(0,b=""),r(1,E=""),r(27,ue=!0),f("change",{value:b,description:E}),f("task",{row:{_task:{event:te.id},_id:!1},eventId:te.id,item:$})))},async()=>{if(!b)return;let e=await Iw($.refClass,te.id,b);e._task||(e={_task:await t.getTaskByDocId(b,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},e=>{b||E&&ye({which:13,preventDefault:()=>{},srcElement:{value:E}})},async e=>{r(25,oe={});for(const e in K){let n=K[e],i="";if(n.startsWith("owner"))i=pe(n,c);else if(n.startsWith("+")){const[e,r]=n.slice(1).split(".");n=e;const o=await t.getSchemaByClass(n),s=_[n];let a=await $w("",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,oe[e]=i,oe)}r(24,ce=!0)},R,x,B,j,_,O,V,q,G,X,Q,re,he,o,function(e){E=e,r(1,E),r(0,b),r(63,he),r(51,R),r(52,x)},function(e){ue=e,r(27,ue)},function(e){ae=e,r(19,ae)},function(e){J=e,r(20,J)},function(e){ce=e,r(24,ce)}]}class Pr extends Oe{constructor(e){var t;super(),hr.getElementById("svelte-10ggg6v-style")||((t=B("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}",x(hr.head,t)),xe(this,e,Mr,Or,T,{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,isScreen:60},[-1,-1,-1])}}const{document:Br}=Ee;function Lr(e){e[46]=e[47].items}function Fr(e,t,n){const r=e.slice();return r[48]=t[n],r[50]=n,r}function Vr(e,t,n){const r=e.slice();return r[51]=t[n],r[53]=n,r}function Ur(e,t,n){const r=e.slice();return r[51]=t[n],r}function Wr(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function zr(e){let t,n,r,i;Lr(e);const o=[Hr,qr],s=[];function a(e,t){return e[6]?1:0}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){Lr(e);let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}function qr(e){let t,n;return t=new Rw({props:{schema:e[4],recID:e[7]}}),t.$on("choose",e[24]),t.$on("back",e[25]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Hr(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:[jr]},$$scope:{ctx:e}}}),n.$on("click",e[34]);let C=e[1]&&Gr(e);o=new e[12]({props:{disabled:!e[5].length,filled:!0,$$slots:{default:[Yr]},$$scope:{ctx:e}}}),o.$on("click",e[17]);let b=e[14]&&function(e){let t,n;return t=new e[9]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}(e);function A(t){e[35](t)}let E={id:e[13]};void 0!==e[3]&&(E.value=e[3]),d=new e[10]({props:E}),oe.push(()=>Te(d,"value",A)),d.$on("input",e[19]),m=new bt({props:{size:"18"}});let S=e[46]?.length&&Zr(e),N=e[5]?.length&&Qr(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),C&&C.c(),i=V(),ke(o.$$.fragment),s=V(),b&&b.c(),a=V(),l=B("div"),c=F("Suchen: "),ke(d.$$.fragment),f=V(),h=B("span"),ke(m.$$.fragment),p=V(),g=B("div"),w=B("table"),S&&S.c(),y=V(),v=B("tbody"),N&&N.c(),H(t,"class","form--buttons svelte-4visk8"),H(h,"class","feather pointer svelte-4visk8"),X(l,"margin-bottom","1em"),X(l,"position","relative"),H(w,"striped",""),H(w,"class","svelte-4visk8"),H(g,"class","eList svelte-4visk8")},m(u,A){O(u,t,A),De(n,t,null),x(t,r),C&&C.m(t,null),x(t,i),De(o,t,null),O(u,s,A),b&&b.m(u,A),O(u,a,A),O(u,l,A),x(l,c),De(d,l,null),x(l,f),x(l,h),De(m,h,null),O(u,p,A),O(u,g,A),x(g,w),S&&S.m(w,null),x(w,y),x(w,v),N&&N.m(v,null),$=!0,I||(_=W(h,"click",e[21]),I=!0)},p(e,r){const s={};33554432&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=Gr(e),C.c(),_e(C,1),C.m(t,i)):C&&($e(),Ce(C,1,1,()=>{C=null}),Ie());const a={};32&r[0]&&(a.disabled=!e[5].length),33554432&r[1]&&(a.$$scope={dirty:r,ctx:e}),o.$set(a);const l={};!u&&8&r[0]&&(u=!0,l.value=e[3],he(()=>u=!1)),d.$set(l),e[46]?.length?S?(S.p(e,r),4&r[0]&&_e(S,1)):(S=Zr(e),S.c(),_e(S,1),S.m(w,y)):S&&($e(),Ce(S,1,1,()=>{S=null}),Ie()),e[5]?.length?N?(N.p(e,r),32&r[0]&&_e(N,1)):(N=Qr(e),N.c(),_e(N,1),N.m(v,null)):N&&($e(),Ce(N,1,1,()=>{N=null}),Ie())},i(e){$||(_e(n.$$.fragment,e),_e(C),_e(o.$$.fragment,e),_e(b),_e(d.$$.fragment,e),_e(m.$$.fragment,e),_e(S),_e(N),$=!0)},o(e){Ce(n.$$.fragment,e),Ce(C),Ce(o.$$.fragment,e),Ce(b),Ce(d.$$.fragment,e),Ce(m.$$.fragment,e),Ce(S),Ce(N),$=!1},d(e){e&&M(t),Re(n),C&&C.d(),Re(o),e&&M(s),b&&b.d(e),e&&M(a),e&&M(l),Re(d),Re(m),e&&M(p),e&&M(g),S&&S.d(),N&&N.d(),I=!1,_()}}}function jr(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Gr(e){let t,n;return t=new e[12]({props:{filled:!0,$$slots:{default:[Xr]},$$scope:{ctx:e}}}),t.$on("click",e[23]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};33554432&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Xr(e){let t;return{c(){t=F("Neu")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Yr(e){let t;return{c(){t=F("Bestätigen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Zr(e){let t,n,r,i,o,s,a,l;i=new pt({props:{size:"20",style:"color: #326173;"}});let c=e[46],d=[];for(let t=0;t<c.length;t+=1)d[t]=Kr(Ur(e,c,t));return{c(){t=B("thead"),n=B("tr"),r=B("th"),ke(i.$$.fragment),o=V();for(let e=0;e<d.length;e+=1)d[e].c();H(r,"class","svelte-4visk8"),H(n,"class","svelte-4visk8"),H(t,"class","svelte-4visk8")},m(c,u){O(c,t,u),x(t,n),x(n,r),De(i,r,null),x(n,o);for(let e=0;e<d.length;e+=1)d[e].m(n,null);s=!0,a||(l=W(r,"click",function(){N(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[46],t=0;t<c.length;t+=1){const i=Ur(e,c,t);d[t]?d[t].p(i,r):(d[t]=Kr(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){Ce(i.$$.fragment,e),s=!1},d(e){e&&M(t),Re(i),P(d,e),a=!1,l()}}}function Kr(e){let t,n,r=e[51]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-4visk8")},m(e,r){O(e,t,r),x(t,n)},p(e,t){4&t[0]&&r!==(r=e[51]?.designation+"")&&j(n,r)},d(e){e&&M(t)}}}function Qr(e){let t,n,r=[],i=new Map,o=e[5];const s=e=>e[48]._id;for(let t=0;t<o.length;t+=1){let n=Fr(e,o,t),a=s(n);i.set(a,r[t]=ni(a,n))}return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,i){for(let t=0;t<r.length;t+=1)r[t].m(e,i);O(e,t,i),n=!0},p(e,n){1409069&n[0]&&(o=e[5],$e(),r=Ne(r,n,s,1,e,o,i,t.parentNode,Se,ni,t,Fr),Ie())},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)Ce(r[e]);n=!1},d(e){for(let t=0;t<r.length;t+=1)r[t].d(e);e&&M(t)}}}function Jr(e){let t,n,r,i,o=e[0],s=ei(e),a=e[46],l=[];for(let t=0;t<a.length;t+=1)l[t]=ti(Vr(e,a,t));return{c(){t=B("tr"),s.c(),n=V();for(let e=0;e<l.length;e+=1)l[e].c();r=V(),H(t,"class","svelte-4visk8"),Y(t,"active",e[0].includes(e[48]._id))},m(e,o){O(e,t,o),s.m(t,null),x(t,n);for(let e=0;e<l.length;e+=1)l[e].m(t,null);x(t,r),i=!0},p(e,i){if(1&i[0]&&T(o,o=e[0])?($e(),Ce(s,1,1,b),Ie(),s=ei(e),s.c(),_e(s),s.m(t,n)):s.p(e,i),327716&i[0]){let n;for(a=e[46],n=0;n<a.length;n+=1){const o=Vr(e,a,n);l[n]?l[n].p(o,i):(l[n]=ti(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]&&Y(t,"active",e[0].includes(e[48]._id))},i(e){i||(_e(s),i=!0)},o(e){Ce(s),i=!1},d(e){e&&M(t),s.d(e),P(l,e)}}}function ei(e){let t,n,r;return n=new e[11]({props:{name:e[15],data:e[48]._id,checked:e[0].includes(e[48]._id),round:!0}}),{c(){t=B("td"),ke(n.$$.fragment),H(t,"title","Wählt den Wert aus"),H(t,"class","svelte-4visk8")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};32&t[0]&&(r.data=e[48]._id),33&t[0]&&(r.checked=e[0].includes(e[48]._id)),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function ti(e){let t,n,r,i=e[16](e[48],e[51])+"";return{c(){t=B("td"),n=F(i),H(t,"class",r=D(e[51].type)+" svelte-4visk8")},m(e,r){O(e,t,r),x(t,n)},p(e,o){36&o[0]&&i!==(i=e[16](e[48],e[51])+"")&&j(n,i),4&o[0]&&r!==(r=D(e[51].type)+" svelte-4visk8")&&H(t,"class",r)},d(e){e&&M(t)}}}function ni(e,t){let n,r,i,o=t[20](t[48],t[46],t[3]),s=o&&Jr(t);return{key:e,first:null,c(){n=U(),s&&s.c(),r=U(),this.first=n},m(e,t){O(e,n,t),s&&s.m(e,t),O(e,r,t),i=!0},p(e,n){t=e,44&n[0]&&(o=t[20](t[48],t[46],t[3])),o?s?(s.p(t,n),44&n[0]&&_e(s,1)):(s=Jr(t),s.c(),_e(s,1),s.m(r.parentNode,r)):s&&($e(),Ce(s,1,1,()=>{s=null}),Ie())},i(e){i||(_e(s),i=!0)},o(e){Ce(s),i=!1},d(e){e&&M(n),s&&s.d(e),e&&M(r)}}}function ri(e){let t,n;return t=new e[9]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ii(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:ri,then:zr,catch:Wr,value:47,blocks:[,,,]};return be(n=e[2]&&e[18](),i),{c(){t=U(),i.block.c()},m(e,n){O(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]())&&be(n,i)||Ae(i,e,r)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),i.block.d(e),i.token=null,i=null}}}function oi(e,i,o){let s=JSON.parse(n.getItem("Locale")).id;const a=ne(),{Loading:l,TextField:c,Checkbox:d,Button:f}=u;let h,m,p,w,{inputList:y}=i,{selection:v}=i,{item:I}=i,{target:_}=i,{className:C}=i,{classId:b}=i,{recordId:A}=i,{stopAggregation:E=!1}=i,{shouldNew:S}=i,{sort:N}=i,T=!0,k=C+Math.floor(9e3*Math.random()+1e3).toString()+"search",D=!1;v||=[];let R=v;const x=C+_+"checkbox",O=(e,t)=>{if(!t)return;let n=e[t.name];if("template"===t.type){const r=[],i=e[t.refItem.split(".").at(-1)];if("object"==typeof i){for(const e in i)r.push(i[e]?.join(","));n=r?.join(" / ")}}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?$(n):g(e[`_${t.name}`]||n||"")},M=t.getSchemaByClass(C),P=(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};ee(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e&&e.scrollIntoView({block:"end",behavior:"smooth"}),document.getElementById(k)?.focus()},200)}),r.subscribe(async e=>{if(!e)return;const t=await M;e.eventId===t.id&&(Aw(t.class,e.eventId),o(2,T=!o(2,T=!1)))});const B=()=>{o(6,D=!1)};return e.$$set=e=>{"inputList"in e&&o(26,y=e.inputList),"selection"in e&&o(0,v=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,b=e.classId),"recordId"in e&&o(31,A=e.recordId),"stopAggregation"in e&&o(32,E=e.stopAggregation),"shouldNew"in e&&o(1,S=e.shouldNew),"sort"in e&&o(33,N=e.sort)},[v,S,T,h,m,p,D,w,a,l,c,d,f,k,!1,x,O,()=>{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,v=t.concat(e)),R=[...v]}else o(0,v=t),R=[];a("choose",{list:v})},async()=>{o(4,m=await M),p||o(5,p=P(N||m.displaySort,await y||await $w(m.class,m.id)));const{display:e}=m;let n=await(async(e,n,r)=>{if(!e)return;let i=[];for(let o of e){if(o.includes(":")&&(o=o.split(":")[0]),"_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,m,p);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=O(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,p=P(N||m.displaySort,await $w(m.class,m.id))),e.detail?.row?._id&&v.push(e.detail.row._id),B()},B,y,I,_,C,b,A,E,N,()=>a("back"),function(e){h=e,o(3,h)}]}class si extends Oe{constructor(e){var t;super(),Br.getElementById("svelte-4visk8-style")||((t=B("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}",x(Br.head,t)),xe(this,e,oi,ii,T,{inputList:26,selection:0,item:27,target:28,className:29,classId:30,recordId:31,stopAggregation:32,shouldNew:1,sort:33},[-1,-1])}}function ai(e,t,n){const r=e.slice();return r[12]=t[n],r[45]=n,r}function li(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ci(e){let t,n;return t=new e[17]({props:{outline:!0,$$slots:{default:[ui]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};36863&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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function di(e){let t,n;return t=new Pr({props:{classId:e[5],eventId:e[6],required:e[8],disabled:e[0],formnovalidate:e[11],readonly:e[9],id:e[1]+"."+e[45],item:e[2],desc:e[3],value:e[12],noForm:e[4],praefix:e[10],recordId:e[7],multi:!0}}),{c(){ke(t.$$.fragment)},m(e,r){De(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[45]),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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ui(e){let t,n,r,i,o,s,a;n=new Pt({props:{size:"18"}});let l=e[15],c=[];for(let t=0;t<l.length;t+=1)c[t]=di(ai(e,l,t));const d=e=>Ce(c[e],1,1,()=>{c[e]=null});return{c(){t=B("span"),ke(n.$$.fragment),r=V();for(let e=0;e<c.length;e+=1)c[e].c();i=U(),H(t,"class","feather pointer")},m(l,d){O(l,t,d),De(n,t,null),O(l,r,d);for(let e=0;e<c.length;e+=1)c[e].m(l,d);O(l,i,d),o=!0,s||(a=W(t,"click",e[24]),s=!0)},p(e,t){if(36863&t[0]){let n;for(l=e[15],n=0;n<l.length;n+=1){const r=ai(e,l,n);c[n]?(c[n].p(r,t),_e(c[n],1)):(c[n]=di(r),c[n].c(),_e(c[n],1),c[n].m(i.parentNode,i))}for($e(),n=l.length;n<c.length;n+=1)d(n);Ie()}},i(e){if(!o){_e(n.$$.fragment,e);for(let e=0;e<l.length;e+=1)_e(c[e]);o=!0}},o(e){Ce(n.$$.fragment,e),c=c.filter(Boolean);for(let e=0;e<c.length;e+=1)Ce(c[e]);o=!1},d(e){e&&M(t),Re(n),e&&M(r),P(c,e),e&&M(i),s=!1,a()}}}function fi(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function hi(e){let t,n;return t=new e[19]({props:{title:e[14].designation,class:"eList",$$slots:{default:[mi]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.title=e[14].designation),82084&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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function mi(e){let t,n;return t=new si({props:{selection:e[16],item:e[2],className:e[14].class,classId:e[5],recordId:e[7],inputList:e[23](),target:e[2].name,shouldNew:!e[20]+",",sort:e[21]}}),t.$on("choose",e[25]),t.$on("back",e[26]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function pi(e){let t,n,r=e[13]&&hi(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[13]?r?(r.p(e,n),8192&n[0]&&_e(r,1)):(r=hi(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function gi(e){let t,n,r,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:fi,then:ci,catch:li,value:43,blocks:[,,,]};function s(t){e[35](t)}be(e[22](),o);let a={class:"tModal",noClickaway:!0,$$slots:{default:[pi]},$$scope:{ctx:e}};return void 0!==e[13]&&(a.open=e[13]),n=new e[18]({props:a}),oe.push(()=>Te(n,"open",s)),{c(){o.block.c(),t=V(),ke(n.$$.fragment)},m(e,r){o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,O(e,t,r),De(n,e,r),i=!0},p(t,i){Ae(o,e=t,i);const s={};90276&i[0]|32768&i[1]&&(s.$$scope={dirty:i,ctx:e}),!r&&8192&i[0]&&(r=!0,s.open=e[13],he(()=>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){Ce(o.blocks[e])}Ce(n.$$.fragment,e),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&M(t),Re(n,e)}}}function wi(e,r,i){const o=ne(),{Card:s,Modal:a,Dialog:l,Button:c}=u;JSON.parse(n.getItem("Locale")).id;let d,f,h,{id:m}=r,{item:p}=r,{record:g}=r,{value:w=[]}=r,{desc:y=""}=r,{noForm:v=!1}=r,{classId:$}=r,{eventId:I}=r,{recordId:_}=r,{withRefValue:C=!1}=r,{refValue:b=""}=r,{required:A}=r,{disabled:E}=r,{readonly:S}=r,{praefix:N}=r,{selectionFields:T}=r,{formnovalidate:k}=r,{selection:D}=r,{deList:R}=r,{isTemplate:x}=r,{noList:O=!1}=r,M=!1;const{lookup:P,refStatus:B,filter:L,constraint:F,sort:V}=p.properties.multi;E=!0;const U=()=>{i(13,M=!1)};return e.$$set=e=>{"id"in e&&i(1,m=e.id),"item"in e&&i(2,p=e.item),"record"in e&&i(27,g=e.record),"value"in e&&i(12,w=e.value),"desc"in e&&i(3,y=e.desc),"noForm"in e&&i(4,v=e.noForm),"classId"in e&&i(5,$=e.classId),"eventId"in e&&i(6,I=e.eventId),"recordId"in e&&i(7,_=e.recordId),"withRefValue"in e&&i(28,C=e.withRefValue),"refValue"in e&&i(29,b=e.refValue),"required"in e&&i(8,A=e.required),"disabled"in e&&i(0,E=e.disabled),"readonly"in e&&i(9,S=e.readonly),"praefix"in e&&i(10,N=e.praefix),"selectionFields"in e&&i(30,T=e.selectionFields),"formnovalidate"in e&&i(11,k=e.formnovalidate),"selection"in e&&i(31,D=e.selection),"deList"in e&&i(32,R=e.deList),"isTemplate"in e&&i(33,x=e.isTemplate),"noList"in e&&i(34,O=e.noList)},e.$$.update=()=>{if(134217860&e.$$.dirty[0]&&g&&!_&&!p.properties.multi.lookup){const e=g[p.name];Array.isArray(e)&&0===e.length&&i(15,f=[])}},[E,m,p,y,v,$,I,_,A,S,N,k,w,M,d,f,h,s,a,l,P,V,async()=>{if(i(15,f=[].concat(w)),p.refEvent){const e=await t.getSchemas();i(14,d=e.find(e=>e.identity.name===p.refEvent))}else i(14,d=await t.getSchemaByClass(p.refClass))},async()=>{let e,n;if(P)if(P.refClass){if(g[P.refClass]){const r=await bw(P.refClass,g[P.refClass]);r&&Array.isArray(r[P.refItem])&&(n=[{$match:{_id:{$in:r[P.refItem]}}}],e=await t.getSectionView(d.class,n,!0))}}else n=[{$match:{[P]:g[P]}}],B&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":B}}])),e=await t.getSectionView(d.class,n,!0);else if(B){const n=await t.getTasksListStatus(d.id,B);n?.data?.length&&(e=n.data)}else e=await $w("",d.id);if(!e?.length)return[];if(F&&e?.length){const{refClass:r,refStatus:i}=F;if(i){const 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)))}else e=e.filter(e=>e[r]===g[r])}if(L)for(const t in L)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},()=>{S||(i(13,M=!0),i(16,h=f))},({detail:e})=>{g.__id||(i(15,f=e.list),o("change",{value:f}),o("multi",{lookup:P,filter:L,name:p.name,value:f})),U()},U,g,C,b,T,D,R,x,O,function(e){M=e,i(13,M)}]}class yi extends Oe{constructor(e){var t;super(),document.getElementById("svelte-1m792ni-style")||((t=B("style")).id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",x(document.head,t)),xe(this,e,wi,gi,T,{id:1,item:2,record:27,value:12,desc:3,noForm:4,classId:5,eventId:6,recordId:7,withRefValue:28,refValue:29,required:8,disabled:0,readonly:9,praefix:10,selectionFields:30,formnovalidate:11,selection:31,deList:32,isTemplate:33,noList:34},[-1,-1])}}const vi=/\d+/g,$i=/%[HMSpPdmyY%]/g;function Ii(e,t,n){const r=Math.floor((new Date).getFullYear()/100);let i=!1;if(""===e)return null;const o=t.split($i);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{vi.lastIndex=s;const o=vi.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 _i(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Ci}=Ee;function bi(e,t,n){const r=e.slice();return r[17]=t[n],r}function Ai(e,t,n){const r=e.slice();return r[20]=t[n],r}function Ei(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Si(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]=Ti(Ai(e,m,t));const g=e=>Ce(p[e],1,1,()=>{p[e]=null});let w=e[0].list&&ki(e);return l=new e[5]({props:{outline:!0,$$slots:{default:[Ri]},$$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:[xi]},$$scope:{ctx:e}}}),{c(){t=B("form"),n=B("input"),i=V();for(let e=0;e<p.length;e+=1)p[e].c();o=V(),w&&w.c(),s=V(),a=B("div"),ke(l.$$.fragment),c=V(),ke(d.$$.fragment),H(n,"class",D(e[6])+" svelte-1phofh5"),H(n,"name","_id"),H(n,"type","hidden"),n.value=r=e[1]._id||"",H(t,"class","fTask svelte-1phofh5"),H(t,"id",e[6]),H(a,"class","form--buttons svelte-1phofh5")},m(r,m){O(r,t,m),x(t,n),x(t,i);for(let e=0;e<p.length;e+=1)p[e].m(t,null);x(t,o),w&&w.m(t,null),O(r,s,m),O(r,a,m),De(l,a,null),x(a,c),De(d,a,null),u=!0,f||(h=[W(t,"keydown",e[8]),W(t,"submit",z(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=Ai(e,m,n);p[n]?(p[n].p(r,i),_e(p[n],1)):(p[n]=Ti(r),p[n].c(),_e(p[n],1),p[n].m(t,o))}for($e(),n=m.length;n<p.length;n+=1)g(n);Ie()}e[0].list?w?(w.p(e,i),1&i&&_e(w,1)):(w=ki(e),w.c(),_e(w,1),w.m(t,null)):w&&($e(),Ce(w,1,1,()=>{w=null}),Ie());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)Ce(p[e]);Ce(w),Ce(l.$$.fragment,e),Ce(d.$$.fragment,e),u=!1},d(e){e&&M(t),P(p,e),w&&w.d(),e&&M(s),e&&M(a),Re(l),Re(d),f=!1,S(h)}}}function Ni(e){let t,n;return t=new ah({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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ti(e){let t,n,r=Pi(!0,e[20]),i=r&&Ni(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(e,t,r),n=!0},p(e,n){1&n&&(r=Pi(!0,e[20])),r?i?(i.p(e,n),1&n&&_e(i,1)):(i=Ni(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function ki(e){let t,n,r=e[0].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Di(bi(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(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=bi(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=Di(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}function Di(e){let t,n,r,i;return t=new e[4]({props:{text:e[17].designation}}),r=new Xi({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(){ke(t.$$.fragment),n=V(),ke(r.$$.fragment)},m(e,o){De(t,e,o),O(e,n,o),De(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){Ce(t.$$.fragment,e),Ce(r.$$.fragment,e),i=!1},d(e){Re(t,e),e&&M(n),Re(r,e)}}}function Ri(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function xi(e){let t;return{c(){t=F("Speichern")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Oi(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Mi(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Oi,then:Si,catch:Ei,value:16,blocks:[,,,]};return be(e[7](),i),{c(){t=V(),n=B("section"),i.block.c(),Ci.title="Vorgaben",H(n,"class","sTask svelte-1phofh5")},m(e,o){O(e,t,o),O(e,n,o),i.block.m(n,i.anchor=null),i.mount=()=>n,i.anchor=null,r=!0},p(t,[n]){Ae(i,e=t,n)},i(e){r||(_e(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}r=!1},d(e){e&&M(t),e&&M(n),i.block.d(),i.token=null,i=null}}}const Pi=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Bi(e,r,o){let l,c,d;k(e,s,e=>o(11,c=e)),k(e,i,e=>o(12,d=e));const{Divider:f,Button:h,FormField:m}=u,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 Ii(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&&o(0,g=e.schema),"record"in e&&o(1,w=e.record)},e.$$.update=()=>{4&e.$$.dirty&&o(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)&&o(2,v=!0),c.role?.length&&g.authorization?.length){const e=g.authorization.some(e=>d?.find(t=>t===e.role&&"edit"===e.activity));o(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:Li}=Ee;function Fi(e,t,n){const r=e.slice();return r[52]=t[n],r}function Vi(e){let t,n;return t=new ah({props:{classId:e[6],item:e[52],listName:e[3].name,allowFutureUpdate:e[12],eventId:e[7],record:e[0],multiValues:e[4],allowedValues:e[5]&&e[5][e[52].name],disabled:e[8],required:e[9],currency:e[11],notifyList:e[1]}}),t.$on("notify",e[20]),t.$on("notify2",e[19]),t.$on("defPrep",e[22]),t.$on("formula",e[24]),t.$on("task",e[30]),t.$on("multi",e[25]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.classId=e[6]),8&n[0]&&(r.item=e[52]),8&n[0]&&(r.listName=e[3].name),4096&n[0]&&(r.allowFutureUpdate=e[12]),128&n[0]&&(r.eventId=e[7]),1&n[0]&&(r.record=e[0]),16&n[0]&&(r.multiValues=e[4]),40&n[0]&&(r.allowedValues=e[5]&&e[5][e[52].name]),256&n[0]&&(r.disabled=e[8]),512&n[0]&&(r.required=e[9]),2048&n[0]&&(r.currency=e[11]),2&n[0]&&(r.notifyList=e[1]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ui(e){let t,n,r=Pi(e[10],e[52]),i=r&&Vi(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(e,t,r),n=!0},p(e,n){1032&n[0]&&(r=Pi(e[10],e[52])),r?i?(i.p(e,n),1032&n[0]&&_e(i,1)):(i=Vi(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function Wi(e){let t,n,r,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Ui(Fi(e,i,t));const s=e=>Ce(o[e],1,1,()=>{o[e]=null});return{c(){t=B("div");for(let e=0;e<o.length;e+=1)o[e].c();H(t,"id",n=`accordion-content-${e[6]}-${e[3].name}`)},m(e,n){O(e,t,n);for(let e=0;e<o.length;e+=1)o[e].m(t,null);r=!0},p(e,a){if(56107003&a[0]){let n;for(i=e[3].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]=Ui(r),o[n].c(),_e(o[n],1),o[n].m(t,null))}for($e(),n=i.length;n<o.length;n+=1)s(n);Ie()}(!r||72&a[0]&&n!==(n=`accordion-content-${e[6]}-${e[3].name}`))&&H(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)Ce(o[e]);r=!1},d(e){e&&M(t),P(o,e)}}}function zi(e){let t,n,r=e[18](e[13])+"";return{c(){t=B("span"),n=F(r)},m(e,r){O(e,t,r),x(t,n)},p(e,t){8192&t[0]&&r!==(r=e[18](e[13])+"")&&j(n,r)},d(e){e&&M(t)}}}function qi(e){let t,n,r;return n=new e[15]({props:{$$slots:{default:[zi]},$$scope:{ctx:e}}}),n.$on("click",function(){N(e[21](e[51]))&&e[21](e[51]).apply(this,arguments)}),{c(){t=B("div"),ke(n.$$.fragment),H(t,"class","accordion svelte-p2ws74"),H(t,"slot","handle")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(t,r){e=t;const i={};8192&r[0]|16777216&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Hi(e){let t,n;return t=new e[17]({props:{class:e[14],open:e[2],$$slots:{handle:[qi,({toggle:e})=>({51:e}),({toggle:e})=>[0,e?1048576:0]],default:[Wi,({toggle:e})=>({51:e}),({toggle:e})=>[0,e?1048576:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[23]),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};16384&n[0]&&(r.class=e[14]),4&n[0]&&(r.open=e[2]),16379&n[0]|17825792&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ji(e){let t,n,r;return n=new e[16]({props:{$$slots:{default:[Hi]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),H(t,"class","formList")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};32767&t[0]|16777216&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Gi(e,n,r){const{Button:i,Accordion:o,AccordionSection:s}=u,a=ne();let{list:l}=n,{multiValues:c}=n,{allowedValues:d}=n,{schema:f}=n,{record:h}=n,{classId:m}=n,{eventId:p}=n,{disabled:v}=n,{required:I}=n,{open:_=!1}=n,{template:C={}}=n,{isTemplate:b=!1}=n,{currency:A}=n,{update:E=!1}=n,{notifyList:S}=n,{allowFutureUpdate:N}=n,{updateRec:T}=n;_||=void 0!==T;let k=new Map;const D={};let R,x=h[l.name]||{},O=[];h[l.name]=x;const M=(e,t)=>""===t[e.name]?"":e._attr?P(e,t[e.name]):"object"===e.type?L(t[e.name]):Array.isArray(t[e.name])?B(t[e.name]):"boolean"===e.type?$(t[e.name]):"number"===e.type?F(t[e.name],e.properties?.decimals||0):"dateRange"===e.type?y(e.name,t):"date"===e.type?g(((e,t=!1)=>{if(!e)return"";try{if(e.split&&3===e.split("-").length)return new Date(e)?.toISOString();if(e.split&&3===e.split(".").length){const[t,n,r]=e.split("."),i=new Date(r,n-1,t);if(!isNaN(i))return i.toISOString()}}catch{}return t?e:""})(t[e.name])):"datetime"===e.type?w(t[e.name]):e.properties?.multi?"":t[e.name],P=(e,t)=>D[t]?.split(" • ").at(e._attr),B=e=>e.slice(0,3).join(", "),L=e=>D[e]?.split(" • ").filter(e=>!!e).slice(0,2).join(" · "),F=(e,t)=>(t||=0,"number"==typeof e&&e||(e=Number(e||0)),isNaN(e)&&(e=0),(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t));["readonly","hidden","required"].map(e=>{f.filter(t=>"object"==typeof(t.properties&&t.properties[e])).forEach(t=>{const n=t.properties[e].refItem||"",r=t.properties[e].refValue,i=t.properties[e].refContent;let[o,s]=n.split(".");s||(s=o,o=void 0),o||f.find(e=>e.name===s)?O.push({action:e,itemName:t.name,refObj:o,refName:s,refValue:r,refContent:i,op:t.properties[e].invert?"!":""}):O.push({action:e,itemName:s,refObj:o,refName:t.name,refValue:r,refContent:i,op:t.properties[e].invert?"!":"",revert:!0})})});const V=async e=>{const t=e.split(".")[1]||e,n=O.filter(n=>n.refObj===e||n.refName===t||n.itemName===n.refName);if(n?.length)for(const e of n){const{refObj:t,refName:n,refValue:r,refContent:i,op:o,revert:s}=e;let a,c,{itemName:d,action:u}=e,f=!1,p=h[l.name+"."+n];if(t){const e=h[t];e&&(f=await getTaskFull(t,e))}i?p=void 0===p||p==i:!s&&f&&(p=f[n],Array.isArray(p)&&0===p.length?p=!1:r&&(p=p==(f[r]||h[r]))),!p&&s&&void 0!==h[d]&&(p=h[d]),void 0===p&&(p=h[l.name][n]),"!"===o&&(p=!p),s&&(d=n);const g=`#accordion-content-${m}-${l.name} .form-field.${d}`;"required"!==u&&"readonly"!==u||(u="required"===u?u:"disabled",setTimeout(()=>{if(a=`${g} .field textarea`,c=document.querySelector(a),c){const e=`${g} .field input`,t=document.querySelector(e);t&&p&&t.setAttribute(u,""),t&&!p&&t.removeAttribute(u)}c||(a=`${g} .field input#${"dp-"+d}`,c=document.querySelector(a)),c||(a=`${g} .field input`,c=document.querySelector(a)),c&&p&&c.setAttribute(u,""),c&&!p&&c.removeAttribute(u)},0)),"hidden"===u&&(c=document.querySelector(g),c?.classList&&c.classList.toggle("hidden",p))}},U=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)},W=()=>{for(const e of f)e.ocr||h[l.name][e.name]||("boolean"==typeof e.properties?.value&&r(0,h[l.name][e.name]=e.properties.value,h),"string"==typeof e.properties?.value&&r(0,h[l.name][e.name]=e.properties.value,h),"number"==typeof e.properties?.value&&r(0,h[l.name][e.name]=e.properties.value,h))},z=e=>{if(!e)return;const t=e.properties.value.formula,{operator:n,argument:i}=t,o=i.map(e=>h[l.name][e.refItem]);if("$preferred"===n){if(h._id&&void 0!==h[l.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,h[l.name][e.name]=t,h)}},q=async({item:e,value:t})=>{const n=f.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,a=s.map(n=>n.refItem===e.name?t:x[n.refItem]||h[n.refItem]);let c=0;"$add"===o&&(c=a.reduce((e,t)=>+(e||0)+ +(t||0))),r(0,h[l.name][n.name]=F(c,n.properties?.decimals),h)},H=()=>{setTimeout(()=>{const e=f.find(e=>e.properties?.checkOnValid);if(e&&!x[e.name])return void r(14,R="");let t=`#accordion-content-${m}-${l.name} .form-field:not(.hidden) .field :required:not(:disabled)`;const n=document.querySelectorAll(t);let i=!1;n.forEach(e=>{!e.id.startsWith("dp-")&&e.required&&""===e.value&&(i=!0)}),i||(t=`#accordion-content-${m}-${l.name} :not(.form-field.hidden) .field input.invalid`,document.querySelector(t)&&(i=!0)),r(14,R=i?"invalid":"")},0)};return ee(()=>(O?.length&&Array.from(new Set(O.map(e=>e.refName))).forEach(V),H())),e.$$set=e=>{"list"in e&&r(3,l=e.list),"multiValues"in e&&r(4,c=e.multiValues),"allowedValues"in e&&r(5,d=e.allowedValues),"schema"in e&&r(26,f=e.schema),"record"in e&&r(0,h=e.record),"classId"in e&&r(6,m=e.classId),"eventId"in e&&r(7,p=e.eventId),"disabled"in e&&r(8,v=e.disabled),"required"in e&&r(9,I=e.required),"open"in e&&r(2,_=e.open),"template"in e&&r(27,C=e.template),"isTemplate"in e&&r(10,b=e.isTemplate),"currency"in e&&r(11,A=e.currency),"update"in e&&r(28,E=e.update),"notifyList"in e&&r(1,S=e.notifyList),"allowFutureUpdate"in e&&r(12,N=e.allowFutureUpdate),"updateRec"in e&&r(29,T=e.updateRec)},e.$$.update=()=>{268435465&e.$$.dirty[0]&&E&&h&&r(13,x=h[l.name]||{}),2&e.$$.dirty[0]&&S&&H(),536870912&e.$$.dirty[0]&&(e=>{if(W(),e)for(const t of f)e[l.name]?void 0!==e[l.name][t.name]&&r(0,h[l.name][t.name]=e[l.name][t.name],h):r(0,h[l.name][t.name]="",h)})(T)},[h,S,_,l,c,d,m,p,v,I,b,A,N,x,R,i,o,s,e=>{let t=f;return l.display?.refItem&&(t=l.display.refItem.map(e=>{const[t,n]=e.split("."),r=f.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=>M(t,e)).filter(e=>!!e).join(" • ")||"+"},({detail:e})=>{ue().then(()=>{const{itemName:t,value:n}=e;r(13,x={...x,[t]:n})})},({detail:e})=>{const{itemName:t,value:n,desc:i}=e,[o,s]=t.split(".");if(!s)return;const a=f.filter(e=>"$preferred"===e.properties?.value?.formula?.operator);for(const e of a)z(e);V(t),r(1,S={listName:l.name,itemName:t,value:n}),i&&(D[s]=i);const c=h[o];r(0,h[o]={...c,[s]:n},h),f.filter(e=>!e.refItem&&e.refInput===s).forEach(e=>{const t=h[o];r(0,h[o]={...t,[e.name]:n},h)}),r(13,x=h[o]),H()},e=>t=>{(()=>{const e=C[l.name]||{};for(const t in e)C[l.name][t]&&!h[l.name][t]&&r(0,h[l.name][t]=C[l.name][t],h)})(),e(t);const n=`#accordion-content-${m}-${l.name} > div.form-field:last-child`;document.querySelector(n),ue().then(()=>{const e=`#accordion-content-${m}-${l.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(U)})},async({detail:{className:e,itemName:n,value:r,valueItem:i}})=>{if(k.has(e))return;if(i&&(r+="."+i),!0!==r&&(r=(r=[].concat(r)).some(e=>e===className+"."+l.name)),!r)return;const o={[n]:!0},s=await t.getSectionView(e,o);s?.length&&k.set(e,s[0])},()=>{setTimeout(()=>{Array.from(k).forEach(([e,t])=>{h[l.name][e]||r(0,h[l.name][e]=t._id,h)})},200)},({detail:e})=>{q(e)},({detail:e})=>{e.objectName=l.name,a("multi",e)},f,C,E,T,function(t){re(e,t)}]}class Xi extends Oe{constructor(e){var t;super(),Li.getElementById("svelte-p2ws74-style")||((t=B("style")).id="svelte-p2ws74-style",t.textContent=".accordion.svelte-p2ws74{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}}.panel.invalid .btn{border:1px #b80000 solid}",x(Li.head,t)),xe(this,e,Gi,ji,T,{list:3,multiValues:4,allowedValues:5,schema:26,record:0,classId:6,eventId:7,disabled:8,required:9,open:2,template:27,isTemplate:10,currency:11,update:28,notifyList:1,allowFutureUpdate:12,updateRec:29},[-1,-1])}}const{document:Yi}=Ee;function Zi(e){e[0]=e[23].list,e[22]=e[23].items}function Ki(e,t,n){const r=e.slice();return r[24]=t[n],r}function Qi(e,t,n){const r=e.slice();return r[27]=t[n],r}function Ji(e,t,n){const r=e.slice();return r[27]=t[n],r}function eo(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function to(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)}Zi(e),n=new e[7]({props:{outline:!0,$$slots:{default:[no]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),oe.push(()=>Te(s,"value",v)),s.$on("input",e[12]),d=new bt({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]=ro(Ji(e,r,t));return{c(){t=B("thead"),n=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();H(n,"class","svelte-14hcfjl"),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(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=Ji(e,r,o);i[o]?i[o].p(s,t):(i[o]=ro(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&&M(t),P(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]=so(Ki(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);O(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=Ki(e,n,o);r[o]?r[o].p(s,i):(r[o]=so(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){P(r,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("div"),o=F("Suchen: "),ke(s.$$.fragment),l=V(),c=B("span"),ke(d.$$.fragment),u=V(),f=B("div"),h=B("table"),I&&I.c(),m=V(),p=B("tbody"),_&&_.c(),H(t,"class","form--buttons svelte-14hcfjl"),H(c,"class","feather pointer svelte-14hcfjl"),X(i,"margin-bottom","1em"),X(i,"position","relative"),H(h,"striped",""),H(h,"class","svelte-14hcfjl"),H(f,"class","eList svelte-14hcfjl")},m(a,v){O(a,t,v),De(n,t,null),O(a,r,v),O(a,i,v),x(i,o),De(s,i,null),x(i,l),x(i,c),De(d,c,null),O(a,u,v),O(a,f,v),x(f,h),I&&I.m(h,null),x(h,m),x(h,p),_&&_.m(p,null),g=!0,w||(y=W(c,"click",e[14]),w=!0)},p(e,t){Zi(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],he(()=>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){Ce(n.$$.fragment,e),Ce(s.$$.fragment,e),Ce(d.$$.fragment,e),g=!1},d(e){e&&M(t),Re(n),e&&M(r),e&&M(i),Re(s),Re(d),e&&M(u),e&&M(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function no(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ro(e){let t,n,r=e[27]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function io(e){let t,n,r=e[22],i=[];for(let t=0;t<r.length;t+=1)i[t]=oo(Qi(e,r,t));return{c(){t=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=V(),H(t,"class","pointer svelte-14hcfjl")},m(e,r){O(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);x(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[22],s=0;s<r.length;s+=1){const a=Qi(e,r,s);i[s]?i[s].p(a,o):(i[s]=oo(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&&M(t),P(i,e)}}}function oo(e){let t,n,r,i,o=e[9](e[24],e[27])+"";return{c(){t=B("td"),n=F(o),H(t,"class","svelte-14hcfjl")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(e[10](e[24]))),r=!0)},p(t,n){e=t},d(e){e&&M(t),r=!1,i()}}}function so(e){let t,n=e[13](e[24],e[22],e[1]),r=n&&io(e);return{c(){r&&r.c(),t=U()},m(e,n){r&&r.m(e,n),O(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=io(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&M(t)}}}function ao(e){let t,n;return t=new e[5]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function lo(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:ao,then:to,catch:eo,value:23,blocks:[,,,]};return be(e[11](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function co(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[lo]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function uo(e,n,r){const i=ne(),{Dialog:o,Divider:s,Loading:a,TextField:l,Button:c}=u;let{item:d}=n,{className:f}=n,{classId:h}=n,{list:m}=n,p="",w=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):g(e[`_${t.name}`]||e[t.name]||"")},v=t.getSchemaByClass(f);ee(()=>{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,d=e.item),"className"in e&&r(16,f=e.className),"classId"in e&&r(17,h=e.classId),"list"in e&&r(0,m=e.list)},[m,p,i,o,s,a,l,c,w,y,e=>()=>i("choose",{row:e}),async()=>{const e=await v,t=e.display;let n=await kn(t,e,m);return{list:m,items:n}},({detail:{value:e}})=>{r(1,p=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(y(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,p="")},d,f,h,()=>i("back"),function(e){p=e,r(1,p)}]}class fo extends Oe{constructor(e){var t;super(),Yi.getElementById("svelte-14hcfjl-style")||((t=B("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}",x(Yi.head,t)),xe(this,e,uo,co,T,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:ho}=Ee;function mo(e,t,n){const r=e.slice();return r[12]=t[n],r}function po(e,t,n){const r=e.slice();return r[4]=t[n],r}function go(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function wo(e){let t,n,r,i=e[8].items,o=[];for(let t=0;t<i.length;t+=1)o[t]=Co(po(e,i,t));const s=e=>Ce(o[e],1,1,()=>{o[e]=null});let a=e[8].list&&bo(e);return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=V(),a&&a.c(),n=U()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);O(e,t,i),a&&a.m(e,i),O(e,n,i),r=!0},p(e,r){if(127764431&r[0]){let n;for(i=e[8].items,n=0;n<i.length;n+=1){const s=po(e,i,n);o[n]?(o[n].p(s,r),_e(o[n],1)):(o[n]=Co(s),o[n].c(),_e(o[n],1),o[n].m(t.parentNode,t))}for($e(),n=i.length;n<o.length;n+=1)s(n);Ie()}e[8].list?a?(a.p(e,r),256&r[0]&&_e(a,1)):(a=bo(e),a.c(),_e(a,1),a.m(n.parentNode,n)):a&&($e(),Ce(a,1,1,()=>{a=null}),Ie())},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)Ce(o[e]);Ce(a),r=!1},d(e){P(o,e),e&&M(t),a&&a.d(e),e&&M(n)}}}function yo(e){let t,n,r,i;const o=[$o,vo],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=U()},m(e,n){~t&&s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie()),~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){Ce(n),i=!1},d(e){~t&&s[t].d(e),e&&M(r)}}}function vo(e){let t,n,r,i;n=new ah({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]}}),n.$on("notify",e[18]),n.$on("multi",e[19]),n.$on("defPrep",e[20]);let o=e[4].name===e[15]&&!!e[1]&&Io(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(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]),257&r[0]&&(i.disabled=e[4].name===e[15]&&e[16]||e[0]),64&r[0]&&(i.eventId=e[6]),4&r[0]&&(i.notifyList=e[2]),8&r[0]&&(i.currency=e[3]),1024&r[0]&&(i.changeValue=e[10]),n.$set(i),e[4].name===e[15]&&e[1]?o?(o.p(e,r),258&r[0]&&_e(o,1)):(o=Io(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function $o(e){let t,n,r,i;n=new ah({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]&&_o(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"padding-top",".25em"),X(t,"background-color","lightyellow"),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(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=_o(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Io(e){let t,n,r,i,o;return n=new St({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[26]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function _o(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 pointer svelte-16mo2c")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[23]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Co(e){let t,n,r="list"!==e[4].type&&yo(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){"list"!==e[4].type?r?(r.p(e,n),256&n[0]&&_e(r,1)):(r=yo(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function bo(e){let t,n,r=e[8].list,i=[];for(let t=0;t<r.length;t+=1)i[t]=Eo(mo(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(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=mo(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=Eo(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}function Ao(e){let t,n,r,i,o;function s(t){e[32](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 Xi({props:a}),oe.push(()=>Te(r,"notifyList",s)),{c(){ke(t.$$.fragment),n=V(),ke(r.$$.fragment)},m(e,i){De(t,e,i),O(e,n,i),De(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],he(()=>i=!1)),r.$set(s)},i(e){o||(_e(t.$$.fragment,e),_e(r.$$.fragment,e),o=!0)},o(e){Ce(t.$$.fragment,e),Ce(r.$$.fragment,e),o=!1},d(e){Re(t,e),e&&M(n),Re(r,e)}}}function Eo(e){let t,n,r="array"!==e[12].type&&Ao(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){"array"!==e[12].type?r?(r.p(e,n),256&n[0]&&_e(r,1)):(r=Ao(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function So(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function No(e){let t,n;return t=new fo({props:{item:e[4],className:e[5],classId:e[9],list:e[12]}}),t.$on("choose",e[21]),t.$on("back",e[22]),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function To(e){let t,n,r=e[11]&&No(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[11]?r?(r.p(e,n),2048&n[0]&&_e(r,1)):(r=No(e),r.c(),_e(r,1),r.m(t.parentNode,t)):r&&($e(),Ce(r,1,1,()=>{r=null}),Ie())},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function ko(e){let t,n,r,i,o,s,a={ctx:e,current:null,token:null,hasCatch:!1,pending:So,then:wo,catch:go,value:57,blocks:[,,,]};function l(t){e[33](t)}be(e[17](),a),n=new e[13]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[To]},$$scope:{ctx:e}};return void 0!==e[11]&&(c.open=e[11]),i=new e[14]({props:c}),oe.push(()=>Te(i,"open",l)),{c(){a.block.c(),t=V(),ke(n.$$.fragment),r=V(),ke(i.$$.fragment)},m(e,o){a.block.m(e,a.anchor=o),a.mount=()=>t.parentNode,a.anchor=t,O(e,t,o),De(n,e,o),O(e,r,o),De(i,e,o),s=!0},p(t,n){Ae(a,e=t,n);const r={};6704&n[0]|1&n[2]&&(r.$$scope={dirty:n,ctx:e}),!o&&2048&n[0]&&(o=!0,r.open=e[11],he(()=>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){Ce(a.blocks[e])}Ce(n.$$.fragment,e),Ce(i.$$.fragment,e),s=!1},d(e){a.block.d(e),a.token=null,a=null,e&&M(t),Re(n,e),e&&M(r),Re(i,e)}}}function Do(e,n,r){const{Divider:i,FormField:o,Modal:s}=u,a=ne();let l,c,d,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={},b=[],A=[],E={},S=new Map,N=!1,T="";const k=y.checkOn,D=v,R=e=>{l.items.filter(t=>"object"==typeof(t.properties&&t.properties[e])).map(t=>{const n=t.properties[e].refItem||"",[r,i]=n.split(".");b.push({action:e,itemName:t.name,refObj:r,refName:i,op:t.properties[e].invert?"!":""})})},x=()=>{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=b.filter(t=>t.refObj===e);if(t?.length){r(10,E={});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,d=!i&&C[n];const u=C[n];u&&i&&(d=(await bw(n,u))[i]),Array.isArray(d)&&0===d.length&&(d=!1),"!"===o&&(d=!d),"required"!==s&&"readonly"!==s||(s="required"===s?s:"disabled",setTimeout(()=>{a=`#${c} .form-field.${t} .field textarea`,l=document.querySelector(a),l||(a=`#${c} .form-field.${t} .field input`,l=document.querySelector(a)),l&&d&&l.setAttribute(s,""),l&&!d&&l.removeAttribute(s)},0)),"hidden"===s&&(a=`#${c} .form-field.${t}`,l=document.querySelector(a),l?.classList?.toggle("hidden",!!d),d&&r(10,E[t]="",E))}}};ee(()=>{M()});const M=async()=>{const e=e=>new Promise(t=>setTimeout(t,e));let t,n=0;for(;!(t=document.getElementById(c))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of b)e.add(t.refObj||d);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(d,n);i?.length?(r(12,T=i),r(11,N=!0)):(r(1,v=""),r(27,$=""),a("setRefValue",$))},L=()=>{r(11,N=!1)},F=()=>{r(1,v=""),r(27,$=v),r(7,C={}),a("setRefValue",$)};return e.$$set=e=>{"required"in e&&r(28,m=e.required),"disabled"in e&&r(0,p=e.disabled),"readonly"in e&&r(29,g=e.readonly),"id"in e&&r(30,w=e.id),"item"in e&&r(4,y=e.item),"value"in e&&r(1,v=e.value),"refValue"in e&&r(27,$=e.refValue),"currency"in e&&r(3,I=e.currency),"notifyList"in e&&r(2,_=e.notifyList)},e.$$.update=()=>{536870913&e.$$.dirty[0]&&r(0,p=p||g),224&e.$$.dirty[0]|1&e.$$.dirty[1]&&C&&a("safeReference",{record:C,class:d,event:f,taskId:h})},[p,v,_,I,y,d,f,C,l,c,E,N,T,i,s,k,D,async()=>{try{if(v){const e=await t.getTask(y.refClass,v);delete e._task,r(7,C=e),r(31,h=(await t.getTaskByDocId(e._id,!0))._id)}else r(7,C={})}catch{}return r(8,l=await t.getSchemaByClass(y.refClass)),r(9,c="form-"+l.class+Math.floor(9e3*Math.random()+1e3).toString()),r(5,d=l.class),l.identity.designation,r(6,f=l.id),["readonly","hidden","required"].map(R),x(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(r(7,C[t]=n,C),t===k)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===d)),!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(d,{_id:e.row._id});n?.length&&(r(1,v=n[0]._id),r(27,$=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)},async()=>{if(!v)return;let e=await Iw(y.refClass,l.id,v);e._task||(e={_task:await t.getTaskByDocId(v,!0)});const n=e._task.task_id||e._task._id,r=`/task/${e._task.event}/${n}/task?view=standalone`;window.open(r)},$,m,g,w,h,function(e){_=e,r(2,_)},function(e){N=e,r(11,N)}]}class Ro extends Oe{constructor(e){var t;super(),ho.getElementById("svelte-16mo2c-style")||((t=B("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",x(ho.head,t)),xe(this,e,Do,ko,T,{required:28,disabled:0,readonly:29,id:30,item:4,value:1,refValue:27,currency:3,notifyList:2},[-1,-1,-1])}}function xo(e){let t,n;return{c(){t=B("span"),n=F(e[5]),H(t,"class","item")},m(e,r){O(e,t,r),x(t,n)},p(e,t){32&t[0]&&j(n,e[5])},d(e){e&&M(t)}}}function Oo(e){let t,n,r,i=e[6]&&xo(e),o=e[14]&&function(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Übernehmen"),H(t,"class","pointer feather svelte-1fuww0c")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[17]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}(e);return{c(){i&&i.c(),t=V(),o&&o.c(),n=U()},m(e,s){i&&i.m(e,s),O(e,t,s),o&&o.m(e,s),O(e,n,s),r=!0},p(e,n){e[6]?i?i.p(e,n):(i=xo(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){Ce(o),r=!1},d(e){i&&i.d(e),e&&M(t),o&&o.d(e),e&&M(n)}}}function Mo(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=B("div"),ke(n.$$.fragment),X(t,"position","relative"),X(t,"max-width","10em")},m(e,i){O(e,t,i),De(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]|262144&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Po(e,r,i){const o=ne(),{TextField:s}=u;let{id:a}=r,{item:l}=r,{widget:c}=r,{value:d}=r,{record:f}=r,{noForm:h=!1}=r,{classId:m}=r,{disabled:p}=r,{formnovalidate:g}=r,{currency:w}=r,{ownCurrency:y}=r,{praefix:v}=r,{notifyList:$}=r,{isNew:I}=r;const C=JSON.parse(n.getItem("Locale"));let b=w,A=["price","amount","amountValue","taxValue","total","__total"].find(e=>e===l.name?.split("-")[0])||l.properties?.currency;!1===l.properties?.currency&&(A=!1),"owner.currency"===l.properties?.currency&&(b=y);const E=Number("1.1").toLocaleString(C.id).substring(1,2),{properties:S={}}=l;let{min:N,max:T,step:k,pattern:D,decimals:R=0,unit:x="",placeholder:O,hint:M,readonly:P,negative:B,required:L=!1,transfer:F,zeroNotAllowed:V=!1,showNative:U}=S,W="";A&&void 0===S?.decimals&&(R=2),d=d?Number(d.toString().replace(",",".")):0;let z,q=!1;P=!0===P||void 0;var H=new Intl.NumberFormat(C.id,{minimumFractionDigits:R});const j=async(e,n)=>{if(!c)return n;if(z)return z;if(q)return n;if(q=!0,!e.properties?.filter)return n;const{_state:r,_date:i,_diff:o,_lt:s,_count:a,_compare:l,value:d}=e.properties.filter,u=[{$match:{[c.schema.class]:c.value}}];if(l){const{refItem:e,value:t,op:n}=l;""===t&&"ne"===n?u.push({$match:{[e]:{$nin:["",void 0]}}}):u.push({$match:{[e]:{["$"+n]:t}}})}if(r&&u.push({$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":r}}),i){const{refItem:e,operator:t}=i,{first:n,last:r}=X(t);u.push({$match:{[e]:{$gte:n,$lte:r}}})}else s&&u.push({$match:{[s]:{$lt:(new Date).toISOString()}}});let f=[];if(o){for(const e of o)e.includes(".")&&f.push(e.split(".")[0]);for(const t of f)u.push({$lookup:{from:t,localField:"_id",foreignField:e.refClass,as:t}},{$unwind:{path:"$"+t,preserveNullAndEmptyArrays:!0}},{$match:{[t]:{$exists:!0}}})}let h=await t.getTasksWidgetFiltered(e.refClass,u);if(h?.length)if(a)n=h.length;else if(o)n=h.map(e=>function(e,t){if(!e||!t)return 0;const n=new Date(e),r=new Date(t).getTime()-n.getTime();return Math.round(r/864e5)}(_(e,o[0]),_(e,o[1]))).reduce((e,t)=>e+t,0)/h.length;else if(d.includes(".")){const[e,t]=d.split(".");n=h.reduce((n,r)=>n+r[e].reduce((e,n)=>e+ +(n[t]||0),0),0)}else n=h.reduce((e,t)=>e+ +(t[d]||0),0);else n="";return z=n,n},G=e=>function(e,t){return(+(Math.round(e+"e+"+t)+"e-"+t)).toFixed(t)}(Number(e.toString()),R).replace(".",E);D||(D=R?`[0-9]+([${E}][0-9]{1,${R}})?`:"[0-9]*"),B&&(D="-?"+D);const X=(e,t=0)=>{const n=new Date;n.setDate(n.getDate()-t);let r=n.getFullYear();const i=n.getMonth(),o=n.getDate();let s,a,l=r,c=0;switch(e){case"currentSemiYear":s=i<6?0:6,a=s+5;break;case"currentQuarter":s=i<3?0:i>6?3:i<9?6:9,a=s+2;break;case"currentMonth":s=a=i;break;case"currentDay":l=2e3,s=0,a=i-1,c=o;break;case"prevYear":l-=1,r-=1,s=0,a=s+11;break;default:s=0,a=s+11}return{first:new Date(l,s,1).toISOString(),last:new Date(r,a+1,c).toISOString()}};return e.$$set=e=>{"id"in e&&i(0,a=e.id),"item"in e&&i(19,l=e.item),"widget"in e&&i(20,c=e.widget),"value"in e&&i(18,d=e.value),"record"in e&&i(21,f=e.record),"noForm"in e&&i(1,h=e.noForm),"classId"in e&&i(2,m=e.classId),"disabled"in e&&i(3,p=e.disabled),"formnovalidate"in e&&i(22,g=e.formnovalidate),"currency"in e&&i(23,w=e.currency),"ownCurrency"in e&&i(24,y=e.ownCurrency),"praefix"in e&&i(25,v=e.praefix),"notifyList"in e&&i(26,$=e.notifyList),"isNew"in e&&i(27,I=e.isNew)},e.$$.update=()=>{25690112&e.$$.dirty[0]&&w&&("owner.currency"===l.properties?.currency?i(5,b=y):i(5,b=w)),4194320&e.$$.dirty[0]&&i(4,L=L&&!g),262144&e.$$.dirty[0]&&(async e=>{e=await j(l,e),i(9,W=V&&!+e||I&&L&&!+e?"":G((e||"0").toString().replace(",","."))),(c||!0===p&&!U)&&i(9,W=isNaN(e)?"":H.format(W)),d!==e&&i(18,d=e)})(d),67108864&e.$$.dirty[0]&&(async()=>{const e=l.properties?.value?.formula;if(e)void 0!==v&&""!==v?e?.operator?.multiply&&o("formula",{item:l}):e?.operator&&o("formula",{item:l})})()},[a,h,m,p,L,b,A,D,P,W,s,C,k,O,F,e=>{const{detail:t}=e;void 0!==v&&""!==v||o("formula",{item:l,value:t.value}),o("blur",{value:G(t.value)})},({detail:e})=>{P||+d||i(9,W="")},({detail:e})=>{const t=[].concat(F.target);if(void 0===v||""===v)for(const e of t)o("record",{itemName:e,value:d});else for(const e of t)o("listRecord",{itemName:e,decimals:l.properties?.decimals,value:d})},d,l,c,f,g,w,y,v,$,I]}class Bo extends Oe{constructor(e){var t;super(),document.getElementById("svelte-1fuww0c-style")||((t=B("style")).id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",x(document.head,t)),xe(this,e,Po,Mo,T,{id:0,item:19,widget:20,value:18,record:21,noForm:1,classId:2,disabled:3,formnovalidate:22,currency:23,ownCurrency:24,praefix:25,notifyList:26,isNew:27},[-1,-1])}}const{document:Lo}=Ee;function Fo(e){e[35]=e[37].list,e[36]=e[37].items}function Vo(e,t,n){const r=e.slice();return r[38]=t[n],r[40]=n,r}function Uo(e,t,n){const r=e.slice();return r[41]=t[n],r[43]=n,r}function Wo(e,t,n){const r=e.slice();return r[41]=t[n],r}function zo(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function qo(e){let t,n,r,i,o,s,a,l,c,d,u,f,h,m,p,g,w,y,v;Fo(e),n=new e[9]({props:{outline:!0,$$slots:{default:[Ho]},$$scope:{ctx:e}}}),n.$on("click",e[32]);let $=!e[2]&&jo(e);function I(t){e[33](t)}let _={id:e[12]};void 0!==e[3]&&(_.value=e[3]),a=new e[7]({props:_}),oe.push(()=>Te(a,"value",I)),a.$on("input",e[15]),u=new bt({props:{size:"18"}});let C=e[36]?.length&&function(e){let t,n,r,i,o=!e[2]&&Xo(e),s=e[36],a=[];for(let t=0;t<s.length;t+=1)a[t]=Yo(Wo(e,s,t));return{c(){t=B("thead"),n=B("tr"),o&&o.c(),r=V();for(let e=0;e<a.length;e+=1)a[e].c();H(n,"class","svelte-1m010ne"),H(t,"class","svelte-1m010ne")},m(e,s){O(e,t,s),x(t,n),o&&o.m(n,null),x(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&&($e(),Ce(o,1,1,()=>{o=null}),Ie()):o?(o.p(e,t),4&t[0]&&_e(o,1)):(o=Xo(e),o.c(),_e(o,1),o.m(n,r)),16384&t[0]){let r;for(s=e[36],r=0;r<s.length;r+=1){const i=Wo(e,s,r);a[r]?a[r].p(i,t):(a[r]=Yo(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){Ce(o),i=!1},d(e){e&&M(t),o&&o.d(),P(a,e)}}}(e),b=e[35]?.length&&function(e){let t,n,r=e[35],i=[];for(let t=0;t<r.length;t+=1)i[t]=es(Vo(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=U()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);O(e,t,r),n=!0},p(e,n){if(1138717&n[0]){let s;for(r=e[35],s=0;s<r.length;s+=1){const o=Vo(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=es(o),i[s].c(),_e(i[s],1),i[s].m(t.parentNode,t))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){P(i,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),$&&$.c(),i=V(),o=B("div"),s=F("Suchen: "),ke(a.$$.fragment),c=V(),d=B("span"),ke(u.$$.fragment),f=V(),h=B("div"),m=B("table"),C&&C.c(),p=V(),g=B("tbody"),b&&b.c(),H(t,"class","form--buttons svelte-1m010ne"),H(d,"class","feather pointer svelte-1m010ne"),X(o,"margin-bottom","1em"),X(o,"position","relative"),H(m,"striped",""),H(m,"class","svelte-1m010ne"),H(h,"class","eList svelte-1m010ne")},m(l,I){O(l,t,I),De(n,t,null),x(t,r),$&&$.m(t,null),O(l,i,I),O(l,o,I),x(o,s),De(a,o,null),x(o,c),x(o,d),De(u,d,null),O(l,f,I),O(l,h,I),x(h,m),C&&C.m(m,null),x(m,p),x(m,g),b&&b.m(g,null),w=!0,y||(v=W(d,"click",e[17]),y=!0)},p(e,r){Fo(e);const i={};32768&r[1]&&(i.$$scope={dirty:r,ctx:e}),n.$set(i),e[2]?$&&($e(),Ce($,1,1,()=>{$=null}),Ie()):$?($.p(e,r),4&r[0]&&_e($,1)):($=jo(e),$.c(),_e($,1),$.m(t,null));const o={};!l&&8&r[0]&&(l=!0,o.value=e[3],he(()=>l=!1)),a.$set(o),e[36]?.length&&C.p(e,r),e[35]?.length&&b.p(e,r)},i(e){w||(_e(n.$$.fragment,e),_e($),_e(a.$$.fragment,e),_e(u.$$.fragment,e),_e(C),_e(b),w=!0)},o(e){Ce(n.$$.fragment,e),Ce($),Ce(a.$$.fragment,e),Ce(u.$$.fragment,e),Ce(C),Ce(b),w=!1},d(e){e&&M(t),Re(n),$&&$.d(),e&&M(i),e&&M(o),Re(a),Re(u),e&&M(f),e&&M(h),C&&C.d(),b&&b.d(),y=!1,v()}}}function Ho(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function jo(e){let t,n;return t=new e[9]({props:{disabled:!e[35].length,filled:!0,$$slots:{default:[Go]},$$scope:{ctx:e}}}),t.$on("click",e[18](e[35])),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Go(e){let t;return{c(){t=F("Bestätigen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Xo(e){let t,n,r,i,o;return n=new pt({props:{size:"20"}}),{c(){t=B("th"),ke(n.$$.fragment),H(t,"class","svelte-1m010ne")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[19](e[35])),i=!0)},p(t,n){e=t},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Yo(e){let t,n,r=e[41]+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-1m010ne")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function Zo(e){let t,n,r,i,o,s,a,l=e[0],c=Qo(e),d=e[36],u=[];for(let t=0;t<d.length;t+=1)u[t]=Jo(Uo(e,d,t));return{c(){t=B("tr"),c.c(),n=V();for(let e=0;e<u.length;e+=1)u[e].c();r=V(),H(t,"style",i=e[2]?"cursor: default;":"cursor: zoom-in;"),H(t,"title","übernimmt den Wert direkt"),H(t,"class","svelte-1m010ne"),Y(t,"active",e[0].includes(Array.isArray(e[38])?e[38][0]:e[38]))},m(i,l){O(i,t,l),c.m(t,null),x(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);x(t,r),o=!0,s||(a=W(t,"click",e[20](e[38])),s=!0)},p(s,a){if(e=s,1&a[0]&&T(l,l=e[0])?($e(),Ce(c,1,1,b),Ie(),c=Qo(e),c.c(),_e(c),c.m(t,n)):c.p(e,a),16400&a[0]){let n;for(d=e[36],n=0;n<d.length;n+=1){const i=Uo(e,d,n);u[n]?u[n].p(i,a):(u[n]=Jo(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;"))&&H(t,"style",i),16385&a[0]&&Y(t,"active",e[0].includes(Array.isArray(e[38])?e[38][0]:e[38]))},i(e){o||(_e(c),o=!0)},o(e){Ce(c),o=!1},d(e){e&&M(t),c.d(e),P(u,e),s=!1,a()}}}function Ko(e){let t,n,r;return n=new e[11]({props:{name:e[13],data:e[40],checked:e[0].includes(Array.isArray(e[38])?e[38][0]:e[38]),round:!0}}),{c(){t=B("td"),ke(n.$$.fragment),H(t,"title","Wählt den Wert aus"),H(t,"class","svelte-1m010ne")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};1&t[0]&&(r.checked=e[0].includes(Array.isArray(e[38])?e[38][0]:e[38])),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Qo(e){let t,n,r=!e[2]&&Ko(e);return{c(){r&&r.c(),t=U()},m(e,i){r&&r.m(e,i),O(e,t,i),n=!0},p(e,n){e[2]?r&&($e(),Ce(r,1,1,()=>{r=null}),Ie()):r?(r.p(e,n),4&n[0]&&_e(r,1)):(r=Ko(e),r.c(),_e(r,1),r.m(t.parentNode,t))},i(e){n||(_e(r),n=!0)},o(e){Ce(r),n=!1},d(e){r&&r.d(e),e&&M(t)}}}function Jo(e){let t,n,r=(Array.isArray(e[38])?e[38][e[43]]:e[4][e[40]]?e[4][e[40]][e[43]]:e[38])+"";return{c(){t=B("td"),n=F(r),H(t,"class","svelte-1m010ne")},m(e,r){O(e,t,r),x(t,n)},p(e,t){16&t[0]&&r!==(r=(Array.isArray(e[38])?e[38][e[43]]:e[4][e[40]]?e[4][e[40]][e[43]]:e[38])+"")&&j(n,r)},d(e){e&&M(t)}}}function es(e){let t,n,r=e[16](e[38],e[3]),i=r&&Zo(e);return{c(){i&&i.c(),t=U()},m(e,r){i&&i.m(e,r),O(e,t,r),n=!0},p(e,n){8&n[0]&&(r=e[16](e[38],e[3])),r?i?(i.p(e,n),8&n[0]&&_e(i,1)):(i=Zo(e),i.c(),_e(i,1),i.m(t.parentNode,t)):i&&($e(),Ce(i,1,1,()=>{i=null}),Ie())},i(e){n||(_e(i),n=!0)},o(e){Ce(i),n=!1},d(e){i&&i.d(e),e&&M(t)}}}function ts(e){let t,n;return t=new e[6]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ns(e){let t,n,r,i;t=new e[10]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:ts,then:qo,catch:zo,value:37,blocks:[,,,]};return be(e[14](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function rs(e){let t,n;return t=new e[8]({props:{title:e[1]||"Auswahl",class:"eList",$$slots:{default:[ns]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.title=e[1]||"Auswahl"),29&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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function is(e,n,r){const i=ne(),{Loading:o,TextField:s,Dialog:a,Button:l,Divider:c,Checkbox:d}=u;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:b}=n,{allowedValues:A}=n;p||=[];let E="",S=f+Math.floor(9e3*Math.random()+1e3).toString()+"search",N=[];const T=w+y+v+"checkbox",k=(e,t)=>e>t?1:t>e?-1:0;ee(()=>{window.setTimeout(()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(S)?.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,b=e.single),"allowedValues"in e&&r(31,A=e.allowedValues)},[p,m,b,E,N,i,o,s,a,l,c,d,S,T,async()=>{let e=[],n=[],i={};if(r(4,N=[]),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 k(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 k(n(e),n(t))}),r(4,N=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)=>k(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 k(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);let s=[];const a=o.items[0].name,l=o.items[1].name,c=o.list[0].name;if(g){if("$self"===g){const t=e.map(e=>({designation:e.auxTableId,description:e.designation}));e=t.length?t:[]}else{const t=e.find(e=>e[a]===g);e=t?t[c]:[]}r(21,v=l)}let d;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&&(s=A),d=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:[...d,...n]}},({detail:{value:e}})=>{r(3,E=e)},(e,t)=>{if(!t)return!0;return!!(Array.isArray(e)?e.join(" "):e).toLowerCase().includes(t.toLowerCase())},()=>{r(3,E="")},e=>()=>{const t=document.getElementsByName(T),n=[];t.forEach((t,r)=>{t.checked&&n.push(e[+t.attributes.data.value])}),i("choose",{list:n})},e=>()=>{document.getElementsByName(T).forEach((e,t)=>{e.checked=!e.checked})},e=>t=>{if("TD"===t.target?.nodeName){const t=Array.isArray(e)?e[0]:e;b?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,A,()=>i("back"),function(e){E=e,r(3,E)}]}class os extends Oe{constructor(e){var t;super(),Lo.getElementById("svelte-1m010ne-style")||((t=B("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}",x(Lo.head,t)),xe(this,e,is,rs,T,{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,allowedValues:31},[-1,-1])}}const{document:ss}=Ee;function as(e){let t,n,r,i,o,s=e[7].length+"";return{c(){t=B("span"),n=F("("),r=F(s),i=F(")"),H(t,"class",o=D(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,o){O(e,t,o),x(t,n),x(t,r),x(t,i)},p(e,n){128&n[0]&&s!==(s=e[7].length+"")&&j(r,s),2&n[0]&&o!==(o=D(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&H(t,"class",o)},d(e){e&&M(t)}}}function ls(e){let t;return{c(){t=B("div"),H(t,"class","load-more-options"),H(t,"slot","load-more-options-message")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function cs(e){let t,n,r,i;const o=[fs,us,ds],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=U()},m(e,n){~t&&s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?~t&&s[t].p(e,i):(n&&($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie()),~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){Ce(n),i=!1},d(e){~t&&s[t].d(e),e&&M(r)}}}function ds(e){let t,n,r,i,o;return n=new rt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Übernehmen"),H(t,"class","feather pointer svelte-1rbaejz")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[26]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function us(e){let t,n,r,i,o;return n=new yt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title",e[17].title||"Generieren"),H(t,"class","feather pointer svelte-1rbaejz")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[25]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function fs(e){let t,n,r,i,o;return n=new bt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Löschen"),H(t,"class","feather pointer svelte-1rbaejz")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[27]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function hs(e){let t,n,r;function i(t){e[38](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[ms]},$$scope:{ctx:e}};return void 0!==e[10]&&(o.open=e[10]),t=new e[11]({props:o}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(t,e,n),r=!0},p(e,r){const i={};117&r[0]|65536&r[1]&&(i.$$scope={dirty:r,ctx:e}),!n&&1024&r[0]&&(n=!0,i.open=e[10],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function ms(e){let t,n;return t=new os({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,allowedValues:e[6]}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){ke(t.$$.fragment)},m(e,r){De(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),64&n[0]&&(r.allowedValues=e[6]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ps(e){let t,n,r,i,o,s,a,l,c,d=!e[16].single&&e[7]?.length&&as(e);function u(t){e[36](t)}function f(t){e[37](t)}let h={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],placeholder:e[8],getOptions:gs,minSearchLength:"3",$$slots:{"load-more-options-message":[ls]},$$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}),oe.push(()=>Te(r,"selection",u)),oe.push(()=>Te(r,"maxOptions",f)),r.$on("change",e[22]);let m=!e[1]&&cs(e),p=e[10]&&hs(e);return{c(){t=B("div"),d&&d.c(),n=V(),ke(r.$$.fragment),s=V(),m&&m.c(),a=V(),p&&p.c(),l=U(),X(t,"position","relative")},m(e,i){O(e,t,i),d&&d.m(t,null),x(t,n),De(r,t,null),x(t,s),m&&m.m(t,null),O(e,a,i),p&&p.m(e,i),O(e,l,i),c=!0},p(e,s){!e[16].single&&e[7]?.length?d?d.p(e,s):(d=as(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]),256&s[0]&&(a.placeholder=e[8]),65536&s[1]&&(a.$$scope={dirty:s,ctx:e}),!i&&128&s[0]&&(i=!0,a.selection=e[7],he(()=>i=!1)),!o&&512&s[0]&&(o=!0,a.maxOptions=e[9],he(()=>o=!1)),r.$set(a),e[1]?m&&($e(),Ce(m,1,1,()=>{m=null}),Ie()):m?(m.p(e,s),2&s[0]&&_e(m,1)):(m=cs(e),m.c(),_e(m,1),m.m(t,null)),e[10]?p?(p.p(e,s),1024&s[0]&&_e(p,1)):(p=hs(e),p.c(),_e(p,1),p.m(l.parentNode,l)):p&&($e(),Ce(p,1,1,()=>{p=null}),Ie())},i(e){c||(_e(r.$$.fragment,e),_e(m),_e(p),c=!0)},o(e){Ce(r.$$.fragment,e),Ce(m),Ce(p),c=!1},d(e){e&&M(t),d&&d.d(),Re(r),m&&m.d(),e&&M(a),p&&p.d(e),e&&M(l)}}}async function*gs(e){yield[{name:e}]}function ws(e,n,r){const i=ne(),{Modal:o,Autocomplete:s}=u;let{classId:a}=n,{id:l}=n,{item:c}=n,{record:d}=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,{allowedValues:I}=n;const{properties:_={}}=c;let{placeholder:C,hint:b,readonly:A,required:E=!1,lookup:S="",view:N=!1,multi:T,max:k=1e3,generate:D=!1,status:R=!0,refDoc:x}=_;const[O,M]=S.split(":");let P=!1,B=f.map&&f.map(e=>({name:e}))||[];m||=A,m&&(C="");const L=({detail:e})=>{let t=[];e.value.map(e=>{const n=e.name?.split(",");t=t.concat(n)}),r(7,B=t.map(e=>({name:e.trim()})));const n=B.map(e=>e.name);i("blur",{value:n}),i("multi",{view:T.view,lookup:S,name:c.name,value:n})};ee(async()=>{i("multi",{view:T.view,lookup:S,name:c.name,value:f});const e=document.getElementById(l);e.classList.add(a),!A&&S&&e.addEventListener("focus",F)});const F=()=>{if(S){document.getElementById(l).blur();const e=v||k;(T.unique||B.length<e)&&r(10,P=!0)}},V=()=>{r(10,P&&=!1)},U=({detail:e})=>{const t=e.list.map(e=>Array.isArray(e)?e[0]:e);r(7,B=t.map(e=>({name:e}))),i("blur",{value:t}),i("multi",{view:T.view,lookup:S,name:c.name,value:t}),V()},W=async()=>{const e={[M]:d[M]},n=await t.getSectionView(O,e),r=Array.from({length:n.length},(e,t)=>n[t][c.name]);U({detail:{name:c.name,list:r}})},z=(e=!1)=>{if(E){const e=!B?.length,t=document.getElementById(l);return t?.classList?.toggle("invalid",e),void i("invalid",{idx:w,value:e})}if(m||!T.required)return;const t=T.maxItem;if(!t||T.unique)return;r(9,k=!1!==e?e:v||d[t]||0);const n=B?.length!=k,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,c=e.item),"record"in e&&r(5,d=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),"allowedValues"in e&&r(6,I=e.allowedValues)},e.$$.update=()=>{48&e.$$.dirty[0]&&d&&""===d[c.name]&&r(7,B=[]),48&e.$$.dirty[0]&&d&&Array.isArray(d[c.name])&&r(7,B=d[c.name].map(e=>({name:e}))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&y&&y===c.name&&r(7,B=[]),128&e.$$.dirty[0]&&B&&(r(0,f=B.map&&B.map(e=>e.name)||[]),z()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:r}=e;void 0!==w&&w!==r||t&&t.name===T.maxItem&&z(n)})(g),536870912&e.$$.dirty[0]|16&e.$$.dirty[1]&&r(35,E=E&&!p),8&e.$$.dirty[1]&&(async e=>{if(void 0===w)return;const{itemName:n,value:o}=e||{};if(o){if(c.refItem&&c.refItem?.split(".")[0]===n){let[e,n]=c.refItem.split(".");if(Array.isArray(o)){if(e=e.slice(0,-1),!o.length)return i("record",{itemName:"quantity",value:0}),void r(7,B=[]);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][c.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,B=l.map(e=>({name:e}))),L({detail:{value:B}})}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][c.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,B=l&&l.map(e=>({name:e})))}}if(c.refItem2&&c.refItem2?.split(".")[0]===n){let[e,n]=c.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,B=[]);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][c.name]));if(!l.length)return;i("record",{itemName:"quantity",value:l.length}),r(7,B=l.map(e=>({name:e}))),L({detail:{value:B}})}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][c.name];i("record",{itemName:"quantity",value:l?.length||0}),r(7,B=l&&l.map(e=>({name:e})))}}setTimeout(z,250)}})($)},[f,m,a,l,c,d,I,B,C,k,P,o,s,A,S,N,T,D,R,x,O,M,L,V,U,()=>{const e=d[D.itemQuantity]||v;if(!e)return;const t=D.prefix||"",n=d[D.variable]||"",r=D.len||5,i=Array.from({length:e},(e,i)=>t+n+"-"+i.toString().padStart(r,"0"));U({detail:{name:c.name,list:i}})},async()=>{if(!0===N)return W();const e=v||d[T.maxItem];if(!e)return;let n={};M&&(n={[M]:d[M]}),R&&(n.status=!0);const r=[].concat(d[T.view]||[]);r.length&&(n[T.view]={$in:r});const i=await t.getSectionView(O,n),o=Array.from({length:e<i.length?e:i.length},(e,t)=>i[t][c.name]);U({detail:{name:c.name,list:o}})},()=>{U({detail:{name:c.name,list:[]}})},h,p,g,w,y,v,$,E,function(e){B=e,r(7,B),r(5,d),r(4,c),r(32,y)},function(e){k=e,r(9,k)},function(e){P=e,r(10,P)}]}class ys extends Oe{constructor(e){var t;super(),ss.getElementById("svelte-1rbaejz-style")||((t=B("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}",x(ss.head,t)),xe(this,e,ws,ps,T,{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,allowedValues:6},[-1,-1])}}function vs(e){let t,n,r;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function $s(e){let t,n,r,i,o;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[9]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Is(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=[$s,vs],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}const _s=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://www.google.com/maps/dir/Current%20Location/"+encodeURIComponent(a)});function Cs(e,t,n){const{TextField:r}=u;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:c}=t,{name:d}=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,c=e.id),"name"in e&&n(6,d=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,c,d,f,r,async()=>{if(!f)return;const e=d.includes(".")?h[d.split(".")[0]]:h,t=await _s(e);window.open(t,"_blank")},h,m,function(t){re(e,t)}]}class bs extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,Cs,Is,T,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:As}=Ee;function Es(e){let t;return{c(){t=B("div"),H(t,"class","load-more-options"),H(t,"slot","load-more-options-message")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Ss(e){let t,n,r;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-wpjws5")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Ns(e){let t,n,r,i,o;return n=new Wt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-wpjws5")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[8]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(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":[Es]},$$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}),oe.push(()=>Te(n,"value",l)),oe.push(()=>Te(n,"selection",c)),oe.push(()=>Te(n,"searchQuery",d)),n.$on("change",e[6]);let f=e[5]&&function(e){let t,n,r,i;const o=[Ns,Ss],s=[];function a(e,t){return e[0]?0:1}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),s=V(),f&&f.c(),X(t,"position","relative"),H(t,"class","inputAutoComplete")},m(e,r){O(e,t,r),De(n,t,null),x(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],he(()=>r=!1)),!i&&4&t[0]&&(i=!0,s.selection=e[2],he(()=>i=!1)),!o&&8&t[0]&&(o=!0,s.searchQuery=e[3],he(()=>o=!1)),n.$set(s),e[5]&&f.p(e,t)},i(e){a||(_e(n.$$.fragment,e),_e(f),a=!0)},o(e){Ce(n.$$.fragment,e),Ce(f),a=!1},d(e){e&&M(t),Re(n),f&&f.d()}}}function ks(e,t,n){const{Autocomplete:r}=u,i=ne();let{classId:o}=t,{id:s}=t,{item:a}=t,{name:l}=t,{listName:c}=t,{record:d}=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 b,A=f,E=!1;ee(()=>{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=>{E=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((c?d[c][e]:d[e]).length<w)return}const e=await k();if(e?.length)if(1===e.length){if(f.startsWith(e[0].name))return;n(3,A=n(0,f=e[0].name)),R(f)}else e.find(e=>(A||"").startsWith(e.name))||f||n(3,A=" ");else n(0,f=n(3,A=""))},k=async(e="")=>{const t=await(async()=>{const e=c?d[c].country:d.country;if(e){const t=await bw("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+"?"+D()+"&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[_]}))},D=()=>I.map(({name:e,refItem:t})=>`${t}=${(c?d[c][e]:d[e]).split(" ")[0]}`).join("&"),R=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,c=e.listName),"record"in e&&n(13,d=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,b,A,r,C,({detail:{value:e}})=>{e.length&&n(3,A=n(0,f=e[0].name)),n(2,b=[]),R(f)},async function*(e){if(E||f&&e.startsWith(f))return n(0,f=e),void R(f);const t=await k(e);if(!t?.length)return n(0,f=e),void R(f);1===t.length?(n(3,A=n(0,f=t[0].name)),n(2,b=[]),R(f)):yield t},async()=>{if(!f)return;const e=l.includes(".")?d[l.split(".")[0]]:d,t=await _s(e);window.open(t,"_blank")},o,a,l,c,d,h,m,p,function(e){f=e,n(0,f)},function(e){b=e,n(2,b)},function(e){A=e,n(3,A)}]}class Ds extends Oe{constructor(e){var t;super(),As.getElementById("svelte-wpjws5-style")||((t=B("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}",x(As.head,t)),xe(this,e,ks,Ts,T,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:Rs}=Ee;function xs(e){e[26]=e[28].list,e[27]=e[28].items}function Os(e,t,n){const r=e.slice();return r[29]=t[n],r}function Ms(e,t,n){const r=e.slice();return r[32]=t[n],r}function Ps(e,t,n){const r=e.slice();return r[32]=t[n],r}function Bs(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Ls(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)}xs(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Fs]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let $={id:e[8]};void 0!==e[1]&&($.value=e[1]),s=new e[6]({props:$}),oe.push(()=>Te(s,"value",v)),s.$on("input",e[12]),d=new bt({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]=Vs(Ps(e,r,t));return{c(){t=B("thead"),n=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();H(n,"class","svelte-14hcfjl"),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(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=Ps(e,r,o);i[o]?i[o].p(s,t):(i[o]=Vs(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&&M(t),P(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]=zs(Os(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=U()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);O(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=Os(e,n,o);r[o]?r[o].p(s,i):(r[o]=zs(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){P(r,e),e&&M(t)}}}(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("div"),o=F("Suchen: "),ke(s.$$.fragment),l=V(),c=B("span"),ke(d.$$.fragment),u=V(),f=B("div"),h=B("table"),I&&I.c(),m=V(),p=B("tbody"),_&&_.c(),H(t,"class","form--buttons svelte-14hcfjl"),H(c,"class","feather pointer svelte-14hcfjl"),X(i,"margin-bottom","1em"),X(i,"position","relative"),H(h,"striped",""),H(h,"class","svelte-14hcfjl"),H(f,"class","eList svelte-14hcfjl")},m(a,v){O(a,t,v),De(n,t,null),O(a,r,v),O(a,i,v),x(i,o),De(s,i,null),x(i,l),x(i,c),De(d,c,null),O(a,u,v),O(a,f,v),x(f,h),I&&I.m(h,null),x(h,m),x(h,p),_&&_.m(p,null),g=!0,w||(y=W(c,"click",e[14]),w=!0)},p(e,t){xs(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],he(()=>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){Ce(n.$$.fragment,e),Ce(s.$$.fragment,e),Ce(d.$$.fragment,e),g=!1},d(e){e&&M(t),Re(n),e&&M(r),e&&M(i),Re(s),Re(d),e&&M(u),e&&M(f),I&&I.d(),_&&_.d(),w=!1,y()}}}function Fs(e){let t;return{c(){t=F("Abbrechen")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function Vs(e){let t,n,r=e[32]?.designation+"";return{c(){t=B("th"),n=F(r),H(t,"class","svelte-14hcfjl")},m(e,r){O(e,t,r),x(t,n)},p:b,d(e){e&&M(t)}}}function Us(e){let t,n,r=e[27],i=[];for(let t=0;t<r.length;t+=1)i[t]=Ws(Ms(e,r,t));return{c(){t=B("tr");for(let e=0;e<i.length;e+=1)i[e].c();n=V(),H(t,"class","pointer svelte-14hcfjl"),Y(t,"active",e[29]._id===e[0])},m(e,r){O(e,t,r);for(let e=0;e<i.length;e+=1)i[e].m(t,null);x(t,n)},p(e,o){if(3584&o[0]){let s;for(r=e[27],s=0;s<r.length;s+=1){const a=Ms(e,r,s);i[s]?i[s].p(a,o):(i[s]=Ws(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]&&Y(t,"active",e[29]._id===e[0])},d(e){e&&M(t),P(i,e)}}}function Ws(e){let t,n,r,i,o=e[9](e[29],e[32])+"";return{c(){t=B("td"),n=F(o),H(t,"class","svelte-14hcfjl")},m(o,s){O(o,t,s),x(t,n),r||(i=W(t,"click",q(e[10](e[29]))),r=!0)},p(t,n){e=t},d(e){e&&M(t),r=!1,i()}}}function zs(e){let t,n=e[13](e[29],e[27],e[1]),r=n&&Us(e);return{c(){r&&r.c(),t=U()},m(e,n){r&&r.m(e,n),O(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=Us(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&M(t)}}}function qs(e){let t,n;return t=new e[5]({}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p:b,i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Hs(e){let t,n,r,i;t=new e[4]({});let o={ctx:e,current:null,token:null,hasCatch:!1,pending:qs,then:Ls,catch:Bs,value:28,blocks:[,,,]};return be(e[11](),o),{c(){ke(t.$$.fragment),n=V(),r=U(),o.block.c()},m(e,s){De(t,e,s),O(e,n,s),O(e,r,s),o.block.m(e,o.anchor=s),o.mount=()=>r.parentNode,o.anchor=r,i=!0},p(t,n){Ae(o,e=t,n)},i(e){i||(_e(t.$$.fragment,e),_e(o.block),i=!0)},o(e){Ce(t.$$.fragment,e);for(let e=0;e<3;e+=1){Ce(o.blocks[e])}i=!1},d(e){Re(t,e),e&&M(n),e&&M(r),o.block.d(e),o.token=null,o=null}}}function js(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Hs]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Gs(e,n,i){const o=ne(),{Dialog:s,Divider:a,Loading:l,TextField:c,Button:d}=u;let{item:f}=n,{className:h}=n,{classId:m}=n,{rowId:p}=n,{viewName:w}=n,{viewValue:y}=n,{recordId:v}=n,{filter:I}=n,_="",C=m+Math.floor(9e3*Math.random()+1e3).toString()+"search";const b=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):g(e[`_${t.name}`]||e[t.name]||"")},A=t.getSchemaByClass(h);ee(()=>{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&&Aw(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,m=e.classId),"rowId"in e&&i(0,p=e.rowId),"viewName"in e&&i(18,w=e.viewName),"viewValue"in e&&i(19,y=e.viewValue),"recordId"in e&&i(20,v=e.recordId),"filter"in e&&i(21,I=e.filter)},[p,_,o,s,a,l,c,d,C,b,e=>()=>o("choose",{row:e}),async()=>{const e=await A,n="."+m+"#"+w;document.querySelector(n);let r={[w]:y},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 kn(o,e,i)}},({detail:{value:e}})=>{i(1,_=e)},(e,t,n)=>{if(!n)return!0;for(const r of t)if(b(e,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,_="")},f,h,m,w,y,v,I,()=>o("back"),function(e){_=e,i(1,_)}]}class Xs extends Oe{constructor(e){var t;super(),Rs.getElementById("svelte-14hcfjl-style")||((t=B("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}",x(Rs.head,t)),xe(this,e,Gs,js,T,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Ys(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Zs(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}),oe.push(()=>Te(n,"value",s));let l=!e[6]&&Ks(e);return{c(){t=B("div"),ke(n.$$.fragment),i=V(),l&&l.c(),X(t,"position","relative")},m(e,r){O(e,t,r),De(n,t,null),x(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],he(()=>r=!1)),n.$set(o),e[6]?l&&($e(),Ce(l,1,1,()=>{l=null}),Ie()):l?(l.p(e,i),64&i&&_e(l,1)):(l=Ks(e),l.c(),_e(l,1),l.m(t,null))},i(e){o||(_e(n.$$.fragment,e),_e(l),o=!0)},o(e){Ce(n.$$.fragment,e),Ce(l),o=!1},d(e){e&&M(t),Re(n),l&&l.d()}}}function Ks(e){let t,n,r,i,o;return n=new en({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-wbrqzu")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[17]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Qs(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Js(e){let t,n,r;function i(t){e[22](t)}let o={class:"tModal",noClickaway:!0,$$slots:{default:[ea]},$$scope:{ctx:e}};return void 0!==e[8]&&(o.open=e[8]),t=new e[11]({props:o}),oe.push(()=>Te(t,"open",i)),{c(){ke(t.$$.fragment)},m(e,n){De(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],he(()=>n=!1)),t.$set(i)},i(e){r||(_e(t.$$.fragment,e),r=!0)},o(e){Ce(t.$$.fragment,e),r=!1},d(e){Re(t,e)}}}function ea(e){let t,n;return t=new Xs({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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ta(e){let t,n,r,i={ctx:e,current:null,token:null,hasCatch:!1,pending:Qs,then:Zs,catch:Ys,value:27,blocks:[,,,]};be(e[16](),i);let o=e[8]&&Js(e);return{c(){i.block.c(),t=V(),o&&o.c(),n=U()},m(e,s){i.block.m(e,i.anchor=s),i.mount=()=>t.parentNode,i.anchor=t,O(e,t,s),o&&o.m(e,s),O(e,n,s),r=!0},p(t,[r]){Ae(i,e=t,r),e[8]?o?(o.p(e,r),256&r&&_e(o,1)):(o=Js(e),o.c(),_e(o,1),o.m(n.parentNode,n)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){r||(_e(i.block),_e(o),r=!0)},o(e){for(let e=0;e<3;e+=1){Ce(i.blocks[e])}Ce(o),r=!1},d(e){i.block.d(e),i.token=null,i=null,e&&M(t),o&&o.d(e),e&&M(n)}}}function na(e,t,n){const{TextField:r,Modal:i}=u;let{classId:o}=t,{id:s}=t,{item:a}=t,{record:l}=t,{value:c}=t,{noForm:d=!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,c=e.value),"noForm"in e&&n(5,d=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)},[c,o,s,a,l,d,f,h,_,g,r,i,w,v,$,I,async()=>(n(9,g=l[I.selection]),!0),()=>{n(8,_=!0)},({detail:e})=>{n(0,c=e.row[I.value?I.value:"_id"]),C()},C,m,function(e){c=e,n(0,c)},function(e){_=e,n(8,_)}]}class ra extends Oe{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=B("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",x(document.head,t)),xe(this,e,na,ta,T,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function ia(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 rt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"title","Übernehmen"),H(t,"class","pointer feather")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[12]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}(e);return{c(){t=B("input"),r=V(),ke(i.$$.fragment),o=V(),d&&d.c(),s=U(),H(t,"type","string"),H(t,"class",n=e[3]||e[4]),H(t,"id",e[1]),H(t,"name",e[1]),t.hidden=!0},m(n,u){O(n,t,u),G(t,e[0]),O(n,r,u),De(i,n,u),O(n,o,u),d&&d.m(n,u),O(n,s,u),a=!0,l||(c=W(t,"input",e[19]),l=!0)},p(e,[r]){(!a||24&r&&n!==(n=e[3]||e[4]))&&H(t,"class",n),(!a||2&r)&&H(t,"id",e[1]),(!a||2&r)&&H(t,"name",e[1]),1&r&&G(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){Ce(i.$$.fragment,e),Ce(d),a=!1},d(e){e&&M(t),e&&M(r),Re(i,e),e&&M(o),d&&d.d(e),e&&M(s),l=!1,c()}}}let oa=new Map;function sa(e,n,r){const i=ne(),{DatePicker:o}=u;let{value:s}=n,{id:a}=n,{item:l}=n,{record:c}=n,{widget:d}=n,{praefix:f}=n,{noForm:h=!1}=n,{classId:m}=n,{eventId:p}=n,{readonly:g}=n,{disabled:w}=n,{required:y}=n,{notifyList:v}=n,{dateInput:$}=n;s||(s=void 0),c._id||""!==l.properties?.value||(s=void 0);let I=null;const _=(void 0===f?"":f.toString())+"-"+p+"-"+l.name,C=l.properties?.noCalendar||!1,b=l.properties?.transfer,A=({detail:e})=>{try{r(0,s=_i(e.value,s)),void 0!==f&&""!==f&&oa.set(_,new Date(s.valueOf())),E(s)}catch{r(0,s=void 0)}},E=e=>{i("change",{value:new Date(e.valueOf())})};if(void 0!==f&&!s&&void 0!==s){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);s=_i(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,c=e.record),"widget"in e&&r(15,d=e.widget),"praefix"in e&&r(2,f=e.praefix),"noForm"in e&&r(3,h=e.noForm),"classId"in e&&r(4,m=e.classId),"eventId"in e&&r(16,p=e.eventId),"readonly"in e&&r(5,g=e.readonly),"disabled"in e&&r(6,w=e.disabled),"required"in e&&r(7,y=e.required),"notifyList"in e&&r(17,v=e.notifyList),"dateInput"in e&&r(18,$=e.dateInput)},e.$$.update=()=>{if(1&e.$$.dirty&&s&&!b&&oa.has(_)&&r(0,s=oa.get(_)),16384&e.$$.dirty&&(async()=>{if(!d)return;if(!l?.properties?.filter)return;const{_last:e,value:n}=l.properties.filter;if(e){const e=[{$match:{[d.schema.class]:d.value}},{$sort:{[n]:-1}},{$limit:1}],i=await t.getTasksWidgetFiltered(l.refClass,e);r(0,s=i?.length?new Date(i[0][n]):void 0)}})(),131072&e.$$.dirty&&(async e=>{if(null===I){const e=(await t.getEvent(p)).output.class[0].item;I=e.find(e=>e.properties?.value?.formula)}I&&I.properties.value.formula.argument[0].refItem===l.name&&(e&&e.itemName!==l.name&&!I.properties.value.formula.argument[1].value&&e.itemName!==I.properties.value.formula.argument[1].refItem.split(".")[0]||i("formula",{item:I}))})(v),262144&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!=f&&A({detail:{value:new Date(n)}})})($),24673&e.$$.dirty&&c&&c[l.name]){let e=c[l.name];"string"==typeof e&&e?.includes("-")&&r(0,s=new Date(e));try{w||g||r(0,s=_i(c[l.name],s))}catch{}}},[s,a,f,h,m,g,w,y,o,C,b,A,()=>{i("record",{target:b.target,value:s.toISOString()})},l,c,d,p,v,$,function(){s=this.value,r(0,s),r(14,c),r(13,l),r(6,w),r(5,g)}]}class aa extends Oe{constructor(e){super(),xe(this,e,sa,ia,T,{value:0,id:1,item:13,record:14,widget:15,praefix:2,noForm:3,classId:4,eventId:16,readonly:5,disabled:6,required:7,notifyList:17,dateInput:18})}}function la(e){let t;return{c(){t=F("Stunden")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ca(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[la]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function da(e){let t;return{c(){t=F("Minuten")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ua(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[da]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function fa(e){let t;return{c(){t=F("Jetzt")},m(e,n){O(e,t,n)},d(e){e&&M(t)}}}function ha(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[fa]},$$scope:{ctx:e}}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function ma(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":[ha],"minutes-label":[ua],"hours-label":[ca]},$$scope:{ctx:e}}}),s.$on("change",e[7]),{c(){t=B("input"),r=V(),ke(i.$$.fragment),o=V(),ke(s.$$.fragment),H(t,"type","string"),H(t,"class",n=e[2]||e[3]),H(t,"id",e[1]),H(t,"name",e[1]),t.hidden=!0},m(n,d){O(n,t,d),G(t,e[0]),O(n,r,d),De(i,n,d),O(n,o,d),De(s,n,d),a=!0,l||(c=W(t,"input",e[9]),l=!0)},p(e,[r]){(!a||12&r&&n!==(n=e[2]||e[3]))&&H(t,"class",n),(!a||2&r)&&H(t,"id",e[1]),(!a||2&r)&&H(t,"name",e[1]),1&r&&G(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){Ce(i.$$.fragment,e),Ce(s.$$.fragment,e),a=!1},d(e){e&&M(t),e&&M(r),Re(i,e),e&&M(o),Re(s,e),l=!1,c()}}}function pa(e,t,n){const r=ne(),{Label:i,DatePicker:o,TimePicker:s}=u;let{value:a}=t,{id:l}=t,{noForm:c=!1}=t,{classId:d}=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,c=e.noForm),"classId"in e&&n(3,d=e.classId)},[a,l,c,d,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=_i(e.value,a)),f(a)},function(){a=this.value,n(0,a)}]}class ga extends Oe{constructor(e){super(),xe(this,e,pa,ma,T,{value:0,id:1,noForm:2,classId:3})}}function wa(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=B("input"),o=V(),s=B("input"),d=V(),ke(u.$$.fragment),f=F(" /\n"),ke(h.$$.fragment),H(t,"type","string"),H(t,"class",n=e[1]||e[2]),H(t,"id",r=e[0]+"_from"),H(t,"name",i=e[0]+"_from"),t.hidden=!0,H(s,"type","string"),H(s,"class",a=e[1]||e[2]),H(s,"id",l=e[0]+"_to"),H(s,"name",c=e[0]+"_to"),s.hidden=!0},m(n,r){O(n,t,r),G(t,e[5]),O(n,o,r),O(n,s,r),G(s,e[6]),O(n,d,r),De(u,n,r),O(n,f,r),De(h,n,r),m=!0,p||(g=[W(t,"input",e[15]),W(s,"input",e[16])],p=!0)},p(e,[o]){(!m||6&o&&n!==(n=e[1]||e[2]))&&H(t,"class",n),(!m||1&o&&r!==(r=e[0]+"_from"))&&H(t,"id",r),(!m||1&o&&i!==(i=e[0]+"_from"))&&H(t,"name",i),32&o&&G(t,e[5]),(!m||6&o&&a!==(a=e[1]||e[2]))&&H(s,"class",a),(!m||1&o&&l!==(l=e[0]+"_to"))&&H(s,"id",l),(!m||1&o&&c!==(c=e[0]+"_to"))&&H(s,"name",c),64&o&&G(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){Ce(u.$$.fragment,e),Ce(h.$$.fragment,e),m=!1},d(e){e&&M(t),e&&M(o),e&&M(s),e&&M(d),Re(u,e),e&&M(f),Re(h,e),p=!1,S(g)}}}function ya(e,t,n){const r=ne(),{DatePicker:i}=u;let{value:o}=t,{id:s}=t,{item:a}=t,{noForm:l=!1}=t,{classId:c}=t,{required:d}=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,c=e.classId),"required"in e&&n(3,d=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,c,d,f,p,g,w,y,i,h,({detail:e})=>{n(5,p=_i(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=_i(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 va extends Oe{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=B("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",x(document.head,t)),xe(this,e,ya,wa,T,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}var $a={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 Ia(e){return Ia="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},Ia(e)}function _a(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 Ca(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 Ca(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 Ca(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 ba={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=_a(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=_a(e),n=t[0],r=t.slice(1),i=n;return r.forEach(function(e){i=i.greaterThan(e)?i:e}),i}};function Aa(e){return!isNaN(parseInt(e))&&isFinite(e)}function Ea(e){return e%2==0}function Sa(e){return Aa(e)&&!Number.isInteger(e)}function Na(e){return Math.abs(e)%1==.5}function Ta(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 ka(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"===Ia(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 Ra(){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 Na(e)&&Ea(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return Na(e)?Ea(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return Na(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return Na(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return Na(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 xa=Ra();function Oa(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"!==Ia(i)&&"function"!=typeof i||"function"!=typeof i.then?function(n,r){return Ta(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 Aa(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Ba(e){Ma(Number.isInteger(e),"You must provide an integer.",TypeError)}var La=Ra(),Fa=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;Ba(r),Ba(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;Ba(e);var n=this.getPrecision(),r=e>n,i=r?La.multiply:La.divide,o=r?[e,n]:[n,e],s=Math.pow(10,La.subtract.apply(La,o));return u.call(this,{amount:La.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:La.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:La.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:La.round(La.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:La.round(La.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(La.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 La.add(e,t)}),r=this.getAmount(),i=e.map(function(e){var i=Math.floor(La.divide(La.multiply(t.getAmount(),e),n));return r=La.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=La.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 Oa(m).getExchangeRate(this.getCurrency(),e).then(function(n){return Ma(!ka(n),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),u.call(t,{amount:La.round(La.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!==La.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==La.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!ka(e)}):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return ka(this.getMatches().find(e))?0:this.getMatches()[xa.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 ka(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ka(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 La.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 La.divide(La.round(La.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},$a,ba),Va={},Ua={};!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}(Ua);const Wa=Ua,za={allowBooleanAttributes:!1,unpairedTags:[]};function qa(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function Ha(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 Ja("InvalidXml","XML declaration allowed only at the start of the document.",nl(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}continue}return t}function ja(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({},za,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=Ha(e,o),o.err)return o}else{if("<"!==e[o]){if(qa(e[o]))continue;return Ja("InvalidChar","char '"+e[o]+"' is not expected.",nl(e,o))}{let s=o;if(o++,"!"===e[o]){o=ja(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--),!tl(l)){let t;return t=0===l.trim().length?"Invalid space after '<'.":"Tag '"+l+"' is an invalid name.",Ja("InvalidTag",t,nl(e,o))}const c=Ya(e,o);if(!1===c)return Ja("InvalidAttr","Attributes for '"+l+"' have open quote.",nl(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=Ka(d,t);if(!0!==i)return Ja(i.err.code,i.err.msg,nl(e,n+i.err.line));r=!0}else if(a){if(!c.tagClosed)return Ja("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",nl(e,o));if(d.trim().length>0)return Ja("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",nl(e,s));if(0===n.length)return Ja("InvalidTag","Closing tag '"+l+"' has not been opened.",nl(e,s));{const t=n.pop();if(l!==t.tagName){let n=nl(e,t.tagStartPos);return Ja("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+l+"'.",nl(e,s))}0==n.length&&(i=!0)}}else{const a=Ka(d,t);if(!0!==a)return Ja(a.err.code,a.err.msg,nl(e,o-d.length+a.err.line));if(!0===i)return Ja("InvalidXml","Multiple possible root nodes found.",nl(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=ja(e,o);continue}if("?"!==e[o+1])break;if(o=Ha(e,++o),o.err)return o}else if("&"===e[o]){const t=Qa(e,o);if(-1==t)return Ja("InvalidChar","char '&' is not expected.",nl(e,o));o=t}else if(!0===i&&!qa(e[o]))return Ja("InvalidXml","Extra text at the end",nl(e,o));"<"===e[o]&&o--}}}return r?1==n.length?Ja("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",nl(e,n[0].tagStartPos)):!(n.length>0)||Ja("InvalidXml","Invalid '"+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):Ja("InvalidXml","Start tag expected.",1)};const Ga='"',Xa="'";function Ya(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if(e[t]===Ga||e[t]===Xa)""===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 Za=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function Ka(e,t){const n=Wa.getAllMatches(e,Za),r={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return Ja("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",rl(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return Ja("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",rl(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return Ja("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",rl(n[e]));const i=n[e][2];if(!el(i))return Ja("InvalidAttr","Attribute '"+i+"' is an invalid name.",rl(n[e]));if(r.hasOwnProperty(i))return Ja("InvalidAttr","Attribute '"+i+"' is repeated.",rl(n[e]));r[i]=1}return!0}function Qa(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 Ja(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function el(e){return Wa.isName(e)}function tl(e){return Wa.isName(e)}function nl(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function rl(e){return e.startIndex+e[1].length}var il={};const ol={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}};il.buildOptions=function(e){return Object.assign({},ol,e)},il.defaultOptions=ol;var sl=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 al=Ua;function ll(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 cl(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function dl(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 ul(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 fl(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 hl(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 ml(e){if(al.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}var pl=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&&dl(e,t))t+=7,[entityName,val,t]=ll(e,t+1),-1===val.indexOf("&")&&(n[ml(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(i&&ul(e,t))t+=8;else if(i&&fl(e,t))t+=8;else if(i&&hl(e,t))t+=9;else{if(!cl)throw new Error("Invalid DOCTYPE");o=!0}r++,s=""}if(0!==r)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}};const gl=/^[-+]?0x[a-fA-F0-9]+$/,wl=/^([\-\+])?(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 yl={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var vl=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 $l=Ua,Il=sl,_l=pl,Cl=function(e,t={}){if(t=Object.assign({},yl,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&&gl.test(n))return Number.parseInt(n,16);{const r=wl.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}},bl=vl;function Al(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 El(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 Ll(e,this.options.parseTagValue,this.options.numberParseOptions);return e.trim()===e?Ll(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 Nl=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Tl(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=$l.getAllMatches(e,Nl),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:Ll(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 kl=function(e){e=e.replace(/\r\n?/g,"\n");const t=new Il("!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 Il(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=_l(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 Il(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 Il(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 Il(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 Rl=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 xl(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 Ol(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 Bl(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 Ll(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&(t.length>15?t:Cl(e,n))}return $l.isExist(e)?e:""}var Fl=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=Al,this.parseXml=kl,this.parseTextData=El,this.resolveNameSpace=Sl,this.buildAttributesMap=Tl,this.isItStopNode=Ol,this.replaceEntitiesValue=Rl,this.readStopNodeData=Bl,this.saveTextToParentTag=xl,this.addChild=Dl,this.ignoreAttributesFn=bl(this.options.ignoreAttributes)}},Vl={};function Ul(e,t,n){let r;const i={};for(let o=0;o<e.length;o++){const s=e[o],a=Wl(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=Ul(s[a],t,l);const n=ql(e,t);s[":@"]?zl(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 Wl(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function zl(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 ql(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 Ul(e,t)};const{buildOptions:Hl}=il,jl=Fl,{prettify:Gl}=Vl,Xl=Va;var Yl=class{constructor(e){this.externalEntities={},this.options=Hl(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=Xl.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new jl(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(e);return this.options.preserveOrder||void 0===r?r:Gl(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 '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}};function Zl(e,t,n,r){let i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s],l=Kl(a);if(void 0===l)continue;let c="";if(c=0===n.length?l:`${n}.${l}`,l===t.textNodeName){let e=a[l];Jl(c,t)||(e=t.tagValueProcessor(l,e),e=ec(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=Ql(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}${Ql(a[":@"],t)}`,f=Zl(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 Kl(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 Ql(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=ec(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function Jl(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 ec(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 tc=function(e,t){let n="";return t.format&&t.indentBy.length>0&&(n="\n"),Zl(e,t,"",n)},nc=vl,rc={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:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ic(e){this.options=Object.assign({},rc,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=nc(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ac),this.processTextOrObjNode=oc,this.options.format?(this.indentate=sc,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function oc(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 sc(e){return this.options.indentBy.repeat(e)}function ac(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}ic.prototype.build=function(e){return this.options.preserveOrder?tc(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},ic.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}},ic.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},ic.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}},ic.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},ic.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}},ic.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 lc={XMLParser:Yl,XMLValidator:Va,XMLBuilder:ic},cc=[],dc=0;dc<256;++dc)cc.push((dc+256).toString(16).slice(1));"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);class uc extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class fc extends uc{constructor(e){super(e)}}class hc extends uc{constructor(e){super(e)}}const mc=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}},pc=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()}}}},gc=(e,t="USD")=>{const n=Fa({currency:t});return Math.floor(Number(e)*10**n.getPrecision())},wc=e=>{const t=e.DtTm||e.Dt;return new Date(t)},yc=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=gc(c));const u=e.TxsSummry?.TtlCdtNtries?.NbOfNtries,f=e.TxsSummry?.TtlCdtNtries?.Sum,h=e.TxsSummry?.TtlDbtNtries?.NbOfNtries,m=e.TxsSummry?.TtlDbtNtries?.Sum,p=mc(e.Acct),g=pc(e.Acct.Svcr);let w=[];Array.isArray(e.Bal)?w=e.Bal.map(vc):e.Bal&&(w=[vc(e.Bal)]);let y=[];return Array.isArray(e.Ntry)?y=e.Ntry.map($c):e.Ntry&&(y=[$c(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}},vc=e=>{const t=e.Amt["#text"],n=e.Amt["@_Ccy"],r=gc(t,n),i="CRDT"===e.CdtDbtInd?"credit":"debit",o=e.Tp.CdOrPrtry.Cd;return{date:wc(e.Dt),amount:r,currency:n,creditDebitIndicator:i,type:o}},$c=e=>{const t=e.NtryRef,n="CRDT"===e.CdtDbtInd?"credit":"debit",r=wc(e.BookgDt),i=!0===e.RvslInd,o=e.Amt["#text"],s=e.Amt["@_Ccy"],a=gc(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=_c(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(Ic)}).flat(),additionalInformation:c,accountServicerReferenceId:d,bankTransactionCode:u}},Ic=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=mc(e.RltdPties.DbtrAcct)),e.RltdAgts?.DbtrAgt&&(g=pc(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=mc(e.RltdPties.CdtrAcct)),e.RltdAgts?.CdtrAgt&&($=pc(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}},_c=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 Cc{_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 lc.XMLParser({ignoreAttributes:!1,tagValueProcessor:(e,t,n,r,i)=>{if(!i||!["Cd","NtryRef"].includes(e))return t}})}static fromXML(e){const t=Cc.getParser().parse(e);if(!t.Document)throw new fc("Invalid XML format");if(!(t.Document["@_xmlns"]||t.Document["@_Xmlns"]).startsWith("urn:iso:std:iso:20022:tech:xsd:camt.053.001."))throw new hc("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=>yc(e)):[yc(n.Stmt)];const s=n.GrpHdr.MsgRcpt;return new Cc({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 bc(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}),oe.push(()=>Te(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(){ke(t.$$.fragment),r=V(),ke(i.$$.fragment)},m(e,n){De(t,e,n),O(e,r,n),De(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],he(()=>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){Ce(t.$$.fragment,e),Ce(i.$$.fragment,e),o=!1},d(e){Re(t,e),e&&M(r),Re(i,e)}}}function Ac(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(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Ec(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[Sc]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),X(t,"margin-top","1em")},m(e,i){O(e,t,i),De(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){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Sc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=F(e[6]),n=V(),ke(r.$$.fragment)},m(e,o){O(e,t,o),O(e,n,o),De(r,e,o),i=!0},p(e,n){(!i||64&n)&&j(t,e[6])},i(e){i||(_e(r.$$.fragment,e),i=!0)},o(e){Ce(r.$$.fragment,e),i=!1},d(e){e&&M(t),e&&M(n),Re(r,e)}}}function Nc(e){let t,n,r,i,o;const s=[Ac,bc],a=[];t=function(e){return e[11]?0:1}(e),n=a[t]=s[t](e);let l=e[5]&&Ec(e);return{c(){n.c(),r=V(),l&&l.c(),i=U()},m(e,n){a[t].m(e,n),O(e,r,n),l&&l.m(e,n),O(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=Ec(e),l.c(),_e(l,1),l.m(i.parentNode,i)):l&&($e(),Ce(l,1,1,()=>{l=null}),Ie())},i(e){o||(_e(n),_e(l),o=!0)},o(e){Ce(n),Ce(l),o=!1},d(e){a[t].d(e),e&&M(r),l&&l.d(e),e&&M(i)}}}function Tc(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=u,l=ne();let{classId:c}=n,{eventId:d}=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=T(n),s=!1;if(o.startsWith("R-")||(o=""),!o&&r&&(s=!0,r=r.toString(),o=T(r.replaceAll(" ","")),o.startsWith("R-")||(o=""),!o&&r.includes("R-"))){o="R-"+r.split("R-")[1].slice(0,8)}if(o&&(i=await t.getSectionView("invoice",{invoiceId:o}),i?.length)){const e=i[0];if(!a.find(t=>t.invoice==e._id))return e._id}}catch(e){console.log("error",e)}return""},b=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{}},E=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 S(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 b(c,r.bookingDate,a.amount);!1===u&&(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||a.accountServicerReferenceId,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,listInput:!0}),s.length&&l("record",{itemName:"open"+e.name,value:s,listInput:!0})},S=async e=>{try{const n=await t.getSectionView("accountingPlan",{iban:e});if(n?.length)return n[0]._id}catch{}return""},N=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=Cc.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"});for(const e of i)await E(e,o,n);setTimeout(()=>{l("saveFull"),r(5,$=!1)},2e3)}catch(e){console.log("Error",e),r(6,I="Ungültiger Inhalt!"),r(5,$=!0)}},T=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(e){console.log("error",e)}return""};return e.$$set=e=>{"classId"in e&&r(0,c=e.classId),"eventId"in e&&r(14,d=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))},[c,m,p,w,y,$,I,i,o,s,a,v,async()=>{const{list:e}=h.properties,n=w[0],i=await t.getEvent(d);if(n){r(4,y=n.name);const t=await n.text();if(g)return await N(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:T(t),information:n.RmtInf?.Ustrd||""};s.push(r)}}s.length&&l("record",{itemName:e,value:s})}},()=>{r(3,w)},d,f,h,function(e){w=e,r(3,w)}]}class kc extends Oe{constructor(e){var t;super(),document.getElementById("svelte-157hlzf-style")||((t=B("style")).id="svelte-157hlzf-style",t.textContent="label.file-dropzone{margin-top:0 !important}",x(document.head,t)),xe(this,e,Tc,Nc,T,{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=Rc(10,n[31]),t.amountVat=xc(!0,Rc(32,n[31]),t.amount)||xc(!1,Rc(33,n[31]),t.amount),t):t},Rc=(e,t)=>{if(!e)return"";if(!t)return"";const n=t.split("/"+e+"/")[1];return n?.split("/")[0]||""},xc=(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:Oc}=Ee;function Mc(e){let t,n,r,i,o,s,a;function l(t){e[18](t)}let c={class:e[0],id:e[1],name:e[2],accept:"application/pdf",max:"1",beforeChange:e[14]};void 0!==e[3]&&(c.files=e[3]),t=new e[7]({props:c}),oe.push(()=>Te(t,"files",l)),t.$on("change",e[12]);const d=[Lc,Bc],u=[];function f(e,t){return e[5]?0:1}return i=f(e),o=u[i]=d[i](e),{c(){ke(t.$$.fragment),r=V(),o.c(),s=U()},m(e,n){De(t,e,n),O(e,r,n),u[i].m(e,n),O(e,s,n),a=!0},p(e,r){const a={};1&r&&(a.class=e[0]),2&r&&(a.id=e[1]),4&r&&(a.name=e[2]),!n&&8&r&&(n=!0,a.files=e[3],he(()=>n=!1)),t.$set(a);let l=i;i=f(e),i===l?u[i].p(e,r):($e(),Ce(u[l],1,1,()=>{u[l]=null}),Ie(),o=u[i],o?o.p(e,r):(o=u[i]=d[i](e),o.c()),_e(o,1),o.m(s.parentNode,s))},i(e){a||(_e(t.$$.fragment,e),_e(o),a=!0)},o(e){Ce(t.$$.fragment,e),Ce(o),a=!1},d(e){Re(t,e),e&&M(r),u[i].d(e),e&&M(s)}}}function Pc(e){let t,n,r,i;n=new e[8]({props:{inputClass:e[0],readonly:!0,id:e[1],name:e[1],value:e[4]}});let o=e[4]&&Vc(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(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=Vc(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Bc(e){let t,n;return t=new e[8]({props:{inputClass:e[0],hidden:!0,id:e[1],name:e[1],value:e[4]}}),{c(){ke(t.$$.fragment)},m(e,r){De(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){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Lc(e){let t,n,r;return n=new e[9]({props:{outline:!0,$$slots:{default:[Fc]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),X(t,"margin-top","1em")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};67108928&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Fc(e){let t,n,r,i;return r=new e[10]({}),{c(){t=F(e[6]),n=V(),ke(r.$$.fragment)},m(e,o){O(e,t,o),O(e,n,o),De(r,e,o),i=!0},p(e,n){(!i||64&n)&&j(t,e[6])},i(e){i||(_e(r.$$.fragment,e),i=!0)},o(e){Ce(r.$$.fragment,e),i=!1},d(e){e&&M(t),e&&M(n),Re(r,e)}}}function Vc(e){let t,n,r,i,o;return n=new Ke({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-o0hiko")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[13]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Uc(e){let t,n,r,i;const o=[Pc,Mc],s=[];return t=function(e){return e[11]?0:1}(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,[t]){n.p(e,t)},i(e){i||(_e(n),i=!0)},o(e){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}let Wc;function zc(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=u,l=ne();let c,d,{classId:f}=n,{eventId:h}=n,{record:m}=n,{item:p}=n,{id:g}=n,{name:w}=n,y=[],v=m[p.name]||"",$=!!m._id;const I={scale:{once:!1,value:3,start:3,step:.4,stop:4},resultOpts:{singleCodeInPage:!0,multiCodesInPage:!1,maxCodesInPage:1},improve:!0,jsQR:{}},_=e=>async n=>{if(!n.success)return;const i=await t.getSchema(h),o=n.codes?.filter(e=>!!e)?.at(0);if(!o?.length||!o.startsWith("SPC")){const n=await t.getSectionView("serviceAI",{event:i.identity.name});if(!n?.length)return;r(6,d="OCR Erkennung läuft, bitte warten."),r(5,c=!0);const o=new FormData;o.append("file",e);const s={headers:{"Content-Type":"multipart/mixed"}},a=await t.retrieveOCR(h,o,s);for(const e in a){let t=a[e];if(t?.split&&3===t.split("-").length&&24===t.length){const[e,n,r]=t.split("T")[0].split("-");t=new Date(e,n-1,r)}r(15,m[e]=t,m),l("record",{itemName:e,value:t})}return void r(5,c=!1)}const s=Dc(o);for(const e in s){if(i.items.find(t=>t.name===e)){if("object"==typeof s[e]){let n={};for(const i in s[e])if("object"==typeof s[e][i])for(const o in s[e][i]){s[e][i][o]&&(n[o]=s[e][i][o]);const a=await t.getSectionView(i,n);if(a?.length){const n=await t.getSectionView(e,{[i]:a[0]._id});n?.length&&r(15,m[e]=n[0]._id,m)}}else{s[e][i]&&(n[i]=s[e][i]);const o=await t.getSectionView(e,n);o?.length&&r(15,m[e]=o[0]._id,m)}}else s[e]&&r(15,m[e]=s[e],m);l("record",{itemName:e,value:m[e]})}}};return ee(()=>{if(Wc)return;let e=document.createElement("script");e.src="/QR/pdf-qr2.js",document.head.append(e),e.onload=function(){Wc=PDF_QR_JS}}),te(()=>{}),e.$$set=e=>{"classId"in e&&r(0,f=e.classId),"eventId"in e&&r(16,h=e.eventId),"record"in e&&r(15,m=e.record),"item"in e&&r(17,p=e.item),"id"in e&&r(1,g=e.id),"name"in e&&r(2,w=e.name)},[f,g,w,y,v,c,d,i,o,s,a,$,async e=>{const n=y[0];if(!n){l("record",{itemName:"$file",value:!1});const e=await t.getSchema(h);for(const t of e.items)l("record",{itemName:t.name,value:""});return}const i=URL.createObjectURL(n);r(4,v=n.name),l("record",{itemName:"$file",value:{fileName:v,file:n}}),Wc.decodeDocument(i,I,_(n))},async()=>{if(!m?._id)return;const e=await t.getTaskByDocId(m._id,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;const r="/api/userreport/"+n[0]._id,i=await window.fetch(r),o=await i.blob(),s=window.URL.createObjectURL(o);window.open(s,"_blank")},()=>{r(3,y)},m,h,p,function(e){y=e,r(3,y)}]}class qc extends Oe{constructor(e){var t;super(),Oc.getElementById("svelte-o0hiko-style")||((t=B("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}",x(Oc.head,t)),xe(this,e,zc,Uc,T,{classId:0,eventId:16,record:15,item:17,id:1,name:2})}}const{document:Hc}=Ee;function jc(e){let t,n,r,i,o,s,a;function l(t){e[23](t)}let c={class:e[0],id:e[2],name:e[3],accept:e[4],max:"1",beforeChange:e[18]};void 0!==e[5]&&(c.files=e[5]),t=new e[10]({props:c}),oe.push(()=>Te(t,"files",l)),t.$on("change",e[14]);const d=[Zc,Yc],u=[];function f(e,t){return e[6]?0:1}return i=f(e),o=u[i]=d[i](e),{c(){ke(t.$$.fragment),r=V(),o.c(),s=U()},m(e,n){De(t,e,n),O(e,r,n),u[i].m(e,n),O(e,s,n),a=!0},p(e,r){const a={};1&r[0]&&(a.class=e[0]),4&r[0]&&(a.id=e[2]),8&r[0]&&(a.name=e[3]),16&r[0]&&(a.accept=e[4]),!n&&32&r[0]&&(n=!0,a.files=e[5],he(()=>n=!1)),t.$set(a);let l=i;i=f(e),i===l?u[i].p(e,r):($e(),Ce(u[l],1,1,()=>{u[l]=null}),Ie(),o=u[i],o?o.p(e,r):(o=u[i]=d[i](e),o.c()),_e(o,1),o.m(s.parentNode,s))},i(e){a||(_e(t.$$.fragment,e),_e(o),a=!0)},o(e){Ce(t.$$.fragment,e),Ce(o),a=!1},d(e){Re(t,e),e&&M(r),u[i].d(e),e&&M(s)}}}function Gc(e){let t,n,r,i;n=new e[11]({props:{inputClass:e[0],readonly:!0,id:e[2],name:e[2],value:e[8]}});let o=e[8]&&Qc(e);return{c(){t=B("div"),ke(n.$$.fragment),r=V(),o&&o.c(),X(t,"position","relative")},m(e,s){O(e,t,s),De(n,t,null),x(t,r),o&&o.m(t,null),i=!0},p(e,r){const i={};1&r[0]&&(i.inputClass=e[0]),4&r[0]&&(i.id=e[2]),4&r[0]&&(i.name=e[2]),256&r[0]&&(i.value=e[8]),n.$set(i),e[8]?o?(o.p(e,r),256&r[0]&&_e(o,1)):(o=Qc(e),o.c(),_e(o,1),o.m(t,null)):o&&($e(),Ce(o,1,1,()=>{o=null}),Ie())},i(e){i||(_e(n.$$.fragment,e),_e(o),i=!0)},o(e){Ce(n.$$.fragment,e),Ce(o),i=!1},d(e){e&&M(t),Re(n),o&&o.d()}}}function Xc(e){let t,n,r,i,o,s,a,l;return n=new e[11]({props:{inputClass:e[0],disabled:!0,id:e[2],name:e[2],value:e[1].properties.file.desc}}),o=new Ke({props:{size:"18"}}),{c(){t=B("div"),ke(n.$$.fragment),r=V(),i=B("span"),ke(o.$$.fragment),H(i,"class","feather pointer svelte-o0hiko"),X(t,"position","relative")},m(c,d){O(c,t,d),De(n,t,null),x(t,r),x(t,i),De(o,i,null),s=!0,a||(l=W(i,"click",e[16]),a=!0)},p(e,t){const r={};1&t[0]&&(r.inputClass=e[0]),4&t[0]&&(r.id=e[2]),4&t[0]&&(r.name=e[2]),2&t[0]&&(r.value=e[1].properties.file.desc),n.$set(r)},i(e){s||(_e(n.$$.fragment,e),_e(o.$$.fragment,e),s=!0)},o(e){Ce(n.$$.fragment,e),Ce(o.$$.fragment,e),s=!1},d(e){e&&M(t),Re(n),Re(o),a=!1,l()}}}function Yc(e){let t,n;return t=new e[11]({props:{inputClass:e[0],hidden:!0,id:e[2],name:e[2],value:e[8]}}),{c(){ke(t.$$.fragment)},m(e,r){De(t,e,r),n=!0},p(e,n){const r={};1&n[0]&&(r.inputClass=e[0]),4&n[0]&&(r.id=e[2]),4&n[0]&&(r.name=e[2]),256&n[0]&&(r.value=e[8]),t.$set(r)},i(e){n||(_e(t.$$.fragment,e),n=!0)},o(e){Ce(t.$$.fragment,e),n=!1},d(e){Re(t,e)}}}function Zc(e){let t,n,r;return n=new e[12]({props:{outline:!0,$$slots:{default:[Kc]},$$scope:{ctx:e}}}),{c(){t=B("div"),ke(n.$$.fragment),X(t,"margin-top","1em")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p(e,t){const r={};128&t[0]|4&t[1]&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Kc(e){let t,n,r,i;return r=new e[13]({}),{c(){t=F(e[7]),n=V(),ke(r.$$.fragment)},m(e,o){O(e,t,o),O(e,n,o),De(r,e,o),i=!0},p(e,n){(!i||128&n[0])&&j(t,e[7])},i(e){i||(_e(r.$$.fragment,e),i=!0)},o(e){Ce(r.$$.fragment,e),i=!1},d(e){e&&M(t),e&&M(n),Re(r,e)}}}function Qc(e){let t,n,r,i,o;const s=[ed,Jc],a=[];function l(e,n){return 256&n[0]&&(t=!!e[8].endsWith(".mp4")),t?0:1}return n=l(e,[-1]),r=a[n]=s[n](e),{c(){r.c(),i=U()},m(e,t){a[n].m(e,t),O(e,i,t),o=!0},p(e,t){let o=n;n=l(e,t),n===o?a[n].p(e,t):($e(),Ce(a[o],1,1,()=>{a[o]=null}),Ie(),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){Ce(r),o=!1},d(e){a[n].d(e),e&&M(i)}}}function Jc(e){let t,n,r,i,o;return n=new Ke({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-o0hiko")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[15]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function ed(e){let t,n={ctx:e,current:null,token:null,hasCatch:!1,pending:rd,then:nd,catch:td,value:32};return be(e[17](),n),{c(){t=U(),n.block.c()},m(e,r){O(e,t,r),n.block.m(e,n.anchor=r),n.mount=()=>t.parentNode,n.anchor=t},p(t,r){Ae(n,e=t,r)},i:b,o:b,d(e){e&&M(t),n.block.d(e),n.token=null,n=null}}}function td(e){return{c:b,m:b,p:b,d:b}}function nd(e){let t,n,r,i;return{c(){t=B("video"),n=B("source"),i=F("\n Your browser does not support HTML video."),n.src!==(r=e[32])&&H(n,"src",r),H(n,"type","video/mp4"),H(t,"width","500"),t.controls=!0,X(t,"margin-top","1em")},m(e,r){O(e,t,r),x(t,n),x(t,i)},p:b,d(e){e&&M(t)}}}function rd(e){return{c:b,m:b,p:b,d:b}}function id(e){let t,n,r,i;const o=[Xc,Gc,jc],s=[];function a(e,t){return e[1].properties?.file?0:e[9]?1:2}return t=a(e),n=s[t]=o[t](e),{c(){n.c(),r=U()},m(e,n){s[t].m(e,n),O(e,r,n),i=!0},p(e,i){let l=t;t=a(e),t===l?s[t].p(e,i):($e(),Ce(s[l],1,1,()=>{s[l]=null}),Ie(),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){Ce(n),i=!1},d(e){s[t].d(e),e&&M(r)}}}let od=new Array(201),sd="";function ad(e,n,r){const{FileDropzone:i,TextField:o,Chip:s,Loading:a}=u,l=ne();let{classId:c}=n,{eventId:d}=n,{record:f}=n,{item:h}=n,{id:m}=n,{name:p}=n,{praefix:g}=n,{recordId:w}=n,{fileType:y="application/pdf"}=n;const v=void 0===g||""===g?200:+g;let $,I,_=[],C="",b=!1;const A=async e=>{const n=await t.getSchema(d),i=await t.getSectionView("serviceAI",{event:n.identity.name});if(!i?.length)return;r(7,I="OCR Erkennung läuft, bitte warten."),r(6,$=!0);const o=new FormData;o.append("file",e);const s=await t.retrieveOCR(d,o,{headers:{"Content-Type":"multipart/mixed"}});for(const e in s){let t=s[e];if(Array.isArray(t))r(19,f[e]=t,f);else{if(t?.split&&3===t.split("-").length&&24===t.length){const[e,n,r]=t.split("T")[0].split("-");t=new Date(e,n-1,r)}r(19,f[e]=t,f),l("record",{itemName:e,value:t})}}r(6,$=!1)};return ee(()=>{sd!==c&&(od=new Array(201),r(5,_=[]),r(8,C="")),(async()=>{if(!w)return;const e=await t.getTaskByDocId(w,!0);if(!e)return l("listRecord",{itemName:"fileName",value:"",string:!0});const n=f[h.name];if(!n)return l("listRecord",{itemName:"fileName",value:"",string:!0});const i=await t.getUserReports(e._id);if(!i?.length)return l("listRecord",{itemName:"fileName",value:"",string:!0});let o=i.find(e=>e.fileName===n);if(!o)return l("listRecord",{itemName:"fileName",value:"",string:!0});r(8,C=o.fileName),r(9,b=void 0===g?!!w:!!C)})(),sd=c}),te(()=>{}),e.$$set=e=>{"classId"in e&&r(0,c=e.classId),"eventId"in e&&r(20,d=e.eventId),"record"in e&&r(19,f=e.record),"item"in e&&r(1,h=e.item),"id"in e&&r(2,m=e.id),"name"in e&&r(3,p=e.name),"praefix"in e&&r(21,g=e.praefix),"recordId"in e&&r(22,w=e.recordId),"fileType"in e&&r(4,y=e.fileType)},e.$$.update=()=>{524288&e.$$.dirty[0]&&(C||od[v]&&od[v].length&&(_?.length||r(5,_=od[v]),r(8,C=_[0].name)))},[c,h,m,p,y,_,$,I,C,b,i,o,s,a,async e=>{let t="";const n=_[0];n?(r(8,C=t=n.name),od[v]=_):(r(8,C=""),t=od[v][0].name,od[v]=[]),l("record",{itemName:"$file",value:{fileName:t,file:n}}),200!=v?l("listRecord",{itemName:h.name,value:n?t:"",string:!0}):await A(n)},async()=>{if(!w)return;const e=await t.getTaskByDocId(w,!0);if(!e)return;const n=await t.getUserReports(e._id);if(!n?.length)return;let r=n.find(e=>e.fileName===C);r||(r=n[0])},async()=>{const{service:e,name:n,fileName:r}=h.properties.file,i=await t.getServiceReport(n,e,f[r],"payslip.pdf"),o=new Uint8Array(Object.values(i)),s=new Blob([o],{type:"application/pdf"}),a=URL.createObjectURL(s);window.open(a,"_blank")},async()=>{const e=await t.getTaskByDocId(w,!0);if(!e)return"";const n=await t.getUserReports(e._id);if(!n?.length)return"";let r=n.find(e=>e.fileName===C);return r||(r=n[0]),"/api/userreport/"+r._id},e=>{r(5,_)},f,d,g,w,function(e){_=e,r(5,_)}]}class ld extends Oe{constructor(e){var t;super(),Hc.getElementById("svelte-o0hiko-style")||((t=B("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}",x(Hc.head,t)),xe(this,e,ad,id,T,{classId:0,eventId:20,record:19,item:1,id:2,name:3,praefix:21,recordId:22,fileType:4},[-1,-1])}}function cd(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:dd,placeholder:ud,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=B("div"),ke(n.$$.fragment),X(t,"max-width","4em")},m(e,i){O(e,t,i),De(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){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}const dd="([01][0-9]|2[0-3]):([0-5][0-9])",ud="";function fd(e,t,n){const r=ne(),{TextField:i}=u;let{id:o}=t,{item:s}=t,{value:a}=t,{inputClass:l}=t,{readonly:c}=t,{disabled:d}=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,c=e.readonly),"disabled"in e&&n(4,d=e.disabled),"praefix"in e&&n(8,f=e.praefix)},[o,a,l,c,d,i,({detail:e})=>{r("blur",{value:h(e.value)}),r("checkRange",{idx:f,fieldId:o,value:e.value})},s,f]}class hd extends Oe{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=B("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",x(document.head,t)),xe(this,e,fd,cd,T,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:md}=Ee;function pd(e,t,n){const r=e.slice();return r[29]=t[n],r}function gd(e,t,n){const r=e.slice();return r[32]=t[n],r[34]=n,r}function wd(e){return{c:b,m:b,p:b,d:b}}function yd(e){let t,n,r=e[35]+"",i=e[34]&&function(){let e;return{c(){e=F(", ")},m(t,n){O(t,e,n)},d(t){t&&M(e)}}}();return{c(){t=B("span"),i&&i.c(),n=F(r),H(t,"class","lookupValue")},m(e,r){O(e,t,r),i&&i.m(t,null),x(t,n)},p(e,t){3&t[0]&&r!==(r=e[35]+"")&&j(n,r)},d(e){e&&M(t),i&&i.d()}}}function vd(e){return{c:b,m:b,p:b,d:b}}function $d(e){let t,n,r={ctx:e,current:null,token:null,hasCatch:!1,pending:vd,then:yd,catch:wd,value:35};return be(n=e[3](e[29],e[32]),r),{c(){t=U(),r.block.c()},m(e,n){O(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t},p(t,i){e=t,r.ctx=e,3&i[0]&&n!==(n=e[3](e[29],e[32]))&&be(n,r)||Ae(r,e,i)},d(e){e&&M(t),r.block.d(e),r.token=null,r=null}}}function Id(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]=$d(gd(e,d,t));i=new St({props:{size:"18"}});let f=e[2]&&function(e){let t,n,r,i,o,s,a,l,c;return i=new Ke({props:{size:"18"}}),{c(){t=B("span"),t.textContent=" / ",n=V(),r=B("span"),ke(i.$$.fragment),o=V(),s=B("span"),s.textContent="Rechnung",H(r,"class","pointer feather2 svelte-1jurfpd")},m(d,u){O(d,t,u),O(d,n,u),O(d,r,u),De(i,r,null),O(d,o,u),O(d,s,u),a=!0,l||(c=W(r,"click",function(){N(e[5](e[29]._id))&&e[5](e[29]._id).apply(this,arguments)}),l=!0)},p(t,n){e=t},i(e){a||(_e(i.$$.fragment,e),a=!0)},o(e){Ce(i.$$.fragment,e),a=!1},d(e){e&&M(t),e&&M(n),e&&M(r),Re(i),e&&M(o),e&&M(s),l=!1,c()}}}(e);return{c(){t=B("div");for(let e=0;e<u.length;e+=1)u[e].c();n=V(),r=B("span"),ke(i.$$.fragment),o=V(),f&&f.c(),s=V(),H(r,"class","feather pointer svelte-1jurfpd"),H(t,"class","lookupItem svelte-1jurfpd")},m(d,h){O(d,t,h);for(let e=0;e<u.length;e+=1)u[e].m(t,null);x(t,n),x(t,r),De(i,r,null),x(t,o),f&&f.m(t,null),x(t,s),a=!0,l||(c=W(r,"click",function(){N(e[4](e[29]._id))&&e[4](e[29]._id).apply(this,arguments)}),l=!0)},p(r,i){if(e=r,11&i[0]){let r;for(d=e[0],r=0;r<d.length;r+=1){const o=gd(e,d,r);u[r]?u[r].p(o,i):(u[r]=$d(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){Ce(i.$$.fragment,e),Ce(f),a=!1},d(e){e&&M(t),P(u,e),Re(i),f&&f.d(),l=!1,c()}}}function _d(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=Id(pd(e,r,t));const o=e=>Ce(i[e],1,1,()=>{i[e]=null});return{c(){t=B("div");for(let e=0;e<i.length;e+=1)i[e].c();H(t,"class","lookup svelte-1jurfpd")},m(e,r){O(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[0]){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=pd(e,r,s);i[s]?(i[s].p(o,n),_e(i[s],1)):(i[s]=Id(o),i[s].c(),_e(i[s],1),i[s].m(t,null))}for($e(),s=r.length;s<i.length;s+=1)o(s);Ie()}},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)Ce(i[e]);n=!1},d(e){e&&M(t),P(i,e)}}}function Cd(e,n,r){let{id:i}=n,{item:o}=n,{praefix:s}=n,{record:a}=n,{fullRecord:c}=n,{notifyList:d}=n,{classId:u}=n,{_listName:f}=n;const{refItem:h,refClass:m,view:p,beforeSave:w,showAlways:y,_state:$,addAttachment:I}=o.properties;let _=p.split(","),[C,b]=h.split(":");const[A,E]=C.split(",");let S=[];const[N,T]=b.split("."),k=(e,t)=>{const[n,r]=t.split(".");return r?e[n]?e[n][r]:void 0:""},D=(e=!0)=>{ue().then(()=>{let t;if(t=""===s||void 0===s?document.querySelector("div.form-field."+o.name):document.querySelector(`#accordion-content-${u}-${f}-${s} .form-field.${o.name}`),t&&(t.style.display=e?"none":"flex"),!e&&w){const e=t.querySelector("div label");e&&(e.style.color="red")}})};return ee(D),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),"fullRecord"in e&&r(10,c=e.fullRecord),"notifyList"in e&&r(11,d=e.notifyList),"classId"in e&&r(12,u=e.classId),"_listName"in e&&r(13,f=e._listName)},e.$$.update=()=>{2048&e.$$.dirty[0]&&(async e=>{const{itemName:n,value:i}=e||{};if(n!==A&&n!==E)return;if(r(1,S=[]),!i)return;if(void 0===s||""===s){if(!y&&!!w==!!a._id)return D();if(!a._id&&!a[A])return D()}const o=!_.some(e=>e.includes(":")),l=T?T+"."+A:A;let d={[l]:a[A]||a._id};if(E){if(!a[E]&&!c[E])return D();const e=u.split("-")[1].slice(0,-4),n=await t.getSchemaByClass(e);let r=n?.items?.find(e=>e.name===E);r||(r=n.list?.at(0)?.item.find(e=>e.name===E)),r?.refClass&&(d[r.refClass]=a[E]||c[E])}$&&(d=[{$match:d},{$addFields:{_ids:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_ids",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":$}}]);let f=!1;if(!l.includes(".")){const e=await t.getSchemaByClass(N),n=e?.items?.find(e=>e.name===l);n?.properties?.multi&&(f=!0)}if(r(1,S=await t.getSectionView(N,d,o,!0,f)),!o&&S.length){const e=_.find(e=>e.includes(":")),t=e.split(":")[0];r(1,S=S.map(e=>{const n=e[t].find(e=>e[t]===a._id);return n._id=e._id,n})),r(0,_=_.map(e=>e.split(":")[1]))}D(!S.length)})(d)},[_,S,I,async(e,t)=>{let n="boolean"===o.type?e[t]?"ja":"nein":"object"===o.type?"(ja)":e["_"+t]||g(e[t])||e[t]||k(e,t);if(v(n)){const e=await bw(m,n);e?.designation&&(n=e.designation)}return n},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()=>{const n=await t.getTaskByDocId(e,!0);if(!n)return;const r=await t.getUserReports(n._id);r?.length&&l(r[0])},i,o,s,a,c,d,u,f]}class bd extends Oe{constructor(e){var t;super(),md.getElementById("svelte-1jurfpd-style")||((t=B("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}",x(md.head,t)),xe(this,e,Cd,_d,T,{id:6,item:7,praefix:8,record:9,fullRecord:10,notifyList:11,classId:12,_listName:13},[-1,-1])}}function Ad(e){let t,n,r;return n=new xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Ed(e){let t,n,r,i,o;return n=new xt({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[9]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Sd(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=[Ed,Ad],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}function Nd(e,t,n){const{TextField:r}=u;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:c}=t,{name:d}=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,c=e.id),"name"in e&&n(6,d=e.name),"value"in e&&n(7,f=e.value)},[i,o,s,a,l,c,d,f,r,async()=>{if(!f)return;let e=f;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){re(e,t)}]}class Td extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,Nd,Sd,T,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function kd(e){let t,n,r;return n=new Ht({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Dd(e){let t,n,r,i,o;return n=new Ht({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[12]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Rd(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=[Dd,kd],l=[];function c(e,t){return e[9]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}function xd(e,t,r){let i;const{TextField:o}=u,{environment:s}=h;k(e,s,e=>r(16,i=e));const a=JSON.parse(n.getItem("Locale"));let{inputClass:l}=t,{disabled:c}=t,{formnovalidate:d}=t,{readonly:f}=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"},b=e=>{const t=e?.split("-")?.at(-1)?.toLowerCase();return t||"ch"};return e.$$set=e=>{"inputClass"in e&&r(2,l=e.inputClass),"disabled"in e&&r(3,c=e.disabled),"formnovalidate"in e&&r(4,d=e.formnovalidate),"readonly"in e&&r(5,f=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=>{let t,n,o;const{listName:s,itemName:l,value:c}=e||{};I&&l===I&&c?t=c:i?.owner?.address?.country?t=i.owner.address.country:i?.owner?.country&&(t=i.owner.country),t&&(n=await bw("country",t)),o=n?.countryCode?.toLowerCase()||b(a.id),n?.phonePattern?(r(0,y=n.phonePattern),r(1,v=n.phonePlaceholder||"")):o&&_[o]&&(r(0,y=_[o]),r(1,v=C[o]))})($)},[y,v,l,c,d,f,m,p,g,w,o,s,async()=>{if(!w)return;let e="tel:"+w;window.open(e,"_self")},$,I,function(t){re(e,t)}]}class Od extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,xd,Rd,T,{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 Md(e){let t,n,r;return n=new Ft({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather2 svelte-9up2nn")},m(e,i){O(e,t,i),De(n,t,null),r=!0},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n)}}}function Pd(e){let t,n,r,i,o;return n=new Ft({props:{size:"18"}}),{c(){t=B("span"),ke(n.$$.fragment),H(t,"class","feather pointer svelte-9up2nn")},m(s,a){O(s,t,a),De(n,t,null),r=!0,i||(o=W(t,"click",e[12]),i=!0)},p:b,i(e){r||(_e(n.$$.fragment,e),r=!0)},o(e){Ce(n.$$.fragment,e),r=!1},d(e){e&&M(t),Re(n),i=!1,o()}}}function Bd(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=[Pd,Md],l=[];function c(e,t){return e[7]?0:1}return i=c(e),o=l[i]=a[i](e),{c(){t=B("div"),ke(n.$$.fragment),r=V(),o.c(),X(t,"position","relative")},m(e,o){O(e,t,o),De(n,t,null),x(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):($e(),Ce(l[d],1,1,()=>{l[d]=null}),Ie(),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){Ce(n.$$.fragment,e),Ce(o),s=!1},d(e){e&&M(t),Re(n),l[i].d()}}}function Ld(e,t,n){const{TextField:r}=u;let{inputClass:i}=t,{disabled:o}=t,{formnovalidate:s}=t,{readonly:a}=t,{required:l}=t,{id:c}=t,{name:d}=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,c=e.id),"name"in e&&n(6,d=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,c,d,f,h,m,p,r,async()=>{if(!f)return;let e="mailto:"+f;window.open(e,"_self")},function(t){re(e,t)}]}class Fd extends Oe{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=B("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}",x(document.head,t)),xe(this,e,Ld,Bd,T,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,multiple:8,pattern:9,placeholder:10})}}const Vd=["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 Ud(e){let t;return{c(){t=B("textarea"),H(t,"id",e[0]),X(t,"visibility","hidden")},m(n,r){O(n,t,r),e[20](t)},p(e,n){1&n&&H(t,"id",e[0])},d(n){n&&M(t),e[20](null)}}}function Wd(e){let t;return{c(){t=B("div"),H(t,"id",e[0])},m(n,r){O(n,t,r),e[19](t)},p(e,n){1&n&&H(t,"id",e[0])},d(n){n&&M(t),e[19](null)}}}function zd(e){let t;function n(e,t){return e[1]?Wd:Ud}let r=n(e),i=r(e);return{c(){t=B("div"),i.c(),H(t,"class",e[2])},m(n,r){O(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&&H(t,"class",e[2])},i:b,o:b,d(n){n&&M(t),i.d(),e[21](null)}}}const qd=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let Hd=(()=>{let e={listeners:[],scriptId:qd("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 jd(e,t,n){let r,i,o,{id:s=qd("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")},b=ne(),A=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},E=()=>{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)=>{Vd.forEach(n=>{e.on(n,r=>{t(n.toLowerCase(),{eventName:n,event:r,editor:e})})})})(e,b),"function"==typeof m.setup&&m.setup(e)}});n(4,i.style.visibility="",i),null===(e=A())||void 0===e||e.init(t)};return ee(()=>{if(null!==A())E();else{const e=h||`https://cdn.tiny.cloud/1/${d}/tinymce/${f}/tinymce.min.js`;Hd.load(r.ownerDocument,e,()=>{E()})}}),te(()=>{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){oe[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){oe[e?"unshift":"push"](()=>{i=e,n(4,i)})},function(e){oe[e?"unshift":"push"](()=>{r=e,n(3,r)})}]}class Gd extends Oe{constructor(e){super(),xe(this,e,jd,zd,T,{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 Xd(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 Gd({props:c}),oe.push(()=>Te(n,"value",l)),n.$on("init",e[9]),{c(){t=B("div"),ke(n.$$.fragment),i=V(),o=B("input"),H(o,"class",s=e[1]||e[2]),H(o,"id",e[3]),H(o,"name",e[3]),o.value=e[0],o.hidden=!0,X(t,"min-height","10em"),X(t,"margin-top","-1em"),t.hidden=e[4]},m(e,r){O(e,t,r),De(n,t,null),x(t,i),x(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],he(()=>r=!1)),n.$set(l),(!a||6&i&&s!==(s=e[1]||e[2]))&&H(o,"class",s),(!a||8&i)&&H(o,"id",e[3]),(!a||8&i)&&H(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){Ce(n.$$.fragment,e),a=!1},d(e){e&&M(t),Re(n)}}}let Yd,Zd=!1;function Kd(e,t,r){let i;const{environment:o}=h;k(e,o,e=>r(16,i=e));const s=ne();let a=JSON.parse(n.getItem("Locale")).id;a=a.startsWith("fr")?"fr_FR":a.split("-")[0];let l,c,{value:d=""}=t,{noForm:u}=t,{classId:f}=t,{id:m}=t,{record:p}=t,{hidden:g}=t,{disabled:w}=t,{readonly:y}=t,{keepOrigin:$}=t;const I=(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,u=e.noForm),"classId"in e&&r(2,f=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,w=e.disabled),"readonly"in e&&r(6,y=e.readonly),"keepOrigin"in e&&r(11,$=e.keepOrigin)},e.$$.update=()=>{1024&e.$$.dirty&&(async e=>{if(Zd)return;if($)return;if(!l)return;if(Yd&&!Yd.includes("{{"))return void r(0,d=Yd);Yd=d;const t=I(d,e,c);if(!t?.length)return;Zd=!0;const n=await Promise.all(t.map(async(t,n)=>{let r;return e[t.table]&&(r=await bw(t.table,e[t.table]).catch(()=>{})),{table:r,def:t}}));for(const e of n)for(const t of e.def.attrs){const[n,r]=t.split(".");let i;if(r&&v(e.table&&e.table[n])){const t=await bw(n,e.table[n]);t&&(i=t[r])}else i=_(e.table||c[e.def.table],t);if(i?.endsWith("Z")&&24===i?.length){let[e,t,n]=i.split("-");n=n.slice(0,2),i=`${n}.${t}.${e}`}Yd=Yd.replace(`{{${e.def.table}.${t}}}`,i||"")}r(0,d=Yd||""),s("blur",{value:d}),Zd=!1})(p)},[d,u,f,m,g,w,y,o,C,e=>{c={owner:i.owner},l=!0,Yd=void 0},p,$,function(e){d=e,r(0,d)}]}class Qd extends Oe{constructor(e){var t;super(),document.getElementById("svelte-yi7lpi-style")||((t=B("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}",x(document.head,t)),xe(this,e,Kd,Xd,T,{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.4 | https://github.com/szimek/signature_pad
|
|
4
4
|
* (c) 2026 Szymon Nowak | Released under the MIT license
|