admins-components 6.0.3 → 6.0.5

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.
@@ -1,4 +1,4 @@
1
- "use strict";var n6t=Object.defineProperty;var i6t=(l,f,_)=>f in l?n6t(l,f,{enumerable:!0,configurable:!0,writable:!0,value:_}):l[f]=_;var qf=(l,f,_)=>i6t(l,typeof f!="symbol"?f+"":f,_);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const E=require("vue"),a6t=["checked","id"],s6t=["for"],OM=E.defineComponent({__name:"CheckBox",props:{id:{},label:{},checked:{type:Boolean}},emits:["changed"],setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",{class:"form-check",onClick:_[1]||(_[1]=g=>g.stopPropagation())},[E.createElementVNode("input",{class:"form-check-input",type:"checkbox",checked:f.checked,value:"",id:f.id,onChange:_[0]||(_[0]=g=>f.$emit("changed",{id:f.id,checked:g.target.checked}))},null,40,a6t),E.createElementVNode("label",{class:"form-check-label",for:f.id},E.toDisplayString(f.label),9,s6t)]))}}),o6t={class:"cbl-childrend-container"},c6t=E.defineComponent({__name:"CheckBoxList",props:{items:{},callback:{type:Function}},setup(l){return(f,_)=>{const g=E.resolveComponent("CheckBoxList",!0);return E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.items,T=>(E.openBlock(),E.createElementBlock("div",{key:T.id,class:"cbl-container"},[E.createVNode(OM,{id:T.id,label:T.label,checked:T.checked,onChanged:_[0]||(_[0]=A=>f.callback(A.id,A.checked))},null,8,["id","label","checked"]),E.createElementVNode("div",o6t,[T.childrend?(E.openBlock(),E.createBlock(g,{key:0,items:T.childrend,callback:f.callback},null,8,["items","callback"])):E.createCommentVNode("",!0)])]))),128)}}}),cC=(l,f)=>{const _=l.__vccOpts||l;for(const[g,T]of f)_[g]=T;return _},WVe=cC(c6t,[["__scopeId","data-v-ae2832c5"]]),l6t=["id"],u6t=["disabled"],f6t={class:"dd-label"},_6t=["id"],p6t={class:"dd-item-list"},d6t=["id","onClick"],JM=E.defineComponent({__name:"DropDown",props:{id:{},label:{},selected:{},options:{},opentop:{type:Boolean},disableFilter:{type:Boolean},storeselected:{type:Boolean},filterevent:{type:Boolean},disabled:{type:Boolean},btnextraclass:{}},emits:["selected","filtered"],setup(l,{emit:f}){const _=l;E.watch(_.options,()=>{_.filterevent&&(Be.value=_.options.value)}),E.watch(()=>_.selected,()=>{W()}),E.watch(()=>_.label,()=>{W()});const g=f,T=sr=>{_.storeselected||(I.value=sr.label),g("selected",sr)},A="törlés",I=E.ref(""),$=E.ref(null);E.watch(()=>$.value,()=>{$.value&&document.getElementById($.value.id).scrollIntoView()});const W=()=>{if(_.options.value){const sr=_.options.value.find($t=>$t.id==_.selected);sr?I.value=sr.label:(_e(""),I.value=_.label)}},ee=sr=>{const $t=()=>$?Be.value.indexOf($.value,0):-1,_r=document.getElementById(`${_.id}-clear-btn`);if(_r==sr.target&&sr.key=="ArrowDown"){St.value.focus(),$.value=Be.value[0];return}if(St.value&&St.value==sr.target){if(sr.key=="ArrowUp"){const Ot=$t();if(Ot<1){_r&&_r.focus();return}$.value=Be.value[Ot-1];return}if(sr.key=="ArrowDown"){const Ot=$t();if(Ot>=Be.value.length-1)return;$.value=Be.value[Ot+1];return}if(sr.key=="Enter"){if(!$.value)return;T($.value),nt.value=="block"&&(nt.value="none");return}}},R=()=>{nt.value=="block"&&(nt.value="none")},le=()=>{nt.value=="block"&&(nt.value="none")};E.onMounted(()=>{_.label&&(I.value=_.label),W(),te="",document.addEventListener("click",R),window.addEventListener("scrolled",le),gt(),document.addEventListener("keydown",ee)}),E.onUnmounted(()=>{document.removeEventListener("keydown",ee),document.removeEventListener("click",R),window.removeEventListener("scrolled",le)});let te="";const _e=sr=>{te=sr,_.filterevent?g("filtered",sr):sr==""?Be.value=_.options.value:Be.value=_.options.value.filter($t=>$t.label.toLowerCase().includes(sr.toLowerCase()))},Be=E.ref([]),Ge=()=>{T({label:_.label,id:""}),_e("")},et=()=>{if(nt.value=="block"){nt.value="none";return}setTimeout(()=>{nt.value="block"},10),setTimeout(gt,20)},gt=()=>{const sr=at.value,$t=dt.value;_.opentop?$t.style.top=sr.getBoundingClientRect().y-$t.offsetHeight+"px":($t.style.top=sr.getBoundingClientRect().y+sr.offsetHeight+"px",sr.getBoundingClientRect().y-$t.getBoundingClientRect().y!=-sr.offsetHeight&&($t.style.top=parseInt($t.style.top.substring(0,$t.style.top.length-2))+(sr.getBoundingClientRect().y-$t.getBoundingClientRect().y)+sr.offsetHeight+"px")),St.value&&St.value.focus()},at=E.ref(null),dt=E.ref(null),nt=E.ref("none"),St=E.ref(null);return(sr,$t)=>(E.openBlock(),E.createElementBlock("div",{id:sr.id,class:"dd-flex"},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:at,class:E.normalizeClass(["btn btn-outline-secondary dd-toggle dd-flex",sr.btnextraclass]),type:"button",disabled:sr.disabled,onClick:$t[0]||($t[0]=()=>{_e(E.unref(te)),et()})},[E.createElementVNode("div",f6t,E.toDisplayString(I.value),1)],10,u6t),E.createElementVNode("div",{class:"dd-menu",style:E.normalizeStyle({display:nt.value}),ref_key:"DropDownMenu",ref:dt},[I.value!=_.label?(E.openBlock(),E.createElementBlock("button",{key:0,id:`${sr.id}-clear-btn`,type:"button",class:"btn btn-outline-secondary dd-button",onClick:$t[1]||($t[1]=_r=>Ge())},E.toDisplayString(A),8,_6t)):E.createCommentVNode("",!0),sr.disableFilter?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("input",{key:1,ref_key:"ddSearch",ref:St,type:"text ",class:"form-control",placeholder:"keresés",onInput:$t[2]||($t[2]=_r=>_e(_r.target.value)),onClick:$t[3]||($t[3]=_r=>_r.stopPropagation())},null,544)),E.createElementVNode("div",p6t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(Be.value,_r=>(E.openBlock(),E.createElementBlock("div",{id:_r.id,key:_r.id,class:E.normalizeClass(["dd-item",{"dd-item-preselected":_r==$.value}]),onClick:Ot=>T(_r)},[_r.icon?(E.openBlock(),E.createElementBlock("i",{key:0,class:E.normalizeClass([_r.icon,"dd-item__icon"])},null,2)):E.createCommentVNode("",!0),E.createTextVNode(E.toDisplayString(_r.label),1)],10,d6t))),128))])],4)],8,l6t))}}),m6t=["id"],g6t=["disabled"],h6t={class:"ddc-row"},v6t={class:"ddc-label"},y6t={class:"dd-item-list"},b6t=["onClick"],S6t={class:"ddc-item"},T6t={class:"ddc-label"},x6t="törlés",$Te=E.defineComponent({__name:"DropDownCallBack",props:{id:{},default:{},selected:{},enabled:{type:Boolean},options:{}},setup(l){const f=l,_=R=>{R==f.default&&g.value.callback(""),g.value=R,g.value.callback(g.value.value)},g=E.ref(f.default),T=()=>{if(f.selected&&f.options.value){const R=f.options.value.find(le=>le.value==f.selected);R&&(g.value=R)}};E.onMounted(()=>{T(),document.addEventListener("click",function(){ee.value=="block"&&(ee.value="none")})});const A=()=>{setTimeout(()=>{ee.value="block"},10),setTimeout(()=>{W.value=I.value.offsetHeight},20)},I=E.ref(null),$=E.ref(null),W=E.ref(0),ee=E.ref("none");return(R,le)=>(E.openBlock(),E.createElementBlock("div",{class:"ddc-flex",id:R.id},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:I,class:"btn btn-outline-secondary ddc-button",type:"button",disabled:!R.enabled,onClick:le[0]||(le[0]=te=>A())},[E.createElementVNode("span",h6t,[E.createElementVNode("i",{class:E.normalizeClass([g.value.icon,"ddc-icon"])},null,2),E.createElementVNode("span",v6t,E.toDisplayString(g.value.label),1)])],8,g6t),E.createElementVNode("div",{class:"ddc-menu",style:E.normalizeStyle({display:ee.value,"margin-top":W.value+"px"}),ref_key:"DropDownMenu",ref:$},[g.value!=f.default?(E.openBlock(),E.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-secondary ddc-button",onClick:le[1]||(le[1]=te=>_(f.default))},E.toDisplayString(x6t))):E.createCommentVNode("",!0),E.createElementVNode("div",y6t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.options.value,te=>(E.openBlock(),E.createElementBlock("div",{key:te.label,class:"ddc-item",onClick:_e=>_(te)},[E.createElementVNode("span",S6t,[E.createElementVNode("i",{class:E.normalizeClass([te.icon,"ddc-icon"])},null,2),E.createElementVNode("span",T6t,E.toDisplayString(te.label),1)])],8,b6t))),128))])],4)],8,m6t))}}),k6t=["id"],C6t={key:0,class:"ddm-label"},E6t={key:1,class:"ddm-label"},w6t=["onClick"],Lne=E.defineComponent({__name:"DropDownMenu",props:{label:{},icon:{},options:{},item:{},id:{},right:{type:Boolean}},setup(l){const f=l;E.onMounted(()=>{document.addEventListener("click",function(){_.value&&(_.value=!1)})});const _=E.ref(!1),g=()=>{setTimeout(()=>{_.value=!0},10),setTimeout(T,20)},T=()=>{const W=A.value,ee=I.value;ee.style.top=W.getBoundingClientRect().y+W.offsetHeight+"px",W.getBoundingClientRect().y-ee.getBoundingClientRect().y!=-W.offsetHeight&&(ee.style.top=parseInt(ee.style.top.substring(0,ee.style.top.length-2))+(W.getBoundingClientRect().y-ee.getBoundingClientRect().y)+W.offsetHeight+"px"),ee.style.left=W.getBoundingClientRect().x-(f.right?100:0)+"px"},A=E.ref(null),I=E.ref(null),$=E.ref(0);return(W,ee)=>(E.openBlock(),E.createElementBlock("div",{class:"d-flex",id:W.id},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:A,class:"btn btn-outline-secondary",type:"button",onClick:ee[0]||(ee[0]=R=>g())},[W.label?(E.openBlock(),E.createElementBlock("span",C6t,E.toDisplayString(W.label),1)):E.createCommentVNode("",!0),W.icon?(E.openBlock(),E.createElementBlock("span",E6t,[E.createElementVNode("i",{class:E.normalizeClass(W.icon)},null,2)])):E.createCommentVNode("",!0)],512),_.value?(E.openBlock(),E.createElementBlock("div",{key:0,class:"ddm-menu",ref_key:"DropDownMenu",ref:I,style:E.normalizeStyle({"margin-top":$.value+"px"})},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(W.options,R=>(E.openBlock(),E.createElementBlock("div",{key:R.icon,class:"ddm-item",onClick:le=>R.command(W.item)},[E.createElementVNode("i",{class:E.normalizeClass(R.icon)},null,2),E.createTextVNode(E.toDisplayString(R.label),1)],8,w6t))),128))],4)):E.createCommentVNode("",!0)],8,k6t))}}),D6t={class:"d-flex"},A6t=["disabled"],P6t={class:"d-flex gap-2 align-items-center"},HVe=E.defineComponent({__name:"DropDownButton",props:{id:{},icon:{},label:{},options:{},selected:{},btnlabel:{}},emits:["selected","buttonpressed"],setup(l,{emit:f}){const _=l,g=f,T=I=>{_.selected.value=I,g("selected",_.selected.value)},A=()=>{g("buttonpressed",_.selected.value)};return(I,$)=>{var W,ee,R;return E.openBlock(),E.createElementBlock("div",D6t,[E.createVNode(JM,{id:I.id,label:I.label,options:I.options,selected:(W=I.selected.value)==null?void 0:W.id,btnextraclass:"ddb-dropdown-btn",onSelected:T},null,8,["id","label","options","selected"]),E.createElementVNode("button",{type:"button",class:"btn btn-primary ddb-button",disabled:!((ee=_.selected)!=null&&ee.value)||((R=_.selected)==null?void 0:R.value.id)=="",onClick:A},[E.createElementVNode("span",P6t,[E.createTextVNode(E.toDisplayString(I.btnlabel),1),E.createElementVNode("i",{class:E.normalizeClass(I.icon)},null,2)])],8,A6t)])}}}),N6t=["id"],I6t=["disabled"],O6t={class:"ddcb-label"},F6t=["id"],M6t={class:"ddcb-item-list"},Rne=E.defineComponent({__name:"DropDownCheckBox",props:{id:{},label:{},selectedIds:{},options:{},opentop:{type:Boolean},disableFilter:{type:Boolean},filterevent:{type:Boolean},disabled:{type:Boolean},btnextraclass:{}},emits:["selected","filtered"],setup(l,{emit:f}){const _=l;E.watch(_.options,()=>{_.filterevent&&(Ge.value=_.options.value)}),E.watch(()=>_.selectedIds,()=>{g=_.selectedIds?_.selectedIds:[],R()}),E.watch(()=>_.label,()=>{R()});let g=[];g=_.selectedIds?_.selectedIds:[];const T=f,A=Ot=>{Ot?$.value=Ot.label:$.value=_.label,T("selected",g)},I="törlés",$=E.ref(""),W=E.ref(null);E.watch(()=>W.value,()=>{W.value&&document.getElementById(W.value.id).scrollIntoView()});const ee=()=>{if(g.length==0)$.value=_.label;else if(g.length==1){const Ot=_.options.value.filter(zr=>g.includes(zr.id)).map(zr=>zr.label);$.value=Ot[0]}else $.value=`${g.length}db kiválasztva`},R=()=>{if(_.options.value&&_.selectedIds){_.options.value.filter(zr=>zr.id==_.selectedIds.find(Kr=>Kr==zr.id)).length==0&&Be(""),ee();return}},le=Ot=>{const zr=()=>W?Ge.value.indexOf(W.value,0):-1,Kr=document.getElementById(`${_.id}-clear-btn`);if(Kr==Ot.target&&Ot.key=="ArrowDown"){sr.value.focus(),W.value=Ge.value[0];return}if(sr.value&&sr.value==Ot.target){if(Ot.key=="ArrowUp"){const nr=zr();if(nr<1){Kr&&Kr.focus();return}W.value=Ge.value[nr-1];return}if(Ot.key=="ArrowDown"){const nr=zr();if(nr>=Ge.value.length-1)return;W.value=Ge.value[nr+1];return}if(Ot.key=="Enter"){if(!W.value)return;g.push(W.value.id),A(W.value),St.value=="block"&&(St.value="none");return}}},te=()=>{St.value=="block"&&(St.value="none")};E.onMounted(()=>{_.label&&($.value=_.label),R(),_e="",document.addEventListener("click",te),at(),document.addEventListener("keydown",le)}),E.onUnmounted(()=>{document.removeEventListener("keydown",le),document.removeEventListener("click",te)});let _e="";const Be=Ot=>{_e=Ot,_.filterevent?T("filtered",Ot):Ot==""?Ge.value=_.options.value:Ge.value=_.options.value.filter(zr=>zr.label.toLowerCase().includes(Ot.toLowerCase()))},Ge=E.ref([]),et=()=>{g=[],T("selected",g),A(null),Be("")},gt=()=>{setTimeout(()=>{St.value="block"},10),setTimeout(at,20)},at=()=>{const Ot=dt.value,zr=nt.value;_.opentop?zr.style.top=Ot.getBoundingClientRect().y-zr.offsetHeight+"px":(zr.style.top=Ot.getBoundingClientRect().y+Ot.offsetHeight+"px",Ot.getBoundingClientRect().y-zr.getBoundingClientRect().y!=-Ot.offsetHeight&&(zr.style.top=parseInt(zr.style.top.substring(0,zr.style.top.length-2))+(Ot.getBoundingClientRect().y-zr.getBoundingClientRect().y)+Ot.offsetHeight+"px")),sr.value&&sr.value.focus()},dt=E.ref(null),nt=E.ref(null),St=E.ref("none"),sr=E.ref(null),$t=(Ot,zr)=>{Ot.checked?g.push(zr.id):g=g.filter(Kr=>Kr!=zr.id),ee(),T("selected",g)},_r=Ot=>g.includes(Ot.id);return(Ot,zr)=>(E.openBlock(),E.createElementBlock("div",{id:Ot.id,class:"ddcb-flex"},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:dt,class:E.normalizeClass(["btn btn-outline-secondary ddcb-toggle ddcb-flex",Ot.btnextraclass]),type:"button",disabled:Ot.disabled,onClick:zr[0]||(zr[0]=()=>{Be(E.unref(_e)),gt()})},[E.createElementVNode("div",O6t,E.toDisplayString($.value),1)],10,I6t),E.createElementVNode("div",{class:"ddcb-menu",style:E.normalizeStyle({display:St.value}),ref_key:"DropDownMenu",ref:nt},[$.value!=_.label?(E.openBlock(),E.createElementBlock("button",{key:0,id:`${Ot.id}-clear-btn`,type:"button",class:"btn btn-outline-secondary ddcb-button",onClick:zr[1]||(zr[1]=Kr=>et())},E.toDisplayString(I),8,F6t)):E.createCommentVNode("",!0),Ot.disableFilter?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("input",{key:1,ref_key:"ddSearch",ref:sr,type:"text ",class:"form-control",placeholder:"keresés",onInput:zr[2]||(zr[2]=Kr=>Be(Kr.target.value)),onClick:zr[3]||(zr[3]=Kr=>Kr.stopPropagation())},null,544)),E.createElementVNode("div",M6t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(Ge.value,Kr=>(E.openBlock(),E.createBlock(OM,{label:Kr.label,id:Kr.id,checked:_r(Kr),onChanged:nr=>$t(nr,Kr)},null,8,["label","id","checked","onChanged"]))),256))])],4)],8,N6t))}});function GVe(l){return E.getCurrentScope()?(E.onScopeDispose(l),!0):!1}function gSe(){const l=new Set,f=A=>{l.delete(A)};return{on:A=>{l.add(A);const I=()=>f(A);return GVe(I),{off:I}},off:f,trigger:(...A)=>Promise.all(Array.from(l).map(I=>I(...A))),clear:()=>{l.clear()}}}const YVe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const L6t=()=>{};function hSe(...l){if(l.length!==1)return E.toRef(...l);const f=l[0];return typeof f=="function"?E.readonly(E.customRef(()=>({get:f,set:L6t}))):E.ref(f)}function Cze(l,f=!1,_="Timeout"){return new Promise((g,T)=>{setTimeout(f?()=>T(_):g,l)})}function R6t(l,...f){return f.some(_=>_ in l)}function nTe(l,f=!1){function _(le,{flush:te="sync",deep:_e=!1,timeout:Be,throwOnTimeout:Ge}={}){let et=null;const at=[new Promise(dt=>{et=E.watch(l,nt=>{le(nt)!==f&&(et?et():E.nextTick(()=>et==null?void 0:et()),dt(nt))},{flush:te,deep:_e,immediate:!0})})];return Be!=null&&at.push(Cze(Be,Ge).then(()=>E.toValue(l)).finally(()=>et==null?void 0:et())),Promise.race(at)}function g(le,te){if(!E.isRef(le))return _(nt=>nt===le,te);const{flush:_e="sync",deep:Be=!1,timeout:Ge,throwOnTimeout:et}=te??{};let gt=null;const dt=[new Promise(nt=>{gt=E.watch([l,le],([St,sr])=>{f!==(St===sr)&&(gt?gt():E.nextTick(()=>gt==null?void 0:gt()),nt(St))},{flush:_e,deep:Be,immediate:!0})})];return Ge!=null&&dt.push(Cze(Ge,et).then(()=>E.toValue(l)).finally(()=>(gt==null||gt(),E.toValue(l)))),Promise.race(dt)}function T(le){return _(te=>!!te,le)}function A(le){return g(null,le)}function I(le){return g(void 0,le)}function $(le){return _(Number.isNaN,le)}function W(le,te){return _(_e=>{const Be=Array.from(_e);return Be.includes(le)||Be.includes(E.toValue(le))},te)}function ee(le){return R(1,le)}function R(le=1,te){let _e=-1;return _(()=>(_e+=1,_e>=le),te)}return Array.isArray(E.toValue(l))?{toMatch:_,toContains:W,changed:ee,changedTimes:R,get not(){return nTe(l,!f)}}:{toMatch:_,toBe:g,toBeTruthy:T,toBeNull:A,toBeNaN:$,toBeUndefined:I,changed:ee,changedTimes:R,get not(){return nTe(l,!f)}}}function j6t(l){return nTe(l)}function B6t(l,f,_={}){const{immediate:g=!0,immediateCallback:T=!1}=_,A=E.shallowRef(!1);let I;function $(){I&&(clearTimeout(I),I=void 0)}function W(){A.value=!1,$()}function ee(...R){T&&l(),$(),A.value=!0,I=setTimeout(()=>{A.value=!1,I=void 0,l(...R)},E.toValue(f))}return g&&(A.value=!0,YVe&&ee()),GVe(W),{isPending:E.shallowReadonly(A),start:ee,stop:W}}const $6t=YVe?window:void 0,J6t={json:"application/json",text:"text/plain"};function mne(l){return l&&R6t(l,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const z6t=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function q6t(l){return z6t.test(l)}function Xq(l){return typeof Headers<"u"&&l instanceof Headers?Object.fromEntries(l.entries()):l}function pM(l,...f){return l==="overwrite"?async _=>{let g;for(let T=f.length-1;T>=0;T--)if(f[T]!=null){g=f[T];break}return g?{..._,...await g(_)}:_}:async _=>{for(const g of f)g&&(_={..._,...await g(_)});return _}}function V6t(l={}){const f=l.combination||"chain",_=l.options||{},g=l.fetchOptions||{};function T(A,...I){const $=E.computed(()=>{const R=E.toValue(l.baseUrl),le=E.toValue(A);return R&&!q6t(le)?W6t(R,le):le});let W=_,ee=g;return I.length>0&&(mne(I[0])?W={...W,...I[0],beforeFetch:pM(f,_.beforeFetch,I[0].beforeFetch),afterFetch:pM(f,_.afterFetch,I[0].afterFetch),onFetchError:pM(f,_.onFetchError,I[0].onFetchError)}:ee={...ee,...I[0],headers:{...Xq(ee.headers)||{},...Xq(I[0].headers)||{}}}),I.length>1&&mne(I[1])&&(W={...W,...I[1],beforeFetch:pM(f,_.beforeFetch,I[1].beforeFetch),afterFetch:pM(f,_.afterFetch,I[1].afterFetch),onFetchError:pM(f,_.onFetchError,I[1].onFetchError)}),U6t($,ee,W)}return T}function U6t(l,...f){var _,g;const T=typeof AbortController=="function";let A={},I={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const $={method:"GET",type:"text",payload:void 0};f.length>0&&(mne(f[0])?I={...I,...f[0]}:A=f[0]),f.length>1&&mne(f[1])&&(I={...I,...f[1]});const{fetch:W=(g=(_=$6t)==null?void 0:_.fetch)!=null?g:globalThis==null?void 0:globalThis.fetch,initialData:ee,timeout:R}=I,le=gSe(),te=gSe(),_e=gSe(),Be=E.shallowRef(!1),Ge=E.shallowRef(!1),et=E.shallowRef(!1),gt=E.shallowRef(null),at=E.shallowRef(null),dt=E.shallowRef(null),nt=E.shallowRef(ee||null),St=E.computed(()=>T&&Ge.value);let sr,$t;const _r=hn=>{T&&(sr==null||sr.abort(hn),sr=new AbortController,sr.signal.onabort=()=>et.value=!0,A={...A,signal:sr.signal})},Ot=hn=>{Ge.value=hn,Be.value=!hn};R&&($t=B6t(_r,R,{immediate:!1}));let zr=0;const Kr=async(hn=!1)=>{var sn,_n;_r(),Ot(!0),dt.value=null,gt.value=null,et.value=!1,zr+=1;const qi=zr,Oi={method:$.method,headers:{}},ua=E.toValue($.payload);if(ua){const hi=Xq(Oi.headers),Fi=Object.getPrototypeOf(ua);!$.payloadType&&ua&&(Fi===Object.prototype||Array.isArray(Fi))&&!(ua instanceof FormData)&&($.payloadType="json"),$.payloadType&&(hi["Content-Type"]=(sn=J6t[$.payloadType])!=null?sn:$.payloadType),Oi.body=$.payloadType==="json"?JSON.stringify(ua):ua}let ts=!1;const Rn={url:E.toValue(l),options:{...Oi,...A},cancel:()=>{ts=!0}};if(I.beforeFetch&&Object.assign(Rn,await I.beforeFetch(Rn)),ts||!W)return Ot(!1),Promise.resolve(null);let _i=null;return $t&&$t.start(),W(Rn.url,{...Oi,...Rn.options,headers:{...Xq(Oi.headers),...Xq((_n=Rn.options)==null?void 0:_n.headers)}}).then(async hi=>{if(at.value=hi,gt.value=hi.status,_i=await hi.clone()[$.type](),!hi.ok)throw nt.value=ee||null,new Error(hi.statusText);return I.afterFetch&&({data:_i}=await I.afterFetch({data:_i,response:hi,context:Rn,execute:Kr})),nt.value=_i,le.trigger(hi),hi}).catch(async hi=>{let Fi=hi.message||hi.name;if(I.onFetchError&&({error:Fi,data:_i}=await I.onFetchError({data:_i,error:hi,response:at.value,context:Rn,execute:Kr})),dt.value=Fi,I.updateDataOnError&&(nt.value=_i),te.trigger(hi),hn)throw hi;return null}).finally(()=>{qi===zr&&Ot(!1),$t&&$t.stop(),_e.trigger(null)})},nr=hSe(I.refetch);E.watch([nr,hSe(l)],([hn])=>hn&&Kr(),{deep:!0});const Ai={isFinished:E.readonly(Be),isFetching:E.readonly(Ge),statusCode:gt,response:at,error:dt,data:nt,canAbort:St,aborted:et,abort:_r,execute:Kr,onFetchResponse:le.on,onFetchError:te.on,onFetchFinally:_e.on,get:ii("GET"),put:ii("PUT"),post:ii("POST"),delete:ii("DELETE"),patch:ii("PATCH"),head:ii("HEAD"),options:ii("OPTIONS"),json:Qn("json"),text:Qn("text"),blob:Qn("blob"),arrayBuffer:Qn("arrayBuffer"),formData:Qn("formData")};function ii(hn){return(sn,_n)=>{if(!Ge.value)return $.method=hn,$.payload=sn,$.payloadType=_n,E.isRef($.payload)&&E.watch([nr,hSe($.payload)],([qi])=>qi&&Kr(),{deep:!0}),{...Ai,then(qi,Oi){return Dt().then(qi,Oi)}}}}function Dt(){return new Promise((hn,sn)=>{j6t(Be).toBe(!0).then(()=>hn(Ai)).catch(sn)})}function Qn(hn){return()=>{if(!Ge.value)return $.type=hn,{...Ai,then(sn,_n){return Dt().then(sn,_n)}}}}return I.immediate&&Promise.resolve().then(()=>Kr()),{...Ai,then(hn,sn){return Dt().then(hn,sn)}}}function W6t(l,f){return!l.endsWith("/")&&!f.startsWith("/")?`${l}/${f}`:l.endsWith("/")&&f.startsWith("/")?`${l.slice(0,-1)}${f}`:`${l}${f}`}const XVe=l=>/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/.test(l);class jne{constructor(f,_,g){qf(this,"title");qf(this,"message");qf(this,"errorCode");this.title=f,this.message=_,this.errorCode=g}}var Kk=(l=>(l[l.GET=0]="GET",l[l.GET_TEXT=1]="GET_TEXT",l[l.POST=2]="POST",l[l.POST_TEXT=3]="POST_TEXT",l[l.PUT=4]="PUT",l[l.PUT_TEXT=5]="PUT_TEXT",l[l.PATCH=6]="PATCH",l[l.DELETE=7]="DELETE",l))(Kk||{});class q6{constructor(f,_,g,T,A="application/json",I){qf(this,"fetchMethode");this.relativeUrl=_,this.method=g,this.fetchMethode=V6t({baseUrl:f,fetchOptions:{credentials:f.indexOf("localhost")!=-1||XVe(f)?"omit":"include"},options:{immediate:!1,beforeFetch:$=>{A&&($.options.headers={"Content-Type":A}),I&&($.options.headers={...$.options.headers,...I})},onFetchError:$=>{var R;if(((R=$.error)==null?void 0:R.name)==="AbortError")return $;let W="Ismeretlen eredetű hiba!",ee=!$.response;return $.response&&($.response.ok||(ee=!0,W=T.get($.response.status),W||(W=`${Kk[g]} for Call: ${_} with Status: ${$.response.status} has no registered errorMessages!`,console.error(W)))),ee&&window.dispatchEvent(new CustomEvent("fetch-error",{detail:new jne("Hiba a szerver elérése közben...",W)})),$},afterFetch:$=>$}})}}function V6(l,f,_,g){const T={};return T.payload=E.ref(f),T.routeParams=E.ref(_),T.queryParams=E.ref(g),T.isFetching=E.ref(!1),T.data=E.ref(),T.execute=()=>{T.fetch&&T.fetch.canAbort.value&&T.fetch.abort();const A=`${H6t(l.relativeUrl,T.routeParams.value,T.queryParams.value)}`,I=l.fetchMethode(A);let $;const W=I.isFetching;async function ee(){if(R()&&T.successCallback)T.successCallback(T.data.value);else if(!R()&&T.errorCallback){console.log(T.fetch.error.value);let le;if(T.fetch.response.value&&T.fetch.response.value.body){const te=T.fetch.response.value.body.getReader(),{value:_e,done:Be}=await te.read();!Be&&_e&&(le=new TextDecoder().decode(_e),console.log("Response Body:",le))}T.errorCallback(new jne(T.fetch.error.value,le,T.fetch.statusCode.value?T.fetch.statusCode.value:void 0))}T.finallyCallback&&T.finallyCallback()}function R(){return T.fetch.statusCode&&T.fetch.statusCode.value>=200&&T.fetch.statusCode.value<=299}switch(l.method){case 0:$=I.get().json().data;break;case 1:$=I.get().text().data;break;case 4:$=I.put(T.payload).json().data;break;case 5:$=I.put(T.payload).text().data;break;case 3:$=I.post(T.payload).text().data;break;case 2:$=I.post(T.payload).json().data;break;case 6:$=I.patch(T.payload).json().data;break;case 7:$=I.delete(T.payload).json().data;break;default:throw new Error(`Method: ${l.method} is not implemented!`)}E.watch($,le=>{T.data.value=le}),E.watch(W,le=>{T.isFetching.value=le,le||ee()}),T.fetch=I,I.execute()},T}function H6t(l,f,_){let g=l;return g||(g=""),g.slice(-1)==="/"&&(g=g.substring(0,g.length-1)),f&&Object.keys(f).forEach(T=>{if(g.indexOf(`{${T}}`)===-1)throw window.dispatchEvent(new CustomEvent("fetch-error",{detail:new jne("Hiba!",`RouteParams: ${T} not found in url: ${g}! Contact the developers!`)})),new Error(`RouteParams: ${T} not found in url: ${g}! Contact the developers!`);const A=f[T];g=g.replace(`{${T}}`,A)}),_&&(g.indexOf("?")===-1&&(g+="?"),Object.keys(_).forEach(T=>{const A=_[T];g+=`${T}=${A}`})),g}const G6t=l=>{if(l=="NaN-NaN-NaN"||!l)return null;const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")}`},Y6t=l=>{if(!l)return"-";const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")} ${f.getHours()}:${f.getMinutes()}`},X6t=l=>{if(!l)return"-";const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")} ${f.getHours().toString().padStart(2,"0")}:${f.getMinutes().toString().padStart(2,"0")}`},Q6t=l=>{if(!l)return"-";const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")}`},Z6t=l=>{const f=new Date(Date.parse(l)),_=f.getUTCFullYear(),g=String(f.getUTCMonth()+1).padStart(2,"0"),T=String(f.getUTCDate()).padStart(2,"0"),A=String(f.getUTCHours()).padStart(2,"0"),I=String(f.getUTCMinutes()).padStart(2,"0"),$=String(f.getUTCSeconds()).padStart(2,"0");return`${_}-${g}-${T}T${A}:${I}:${$}Z`},K6t=l=>{const f=new Date(Date.parse(l)),_=f.getUTCFullYear(),g=String(f.getUTCMonth()+1).padStart(2,"0"),T=String(f.getUTCDate()).padStart(2,"0");return`${_}-${g}-${T}`},eAt=l=>{const f=new Date(Date.parse(l)),_=f.getFullYear(),g=String(f.getMonth()+1).padStart(2,"0"),T=String(f.getDate()).padStart(2,"0");return`${_}-${g}-${T}`},QVe=l=>{if(!l)return null;const f=new Date(l);if(isNaN(f))return null;const _=f.getFullYear(),g=String(f.getMonth()+1).padStart(2,"0"),T=String(f.getDate()).padStart(2,"0"),A=String(f.getHours()).padStart(2,"0"),I=String(f.getMinutes()).padStart(2,"0");return`${_}-${g}-${T} ${A}:${I}`},sV=l=>{if(!l)return null;const f=new Date(l);if(isNaN(f))return null;const _=f.getFullYear(),g=String(f.getMonth()+1).padStart(2,"0"),T=String(f.getDate()).padStart(2,"0");return`${_}-${g}-${T}`},gne=(l,f=!1)=>{if(!l)return null;const _=new Date(l);if(isNaN(_))return null;if(f)return sV(_)+"T00:00:00.000Z";const g=_.getUTCFullYear(),T=String(_.getUTCMonth()+1).padStart(2,"0"),A=String(_.getUTCDate()).padStart(2,"0"),I=String(_.getUTCHours()).padStart(2,"0"),$=String(_.getUTCMinutes()).padStart(2,"0"),W=String(_.getUTCSeconds()).padStart(2,"0");return`${g}-${T}-${A}T${I}:${$}:${W}.000Z`},tAt=(l,f=500)=>{let _;return()=>{clearTimeout(_),_=setTimeout(()=>{l()},f)}};function ZVe(l){return new KVe(l)}class KVe{constructor(f){qf(this,"baseUrl");qf(this,"searchPosts");qf(this,"partnersDetailsByIds");qf(this,"whoAmI");qf(this,"getPostsConfig");qf(this,"getImagesConfig");qf(this,"getPresenceConfig");qf(this,"sites");qf(this,"getMeta");this.articleEditorBackendUrl=f,this.baseUrl=this.articleEditorBackendUrl,this.getMeta=V6(new q6(this.baseUrl,"admin/Embeds/meta",Kk.POST,new Map([[400,"Meta lekérdezése ismeretlen hiba!"],[500,"Meta lekérdezése ismeretlen hiba!"]])),{url:""},void 0,void 0),this.searchPosts=V6(new q6(this.baseUrl,"admin/Posts/searchPosts",Kk.POST,new Map([[400,"Cikkek lekérdezése ismeretlen hiba!"],[500,"Cikkek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0),this.partnersDetailsByIds=V6(new q6(this.baseUrl,"api/Partners/detailsByIds",Kk.POST,new Map([[400,"BrandChannelek lekérdezése ismeretlen hiba!"],[500,"BrandChannelek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0),this.whoAmI=V6(new q6(this.baseUrl,"whoami",Kk.GET,new Map([[400,"Felhasználói adatok lekérdezése ismeretlen hiba!"],[500,"Felhasználói adatok lekérdezése ismeretlen hiba!"]])),void 0,void 0,void 0),this.getPostsConfig=V6(new q6(this.baseUrl,"/admin/Widgets/{name}",Kk.GET,new Map([[400,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getImagesConfig=V6(new q6(this.baseUrl,"/admin/Widgets/{name}",Kk.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getPresenceConfig=V6(new q6(this.baseUrl,"/admin/Widgets/{name}",Kk.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.sites=V6(new q6(this.baseUrl,"/admin/sites",Kk.GET,new Map([[400,"Site lekérése ismeretlen hiba!"],[500,"Site lekérése ismeretlen hiba!"]])),void 0,void 0,void 0)}}let Rre=null,Nq=[],Td=!1;function rAt(){if(Rre)return Td&&console.debug("[currentUserInfo] Returning existing store instance"),Rre;Td&&console.debug("[currentUserInfo] Creating new store instance");const l=E.ref(null),f=E.ref("loading"),_=E.ref(null),g=E.ref(null),T=E.computed(()=>f.value==="loading"),A=E.computed(()=>f.value==="authenticated"&&l.value!==null),I=E.computed(()=>{var Be;return((Be=l.value)==null?void 0:Be.displayName)??""}),$=E.computed(()=>{var Be;return((Be=l.value)==null?void 0:Be.email)??""}),W=E.computed(()=>{var Be;return((Be=l.value)==null?void 0:Be.roles)??[]});async function ee(Be,Ge){Td=Ge??!1,Td&&console.debug("[currentUserInfo] initialize() called",{backendUrl:Be}),Td&&console.debug("[currentUserInfo] Starting initialization"),g.value=Be,f.value="loading",_.value=null;try{const et=ZVe(Be);await new Promise((gt,at)=>{(et.baseUrl.indexOf("localhost")!=-1||XVe(et.baseUrl))&&(Td&&console.debug("[currentUserInfo] Localhost/IP detected, using dev credentials"),l.value={displayName:"developer",email:"developer@hvg.hu",roles:["devadmin"],id:"00000000-0000-0000-0000-000000000000"},f.value="authenticated",gt()),et.whoAmI.successCallback=dt=>{var nt;Td&&console.debug("[currentUserInfo] whoAmI success",{displayName:dt.displayName,email:dt.email,rolesCount:((nt=dt.roles)==null?void 0:nt.length)??0}),l.value=dt,f.value="authenticated",gt()},et.whoAmI.errorCallback=dt=>{Td&&console.error("[currentUserInfo] whoAmI failed:",dt),_.value=dt.message??"Ismeretlen hiba történt",f.value="error",at(new Error(_.value))},Td&&console.debug("[currentUserInfo] Executing whoAmI request"),et.whoAmI.execute()}),await new Promise((gt,at)=>{et.sites.successCallback=dt=>{Td&&console.debug("[currentUserInfo] sites fetch success",{sitesCount:dt.length}),Nq=dt,gt()},et.sites.errorCallback=dt=>{Td&&console.error("[currentUserInfo] sites fetch failed:",dt),at(new Error(dt.message??"Ismeretlen hiba történt"))},Td&&console.debug("[currentUserInfo] Executing sites request"),et.sites.execute()}),Td&&console.debug("[currentUserInfo] Initialization completed successfully")}catch(et){throw Td&&console.error("[currentUserInfo] initialize failed:",et),f.value="error",_.value||(_.value="Felhasználói adatok vagy site-ok lekérése sikertelen"),et}}function R(){Td&&console.debug("[currentUserInfo] clear() called, resetting all state"),l.value=null,f.value="loading",_.value=null,g.value=null,Nq=[]}function le(Be,Ge,et){var at;if(Td&&console.debug("[currentUserInfo] hasPermission() check",{siteId:Be,entityName:Ge,accessLevel:et}),!((at=l.value)!=null&&at.roles)||l.value.roles.length===0)return Td&&console.debug("[currentUserInfo] hasPermission() denied: no roles"),!1;if(l.value.roles.includes("devadmin"))return Td&&console.debug("[currentUserInfo] hasPermission() granted: devadmin role"),!0;const gt=et==="admin"?["admin"]:["reader","admin"];for(const dt of gt){const nt=`cms-${Be}-${Ge}-${dt}`;if(l.value.roles.includes(nt))return Td&&console.debug("[currentUserInfo] hasPermission() granted: specific role",nt),!0;const St=`cms-${Be}-all-${dt}`;if(l.value.roles.includes(St))return Td&&console.debug("[currentUserInfo] hasPermission() granted: all-entity role",St),!0}return Td&&console.debug("[currentUserInfo] hasPermission() denied: no matching roles"),!1}function te(Be,Ge){if(Td&&console.debug("[currentUserInfo] getMixableSitesForResource() called",{entityName:Be,currentSiteId:Ge}),!g.value)throw Td&&console.error("[currentUserInfo] getMixableSitesForResource called before initialize"),new Error("Store nincs inicializálva. Hívd meg előbb az initialize() metódust!");const et=Nq.find(at=>at.id===Ge);Td&&console.debug("[currentUserInfo] Current site lookup",{found:!!et,totalSites:Nq.length});const gt=[];return Nq.forEach(at=>{if(et===void 0){if(!le(at.id,Be,"reader"))return;gt.push(at)}else{if(et.entities.find(dt=>dt.type===Be&&dt.allowedSiteIds.includes(at.id))===void 0||!le(at.id,Be,"reader"))return;gt.push(at)}}),Td&&console.debug("[currentUserInfo] getMixableSitesForResource() result",{mixableCount:gt.length,mixableSiteIds:gt.map(at=>at.id)}),gt}function _e(Be,Ge){return Td&&console.debug("[currentUserInfo] getMixableSiteIdsForResource() called",{entityName:Be,currentSiteId:Ge}),te(Be,Ge).map(gt=>gt.id)}return Rre={user:l,state:f,error:_,isLoading:T,isAuthenticated:A,displayName:I,email:$,roles:W,initialize:ee,clear:R,hasPermission:le,getMixableSitesForResource:te,getMixableSiteIdsForResource:_e},Rre}const nAt=()=>{var l;return(l=window.cmsContext)==null?void 0:l.currentSite},iAt={class:"d-flex flex-column w-100 gap-2"},aAt={class:"d-flex flex-row justify-content-between p-2"},sAt={key:0,class:"d-flex flex-column gap-2"},oAt={class:"d-flex flex-row justify-content-between"},cAt={class:"d-flex flex-row justify-content-between"},lAt=["onClick"],uAt={key:0,class:"d-flex flex-row gap-3"},fAt={class:"d-flex flex-column w-100"},_At=["disabled","value"],pAt=["disabled","value"],dAt={class:"d-flex gap-2"},mAt={key:1,class:"d-flex justify-content-around flex-wrap gap-4 p-2"},gAt=["onClick"],hAt={key:2,class:"d-flex justify-content-around flex-wrap gap-4 p-2 cc-years"},vAt=["onClick"],JTe=E.defineComponent({__name:"CalendarComponent",props:{init:{},dateOnly:{type:Boolean}},emits:["changed"],setup(l,{emit:f}){const _=l,g=f,T=E.ref([]),A=E.ref(["H","K","Sz","Cs","P","Sz","V"]),I=E.ref(["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"]),$=E.ref([2025]),W=E.ref(""),ee=E.ref(2025),R=E.ref({local:null,utc:null}),le=E.ref(new Date),te=E.ref("00"),_e=E.ref("00"),Be=E.ref(!1),Ge=E.ref("calendar");E.onMounted(()=>{et(_.init?_.init:null),gt(_.init?_.init:new Date)});const et=dt=>{if(dt){if(dt.setSeconds(0),_.dateOnly){const nt=new Date(dt);nt.setHours(0),nt.setMinutes(0),nt.setSeconds(0),R.value.local=nt,te.value="00",_e.value="00",R.value.utc=gne(nt,!0)}else R.value.local=new Date(dt),te.value=dt.getHours().toString().padStart(2,"0"),_e.value=dt.getMinutes().toString().padStart(2,"0"),R.value.utc=gne(dt);Be.value=!0}else te.value="00",_e.value="00",R.value={local:null,utc:null},Be.value=!1},gt=dt=>{let nt=new Date(dt);nt.setSeconds(0),le.value=new Date(nt),W.value=I.value[nt.getMonth()],ee.value=nt.getFullYear(),$.value=Array.from({length:60},(nr,Ai)=>nt.getFullYear()-29+Ai);const St=nt.getMonth();nt.setDate(1);const sr=[{days:[]}];let $t=sr[0],_r=1;const Ot=nr=>nr.getDay()==0?6:nr.getDay()-1;let zr=Ot(nt);for(let nr=0;nr<zr;nr++)$t.days.push({label:"",isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:nr});const Kr=new Date;for(;nt.getMonth()===St;)zr=Ot(nt),zr==0&&($t={days:[]},sr.push($t)),$t.days.push({label:_r.toString(),isCurrent:nt.getFullYear()==Kr.getFullYear()&&nt.getMonth()==Kr.getMonth()&&nt.getDate()==Kr.getDate(),isSelected:R.value.local?R.value.local.getFullYear()==nt.getFullYear()&&R.value.local.getMonth()==nt.getMonth()&&R.value.local.getDate()==nt.getDate():!1,isWeekend:zr==5||zr==6,isBlank:!1,number:_r}),_r++,nt.setDate(nt.getDate()+1);for(zr=Ot(nt);zr!=6;)$t.days.push({label:_r.toString(),isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:0}),nt.setDate(nt.getDate()+1),zr=Ot(nt);T.value=sr},at=()=>{let dt=new Date;dt.setHours(0),dt.setMinutes(0),dt.setSeconds(0),et(null),gt(dt),g("changed",R.value)};return(dt,nt)=>(E.openBlock(),E.createElementBlock("div",iAt,[E.createElementVNode("div",aAt,[E.createElementVNode("div",{class:"cc-btn",onClick:nt[0]||(nt[0]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()-1),gt(St)})}," < "),E.createElementVNode("div",{class:"cc-btn",onClick:nt[1]||(nt[1]=St=>Ge.value="years")},E.toDisplayString(ee.value),1),E.createElementVNode("div",{class:"cc-btn",onClick:nt[2]||(nt[2]=St=>Ge.value="months")},E.toDisplayString(W.value),1),E.createElementVNode("div",{class:"cc-btn",onClick:nt[3]||(nt[3]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()+1),gt(St)})}," > ")]),Ge.value=="calendar"?(E.openBlock(),E.createElementBlock("div",sAt,[E.createElementVNode("div",oAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(A.value,St=>(E.openBlock(),E.createElementBlock("div",null,E.toDisplayString(St),1))),256))]),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(T.value,St=>(E.openBlock(),E.createElementBlock("div",cAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(St.days,sr=>(E.openBlock(),E.createElementBlock("div",{class:E.normalizeClass(["d-flex flex-row justify-content-center cc-day",{"cc-day-weekend":sr.isWeekend,"cc-day-blank":sr.isBlank,"cc-day-current":sr.isCurrent,"cc-day-selected":sr.isSelected}]),onClick:()=>{let $t=new Date(le.value.getFullYear(),le.value.getMonth(),sr.number,Number.parseInt(te.value),Number.parseInt(_e.value));et($t),gt($t)}},E.toDisplayString(sr.label),11,lAt))),256))]))),256)),dt.dateOnly?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",uAt,[E.createElementVNode("div",null,E.toDisplayString(te.value)+":"+E.toDisplayString(_e.value),1),E.createElementVNode("div",fAt,[E.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"23",disabled:!Be.value,value:te.value,onInput:nt[4]||(nt[4]=St=>{R.value.local.setHours(St.target.value),et(R.value.local)})},null,40,_At),E.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"59",disabled:!Be.value,value:_e.value,onInput:nt[5]||(nt[5]=St=>{R.value.local.setMinutes(St.target.value),et(R.value.local)})},null,40,pAt)])])),E.createElementVNode("div",dAt,[E.createElementVNode("button",{type:"button",class:"btn btn-outline-secondary w-100",onClick:at},"Töröl"),E.createElementVNode("button",{type:"button",class:"btn btn-primary w-100",onClick:nt[6]||(nt[6]=St=>g("changed",R.value))},"Beállít")])])):E.createCommentVNode("",!0),Ge.value=="months"?(E.openBlock(),E.createElementBlock("div",mAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(I.value,(St,sr)=>(E.openBlock(),E.createElementBlock("div",{class:"cc-btn-light",onClick:$t=>{let _r=new Date(le.value);_r.setMonth(sr),gt(_r),Ge.value="calendar",$t.stopPropagation()}},E.toDisplayString(St),9,gAt))),256))])):E.createCommentVNode("",!0),Ge.value=="years"?(E.openBlock(),E.createElementBlock("div",hAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList($.value,St=>(E.openBlock(),E.createElementBlock("div",{class:"cc-btn-light",onClick:sr=>{let $t=new Date(le.value);$t.setFullYear(St),gt($t),Ge.value="calendar",sr.stopPropagation()}},E.toDisplayString(St),9,vAt))),256))])):E.createCommentVNode("",!0)]))}}),yAt={class:"d-flex flex-column flex-md-row gap-2"},bAt={class:"d-flex flex-row gap-2 w-100"},SAt={class:"vf-input-group"},TAt={key:0,class:"vf-floating-wrapper"},xAt={class:"vf-floating-label vf-floating-label-visible vf-floating-label-success"},kAt=["value","placeholder"],oV=E.defineComponent({__name:"DateTimePicker",props:{placeholder:{},initial:{},dateOnly:{type:Boolean}},emits:["changed","calendar"],setup(l,{emit:f}){const _=l,g=f,T=E.ref(null),A=E.ref(null),I=E.ref(""),$=E.ref(null),W=E.ref(null);E.onMounted(()=>{_.initial&&(T.value=_.initial.local,A.value=_.initial.utc,ee())});const ee=()=>{const _e=_.dateOnly?sV(T.value):QVe(T.value);I.value=_e??""},R=E.ref(!1),le=_e=>{R.value?R.value=!1:(R.value=!0,E.nextTick(()=>{const Be=W.value,et=$.value.getBoundingClientRect();Be.style.left=et.left+window.scrollX+"px",Be.style.top=et.top+window.scrollY+et.height+"px"})),_e&&_e.stopPropagation()},te=_e=>{const Be=new Date(Date.parse(_e)),Ge=gne(Be,_.dateOnly);if(!Ge){A.value=null,E.nextTick(()=>A.value="");return}A.value=Ge,T.value=Be,ee(),g("changed",{local:T.value,utc:A.value})};return E.watch(R,()=>{g("calendar",R.value)}),(_e,Be)=>(E.openBlock(),E.createElementBlock("div",yAt,[E.createElementVNode("div",bAt,[E.createElementVNode("div",SAt,[A.value?(E.openBlock(),E.createElementBlock("div",TAt,[E.createElementVNode("span",xAt,E.toDisplayString(_e.placeholder),1)])):E.createCommentVNode("",!0),E.createElementVNode("input",{type:"text",id:"dateTimeInputText",ref_key:"dateTimeInputTextRef",ref:$,class:"vf-input-field",value:I.value,onChange:Be[0]||(Be[0]=Ge=>te(Ge.target.value)),placeholder:_e.placeholder},null,40,kAt)]),E.createElementVNode("div",{ref:"iconBtn",class:"dateTime-picker__iconbtn",onClick:le},[...Be[2]||(Be[2]=[E.createElementVNode("i",{class:"fa-regular fa-calendar"},null,-1)])],512)]),R.value?(E.openBlock(),E.createElementBlock("div",{key:0,ref_key:"calendarRef",ref:W,class:"dateTime-picker__popup"},[E.createVNode(JTe,{init:T.value,dateOnly:_e.dateOnly,onChanged:Be[1]||(Be[1]=Ge=>{T.value=Ge.local,A.value=Ge.utc,le(null),ee(),g("changed",{local:T.value,utc:A.value})})},null,8,["init","dateOnly"])],512)):E.createCommentVNode("",!0)]))}}),CAt={class:"fltrc-container"},EAt={class:"fltrc-container"},wAt=["placeholder","value"],DAt={key:1,class:"d-flex flex-row input-group align-items-center"},AAt=["value"],PAt=["value"],zTe=E.defineComponent({__name:"FilterCompact",props:{items:{}},setup(l){const f=l,_=E.ref(0),g=E.ref(0),T=E.computed(()=>f.items[_.value].filter),A=R=>{let le=f.items[g.value];le.filter.filtered(le.filter.key,""),_.value=R,g.value=R,ee.value+=1},I=E.ref(void 0);E.onMounted(()=>{let R=[];for(let le=0;le<f.items.length;le++)R.push({icon:f.items[le].icon,label:f.items[le].label,command:()=>A(le)});I.value=R});const $=E.ref({}),W=E.ref(void 0),ee=E.ref(0);return(R,le)=>(E.openBlock(),E.createElementBlock("div",CAt,[I.value?(E.openBlock(),E.createBlock(Lne,{key:0,id:"ddm",icon:R.items[_.value].icon,item:R.items[_.value],label:"",options:I.value},null,8,["icon","item","options"])):E.createCommentVNode("",!0),E.createElementVNode("div",EAt,[T.value.type=="text"?(E.openBlock(),E.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:T.value.placeholder,value:T.value.defaultv??"",onInput:le[0]||(le[0]=te=>{T.value.filtered(T.value.key,te.target.value),T.value.defaultv=te.target.value})},null,40,wAt)):E.createCommentVNode("",!0),T.value.type=="date"?(E.openBlock(),E.createElementBlock("div",DAt,[E.createElementVNode("input",{type:"date",class:"form-control",value:T.value.defFrom??"",onInput:le[1]||(le[1]=te=>{$.value.from=te.target.value==""?null:te.target.value,T.value.defFrom=te.target.value==""?null:te.target.value,T.value.filtered(T.value.key,$.value)})},null,40,AAt),le[5]||(le[5]=E.createElementVNode("span",{class:"input-group-text"},"-",-1)),E.createElementVNode("input",{type:"date",class:"form-control",value:T.value.defTil??"",onInput:le[2]||(le[2]=te=>{$.value.until=te.target.value==""?null:te.target.value,T.value.defTil=te.target.value==""?null:te.target.value,T.value.filtered(T.value.key,$.value)})},null,40,PAt)])):E.createCommentVNode("",!0),T.value.type=="dropdown"?(E.openBlock(),E.createBlock(JM,{key:ee.value,selected:W.value,options:T.value.options,filterevent:T.value.filterevent,onFiltered:le[3]||(le[3]=te=>{T.value.onfiltered&&T.value.onfiltered(te)}),id:T.value.key,label:T.value.label,onSelected:le[4]||(le[4]=te=>T.value.filtered(T.value.key,te.id))},null,8,["selected","options","filterevent","id","label"])):E.createCommentVNode("",!0)])]))}}),NAt=["id"],IAt={class:"dtrp-label"},OAt="Törlés",FAt="Beállítás",MAt=E.defineComponent({__name:"DateRangePicker",props:{id:{},label:{}},emits:["changed"],setup(l,{emit:f}){const _=l,g=f,T=E.ref(!1),A=async()=>{T.value=!T.value,T.value&&await ee()},I=E.reactive({top:"0px",left:"0px",zIndex:1e3}),$=E.ref(null),W=E.ref(null),ee=async()=>{await E.nextTick();const sr=W.value.getBoundingClientRect(),$t=$.value;if(!$t)return;const _r=$t.getBoundingClientRect(),Ot=window.innerWidth;I.top=sr.top+sr.height+"px",sr.left<Ot/3?I.left=sr.left+"px":sr.left>2*Ot/3?I.left=sr.left+sr.width-_r.width+"px":I.left=sr.right-sr.width/2-_r.width/2+"px"},R=E.reactive({utc:null,local:null}),le=E.reactive({utc:null,local:null}),te=E.ref(""),_e=async()=>{R.local||le.local?te.value=`'${sV(R.local)??""}'-'${sV(le.local)??""}'`:te.value=_.label,await ee()},Be=St=>{const sr=document.getElementById(`${_.id}-popup`);sr&&!sr.contains(St.target)&&(T.value=!1)};let Ge=!1;E.onMounted(()=>{_e()}),E.onUnmounted(()=>{Ge&&window.removeEventListener("click",Be)});const et=()=>{R.utc=null,R.local=null,le.local=null,le.utc=null,_e(),T.value=!1,g("changed",{fromUtc:R.utc,toUtc:le.utc})},gt=()=>{_e(),T.value=!1,g("changed",{fromUtc:R.utc,toUtc:le.utc})},at=()=>{Ge||setTimeout(()=>{window.addEventListener("click",Be),Ge=!0},100)},dt=()=>{Ge&&setTimeout(()=>{window.removeEventListener("click",Be),Ge=!1},100)},nt=St=>{St?dt():at()};return E.watch(T,()=>{T.value?at():dt()}),(St,sr)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",{id:St.id,class:"dtrp-flex"},[E.createElementVNode("button",{ref_key:"popupBtnRef",ref:W,class:"btn btn-outline-secondary dtrp-flex dtrp-button",type:"button",onClick:A},[E.createElementVNode("div",IAt,E.toDisplayString(te.value),1)],512)],8,NAt),T.value?(E.openBlock(),E.createElementBlock("div",{key:0,ref_key:"popupRef",ref:$,class:"dtrp-popup d-flex flex-column gap-2",style:E.normalizeStyle(I)},[E.createVNode(oV,{placeholder:"Ettől",id:St.id+"-from",onChanged:sr[0]||(sr[0]=$t=>{R.local=$t.local,R.utc=$t.utc}),dateOnly:!0,initial:R,onCalendar:nt},null,8,["id","initial"]),E.createVNode(oV,{placeholder:"Eddig",id:St.id+"-to",onChanged:sr[1]||(sr[1]=$t=>{le.local=$t.local,le.utc=$t.utc}),dateOnly:!0,initial:le,onCalendar:nt},null,8,["id","initial"]),E.createElementVNode("div",{class:"d-flex w-100 gap-2"},[E.createElementVNode("button",{class:"btn btn-outline-secondary w-50",onClick:et},E.toDisplayString(OAt)),E.createElementVNode("button",{class:"btn btn-outline-primary w-50",onClick:gt},E.toDisplayString(FAt))])],4)):E.createCommentVNode("",!0)],64))}});class LAt{constructor(f,_){qf(this,"storageKey");qf(this,"allowedItems",[]);qf(this,"compareFn");this.storageKey=f,this.compareFn=_||((g,T)=>g===T)}getSelected(){try{const f=localStorage.getItem(this.storageKey);if(f){const g=JSON.parse(f).filter(T=>this.allowedItems.some(A=>this.compareFn(T,A)));return g.length>0?g:this.allowedItems}}catch(f){console.warn(`Error reading from localStorage key "${this.storageKey}":`,f)}return this.allowedItems}saveSelected(f){const _=f.length>0?f.filter(g=>this.allowedItems.some(T=>this.compareFn(g,T))):this.allowedItems;try{localStorage.setItem(this.storageKey,JSON.stringify(_))}catch(g){console.error(`Error writing to localStorage key "${this.storageKey}":`,g)}return _}updateAllowedItems(f){this.allowedItems=f}getAllowedItems(){return[...this.allowedItems]}}const qTe=E.defineComponent({__name:"SiteIdSelector",props:{entityType:{},label:{},sites:{}},emits:["selected"],setup(l,{emit:f}){const _=l,g=f,T=new LAt(`selectedSiteIds_${_.entityType}`),A=E.ref([]),I=E.ref([]);E.onMounted(()=>{const W=_.sites.map(ee=>ee.id);T.updateAllowedItems(W),I.value=_.sites.map(ee=>({id:`${_.entityType}-${ee.id}`,label:ee.name})),A.value=T.getSelected().map(ee=>`${_.entityType}-${ee}`),$(A.value)});const $=W=>{const ee=W.map(le=>le.replace(`${_.entityType}-`,"")),R=T.saveSelected(ee);ee.length===0?A.value=[]:A.value=R.map(le=>`${_.entityType}-${le}`),g("selected",R)};return(W,ee)=>(E.openBlock(),E.createBlock(Rne,{id:`site-selector-${W.entityType}`,label:W.label,selectedIds:A.value,options:E.ref(I.value),onSelected:$},null,8,["id","label","selectedIds","options"]))}}),RAt={class:"fltrctrl-container"},jAt=["placeholder","value"],BAt={key:1,class:"d-flex flex-row input-group align-items-center"};class $At{constructor(f,_,g){qf(this,"type");this.key=f,this.placeholder=_,this.filtered=g,this.type="text"}}class JAt{constructor(f,_,g,T,A,I,$){qf(this,"type");this.key=f,this.label=_,this.options=g,this.filterevent=T,this.onfiltered=A,this.filtered=I,this.selected=$,this.type="dropdown"}}class zAt{constructor(f,_,g,T,A,I,$){qf(this,"type");this.key=f,this.label=_,this.options=g,this.filterevent=T,this.onfiltered=A,this.filtered=I,this.selectedIds=$,this.type="dropdowncheckbox"}}class qAt{constructor(f,_,g,T,A){qf(this,"type");this.key=f,this.entityType=_,this.label=g,this.sites=T,this.filtered=A,this.type="siteidselector"}}class VAt{constructor(f,_,g,T,A){qf(this,"type");this.key=f,this.label=_,this.filtered=g,this.defFrom=T,this.defTil=A,this.type="date"}}const vSe=E.ref({}),VTe=E.defineComponent({__name:"FilterControl",props:{item:{}},setup(l){const f=l;E.onMounted(()=>{var g;if(f.item.type=="dropdown"){const T=f.item;_.value=(g=T.options.value.find(A=>A.id==f.item.defaultv))==null?void 0:g.id,T.selected&&E.watch(T.selected,()=>{var A,I;_.value=(I=(A=T.selected)==null?void 0:A.value)==null?void 0:I.id})}});const _=E.ref(void 0);return(g,T)=>(E.openBlock(),E.createElementBlock("div",RAt,[g.item.type=="text"?(E.openBlock(),E.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:g.item.placeholder,value:g.item.defaultv??"",onInput:T[0]||(T[0]=A=>g.item.filtered(g.item.key,A.target.value))},null,40,jAt)):E.createCommentVNode("",!0),g.item.type=="date"?(E.openBlock(),E.createElementBlock("div",BAt,[E.createVNode(MAt,{id:g.item.key+"-dtrp",label:g.item.label,onChanged:T[1]||(T[1]=A=>{vSe.value.from=A.fromUtc,vSe.value.until=A.toUtc,g.item.filtered(g.item.key,vSe.value)})},null,8,["id","label"])])):E.createCommentVNode("",!0),g.item.type=="dropdown"?(E.openBlock(),E.createBlock(JM,{key:2,selected:_.value,options:E.ref(g.item.options),filterevent:g.item.filterevent,onFiltered:T[2]||(T[2]=A=>{g.item.onfiltered&&g.item.onfiltered(A)}),id:g.item.key,label:g.item.label,onSelected:T[3]||(T[3]=A=>{g.item.selected&&(g.item.selected.value=g.item.options.value.find(I=>I.id==A.id)),g.item.filtered(g.item.key,A.id)})},null,8,["selected","options","filterevent","id","label"])):E.createCommentVNode("",!0),g.item.type=="dropdowncheckbox"?(E.openBlock(),E.createBlock(Rne,{key:3,selectedIds:g.item.selectedIds,options:E.ref(g.item.options),filterevent:g.item.filterevent,onFiltered:T[4]||(T[4]=A=>{g.item.onfiltered&&g.item.onfiltered(A)}),id:g.item.key,label:g.item.label,onSelected:T[5]||(T[5]=A=>g.item.filtered(g.item.key,A))},null,8,["selectedIds","options","filterevent","id","label"])):E.createCommentVNode("",!0),g.item.type=="siteidselector"?(E.openBlock(),E.createBlock(qTe,{key:4,"entity-type":g.item.entityType,label:g.item.label,sites:g.item.sites,onSelected:T[6]||(T[6]=A=>g.item.filtered(g.item.key,A))},null,8,["entity-type","label","sites"])):E.createCommentVNode("",!0)]))}}),UAt=["title"],R8=E.defineComponent({__name:"IconButton",props:{icon:{},active:{type:Boolean},big:{type:Boolean},title:{}},emits:["click"],setup(l,{emit:f}){const _=l,g=E.computed(()=>`${_.icon} ${_.big?"ib-button-big":""}`),T=f;return(A,I)=>(E.openBlock(),E.createElementBlock("div",{onClick:I[0]||(I[0]=$=>T("click")),class:"ib-container"},[E.createElementVNode("div",{class:E.normalizeClass(["ib-button",{"ib-button-active":A.active}]),title:A.title},[E.createElementVNode("i",{class:E.normalizeClass(g.value)},null,2)],10,UAt)]))}}),WAt={class:"pc-container"},HAt=["value","max"],UTe=E.defineComponent({__name:"PaginatorControl",props:{settings:{}},emits:["pagesize","page"],setup(l,{emit:f}){const _=l,g=f,T=()=>{let ee=E.ref([]);return _.settings.value.sizes.forEach(R=>ee.value.push({label:R.toString(),id:R.toString()})),ee},A=E.ref(1);E.watch(()=>_.settings.value,()=>{A.value=1});const I=E.computed(()=>Math.floor(_.settings.value.total/_.settings.value.pagesize)+1),$=()=>{A.value>1&&(A.value-=1,g("page",A.value))},W=()=>{A.value<I.value&&(A.value+=1,g("page",A.value))};return(ee,R)=>(E.openBlock(),E.createElementBlock("div",WAt,[E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:$},"<"),E.createElementVNode("input",{class:"form-control pc-input",type:"number",value:A.value,min:"1",max:I.value,onChange:R[0]||(R[0]=le=>ee.$emit("page",le.target.value))},null,40,HAt),E.createTextVNode("/"+E.toDisplayString(I.value)+" ",1),E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:W},">"),E.createVNode(JM,{opentop:!0,class:"pc-dropdown",id:"pagecount",label:"10",selected:ee.settings.value.pagesize.toString(),options:T(),onSelected:R[1]||(R[1]=le=>{A.value=1,ee.$emit("pagesize",parseInt(le.id))})},null,8,["selected","options"])]))}}),GAt={class:"form-check"},YAt=["name","id","checked"],XAt=["for"],WTe=E.defineComponent({__name:"RadioButton",props:{group:{},label:{},id:{},selected:{type:Boolean}},emits:["selected"],setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",GAt,[E.createElementVNode("input",{class:"form-check-input",type:"radio",name:f.group,id:f.id,checked:f.selected,onChange:_[0]||(_[0]=g=>f.$emit("selected",f.id))},null,40,YAt),E.createElementVNode("label",{class:"form-check-label",for:f.id},E.toDisplayString(f.label),9,XAt)]))}}),QAt={class:"d-flex flex-column gap-2 justify-content-around"},eUe=E.defineComponent({__name:"RadioButtonGroup",props:{group:{},items:{}},emits:["selected"],setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",QAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.items,g=>(E.openBlock(),E.createBlock(WTe,{key:g.id,id:g.id,label:g.label,group:f.group,selected:g.selected,onSelected:_[0]||(_[0]=T=>f.$emit("selected",T))},null,8,["id","label","group","selected"]))),128))]))}}),ZAt={key:0,class:"spinner-border",role:"status"},HTe=E.defineComponent({__name:"SpinningProgress",props:{loading:{type:Boolean}},setup(l){return(f,_)=>f.loading?(E.openBlock(),E.createElementBlock("div",ZAt,[..._[0]||(_[0]=[E.createElementVNode("span",{class:"visually-hidden"},"Loading...",-1)])])):E.createCommentVNode("",!0)}}),KAt={key:0,class:"t2l-table-view t2l-table-header-label"},e4t={key:0,class:"t2l-select"},t4t={key:1,class:"t2l-cell"},r4t={class:"t2l-table-view t2l-table-header-filter"},n4t={key:0,class:"t2l-select"},i4t={key:1,class:"t2l-cell"},a4t={class:"t2l-table-view t2l-rows"},s4t={key:0,class:"t2l-select"},o4t=["id","onChange"],c4t=["innerHTML"],l4t={key:1,class:"t2l-cell t2l-actions"},u4t=["title","disabled","onClick"],f4t={class:"t2l-card-view t2l-card-filters"},_4t={class:"t2l-card-filter-order"},p4t={class:"t2l-card-filter-search"},d4t={class:"t2l-card-view t2l-rows"},m4t={key:0,class:"t2l-card-select"},g4t=["id","onChange"],h4t={class:"t2l-label"},v4t=["innerHTML"],y4t={class:"d-flex align-items-center"},b4t={key:2,class:"d-flex justify-content-center t2l-footer"},tUe=E.defineComponent({__name:"TableToList",props:{items:{},config:{}},emits:["pagesize","page"],setup(l){const f=R=>R&&R.component!==void 0,_=l,g=E.computed(()=>_.config.columns.filter(R=>R.visible!=!1)),T=E.computed(()=>_.config.columns.filter(R=>R.visible!=!1&&R.filter)),A=E.computed(()=>g.value.filter(R=>R.sort&&R.sort.active&&R.sort.active.value)),I=E.computed(()=>Math.ceil(g.value.length/_.config.smColCount)),$=(R,le)=>{var te=R-1+(le-1)*I.value;return te<g.value.length?g.value[te]:null},W=(R,le)=>R.converter?R.converter(le[R.property],le):le[R.property],ee=R=>{if(R.sort&&R.sort.active){let le=!R.sort.active.value;_.config.columns.forEach(te=>{te.sort&&te.sort.active&&(te.sort.active.value=!1)}),R.sort.active.value=le,R.sort.callback(le?R.property:"")}};return(R,le)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[R.config.compact?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",KAt,[R.config.selectableId?(E.openBlock(),E.createElementBlock("span",e4t)):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,te=>{var _e,Be;return E.openBlock(),E.createElementBlock("span",{class:E.normalizeClass(["t2l-cell gap-2",te.headerClass]),key:te.property},[te.sort?(E.openBlock(),E.createBlock(R8,{key:0,icon:te.sort.icon,onClick:Ge=>ee(te),active:(Be=(_e=te.sort)==null?void 0:_e.active)==null?void 0:Be.value},null,8,["icon","onClick","active"])):E.createCommentVNode("",!0),E.createTextVNode(" "+E.toDisplayString(te.label),1)],2)}),128)),R.config.actionHeader?(E.openBlock(),E.createElementBlock("span",t4t,E.toDisplayString(R.config.actionHeader),1)):E.createCommentVNode("",!0)])),E.createElementVNode("div",r4t,[R.config.selectableId?(E.openBlock(),E.createElementBlock("span",n4t)):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,te=>(E.openBlock(),E.createElementBlock("span",{class:E.normalizeClass(["t2l-cell",te.class]),key:te.label},[te.filter?(E.openBlock(),E.createBlock(VTe,{key:0,item:te.filter},null,8,["item"])):E.createCommentVNode("",!0)],2))),128)),R.config.actionHeader?(E.openBlock(),E.createElementBlock("span",i4t)):E.createCommentVNode("",!0)]),E.createElementVNode("div",a4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.items,te=>(E.openBlock(),E.createElementBlock("div",{key:te,class:"t2l-row"},[R.config.selectableId?(E.openBlock(),E.createElementBlock("div",s4t,[E.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:_e=>te.selected=!te.selected},null,40,o4t)])):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,_e=>(E.openBlock(),E.createElementBlock("div",{class:E.normalizeClass(["t2l-cell",_e.class]),key:_e.property},[E.isVNode(W(_e,te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W(_e,te)),{key:0})):f(W(_e,te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W(_e,te).component),E.mergeProps({key:1,ref_for:!0},W(_e,te).props),null,16)):(E.openBlock(),E.createElementBlock("span",{key:2,innerHTML:String(W(_e,te)??"")},null,8,c4t))],2))),128)),R.config.actions?(E.openBlock(),E.createElementBlock("div",l4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.config.actions,_e=>(E.openBlock(),E.createElementBlock("button",{key:_e.label,type:"button",class:"btn btn-outline-secondary",title:_e.label,disabled:!_e.enabled(te),onClick:Be=>_e.command(te)},[E.createElementVNode("i",{class:E.normalizeClass(_e.icon)},null,2)],8,u4t))),128))])):E.createCommentVNode("",!0)]))),128))]),E.createElementVNode("div",f4t,[E.createElementVNode("div",_4t,[E.createVNode($Te,{id:"card-filter-order",default:{icon:"fa-solid fa-chevron-down",label:"rendezés"},selected:A.value.length>0?A.value[0].property:"",enabled:R.config.sortEnabled,options:E.ref(g.value.filter(te=>te.sort).map(te=>({icon:te.sort.icon,label:te.sort.label,value:te.property,callback:te.sort.callback})))},null,8,["selected","enabled","options"])]),E.createElementVNode("div",p4t,[E.createVNode(zTe,{items:T.value.map(te=>({filter:te.filter,icon:te.filterIcon,label:te.label}))},null,8,["items"])])]),E.createElementVNode("div",d4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.items,(te,_e)=>(E.openBlock(),E.createElementBlock("div",{class:"t2l-row",key:_e},[R.config.selectableId?(E.openBlock(),E.createElementBlock("div",m4t,[E.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:Be=>te.selected=!te.selected},null,40,g4t)])):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.config.smColCount,Be=>(E.openBlock(),E.createElementBlock("div",{class:"t2l-card-col",key:Be},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(I.value,Ge=>{var et;return E.openBlock(),E.createElementBlock(E.Fragment,{key:Ge},[$(Ge,Be)?(E.openBlock(),E.createElementBlock("div",{key:0,class:E.normalizeClass(["t2l-property",(et=$(Ge,Be))==null?void 0:et.class])},[E.createElementVNode("span",h4t,E.toDisplayString($(Ge,Be).label),1),E.isVNode(W($(Ge,Be),te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W($(Ge,Be),te)),{key:0})):f(W($(Ge,Be),te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W($(Ge,Be),te).component),E.mergeProps({key:1,ref_for:!0},W($(Ge,Be),te).props),null,16)):(E.openBlock(),E.createElementBlock("span",{key:2,innerHTML:String(W($(Ge,Be),te)??"")},null,8,v4t))],2)):E.createCommentVNode("",!0)],64)}),128))]))),128)),E.createElementVNode("div",y4t,[_.config.actions?(E.openBlock(),E.createBlock(Lne,{key:0,item:te,options:_.config.actions,label:"...",id:_e.toString(),right:!0},null,8,["item","options","id"])):E.createCommentVNode("",!0)])]))),128))]),R.config.paginatorSettings?(E.openBlock(),E.createBlock(UTe,{key:1,settings:R.config.paginatorSettings,onPagesize:le[0]||(le[0]=te=>R.$emit("pagesize",te)),onPage:le[1]||(le[1]=te=>R.$emit("page",te))},null,8,["settings"])):E.createCommentVNode("",!0),R.config.paginatorSettings?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",b4t," Elemek: "+E.toDisplayString(_.items.length),1))],64))}}),S4t={class:"d-flex flex flex-row"},T4t={key:1,class:"d-flex flex-column gap-2 options-body flex-grow-1"},x4t={class:"d-flex flex-grow-1 flex-column"},k4t={class:"d-flex flex-row"},C4t={class:"d-flex align-items-end"},E4t=["disabled"],rUe=E.defineComponent({__name:"TableToListOptions",props:{colCount:{},options:{},config:{}},emits:["save"],setup(l,{emit:f}){const _=l,g=E.ref([]);E.onMounted(()=>{g.value=_.options,R()});const T=E.computed(()=>_.colCount!=0?Math.ceil(_.options.length/_.colCount):0),A=(le,te)=>{var _e=_.options[(le-1)*T.value+te-1];return _e},I=()=>{$("save",g.value)},$=f,W=E.ref(!1),ee=E.ref(!0),R=()=>{ee.value=g.value.filter(le=>le.checked).length<=1};return(le,te)=>(E.openBlock(),E.createElementBlock("div",S4t,[W.value?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",{key:0,class:"d-flex flex-row align-items-center gap-2 options-header justify-content-start",onClick:te[0]||(te[0]=_e=>W.value=!W.value)},[...te[3]||(te[3]=[E.createElementVNode("i",{class:"fa-solid fa-cog"},null,-1),E.createElementVNode("div",{class:"options-header-label"},"beállítások",-1)])])),W.value?(E.openBlock(),E.createElementBlock("div",T4t,[te[5]||(te[5]=E.createElementVNode("div",{class:"options-header-label"},"Táblázat tulajdonságai",-1)),E.createElementVNode("div",x4t,[E.createVNode(OM,{id:"compact",label:"Kompakt",checked:!!le.config.compact,onChanged:te[1]||(te[1]=_e=>le.config.compact=_e.checked)},null,8,["checked"])]),te[6]||(te[6]=E.createElementVNode("div",{class:"options-header-label"},"Látható oszlopok",-1)),E.createElementVNode("div",k4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(le.colCount,_e=>(E.openBlock(),E.createElementBlock("div",{class:"d-flex flex-grow-1 flex-column",key:_e},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(T.value,Be=>(E.openBlock(),E.createElementBlock(E.Fragment,{key:Be},[A(_e,Be)?(E.openBlock(),E.createBlock(OM,{key:0,id:A(_e,Be).property,label:A(_e,Be).label,checked:A(_e,Be).checked,onChanged:te[2]||(te[2]=Ge=>{g.value.find(et=>et.property==Ge.id).checked=Ge.checked,R()})},null,8,["id","label","checked"])):E.createCommentVNode("",!0)],64))),128))]))),128)),E.createElementVNode("div",C4t,[E.createElementVNode("button",{class:"btn btn-outline-secondary",type:"button",onClick:I,disabled:ee.value},[...te[4]||(te[4]=[E.createElementVNode("i",{class:"fa-solid fa-save"},null,-1)])],8,E4t)])])])):E.createCommentVNode("",!0)]))}}),w4t={class:"tlb-container d-flex flex-column flex-grow-1"},D4t={class:"d-flex flex-row tlb-item"},A4t={class:"d-flex flex-column flex-grow-1 flex-sm-row justify-content-between tlb-item"},P4t=["id"],N4t={key:0,class:"d-flex id"},I4t={class:"d-flex flex-row align-items-center tlb-children-container"},nUe=E.defineComponent({__name:"TextListBox",props:{items:{}},emits:["deleted"],setup(l){return(f,_)=>{const g=E.resolveComponent("TextListBox",!0);return E.openBlock(),E.createElementBlock("div",w4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.items,T=>(E.openBlock(),E.createElementBlock("div",{class:"d-flex flex-column",key:T.id},[E.createElementVNode("div",D4t,[E.createElementVNode("div",A4t,[E.createElementVNode("div",{class:"d-flex flex-grow-1",id:T.id},E.toDisplayString(T.label),9,P4t),T.showId?(E.openBlock(),E.createElementBlock("div",N4t,E.toDisplayString(T.id),1)):E.createCommentVNode("",!0)]),T.hideDelete?E.createCommentVNode("",!0):(E.openBlock(),E.createBlock(R8,{key:0,icon:"fa-solid fa-trash",onClick:A=>f.$emit("deleted",T.id)},null,8,["onClick"]))]),E.createElementVNode("div",I4t,[T.childrend?(E.openBlock(),E.createBlock(g,{key:0,items:T.childrend,showId:T.showId,hideDelete:T.hideDelete},null,8,["items","showId","hideDelete"])):E.createCommentVNode("",!0)])]))),128))])}}}),O4t={key:0,class:"toast-container position-fixed bottom-0 start-50 translate-middle-x p-4 toast-zindex"},F4t={class:"toast-header"},M4t={class:"me-auto"},L4t={class:"text-body-secondary"},R4t=["onClick"],j4t=["innerHTML"],Eze=500,GTe=E.defineComponent({__name:"ToastComponent",props:{defaultDisplayDuration:{}},setup(l,{expose:f}){const _=l,g=E.ref([]);return f({addToast:A=>{A.displayDuration||(A.displayDuration=_.defaultDisplayDuration),A.id=new Date,g.value.filter(function(I){return I.id!==A.id}),g.value.push(A)}}),setInterval(()=>{g.value=g.value.map(A=>(A.displayDuration-=Eze,A)),g.value=g.value.filter(A=>A.displayDuration>0)},Eze),(A,I)=>g.value.length>0?(E.openBlock(),E.createElementBlock("div",O4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,$=>(E.openBlock(),E.createElementBlock("div",{key:$.message,class:E.normalizeClass(["toast d-block",{"toast-info":$.type==="info","toast-success":$.type==="success","toast-warning":$.type==="warning","toast-error":$.type==="error"}]),role:"alert","aria-live":"assertive","aria-atomic":"true"},[E.createElementVNode("div",F4t,[E.createElementVNode("strong",M4t,E.toDisplayString($.title),1),E.createElementVNode("small",L4t,E.toDisplayString($.id.toLocaleTimeString()),1),E.createElementVNode("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close",onClick:W=>g.value=g.value.filter(ee=>ee.id!==$.id)},null,8,R4t)]),E.createElementVNode("div",{class:"toast-body",innerHTML:$.message},null,8,j4t)],2))),128))])):E.createCommentVNode("",!0)}}),iUe=E.defineComponent({__name:"ToastWrapper",setup(l){const f=E.ref(),_=[{id:"toast-notification-message",handler:g=>{let T=g.detail;f.value.addToast({title:T.title,message:T.message,type:T.severity,displayDuration:T.displayDuration?T.displayDuration:5e3})}},{id:"fetch-error",handler:g=>{let T=g.detail;f.value.addToast({title:T.title,message:T.message,type:"error",displayDuration:1e4})}}];return E.onMounted(()=>{_.forEach(g=>window.addEventListener(g.id,g.handler))}),E.onUnmounted(()=>{_.forEach(g=>window.removeEventListener(g.id,g.handler))}),(g,T)=>(E.openBlock(),E.createBlock(GTe,{ref_key:"toast",ref:f,defaultDisplayDuration:5e3},null,512))}}),Zk=class Zk{};qf(Zk,"getId",(f,_)=>`${f}_${_}`),qf(Zk,"saveOptions",(f,_,g,T)=>{localStorage.setItem(Zk.getId(f,_),JSON.stringify({ttlcos:T,ttlc:{compact:g.compact}})),window.location.reload()}),qf(Zk,"cleanOptions",(f,_)=>{for(let g=0;g<localStorage.length;g++)localStorage.key(g).includes(f)&&localStorage.key(g)!=Zk.getId(f,_)&&localStorage.removeItem(localStorage.key(g))}),qf(Zk,"loadOptions",(f,_,g,T,A)=>{Zk.cleanOptions(f,_);const I=Zk.getId(f,_);if(localStorage.getItem(I))try{const $=JSON.parse(localStorage.getItem(I));A.value=$.ttlcos,A.value.forEach(W=>T.columns.find(ee=>ee.property==W.property).visible=W.checked),T.compact=$.ttlc.compact}catch{localStorage.removeItem(I),Zk.loadOptions(f,_,g,T,A)}else g||(g=[]),A.value=T.columns.map($=>($.visible=g.indexOf($.property)==-1,{label:$.label,property:$.property,checked:$.visible}))});let iTe=Zk;const B4t={class:"hdr-container d-flex flex-row flex-wrap align-items-center gap-3"},$4t=["onClick","title"],J4t={class:"hdr-title d-flex align-items-center"},z4t=["onClick","title","disabled"],q4t={class:"d-flex flex-grow-1 justify-content-end gap-3"},V4t=["onClick","title","disabled"],aUe=E.defineComponent({__name:"HeaderComponent",props:{title:{},isFetching:{type:Boolean},buttons:{}},setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",B4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.buttons,g=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[g.align=="pretitle"&&g.type=="iconButton"?(E.openBlock(),E.createBlock(R8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):E.createCommentVNode("",!0),g.align=="pretitle"&&g.type=="button"?(E.openBlock(),E.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},E.toDisplayString(g.title),9,$4t)):E.createCommentVNode("",!0)],64))),256)),E.createElementVNode("div",J4t,E.toDisplayString(f.title),1),E.createVNode(HTe,{loading:f.isFetching},null,8,["loading"]),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.buttons,g=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[g.align=="left"&&g.type=="iconButton"?(E.openBlock(),E.createBlock(R8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):E.createCommentVNode("",!0),g.align=="left"&&g.type=="button"?(E.openBlock(),E.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title,disabled:g.disabled},E.toDisplayString(g.title),9,z4t)):E.createCommentVNode("",!0)],64))),256)),E.createElementVNode("div",q4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.buttons,g=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[g.align=="right"&&g.type=="iconButton"?(E.openBlock(),E.createBlock(R8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):E.createCommentVNode("",!0),g.align=="right"&&g.type=="button"?(E.openBlock(),E.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title,disabled:g.disabled},E.toDisplayString(g.title),9,V4t)):E.createCommentVNode("",!0)],64))),256))])]))}}),U4t={class:"image-picker"},W4t={key:0},H4t=["src"],G4t={key:1},Y4t=["src"],X4t={key:1},Q4t={key:0,class:"d-flex flex-column flex-grow-1 gap-2"},Z4t=["value","disabled"],K4t=["value","disabled"],ePt=["disabled"],tPt=["id"],rPt=["causationid","viewid","environment","aeurl"],zM=E.defineComponent({__name:"ImagePickerComponent",props:{modelValue:{},details:{type:Boolean},editable:{type:Boolean},direction:{},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _=l,g=f,T={id:"",url:"",isAdult:!1,source:"",title:""},A=E.ref(T);E.watch(()=>A,()=>{g("update:modelValue",A.value)},{deep:!0}),E.watch(()=>_.modelValue,et=>{et&&(A.value=et)},{deep:!0,immediate:!0});const I=_.searchImageWidgetUrl,$=_.imageBaseUrl,W=_.imageViewId,ee=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`ipe-${Date.now()}-${Math.random().toString(36).slice(2)}`,R=E.ref(`${ee}-image-picker-causation-id`);E.onMounted(()=>{if(!document.querySelector(`script[src="${I}"]`)){const et=document.createElement("script");et.type="text/javascript",et.src=I,et.async=!0,document.head.appendChild(et)}});const le=E.computed(()=>A.value&&(A.value.url&&A.value.url.length>0||A.value.id&&A.value.id.length>0)),te=E.computed(()=>{if(le.value)return A.value.url&&A.value.url.length>0?A.value.url:`${$}/${W}/${A.value.id}.img`}),_e=et=>{et.preventDefault(),E.nextTick(()=>{var gt;(gt=document.getElementById(R.value))==null||gt.showModal()})},Be=et=>{et.preventDefault(),A.value=T},Ge=et=>{var gt,at;((gt=et==null?void 0:et.detail)==null?void 0:gt.causationid)===R.value&&((at=document.getElementById(R.value))==null||at.close(),A.value={id:et.detail.image.id,url:"",isAdult:et.detail.image.isAdult,source:et.detail.image.source,title:et.detail.image.title})};return E.onMounted(()=>{window.addEventListener("image-selected",Ge)}),E.onUnmounted(()=>{window.removeEventListener("image-selected",Ge)}),(et,gt)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",U4t,[E.createElementVNode("div",{class:E.normalizeClass(["d-flex gap-2",_.direction==="horizontal"?"flex-sm-row flex-column":"flex-column"])},[E.createElementVNode("div",{class:E.normalizeClass(["d-flex flex-column",_.direction==="horizontal"?"image-picker__preview":""])},[_.direction==="horizontal"?(E.openBlock(),E.createElementBlock("div",W4t,[le.value?(E.openBlock(),E.createElementBlock("img",{key:0,class:"image-picker__preview",alt:"",src:te.value},null,8,H4t)):(E.openBlock(),E.createElementBlock("p",G4t,"Nincs kép kiválasztva!"))])):E.createCommentVNode("",!0),_.direction!=="horizontal"?(E.openBlock(),E.createElementBlock(E.Fragment,{key:1},[le.value?(E.openBlock(),E.createElementBlock("img",{key:0,alt:"",src:te.value},null,8,Y4t)):(E.openBlock(),E.createElementBlock("p",X4t,"Nincs kép kiválasztva!"))],64)):E.createCommentVNode("",!0),E.createElementVNode("div",{class:"btn-group mt-2 w-100",role:"group","aria-label":"Képválasztó gombok"},[E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:_e},"Kép választás"),E.createElementVNode("button",{class:"btn btn-outline-danger",onClick:Be},"Eltávolítás")])],2),_.details&&A.value&&A.value.id?(E.openBlock(),E.createElementBlock("div",Q4t,[E.createElementVNode("div",null,[gt[3]||(gt[3]=E.createElementVNode("label",{for:"imgSrc",class:"form-label"},"Forrás",-1)),E.createElementVNode("input",{id:"imgSrc",class:"form-control",type:"text",placeholder:"Forrás",value:A.value.source,onInput:gt[0]||(gt[0]=at=>{A.value.source=at.target.value}),disabled:!_.editable},null,40,Z4t)]),E.createElementVNode("div",null,[gt[4]||(gt[4]=E.createElementVNode("label",{for:"imgAlt",class:"form-label"},"Képalá",-1)),E.createElementVNode("textarea",{id:"imgAlt",class:"form-control",type:"text",placeholder:"Képalá",value:A.value.title,onInput:gt[1]||(gt[1]=at=>{A.value.title=at.target.value}),disabled:!_.editable},null,40,K4t)]),E.createElementVNode("div",null,[gt[5]||(gt[5]=E.createElementVNode("label",{for:"isAdult",class:"form-check-label"},"Felnőtt tartalom",-1)),E.withDirectives(E.createElementVNode("input",{id:"isAdult",class:"m-1 form-check-input",type:"checkbox","onUpdate:modelValue":gt[2]||(gt[2]=at=>A.value.isAdult=at),disabled:!_.editable},null,8,ePt),[[E.vModelCheckbox,A.value.isAdult]])])])):E.createCommentVNode("",!0)],2)]),E.createElementVNode("dialog",{id:R.value},[E.createElementVNode("hvg-search-image",{causationid:R.value,viewid:E.unref(W),environment:et.environment,aeurl:et.articleEditorUrl,selectonly:"true"},null,8,rPt)],8,tPt)],64))}}),nPt={class:"selector"},iPt={class:"form-label",for:"format"},aPt=["value"],sPt=E.defineComponent({__name:"SelectorComponent",props:{modelValue:{},label:{},options:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _=l,g=f,T=E.computed({get:()=>_.modelValue,set:A=>g("update:modelValue",A)});return E.watchEffect(async()=>{var I;if(!((I=_.options)!=null&&I.length))return;const A=_.options.map($=>$.value);(_.modelValue==null||!A.includes(_.modelValue))&&(g("update:modelValue",A[0]),await E.nextTick())}),(A,I)=>(E.openBlock(),E.createElementBlock("div",nPt,[E.createElementVNode("label",iPt,E.toDisplayString(A.label),1),E.withDirectives(E.createElementVNode("select",{class:"form-control",id:"format","onUpdate:modelValue":I[0]||(I[0]=$=>T.value=$)},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(A.options,$=>(E.openBlock(),E.createElementBlock("option",{key:$.value,value:$.value},E.toDisplayString($.label),9,aPt))),128))],512),[[E.vModelSelect,T.value]])]))}}),sUe=cC(sPt,[["__scopeId","data-v-701e6d6d"]]),oPt={class:"d-flex flex-column gap-2"},cPt={class:"btn-group mt-2 w-100",role:"group","aria-label":"Cikkválasztó gombok"},lPt={key:0,class:"w-100 gap-1 d-flex"},uPt={class:"w-100"},fPt=["value"],_Pt={class:"w-100"},pPt=["value"],dPt=["value"],mPt=["value"],gPt=["id"],hPt=["id","apiurl"],vPt="00000000-0000-0000-0000-000000000000",YTe=E.defineComponent({__name:"InternalArticleOfferComponent",props:{modelValue:{},searchArticleApiUrl:{},searchArticleWidgetUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},showIds:{type:Boolean,default:!0},formats:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _={article:{siteId:"",id:"",imageId:"",title:"",lead:""},format:""},g=f,T=l,A=E.ref(_),I=E.ref({id:A.value.article.imageId||"",url:"",source:"",title:"",isAdult:!1});E.watch(()=>T.modelValue,le=>{le?A.value=le:A.value=_},{deep:!0,immediate:!0}),E.watch(()=>A,le=>{g("update:modelValue",A.value),I.value.id=le.value.article.imageId},{deep:!0,immediate:!0}),E.watch(()=>I.value.id,le=>{A.value.article.imageId=le},{deep:!0,immediate:!0});const $=E.ref(new Date().getTime().toString()+"article");E.onUnmounted(()=>{window.removeEventListener("search_posts_selected",W)}),E.onMounted(()=>{window.addEventListener("search_posts_selected",W)});const W=le=>{var te;if(le.detail.id==$.value){if(le.detail.result&&le.detail.posts.length>0){A.value.article.id=le.detail.posts[0].id,A.value.article.siteId=le.detail.posts[0].siteId,A.value.article.title=le.detail.posts[0].title,A.value.article.lead=le.detail.posts[0].lead;const _e=le.detail.posts[0].featuredImage;A.value.article.imageId=_e||vPt}(te=document.getElementById($.value))==null||te.close()}},ee=()=>{var le;(le=document.getElementById($.value))==null||le.showModal()},R=le=>{if(!document.querySelector(`script[src="${le}"]`)){let te=document.createElement("script");te.type="text/javascript",te.src=le,document.head.appendChild(te)}};return R(T.searchImageWidgetUrl),R(T.searchArticleWidgetUrl),(le,te)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",oPt,[E.createElementVNode("div",cPt,[E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:te[0]||(te[0]=()=>ee())},"Cikk Választás")]),le.showIds?(E.openBlock(),E.createElementBlock("div",lPt,[E.createElementVNode("div",uPt,[E.createElementVNode("input",{type:"text",id:"articleId",class:"form-control",placeholder:"Cikk azonosító",disabled:"",value:A.value.article.id},null,8,fPt)]),E.createElementVNode("div",_Pt,[E.createElementVNode("input",{type:"text",id:"articleSiteId",class:"form-control",placeholder:"Site azonosító",disabled:"",value:A.value.article.siteId},null,8,pPt)])])):E.createCommentVNode("",!0),E.createElementVNode("div",null,[te[5]||(te[5]=E.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),E.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:A.value.article.title,onInput:te[1]||(te[1]=_e=>{var Be;return A.value.article.title=((Be=_e.target)==null?void 0:Be.value)||""})},null,40,dPt)]),E.createElementVNode("div",null,[te[6]||(te[6]=E.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),E.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:A.value.article.lead,onInput:te[2]||(te[2]=_e=>{var Be;return A.value.article.lead=((Be=_e.target)==null?void 0:Be.value)||""})},null,40,mPt)]),E.createVNode(zM,{modelValue:I.value,"onUpdate:modelValue":te[3]||(te[3]=_e=>I.value=_e),details:!1,editable:!1,"article-editor-url":T.searchArticleApiUrl,environment:T.environment,"search-image-widget-url":T.searchImageWidgetUrl,"image-base-url":T.imageBaseUrl,"image-view-id":T.imageViewId},null,8,["modelValue","article-editor-url","environment","search-image-widget-url","image-base-url","image-view-id"]),E.createVNode(sUe,{modelValue:A.value.format,"onUpdate:modelValue":te[4]||(te[4]=_e=>A.value.format=_e),options:T.formats,label:"Formátum"},null,8,["modelValue","options"])]),E.createElementVNode("dialog",{id:$.value},[E.createElementVNode("search-posts-widget",{id:$.value,selector:"true",apiurl:T.searchArticleApiUrl,wpurl:"",searchurl:"",style:{height:"100%"}},null,8,hPt)],8,gPt)],64))}}),yPt={class:"d-flex flex-column gap-2"},bPt=["value"],SPt=["value"],TPt=["value"],XTe=E.defineComponent({__name:"ExternalArticleOfferComponent",props:{modelValue:{},onArticleUrlChanged:{type:Function},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},formats:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _={article:{url:"",imageUrl:"",imageId:"",title:"",lead:""},format:""},g=f,T=l,A=E.ref(_),I=E.ref({id:A.value.article.imageId,url:"",source:"",title:"",isAdult:!1});E.watch(()=>T.modelValue,ee=>{ee?A.value=ee:A.value=_},{deep:!0,immediate:!0}),E.watch(()=>A,ee=>{g("update:modelValue",A.value),I.value.id=ee.value.article.imageId,I.value.url=ee.value.article.imageUrl},{deep:!0,immediate:!0}),E.watch(()=>I.value.id,ee=>{A.value.article.imageId=ee},{deep:!0,immediate:!0}),E.watch(()=>I.value.url,ee=>{A.value.article.imageUrl=ee},{deep:!0,immediate:!0});const $=ee=>{var R;A.value.article.url=((R=ee.target)==null?void 0:R.value)||"",A.value.article.url&&T.onArticleUrlChanged(A.value.article.url,le=>{A.value.article=le})};return(ee=>{if(!document.querySelector(`script[src="${ee}"]`)){let R=document.createElement("script");R.type="text/javascript",R.src=ee,document.head.appendChild(R)}})(T.searchImageWidgetUrl),(ee,R)=>(E.openBlock(),E.createElementBlock("div",yPt,[E.createElementVNode("div",null,[R[4]||(R[4]=E.createElementVNode("label",{for:"articleUrl",class:"form-label"},"Cikk URL",-1)),E.createElementVNode("textarea",{id:"articleUrl",class:"form-control",placeholder:"Cikk URL",value:A.value.article.url,onInput:$},null,40,bPt)]),E.createElementVNode("div",null,[R[5]||(R[5]=E.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),E.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:A.value.article.title,onInput:R[0]||(R[0]=le=>{var te;return A.value.article.title=((te=le.target)==null?void 0:te.value)||""})},null,40,SPt)]),E.createElementVNode("div",null,[R[6]||(R[6]=E.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),E.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:A.value.article.lead,onInput:R[1]||(R[1]=le=>{var te;return A.value.article.lead=((te=le.target)==null?void 0:te.value)||""})},null,40,TPt)]),E.createVNode(zM,{modelValue:I.value,"onUpdate:modelValue":R[2]||(R[2]=le=>I.value=le),details:!1,editable:!1,environment:T.environment,"article-editor-url":T.articleEditorUrl,"search-image-widget-url":T.searchImageWidgetUrl,"image-base-url":T.imageBaseUrl,"image-view-id":T.imageViewId},null,8,["modelValue","environment","article-editor-url","search-image-widget-url","image-base-url","image-view-id"]),E.createVNode(sUe,{modelValue:A.value.format,"onUpdate:modelValue":R[3]||(R[3]=le=>A.value.format=le),options:T.formats,label:"Formátum"},null,8,["modelValue","options"])]))}});function oUe(l,f){return function(){return l.apply(f,arguments)}}const{toString:xPt}=Object.prototype,{getPrototypeOf:QTe}=Object,{iterator:Bne,toStringTag:cUe}=Symbol,$ne=(l=>f=>{const _=xPt.call(f);return l[_]||(l[_]=_.slice(8,-1).toLowerCase())})(Object.create(null)),lC=l=>(l=l.toLowerCase(),f=>$ne(f)===l),Jne=l=>f=>typeof f===l,{isArray:qM}=Array,FM=Jne("undefined");function gV(l){return l!==null&&!FM(l)&&l.constructor!==null&&!FM(l.constructor)&&p2(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const lUe=lC("ArrayBuffer");function kPt(l){let f;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?f=ArrayBuffer.isView(l):f=l&&l.buffer&&lUe(l.buffer),f}const CPt=Jne("string"),p2=Jne("function"),uUe=Jne("number"),hV=l=>l!==null&&typeof l=="object",EPt=l=>l===!0||l===!1,Kre=l=>{if($ne(l)!=="object")return!1;const f=QTe(l);return(f===null||f===Object.prototype||Object.getPrototypeOf(f)===null)&&!(cUe in l)&&!(Bne in l)},wPt=l=>{if(!hV(l)||gV(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},DPt=lC("Date"),APt=lC("File"),PPt=lC("Blob"),NPt=lC("FileList"),IPt=l=>hV(l)&&p2(l.pipe),OPt=l=>{let f;return l&&(typeof FormData=="function"&&l instanceof FormData||p2(l.append)&&((f=$ne(l))==="formdata"||f==="object"&&p2(l.toString)&&l.toString()==="[object FormData]"))},FPt=lC("URLSearchParams"),[MPt,LPt,RPt,jPt]=["ReadableStream","Request","Response","Headers"].map(lC),BPt=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vV(l,f,{allOwnKeys:_=!1}={}){if(l===null||typeof l>"u")return;let g,T;if(typeof l!="object"&&(l=[l]),qM(l))for(g=0,T=l.length;g<T;g++)f.call(null,l[g],g,l);else{if(gV(l))return;const A=_?Object.getOwnPropertyNames(l):Object.keys(l),I=A.length;let $;for(g=0;g<I;g++)$=A[g],f.call(null,l[$],$,l)}}function fUe(l,f){if(gV(l))return null;f=f.toLowerCase();const _=Object.keys(l);let g=_.length,T;for(;g-- >0;)if(T=_[g],f===T.toLowerCase())return T;return null}const M8=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_Ue=l=>!FM(l)&&l!==M8;function aTe(){const{caseless:l,skipUndefined:f}=_Ue(this)&&this||{},_={},g=(T,A)=>{const I=l&&fUe(_,A)||A;Kre(_[I])&&Kre(T)?_[I]=aTe(_[I],T):Kre(T)?_[I]=aTe({},T):qM(T)?_[I]=T.slice():(!f||!FM(T))&&(_[I]=T)};for(let T=0,A=arguments.length;T<A;T++)arguments[T]&&vV(arguments[T],g);return _}const $Pt=(l,f,_,{allOwnKeys:g}={})=>(vV(f,(T,A)=>{_&&p2(T)?l[A]=oUe(T,_):l[A]=T},{allOwnKeys:g}),l),JPt=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),zPt=(l,f,_,g)=>{l.prototype=Object.create(f.prototype,g),l.prototype.constructor=l,Object.defineProperty(l,"super",{value:f.prototype}),_&&Object.assign(l.prototype,_)},qPt=(l,f,_,g)=>{let T,A,I;const $={};if(f=f||{},l==null)return f;do{for(T=Object.getOwnPropertyNames(l),A=T.length;A-- >0;)I=T[A],(!g||g(I,l,f))&&!$[I]&&(f[I]=l[I],$[I]=!0);l=_!==!1&&QTe(l)}while(l&&(!_||_(l,f))&&l!==Object.prototype);return f},VPt=(l,f,_)=>{l=String(l),(_===void 0||_>l.length)&&(_=l.length),_-=f.length;const g=l.indexOf(f,_);return g!==-1&&g===_},UPt=l=>{if(!l)return null;if(qM(l))return l;let f=l.length;if(!uUe(f))return null;const _=new Array(f);for(;f-- >0;)_[f]=l[f];return _},WPt=(l=>f=>l&&f instanceof l)(typeof Uint8Array<"u"&&QTe(Uint8Array)),HPt=(l,f)=>{const g=(l&&l[Bne]).call(l);let T;for(;(T=g.next())&&!T.done;){const A=T.value;f.call(l,A[0],A[1])}},GPt=(l,f)=>{let _;const g=[];for(;(_=l.exec(f))!==null;)g.push(_);return g},YPt=lC("HTMLFormElement"),XPt=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(_,g,T){return g.toUpperCase()+T}),wze=(({hasOwnProperty:l})=>(f,_)=>l.call(f,_))(Object.prototype),QPt=lC("RegExp"),pUe=(l,f)=>{const _=Object.getOwnPropertyDescriptors(l),g={};vV(_,(T,A)=>{let I;(I=f(T,A,l))!==!1&&(g[A]=I||T)}),Object.defineProperties(l,g)},ZPt=l=>{pUe(l,(f,_)=>{if(p2(l)&&["arguments","caller","callee"].indexOf(_)!==-1)return!1;const g=l[_];if(p2(g)){if(f.enumerable=!1,"writable"in f){f.writable=!1;return}f.set||(f.set=()=>{throw Error("Can not rewrite read-only method '"+_+"'")})}})},KPt=(l,f)=>{const _={},g=T=>{T.forEach(A=>{_[A]=!0})};return qM(l)?g(l):g(String(l).split(f)),_},e3t=()=>{},t3t=(l,f)=>l!=null&&Number.isFinite(l=+l)?l:f;function r3t(l){return!!(l&&p2(l.append)&&l[cUe]==="FormData"&&l[Bne])}const n3t=l=>{const f=new Array(10),_=(g,T)=>{if(hV(g)){if(f.indexOf(g)>=0)return;if(gV(g))return g;if(!("toJSON"in g)){f[T]=g;const A=qM(g)?[]:{};return vV(g,(I,$)=>{const W=_(I,T+1);!FM(W)&&(A[$]=W)}),f[T]=void 0,A}}return g};return _(l,0)},i3t=lC("AsyncFunction"),a3t=l=>l&&(hV(l)||p2(l))&&p2(l.then)&&p2(l.catch),dUe=((l,f)=>l?setImmediate:f?((_,g)=>(M8.addEventListener("message",({source:T,data:A})=>{T===M8&&A===_&&g.length&&g.shift()()},!1),T=>{g.push(T),M8.postMessage(_,"*")}))(`axios@${Math.random()}`,[]):_=>setTimeout(_))(typeof setImmediate=="function",p2(M8.postMessage)),s3t=typeof queueMicrotask<"u"?queueMicrotask.bind(M8):typeof process<"u"&&process.nextTick||dUe,o3t=l=>l!=null&&p2(l[Bne]),ki={isArray:qM,isArrayBuffer:lUe,isBuffer:gV,isFormData:OPt,isArrayBufferView:kPt,isString:CPt,isNumber:uUe,isBoolean:EPt,isObject:hV,isPlainObject:Kre,isEmptyObject:wPt,isReadableStream:MPt,isRequest:LPt,isResponse:RPt,isHeaders:jPt,isUndefined:FM,isDate:DPt,isFile:APt,isBlob:PPt,isRegExp:QPt,isFunction:p2,isStream:IPt,isURLSearchParams:FPt,isTypedArray:WPt,isFileList:NPt,forEach:vV,merge:aTe,extend:$Pt,trim:BPt,stripBOM:JPt,inherits:zPt,toFlatObject:qPt,kindOf:$ne,kindOfTest:lC,endsWith:VPt,toArray:UPt,forEachEntry:HPt,matchAll:GPt,isHTMLForm:YPt,hasOwnProperty:wze,hasOwnProp:wze,reduceDescriptors:pUe,freezeMethods:ZPt,toObjectSet:KPt,toCamelCase:XPt,noop:e3t,toFiniteNumber:t3t,findKey:fUe,global:M8,isContextDefined:_Ue,isSpecCompliantForm:r3t,toJSONObject:n3t,isAsyncFn:i3t,isThenable:a3t,setImmediate:dUe,asap:s3t,isIterable:o3t};function ru(l,f,_,g,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=l,this.name="AxiosError",f&&(this.code=f),_&&(this.config=_),g&&(this.request=g),T&&(this.response=T,this.status=T.status?T.status:null)}ki.inherits(ru,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ki.toJSONObject(this.config),code:this.code,status:this.status}}});const mUe=ru.prototype,gUe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(l=>{gUe[l]={value:l}});Object.defineProperties(ru,gUe);Object.defineProperty(mUe,"isAxiosError",{value:!0});ru.from=(l,f,_,g,T,A)=>{const I=Object.create(mUe);ki.toFlatObject(l,I,function(R){return R!==Error.prototype},ee=>ee!=="isAxiosError");const $=l&&l.message?l.message:"Error",W=f==null&&l?l.code:f;return ru.call(I,$,W,_,g,T),l&&I.cause==null&&Object.defineProperty(I,"cause",{value:l,configurable:!0}),I.name=l&&l.name||"Error",A&&Object.assign(I,A),I};const c3t=null;function sTe(l){return ki.isPlainObject(l)||ki.isArray(l)}function hUe(l){return ki.endsWith(l,"[]")?l.slice(0,-2):l}function Dze(l,f,_){return l?l.concat(f).map(function(T,A){return T=hUe(T),!_&&A?"["+T+"]":T}).join(_?".":""):f}function l3t(l){return ki.isArray(l)&&!l.some(sTe)}const u3t=ki.toFlatObject(ki,{},null,function(f){return/^is[A-Z]/.test(f)});function zne(l,f,_){if(!ki.isObject(l))throw new TypeError("target must be an object");f=f||new FormData,_=ki.toFlatObject(_,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ge,et){return!ki.isUndefined(et[Ge])});const g=_.metaTokens,T=_.visitor||R,A=_.dots,I=_.indexes,W=(_.Blob||typeof Blob<"u"&&Blob)&&ki.isSpecCompliantForm(f);if(!ki.isFunction(T))throw new TypeError("visitor must be a function");function ee(Be){if(Be===null)return"";if(ki.isDate(Be))return Be.toISOString();if(ki.isBoolean(Be))return Be.toString();if(!W&&ki.isBlob(Be))throw new ru("Blob is not supported. Use a Buffer instead.");return ki.isArrayBuffer(Be)||ki.isTypedArray(Be)?W&&typeof Blob=="function"?new Blob([Be]):Buffer.from(Be):Be}function R(Be,Ge,et){let gt=Be;if(Be&&!et&&typeof Be=="object"){if(ki.endsWith(Ge,"{}"))Ge=g?Ge:Ge.slice(0,-2),Be=JSON.stringify(Be);else if(ki.isArray(Be)&&l3t(Be)||(ki.isFileList(Be)||ki.endsWith(Ge,"[]"))&&(gt=ki.toArray(Be)))return Ge=hUe(Ge),gt.forEach(function(dt,nt){!(ki.isUndefined(dt)||dt===null)&&f.append(I===!0?Dze([Ge],nt,A):I===null?Ge:Ge+"[]",ee(dt))}),!1}return sTe(Be)?!0:(f.append(Dze(et,Ge,A),ee(Be)),!1)}const le=[],te=Object.assign(u3t,{defaultVisitor:R,convertValue:ee,isVisitable:sTe});function _e(Be,Ge){if(!ki.isUndefined(Be)){if(le.indexOf(Be)!==-1)throw Error("Circular reference detected in "+Ge.join("."));le.push(Be),ki.forEach(Be,function(gt,at){(!(ki.isUndefined(gt)||gt===null)&&T.call(f,gt,ki.isString(at)?at.trim():at,Ge,te))===!0&&_e(gt,Ge?Ge.concat(at):[at])}),le.pop()}}if(!ki.isObject(l))throw new TypeError("data must be an object");return _e(l),f}function Aze(l){const f={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(g){return f[g]})}function ZTe(l,f){this._pairs=[],l&&zne(l,this,f)}const vUe=ZTe.prototype;vUe.append=function(f,_){this._pairs.push([f,_])};vUe.toString=function(f){const _=f?function(g){return f.call(this,g,Aze)}:Aze;return this._pairs.map(function(T){return _(T[0])+"="+_(T[1])},"").join("&")};function f3t(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yUe(l,f,_){if(!f)return l;const g=_&&_.encode||f3t;ki.isFunction(_)&&(_={serialize:_});const T=_&&_.serialize;let A;if(T?A=T(f,_):A=ki.isURLSearchParams(f)?f.toString():new ZTe(f,_).toString(g),A){const I=l.indexOf("#");I!==-1&&(l=l.slice(0,I)),l+=(l.indexOf("?")===-1?"?":"&")+A}return l}class Pze{constructor(){this.handlers=[]}use(f,_,g){return this.handlers.push({fulfilled:f,rejected:_,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(f){this.handlers[f]&&(this.handlers[f]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(f){ki.forEach(this.handlers,function(g){g!==null&&f(g)})}}const bUe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_3t=typeof URLSearchParams<"u"?URLSearchParams:ZTe,p3t=typeof FormData<"u"?FormData:null,d3t=typeof Blob<"u"?Blob:null,m3t={isBrowser:!0,classes:{URLSearchParams:_3t,FormData:p3t,Blob:d3t},protocols:["http","https","file","blob","url","data"]},KTe=typeof window<"u"&&typeof document<"u",oTe=typeof navigator=="object"&&navigator||void 0,g3t=KTe&&(!oTe||["ReactNative","NativeScript","NS"].indexOf(oTe.product)<0),h3t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v3t=KTe&&window.location.href||"http://localhost",y3t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:KTe,hasStandardBrowserEnv:g3t,hasStandardBrowserWebWorkerEnv:h3t,navigator:oTe,origin:v3t},Symbol.toStringTag,{value:"Module"})),By={...y3t,...m3t};function b3t(l,f){return zne(l,new By.classes.URLSearchParams,{visitor:function(_,g,T,A){return By.isNode&&ki.isBuffer(_)?(this.append(g,_.toString("base64")),!1):A.defaultVisitor.apply(this,arguments)},...f})}function S3t(l){return ki.matchAll(/\w+|\[(\w*)]/g,l).map(f=>f[0]==="[]"?"":f[1]||f[0])}function T3t(l){const f={},_=Object.keys(l);let g;const T=_.length;let A;for(g=0;g<T;g++)A=_[g],f[A]=l[A];return f}function SUe(l){function f(_,g,T,A){let I=_[A++];if(I==="__proto__")return!0;const $=Number.isFinite(+I),W=A>=_.length;return I=!I&&ki.isArray(T)?T.length:I,W?(ki.hasOwnProp(T,I)?T[I]=[T[I],g]:T[I]=g,!$):((!T[I]||!ki.isObject(T[I]))&&(T[I]=[]),f(_,g,T[I],A)&&ki.isArray(T[I])&&(T[I]=T3t(T[I])),!$)}if(ki.isFormData(l)&&ki.isFunction(l.entries)){const _={};return ki.forEachEntry(l,(g,T)=>{f(S3t(g),T,_,0)}),_}return null}function x3t(l,f,_){if(ki.isString(l))try{return(f||JSON.parse)(l),ki.trim(l)}catch(g){if(g.name!=="SyntaxError")throw g}return(_||JSON.stringify)(l)}const yV={transitional:bUe,adapter:["xhr","http","fetch"],transformRequest:[function(f,_){const g=_.getContentType()||"",T=g.indexOf("application/json")>-1,A=ki.isObject(f);if(A&&ki.isHTMLForm(f)&&(f=new FormData(f)),ki.isFormData(f))return T?JSON.stringify(SUe(f)):f;if(ki.isArrayBuffer(f)||ki.isBuffer(f)||ki.isStream(f)||ki.isFile(f)||ki.isBlob(f)||ki.isReadableStream(f))return f;if(ki.isArrayBufferView(f))return f.buffer;if(ki.isURLSearchParams(f))return _.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),f.toString();let $;if(A){if(g.indexOf("application/x-www-form-urlencoded")>-1)return b3t(f,this.formSerializer).toString();if(($=ki.isFileList(f))||g.indexOf("multipart/form-data")>-1){const W=this.env&&this.env.FormData;return zne($?{"files[]":f}:f,W&&new W,this.formSerializer)}}return A||T?(_.setContentType("application/json",!1),x3t(f)):f}],transformResponse:[function(f){const _=this.transitional||yV.transitional,g=_&&_.forcedJSONParsing,T=this.responseType==="json";if(ki.isResponse(f)||ki.isReadableStream(f))return f;if(f&&ki.isString(f)&&(g&&!this.responseType||T)){const I=!(_&&_.silentJSONParsing)&&T;try{return JSON.parse(f,this.parseReviver)}catch($){if(I)throw $.name==="SyntaxError"?ru.from($,ru.ERR_BAD_RESPONSE,this,null,this.response):$}}return f}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:By.classes.FormData,Blob:By.classes.Blob},validateStatus:function(f){return f>=200&&f<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ki.forEach(["delete","get","head","post","put","patch"],l=>{yV.headers[l]={}});const k3t=ki.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),C3t=l=>{const f={};let _,g,T;return l&&l.split(`
1
+ "use strict";var n6t=Object.defineProperty;var i6t=(l,f,_)=>f in l?n6t(l,f,{enumerable:!0,configurable:!0,writable:!0,value:_}):l[f]=_;var qf=(l,f,_)=>i6t(l,typeof f!="symbol"?f+"":f,_);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const E=require("vue"),a6t=["checked","id"],s6t=["for"],OM=E.defineComponent({__name:"CheckBox",props:{id:{},label:{},checked:{type:Boolean}},emits:["changed"],setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",{class:"form-check",onClick:_[1]||(_[1]=g=>g.stopPropagation())},[E.createElementVNode("input",{class:"form-check-input",type:"checkbox",checked:f.checked,value:"",id:f.id,onChange:_[0]||(_[0]=g=>f.$emit("changed",{id:f.id,checked:g.target.checked}))},null,40,a6t),E.createElementVNode("label",{class:"form-check-label",for:f.id},E.toDisplayString(f.label),9,s6t)]))}}),o6t={class:"cbl-childrend-container"},c6t=E.defineComponent({__name:"CheckBoxList",props:{items:{},callback:{type:Function}},setup(l){return(f,_)=>{const g=E.resolveComponent("CheckBoxList",!0);return E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.items,T=>(E.openBlock(),E.createElementBlock("div",{key:T.id,class:"cbl-container"},[E.createVNode(OM,{id:T.id,label:T.label,checked:T.checked,onChanged:_[0]||(_[0]=A=>f.callback(A.id,A.checked))},null,8,["id","label","checked"]),E.createElementVNode("div",o6t,[T.childrend?(E.openBlock(),E.createBlock(g,{key:0,items:T.childrend,callback:f.callback},null,8,["items","callback"])):E.createCommentVNode("",!0)])]))),128)}}}),cC=(l,f)=>{const _=l.__vccOpts||l;for(const[g,T]of f)_[g]=T;return _},WVe=cC(c6t,[["__scopeId","data-v-ae2832c5"]]),l6t=["id"],u6t=["disabled"],f6t={class:"dd-label"},_6t=["id"],p6t={class:"dd-item-list"},d6t=["id","onClick"],JM=E.defineComponent({__name:"DropDown",props:{id:{},label:{},selected:{},options:{},opentop:{type:Boolean},disableFilter:{type:Boolean},storeselected:{type:Boolean},filterevent:{type:Boolean},disabled:{type:Boolean},btnextraclass:{}},emits:["selected","filtered"],setup(l,{emit:f}){const _=l;E.watch(_.options,()=>{_.filterevent&&(Be.value=_.options.value)}),E.watch(()=>_.selected,()=>{W()}),E.watch(()=>_.label,()=>{W()});const g=f,T=sr=>{_.storeselected||(I.value=sr.label),g("selected",sr)},A="törlés",I=E.ref(""),$=E.ref(null);E.watch(()=>$.value,()=>{$.value&&document.getElementById($.value.id).scrollIntoView()});const W=()=>{if(_.options.value){const sr=_.options.value.find($t=>$t.id==_.selected);sr?I.value=sr.label:(_e(""),I.value=_.label)}},ee=sr=>{const $t=()=>$?Be.value.indexOf($.value,0):-1,_r=document.getElementById(`${_.id}-clear-btn`);if(_r==sr.target&&sr.key=="ArrowDown"){St.value.focus(),$.value=Be.value[0];return}if(St.value&&St.value==sr.target){if(sr.key=="ArrowUp"){const Ot=$t();if(Ot<1){_r&&_r.focus();return}$.value=Be.value[Ot-1];return}if(sr.key=="ArrowDown"){const Ot=$t();if(Ot>=Be.value.length-1)return;$.value=Be.value[Ot+1];return}if(sr.key=="Enter"){if(!$.value)return;T($.value),nt.value=="block"&&(nt.value="none");return}}},R=()=>{nt.value=="block"&&(nt.value="none")},le=()=>{nt.value=="block"&&(nt.value="none")};E.onMounted(()=>{_.label&&(I.value=_.label),W(),te="",document.addEventListener("click",R),window.addEventListener("scrolled",le),gt(),document.addEventListener("keydown",ee)}),E.onUnmounted(()=>{document.removeEventListener("keydown",ee),document.removeEventListener("click",R),window.removeEventListener("scrolled",le)});let te="";const _e=sr=>{te=sr,_.filterevent?g("filtered",sr):sr==""?Be.value=_.options.value:Be.value=_.options.value.filter($t=>$t.label.toLowerCase().includes(sr.toLowerCase()))},Be=E.ref([]),Ge=()=>{T({label:_.label,id:""}),_e("")},et=()=>{if(nt.value=="block"){nt.value="none";return}setTimeout(()=>{nt.value="block"},10),setTimeout(gt,20)},gt=()=>{const sr=at.value,$t=dt.value;_.opentop?$t.style.top=sr.getBoundingClientRect().y-$t.offsetHeight+"px":($t.style.top=sr.getBoundingClientRect().y+sr.offsetHeight+"px",sr.getBoundingClientRect().y-$t.getBoundingClientRect().y!=-sr.offsetHeight&&($t.style.top=parseInt($t.style.top.substring(0,$t.style.top.length-2))+(sr.getBoundingClientRect().y-$t.getBoundingClientRect().y)+sr.offsetHeight+"px")),St.value&&St.value.focus()},at=E.ref(null),dt=E.ref(null),nt=E.ref("none"),St=E.ref(null);return(sr,$t)=>(E.openBlock(),E.createElementBlock("div",{id:sr.id,class:"dd-flex"},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:at,class:E.normalizeClass(["btn btn-outline-secondary dd-toggle dd-flex",sr.btnextraclass]),type:"button",disabled:sr.disabled,onClick:$t[0]||($t[0]=()=>{_e(E.unref(te)),et()})},[E.createElementVNode("div",f6t,E.toDisplayString(I.value),1)],10,u6t),E.createElementVNode("div",{class:"dd-menu",style:E.normalizeStyle({display:nt.value}),ref_key:"DropDownMenu",ref:dt},[I.value!=_.label?(E.openBlock(),E.createElementBlock("button",{key:0,id:`${sr.id}-clear-btn`,type:"button",class:"btn btn-outline-secondary dd-button",onClick:$t[1]||($t[1]=_r=>Ge())},E.toDisplayString(A),8,_6t)):E.createCommentVNode("",!0),sr.disableFilter?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("input",{key:1,ref_key:"ddSearch",ref:St,type:"text ",class:"form-control",placeholder:"keresés",onInput:$t[2]||($t[2]=_r=>_e(_r.target.value)),onClick:$t[3]||($t[3]=_r=>_r.stopPropagation())},null,544)),E.createElementVNode("div",p6t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(Be.value,_r=>(E.openBlock(),E.createElementBlock("div",{id:_r.id,key:_r.id,class:E.normalizeClass(["dd-item",{"dd-item-preselected":_r==$.value}]),onClick:Ot=>T(_r)},[_r.icon?(E.openBlock(),E.createElementBlock("i",{key:0,class:E.normalizeClass([_r.icon,"dd-item__icon"])},null,2)):E.createCommentVNode("",!0),E.createTextVNode(E.toDisplayString(_r.label),1)],10,d6t))),128))])],4)],8,l6t))}}),m6t=["id"],g6t=["disabled"],h6t={class:"ddc-row"},v6t={class:"ddc-label"},y6t={class:"dd-item-list"},b6t=["onClick"],S6t={class:"ddc-item"},T6t={class:"ddc-label"},x6t="törlés",$Te=E.defineComponent({__name:"DropDownCallBack",props:{id:{},default:{},selected:{},enabled:{type:Boolean},options:{}},setup(l){const f=l,_=R=>{R==f.default&&g.value.callback(""),g.value=R,g.value.callback(g.value.value)},g=E.ref(f.default),T=()=>{if(f.selected&&f.options.value){const R=f.options.value.find(le=>le.value==f.selected);R&&(g.value=R)}};E.onMounted(()=>{T(),document.addEventListener("click",function(){ee.value=="block"&&(ee.value="none")})});const A=()=>{setTimeout(()=>{ee.value="block"},10),setTimeout(()=>{W.value=I.value.offsetHeight},20)},I=E.ref(null),$=E.ref(null),W=E.ref(0),ee=E.ref("none");return(R,le)=>(E.openBlock(),E.createElementBlock("div",{class:"ddc-flex",id:R.id},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:I,class:"btn btn-outline-secondary ddc-button",type:"button",disabled:!R.enabled,onClick:le[0]||(le[0]=te=>A())},[E.createElementVNode("span",h6t,[E.createElementVNode("i",{class:E.normalizeClass([g.value.icon,"ddc-icon"])},null,2),E.createElementVNode("span",v6t,E.toDisplayString(g.value.label),1)])],8,g6t),E.createElementVNode("div",{class:"ddc-menu",style:E.normalizeStyle({display:ee.value,"margin-top":W.value+"px"}),ref_key:"DropDownMenu",ref:$},[g.value!=f.default?(E.openBlock(),E.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-secondary ddc-button",onClick:le[1]||(le[1]=te=>_(f.default))},E.toDisplayString(x6t))):E.createCommentVNode("",!0),E.createElementVNode("div",y6t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.options.value,te=>(E.openBlock(),E.createElementBlock("div",{key:te.label,class:"ddc-item",onClick:_e=>_(te)},[E.createElementVNode("span",S6t,[E.createElementVNode("i",{class:E.normalizeClass([te.icon,"ddc-icon"])},null,2),E.createElementVNode("span",T6t,E.toDisplayString(te.label),1)])],8,b6t))),128))])],4)],8,m6t))}}),k6t=["id"],C6t={key:0,class:"ddm-label"},E6t={key:1,class:"ddm-label"},w6t=["onClick"],Lne=E.defineComponent({__name:"DropDownMenu",props:{label:{},icon:{},options:{},item:{},id:{},right:{type:Boolean}},setup(l){const f=l;E.onMounted(()=>{document.addEventListener("click",function(){_.value&&(_.value=!1)})});const _=E.ref(!1),g=()=>{setTimeout(()=>{_.value=!0},10),setTimeout(T,20)},T=()=>{const W=A.value,ee=I.value;ee.style.top=W.getBoundingClientRect().y+W.offsetHeight+"px",W.getBoundingClientRect().y-ee.getBoundingClientRect().y!=-W.offsetHeight&&(ee.style.top=parseInt(ee.style.top.substring(0,ee.style.top.length-2))+(W.getBoundingClientRect().y-ee.getBoundingClientRect().y)+W.offsetHeight+"px"),ee.style.left=W.getBoundingClientRect().x-(f.right?100:0)+"px"},A=E.ref(null),I=E.ref(null),$=E.ref(0);return(W,ee)=>(E.openBlock(),E.createElementBlock("div",{class:"d-flex",id:W.id},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:A,class:"btn btn-outline-secondary",type:"button",onClick:ee[0]||(ee[0]=R=>g())},[W.label?(E.openBlock(),E.createElementBlock("span",C6t,E.toDisplayString(W.label),1)):E.createCommentVNode("",!0),W.icon?(E.openBlock(),E.createElementBlock("span",E6t,[E.createElementVNode("i",{class:E.normalizeClass(W.icon)},null,2)])):E.createCommentVNode("",!0)],512),_.value?(E.openBlock(),E.createElementBlock("div",{key:0,class:"ddm-menu",ref_key:"DropDownMenu",ref:I,style:E.normalizeStyle({"margin-top":$.value+"px"})},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(W.options,R=>(E.openBlock(),E.createElementBlock("div",{key:R.icon,class:"ddm-item",onClick:le=>R.command(W.item)},[E.createElementVNode("i",{class:E.normalizeClass(R.icon)},null,2),E.createTextVNode(E.toDisplayString(R.label),1)],8,w6t))),128))],4)):E.createCommentVNode("",!0)],8,k6t))}}),D6t={class:"d-flex"},A6t=["disabled"],P6t={class:"d-flex gap-2 align-items-center"},HVe=E.defineComponent({__name:"DropDownButton",props:{id:{},icon:{},label:{},options:{},selected:{},btnlabel:{}},emits:["selected","buttonpressed"],setup(l,{emit:f}){const _=l,g=f,T=I=>{_.selected.value=I,g("selected",_.selected.value)},A=()=>{g("buttonpressed",_.selected.value)};return(I,$)=>{var W,ee,R;return E.openBlock(),E.createElementBlock("div",D6t,[E.createVNode(JM,{id:I.id,label:I.label,options:I.options,selected:(W=I.selected.value)==null?void 0:W.id,btnextraclass:"ddb-dropdown-btn",onSelected:T},null,8,["id","label","options","selected"]),E.createElementVNode("button",{type:"button",class:"btn btn-primary ddb-button",disabled:!((ee=_.selected)!=null&&ee.value)||((R=_.selected)==null?void 0:R.value.id)=="",onClick:A},[E.createElementVNode("span",P6t,[E.createTextVNode(E.toDisplayString(I.btnlabel),1),E.createElementVNode("i",{class:E.normalizeClass(I.icon)},null,2)])],8,A6t)])}}}),N6t=["id"],I6t=["disabled"],O6t={class:"ddcb-label"},F6t=["id"],M6t={class:"ddcb-item-list"},Rne=E.defineComponent({__name:"DropDownCheckBox",props:{id:{},label:{},selectedIds:{},options:{},opentop:{type:Boolean},disableFilter:{type:Boolean},filterevent:{type:Boolean},disabled:{type:Boolean},btnextraclass:{}},emits:["selected","filtered"],setup(l,{emit:f}){const _=l;E.watch(_.options,()=>{_.filterevent&&(Ge.value=_.options.value)}),E.watch(()=>_.selectedIds,()=>{g=_.selectedIds?_.selectedIds:[],R()}),E.watch(()=>_.label,()=>{R()});let g=[];g=_.selectedIds?_.selectedIds:[];const T=f,A=Ot=>{Ot?$.value=Ot.label:$.value=_.label,T("selected",g)},I="törlés",$=E.ref(""),W=E.ref(null);E.watch(()=>W.value,()=>{W.value&&document.getElementById(W.value.id).scrollIntoView()});const ee=()=>{if(g.length==0)$.value=_.label;else if(g.length==1){const Ot=_.options.value.filter(zr=>g.includes(zr.id)).map(zr=>zr.label);$.value=Ot[0]}else $.value=`${g.length}db kiválasztva`},R=()=>{if(_.options.value&&_.selectedIds){_.options.value.filter(zr=>zr.id==_.selectedIds.find(Kr=>Kr==zr.id)).length==0&&Be(""),ee();return}},le=Ot=>{const zr=()=>W?Ge.value.indexOf(W.value,0):-1,Kr=document.getElementById(`${_.id}-clear-btn`);if(Kr==Ot.target&&Ot.key=="ArrowDown"){sr.value.focus(),W.value=Ge.value[0];return}if(sr.value&&sr.value==Ot.target){if(Ot.key=="ArrowUp"){const nr=zr();if(nr<1){Kr&&Kr.focus();return}W.value=Ge.value[nr-1];return}if(Ot.key=="ArrowDown"){const nr=zr();if(nr>=Ge.value.length-1)return;W.value=Ge.value[nr+1];return}if(Ot.key=="Enter"){if(!W.value)return;g.push(W.value.id),A(W.value),St.value=="block"&&(St.value="none");return}}},te=()=>{St.value=="block"&&(St.value="none")};E.onMounted(()=>{_.label&&($.value=_.label),R(),_e="",document.addEventListener("click",te),at(),document.addEventListener("keydown",le)}),E.onUnmounted(()=>{document.removeEventListener("keydown",le),document.removeEventListener("click",te)});let _e="";const Be=Ot=>{_e=Ot,_.filterevent?T("filtered",Ot):Ot==""?Ge.value=_.options.value:Ge.value=_.options.value.filter(zr=>zr.label.toLowerCase().includes(Ot.toLowerCase()))},Ge=E.ref([]),et=()=>{g=[],T("selected",g),A(null),Be("")},gt=()=>{setTimeout(()=>{St.value="block"},10),setTimeout(at,20)},at=()=>{const Ot=dt.value,zr=nt.value;_.opentop?zr.style.top=Ot.getBoundingClientRect().y-zr.offsetHeight+"px":(zr.style.top=Ot.getBoundingClientRect().y+Ot.offsetHeight+"px",Ot.getBoundingClientRect().y-zr.getBoundingClientRect().y!=-Ot.offsetHeight&&(zr.style.top=parseInt(zr.style.top.substring(0,zr.style.top.length-2))+(Ot.getBoundingClientRect().y-zr.getBoundingClientRect().y)+Ot.offsetHeight+"px")),sr.value&&sr.value.focus()},dt=E.ref(null),nt=E.ref(null),St=E.ref("none"),sr=E.ref(null),$t=(Ot,zr)=>{Ot.checked?g.push(zr.id):g=g.filter(Kr=>Kr!=zr.id),ee(),T("selected",g)},_r=Ot=>g.includes(Ot.id);return(Ot,zr)=>(E.openBlock(),E.createElementBlock("div",{id:Ot.id,class:"ddcb-flex"},[E.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:dt,class:E.normalizeClass(["btn btn-outline-secondary ddcb-toggle ddcb-flex",Ot.btnextraclass]),type:"button",disabled:Ot.disabled,onClick:zr[0]||(zr[0]=()=>{Be(E.unref(_e)),gt()})},[E.createElementVNode("div",O6t,E.toDisplayString($.value),1)],10,I6t),E.createElementVNode("div",{class:"ddcb-menu",style:E.normalizeStyle({display:St.value}),ref_key:"DropDownMenu",ref:nt},[$.value!=_.label?(E.openBlock(),E.createElementBlock("button",{key:0,id:`${Ot.id}-clear-btn`,type:"button",class:"btn btn-outline-secondary ddcb-button",onClick:zr[1]||(zr[1]=Kr=>et())},E.toDisplayString(I),8,F6t)):E.createCommentVNode("",!0),Ot.disableFilter?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("input",{key:1,ref_key:"ddSearch",ref:sr,type:"text ",class:"form-control",placeholder:"keresés",onInput:zr[2]||(zr[2]=Kr=>Be(Kr.target.value)),onClick:zr[3]||(zr[3]=Kr=>Kr.stopPropagation())},null,544)),E.createElementVNode("div",M6t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(Ge.value,Kr=>(E.openBlock(),E.createBlock(OM,{label:Kr.label,id:Kr.id,checked:_r(Kr),onChanged:nr=>$t(nr,Kr)},null,8,["label","id","checked","onChanged"]))),256))])],4)],8,N6t))}});function GVe(l){return E.getCurrentScope()?(E.onScopeDispose(l),!0):!1}function gSe(){const l=new Set,f=A=>{l.delete(A)};return{on:A=>{l.add(A);const I=()=>f(A);return GVe(I),{off:I}},off:f,trigger:(...A)=>Promise.all(Array.from(l).map(I=>I(...A))),clear:()=>{l.clear()}}}const YVe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const L6t=()=>{};function hSe(...l){if(l.length!==1)return E.toRef(...l);const f=l[0];return typeof f=="function"?E.readonly(E.customRef(()=>({get:f,set:L6t}))):E.ref(f)}function Cze(l,f=!1,_="Timeout"){return new Promise((g,T)=>{setTimeout(f?()=>T(_):g,l)})}function R6t(l,...f){return f.some(_=>_ in l)}function nTe(l,f=!1){function _(le,{flush:te="sync",deep:_e=!1,timeout:Be,throwOnTimeout:Ge}={}){let et=null;const at=[new Promise(dt=>{et=E.watch(l,nt=>{le(nt)!==f&&(et?et():E.nextTick(()=>et==null?void 0:et()),dt(nt))},{flush:te,deep:_e,immediate:!0})})];return Be!=null&&at.push(Cze(Be,Ge).then(()=>E.toValue(l)).finally(()=>et==null?void 0:et())),Promise.race(at)}function g(le,te){if(!E.isRef(le))return _(nt=>nt===le,te);const{flush:_e="sync",deep:Be=!1,timeout:Ge,throwOnTimeout:et}=te??{};let gt=null;const dt=[new Promise(nt=>{gt=E.watch([l,le],([St,sr])=>{f!==(St===sr)&&(gt?gt():E.nextTick(()=>gt==null?void 0:gt()),nt(St))},{flush:_e,deep:Be,immediate:!0})})];return Ge!=null&&dt.push(Cze(Ge,et).then(()=>E.toValue(l)).finally(()=>(gt==null||gt(),E.toValue(l)))),Promise.race(dt)}function T(le){return _(te=>!!te,le)}function A(le){return g(null,le)}function I(le){return g(void 0,le)}function $(le){return _(Number.isNaN,le)}function W(le,te){return _(_e=>{const Be=Array.from(_e);return Be.includes(le)||Be.includes(E.toValue(le))},te)}function ee(le){return R(1,le)}function R(le=1,te){let _e=-1;return _(()=>(_e+=1,_e>=le),te)}return Array.isArray(E.toValue(l))?{toMatch:_,toContains:W,changed:ee,changedTimes:R,get not(){return nTe(l,!f)}}:{toMatch:_,toBe:g,toBeTruthy:T,toBeNull:A,toBeNaN:$,toBeUndefined:I,changed:ee,changedTimes:R,get not(){return nTe(l,!f)}}}function j6t(l){return nTe(l)}function B6t(l,f,_={}){const{immediate:g=!0,immediateCallback:T=!1}=_,A=E.shallowRef(!1);let I;function $(){I&&(clearTimeout(I),I=void 0)}function W(){A.value=!1,$()}function ee(...R){T&&l(),$(),A.value=!0,I=setTimeout(()=>{A.value=!1,I=void 0,l(...R)},E.toValue(f))}return g&&(A.value=!0,YVe&&ee()),GVe(W),{isPending:E.shallowReadonly(A),start:ee,stop:W}}const $6t=YVe?window:void 0,J6t={json:"application/json",text:"text/plain"};function mne(l){return l&&R6t(l,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const z6t=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function q6t(l){return z6t.test(l)}function Xq(l){return typeof Headers<"u"&&l instanceof Headers?Object.fromEntries(l.entries()):l}function pM(l,...f){return l==="overwrite"?async _=>{let g;for(let T=f.length-1;T>=0;T--)if(f[T]!=null){g=f[T];break}return g?{..._,...await g(_)}:_}:async _=>{for(const g of f)g&&(_={..._,...await g(_)});return _}}function V6t(l={}){const f=l.combination||"chain",_=l.options||{},g=l.fetchOptions||{};function T(A,...I){const $=E.computed(()=>{const R=E.toValue(l.baseUrl),le=E.toValue(A);return R&&!q6t(le)?W6t(R,le):le});let W=_,ee=g;return I.length>0&&(mne(I[0])?W={...W,...I[0],beforeFetch:pM(f,_.beforeFetch,I[0].beforeFetch),afterFetch:pM(f,_.afterFetch,I[0].afterFetch),onFetchError:pM(f,_.onFetchError,I[0].onFetchError)}:ee={...ee,...I[0],headers:{...Xq(ee.headers)||{},...Xq(I[0].headers)||{}}}),I.length>1&&mne(I[1])&&(W={...W,...I[1],beforeFetch:pM(f,_.beforeFetch,I[1].beforeFetch),afterFetch:pM(f,_.afterFetch,I[1].afterFetch),onFetchError:pM(f,_.onFetchError,I[1].onFetchError)}),U6t($,ee,W)}return T}function U6t(l,...f){var _,g;const T=typeof AbortController=="function";let A={},I={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const $={method:"GET",type:"text",payload:void 0};f.length>0&&(mne(f[0])?I={...I,...f[0]}:A=f[0]),f.length>1&&mne(f[1])&&(I={...I,...f[1]});const{fetch:W=(g=(_=$6t)==null?void 0:_.fetch)!=null?g:globalThis==null?void 0:globalThis.fetch,initialData:ee,timeout:R}=I,le=gSe(),te=gSe(),_e=gSe(),Be=E.shallowRef(!1),Ge=E.shallowRef(!1),et=E.shallowRef(!1),gt=E.shallowRef(null),at=E.shallowRef(null),dt=E.shallowRef(null),nt=E.shallowRef(ee||null),St=E.computed(()=>T&&Ge.value);let sr,$t;const _r=hn=>{T&&(sr==null||sr.abort(hn),sr=new AbortController,sr.signal.onabort=()=>et.value=!0,A={...A,signal:sr.signal})},Ot=hn=>{Ge.value=hn,Be.value=!hn};R&&($t=B6t(_r,R,{immediate:!1}));let zr=0;const Kr=async(hn=!1)=>{var sn,_n;_r(),Ot(!0),dt.value=null,gt.value=null,et.value=!1,zr+=1;const qi=zr,Oi={method:$.method,headers:{}},ua=E.toValue($.payload);if(ua){const hi=Xq(Oi.headers),Fi=Object.getPrototypeOf(ua);!$.payloadType&&ua&&(Fi===Object.prototype||Array.isArray(Fi))&&!(ua instanceof FormData)&&($.payloadType="json"),$.payloadType&&(hi["Content-Type"]=(sn=J6t[$.payloadType])!=null?sn:$.payloadType),Oi.body=$.payloadType==="json"?JSON.stringify(ua):ua}let ts=!1;const Rn={url:E.toValue(l),options:{...Oi,...A},cancel:()=>{ts=!0}};if(I.beforeFetch&&Object.assign(Rn,await I.beforeFetch(Rn)),ts||!W)return Ot(!1),Promise.resolve(null);let _i=null;return $t&&$t.start(),W(Rn.url,{...Oi,...Rn.options,headers:{...Xq(Oi.headers),...Xq((_n=Rn.options)==null?void 0:_n.headers)}}).then(async hi=>{if(at.value=hi,gt.value=hi.status,_i=await hi.clone()[$.type](),!hi.ok)throw nt.value=ee||null,new Error(hi.statusText);return I.afterFetch&&({data:_i}=await I.afterFetch({data:_i,response:hi,context:Rn,execute:Kr})),nt.value=_i,le.trigger(hi),hi}).catch(async hi=>{let Fi=hi.message||hi.name;if(I.onFetchError&&({error:Fi,data:_i}=await I.onFetchError({data:_i,error:hi,response:at.value,context:Rn,execute:Kr})),dt.value=Fi,I.updateDataOnError&&(nt.value=_i),te.trigger(hi),hn)throw hi;return null}).finally(()=>{qi===zr&&Ot(!1),$t&&$t.stop(),_e.trigger(null)})},nr=hSe(I.refetch);E.watch([nr,hSe(l)],([hn])=>hn&&Kr(),{deep:!0});const Ai={isFinished:E.readonly(Be),isFetching:E.readonly(Ge),statusCode:gt,response:at,error:dt,data:nt,canAbort:St,aborted:et,abort:_r,execute:Kr,onFetchResponse:le.on,onFetchError:te.on,onFetchFinally:_e.on,get:ii("GET"),put:ii("PUT"),post:ii("POST"),delete:ii("DELETE"),patch:ii("PATCH"),head:ii("HEAD"),options:ii("OPTIONS"),json:Qn("json"),text:Qn("text"),blob:Qn("blob"),arrayBuffer:Qn("arrayBuffer"),formData:Qn("formData")};function ii(hn){return(sn,_n)=>{if(!Ge.value)return $.method=hn,$.payload=sn,$.payloadType=_n,E.isRef($.payload)&&E.watch([nr,hSe($.payload)],([qi])=>qi&&Kr(),{deep:!0}),{...Ai,then(qi,Oi){return Dt().then(qi,Oi)}}}}function Dt(){return new Promise((hn,sn)=>{j6t(Be).toBe(!0).then(()=>hn(Ai)).catch(sn)})}function Qn(hn){return()=>{if(!Ge.value)return $.type=hn,{...Ai,then(sn,_n){return Dt().then(sn,_n)}}}}return I.immediate&&Promise.resolve().then(()=>Kr()),{...Ai,then(hn,sn){return Dt().then(hn,sn)}}}function W6t(l,f){return!l.endsWith("/")&&!f.startsWith("/")?`${l}/${f}`:l.endsWith("/")&&f.startsWith("/")?`${l.slice(0,-1)}${f}`:`${l}${f}`}const XVe=l=>/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/.test(l);class jne{constructor(f,_,g){qf(this,"title");qf(this,"message");qf(this,"errorCode");this.title=f,this.message=_,this.errorCode=g}}var Kk=(l=>(l[l.GET=0]="GET",l[l.GET_TEXT=1]="GET_TEXT",l[l.POST=2]="POST",l[l.POST_TEXT=3]="POST_TEXT",l[l.PUT=4]="PUT",l[l.PUT_TEXT=5]="PUT_TEXT",l[l.PATCH=6]="PATCH",l[l.DELETE=7]="DELETE",l))(Kk||{});class q6{constructor(f,_,g,T,A="application/json",I){qf(this,"fetchMethode");this.relativeUrl=_,this.method=g,this.fetchMethode=V6t({baseUrl:f,fetchOptions:{credentials:f.indexOf("localhost")!=-1||XVe(f)?"omit":"include"},options:{immediate:!1,beforeFetch:$=>{A&&($.options.headers={"Content-Type":A}),I&&($.options.headers={...$.options.headers,...I})},onFetchError:$=>{var R;if(((R=$.error)==null?void 0:R.name)==="AbortError")return $;let W="Ismeretlen eredetű hiba!",ee=!$.response;return $.response&&($.response.ok||(ee=!0,W=T.get($.response.status),W||(W=`${Kk[g]} for Call: ${_} with Status: ${$.response.status} has no registered errorMessages!`,console.error(W)))),ee&&window.dispatchEvent(new CustomEvent("fetch-error",{detail:new jne("Hiba a szerver elérése közben...",W)})),$},afterFetch:$=>$}})}}function V6(l,f,_,g){const T={};return T.payload=E.ref(f),T.routeParams=E.ref(_),T.queryParams=E.ref(g),T.isFetching=E.ref(!1),T.data=E.ref(),T.execute=()=>{T.fetch&&T.fetch.canAbort.value&&T.fetch.abort();const A=`${H6t(l.relativeUrl,T.routeParams.value,T.queryParams.value)}`,I=l.fetchMethode(A);let $;const W=I.isFetching;async function ee(){if(R()&&T.successCallback)T.successCallback(T.data.value);else if(!R()&&T.errorCallback){console.log(T.fetch.error.value);let le;if(T.fetch.response.value&&T.fetch.response.value.body){const te=T.fetch.response.value.body.getReader(),{value:_e,done:Be}=await te.read();!Be&&_e&&(le=new TextDecoder().decode(_e),console.log("Response Body:",le))}T.errorCallback(new jne(T.fetch.error.value,le,T.fetch.statusCode.value?T.fetch.statusCode.value:void 0))}T.finallyCallback&&T.finallyCallback()}function R(){return T.fetch.statusCode&&T.fetch.statusCode.value>=200&&T.fetch.statusCode.value<=299}switch(l.method){case 0:$=I.get().json().data;break;case 1:$=I.get().text().data;break;case 4:$=I.put(T.payload).json().data;break;case 5:$=I.put(T.payload).text().data;break;case 3:$=I.post(T.payload).text().data;break;case 2:$=I.post(T.payload).json().data;break;case 6:$=I.patch(T.payload).json().data;break;case 7:$=I.delete(T.payload).json().data;break;default:throw new Error(`Method: ${l.method} is not implemented!`)}E.watch($,le=>{T.data.value=le}),E.watch(W,le=>{T.isFetching.value=le,le||ee()}),T.fetch=I,I.execute()},T}function H6t(l,f,_){let g=l;return g||(g=""),g.slice(-1)==="/"&&(g=g.substring(0,g.length-1)),f&&Object.keys(f).forEach(T=>{if(g.indexOf(`{${T}}`)===-1)throw window.dispatchEvent(new CustomEvent("fetch-error",{detail:new jne("Hiba!",`RouteParams: ${T} not found in url: ${g}! Contact the developers!`)})),new Error(`RouteParams: ${T} not found in url: ${g}! Contact the developers!`);const A=f[T];g=g.replace(`{${T}}`,A)}),_&&(g.indexOf("?")===-1&&(g+="?"),Object.keys(_).forEach(T=>{const A=_[T];g+=`${T}=${A}`})),g}const G6t=l=>{if(l=="NaN-NaN-NaN"||!l)return null;const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")}`},Y6t=l=>{if(!l)return"-";const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")} ${f.getHours()}:${f.getMinutes()}`},X6t=l=>{if(!l)return"-";const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")} ${f.getHours().toString().padStart(2,"0")}:${f.getMinutes().toString().padStart(2,"0")}`},Q6t=l=>{if(!l)return"-";const f=new Date(Date.parse(l));return`${f.getFullYear()}-${(f.getMonth()+1).toString().padStart(2,"0")}-${f.getDate().toString().padStart(2,"0")}`},Z6t=l=>{const f=new Date(Date.parse(l)),_=f.getUTCFullYear(),g=String(f.getUTCMonth()+1).padStart(2,"0"),T=String(f.getUTCDate()).padStart(2,"0"),A=String(f.getUTCHours()).padStart(2,"0"),I=String(f.getUTCMinutes()).padStart(2,"0"),$=String(f.getUTCSeconds()).padStart(2,"0");return`${_}-${g}-${T}T${A}:${I}:${$}Z`},K6t=l=>{const f=new Date(Date.parse(l)),_=f.getUTCFullYear(),g=String(f.getUTCMonth()+1).padStart(2,"0"),T=String(f.getUTCDate()).padStart(2,"0");return`${_}-${g}-${T}`},eAt=l=>{const f=new Date(Date.parse(l)),_=f.getFullYear(),g=String(f.getMonth()+1).padStart(2,"0"),T=String(f.getDate()).padStart(2,"0");return`${_}-${g}-${T}`},QVe=l=>{if(!l)return null;const f=new Date(l);if(isNaN(f))return null;const _=f.getFullYear(),g=String(f.getMonth()+1).padStart(2,"0"),T=String(f.getDate()).padStart(2,"0"),A=String(f.getHours()).padStart(2,"0"),I=String(f.getMinutes()).padStart(2,"0");return`${_}-${g}-${T} ${A}:${I}`},sV=l=>{if(!l)return null;const f=new Date(l);if(isNaN(f))return null;const _=f.getFullYear(),g=String(f.getMonth()+1).padStart(2,"0"),T=String(f.getDate()).padStart(2,"0");return`${_}-${g}-${T}`},gne=(l,f=!1)=>{if(!l)return null;const _=new Date(l);if(isNaN(_))return null;if(f)return sV(_)+"T00:00:00.000Z";const g=_.getUTCFullYear(),T=String(_.getUTCMonth()+1).padStart(2,"0"),A=String(_.getUTCDate()).padStart(2,"0"),I=String(_.getUTCHours()).padStart(2,"0"),$=String(_.getUTCMinutes()).padStart(2,"0"),W=String(_.getUTCSeconds()).padStart(2,"0");return`${g}-${T}-${A}T${I}:${$}:${W}.000Z`},tAt=(l,f=500)=>{let _;return()=>{clearTimeout(_),_=setTimeout(()=>{l()},f)}};function ZVe(l){return new KVe(l)}class KVe{constructor(f){qf(this,"baseUrl");qf(this,"searchPosts");qf(this,"partnersDetailsByIds");qf(this,"whoAmI");qf(this,"getPostsConfig");qf(this,"getImagesConfig");qf(this,"getPresenceConfig");qf(this,"sites");qf(this,"getMeta");this.articleEditorBackendUrl=f,this.baseUrl=this.articleEditorBackendUrl,this.getMeta=V6(new q6(this.baseUrl,"admin/Embeds/meta",Kk.POST,new Map([[400,"Meta lekérdezése ismeretlen hiba!"],[500,"Meta lekérdezése ismeretlen hiba!"]])),{url:""},void 0,void 0),this.searchPosts=V6(new q6(this.baseUrl,"admin/Posts/searchPosts",Kk.POST,new Map([[400,"Cikkek lekérdezése ismeretlen hiba!"],[500,"Cikkek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0),this.partnersDetailsByIds=V6(new q6(this.baseUrl,"api/Partners/detailsByIds",Kk.POST,new Map([[400,"BrandChannelek lekérdezése ismeretlen hiba!"],[500,"BrandChannelek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0),this.whoAmI=V6(new q6(this.baseUrl,"whoami",Kk.GET,new Map([[400,"Felhasználói adatok lekérdezése ismeretlen hiba!"],[500,"Felhasználói adatok lekérdezése ismeretlen hiba!"]])),void 0,void 0,void 0),this.getPostsConfig=V6(new q6(this.baseUrl,"/admin/Widgets/{name}",Kk.GET,new Map([[400,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getImagesConfig=V6(new q6(this.baseUrl,"/admin/Widgets/{name}",Kk.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getPresenceConfig=V6(new q6(this.baseUrl,"/admin/Widgets/{name}",Kk.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.sites=V6(new q6(this.baseUrl,"/admin/sites",Kk.GET,new Map([[400,"Site lekérése ismeretlen hiba!"],[500,"Site lekérése ismeretlen hiba!"]])),void 0,void 0,void 0)}}let Rre=null,Nq=[],Td=!1;function rAt(){if(Rre)return Td&&console.debug("[currentUserInfo] Returning existing store instance"),Rre;Td&&console.debug("[currentUserInfo] Creating new store instance");const l=E.ref(null),f=E.ref("loading"),_=E.ref(null),g=E.ref(null),T=E.computed(()=>f.value==="loading"),A=E.computed(()=>f.value==="authenticated"&&l.value!==null),I=E.computed(()=>{var Be;return((Be=l.value)==null?void 0:Be.displayName)??""}),$=E.computed(()=>{var Be;return((Be=l.value)==null?void 0:Be.email)??""}),W=E.computed(()=>{var Be;return((Be=l.value)==null?void 0:Be.roles)??[]});async function ee(Be,Ge){Td=Ge??!1,Td&&console.debug("[currentUserInfo] initialize() called",{backendUrl:Be}),Td&&console.debug("[currentUserInfo] Starting initialization"),g.value=Be,f.value="loading",_.value=null;try{const et=ZVe(Be);await new Promise((gt,at)=>{(et.baseUrl.indexOf("localhost")!=-1||XVe(et.baseUrl))&&(Td&&console.debug("[currentUserInfo] Localhost/IP detected, using dev credentials"),l.value={displayName:"developer",email:"developer@hvg.hu",roles:["devadmin"],id:"00000000-0000-0000-0000-000000000000"},f.value="authenticated",gt()),et.whoAmI.successCallback=dt=>{var nt;Td&&console.debug("[currentUserInfo] whoAmI success",{displayName:dt.displayName,email:dt.email,rolesCount:((nt=dt.roles)==null?void 0:nt.length)??0}),l.value=dt,f.value="authenticated",gt()},et.whoAmI.errorCallback=dt=>{Td&&console.error("[currentUserInfo] whoAmI failed:",dt),_.value=dt.message??"Ismeretlen hiba történt",f.value="error",at(new Error(_.value))},Td&&console.debug("[currentUserInfo] Executing whoAmI request"),et.whoAmI.execute()}),await new Promise((gt,at)=>{et.sites.successCallback=dt=>{Td&&console.debug("[currentUserInfo] sites fetch success",{sitesCount:dt.length}),Nq=dt,gt()},et.sites.errorCallback=dt=>{Td&&console.error("[currentUserInfo] sites fetch failed:",dt),at(new Error(dt.message??"Ismeretlen hiba történt"))},Td&&console.debug("[currentUserInfo] Executing sites request"),et.sites.execute()}),Td&&console.debug("[currentUserInfo] Initialization completed successfully")}catch(et){throw Td&&console.error("[currentUserInfo] initialize failed:",et),f.value="error",_.value||(_.value="Felhasználói adatok vagy site-ok lekérése sikertelen"),et}}function R(){Td&&console.debug("[currentUserInfo] clear() called, resetting all state"),l.value=null,f.value="loading",_.value=null,g.value=null,Nq=[]}function le(Be,Ge,et){var at;if(Td&&console.debug("[currentUserInfo] hasPermission() check",{siteId:Be,entityName:Ge,accessLevel:et}),!((at=l.value)!=null&&at.roles)||l.value.roles.length===0)return Td&&console.debug("[currentUserInfo] hasPermission() denied: no roles"),!1;if(l.value.roles.includes("devadmin"))return Td&&console.debug("[currentUserInfo] hasPermission() granted: devadmin role"),!0;const gt=et==="admin"?["admin"]:["reader","admin"];for(const dt of gt){const nt=`cms-${Be}-${Ge}-${dt}`;if(l.value.roles.includes(nt))return Td&&console.debug("[currentUserInfo] hasPermission() granted: specific role",nt),!0;const St=`cms-${Be}-all-${dt}`;if(l.value.roles.includes(St))return Td&&console.debug("[currentUserInfo] hasPermission() granted: all-entity role",St),!0}return Td&&console.debug("[currentUserInfo] hasPermission() denied: no matching roles"),!1}function te(Be,Ge){if(Td&&console.debug("[currentUserInfo] getMixableSitesForResource() called",{entityName:Be,currentSiteId:Ge}),!g.value)throw Td&&console.error("[currentUserInfo] getMixableSitesForResource called before initialize"),new Error("Store nincs inicializálva. Hívd meg előbb az initialize() metódust!");const et=Nq.find(at=>at.id===Ge);Td&&console.debug("[currentUserInfo] Current site lookup",{found:!!et,totalSites:Nq.length});const gt=[];return Nq.forEach(at=>{if(et===void 0){if(!le(at.id,Be,"reader"))return;gt.push(at)}else{if(et.entities.find(dt=>dt.type===Be&&dt.allowedSiteIds.includes(at.id))===void 0||!le(at.id,Be,"reader"))return;gt.push(at)}}),Td&&console.debug("[currentUserInfo] getMixableSitesForResource() result",{mixableCount:gt.length,mixableSiteIds:gt.map(at=>at.id)}),gt}function _e(Be,Ge){return Td&&console.debug("[currentUserInfo] getMixableSiteIdsForResource() called",{entityName:Be,currentSiteId:Ge}),te(Be,Ge).map(gt=>gt.id)}return Rre={user:l,state:f,error:_,isLoading:T,isAuthenticated:A,displayName:I,email:$,roles:W,initialize:ee,clear:R,hasPermission:le,getMixableSitesForResource:te,getMixableSiteIdsForResource:_e},Rre}const nAt=()=>{var l;return(l=window.cmsContext)==null?void 0:l.currentSite},iAt={class:"d-flex flex-column w-100 gap-2"},aAt={class:"d-flex flex-row justify-content-between p-2"},sAt={key:0,class:"d-flex flex-column gap-2"},oAt={class:"d-flex flex-row justify-content-between"},cAt={class:"d-flex flex-row justify-content-between"},lAt=["onClick"],uAt={key:0,class:"d-flex flex-row gap-3"},fAt={class:"d-flex flex-column w-100"},_At=["disabled","value"],pAt=["disabled","value"],dAt={class:"d-flex gap-2"},mAt={key:1,class:"d-flex justify-content-around flex-wrap gap-4 p-2"},gAt=["onClick"],hAt={key:2,class:"d-flex justify-content-around flex-wrap gap-4 p-2 cc-years"},vAt=["onClick"],JTe=E.defineComponent({__name:"CalendarComponent",props:{init:{},dateOnly:{type:Boolean}},emits:["changed"],setup(l,{emit:f}){const _=l,g=f,T=E.ref([]),A=E.ref(["H","K","Sz","Cs","P","Sz","V"]),I=E.ref(["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"]),$=E.ref([2025]),W=E.ref(""),ee=E.ref(2025),R=E.ref({local:null,utc:null}),le=E.ref(new Date),te=E.ref("00"),_e=E.ref("00"),Be=E.ref(!1),Ge=E.ref("calendar");E.onMounted(()=>{et(_.init?_.init:null),gt(_.init?_.init:new Date)});const et=dt=>{if(dt){if(dt.setSeconds(0),_.dateOnly){const nt=new Date(dt);nt.setHours(0),nt.setMinutes(0),nt.setSeconds(0),R.value.local=nt,te.value="00",_e.value="00",R.value.utc=gne(nt,!0)}else R.value.local=new Date(dt),te.value=dt.getHours().toString().padStart(2,"0"),_e.value=dt.getMinutes().toString().padStart(2,"0"),R.value.utc=gne(dt);Be.value=!0}else te.value="00",_e.value="00",R.value={local:null,utc:null},Be.value=!1},gt=dt=>{let nt=new Date(dt);nt.setSeconds(0),le.value=new Date(nt),W.value=I.value[nt.getMonth()],ee.value=nt.getFullYear(),$.value=Array.from({length:60},(nr,Ai)=>nt.getFullYear()-29+Ai);const St=nt.getMonth();nt.setDate(1);const sr=[{days:[]}];let $t=sr[0],_r=1;const Ot=nr=>nr.getDay()==0?6:nr.getDay()-1;let zr=Ot(nt);for(let nr=0;nr<zr;nr++)$t.days.push({label:"",isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:nr});const Kr=new Date;for(;nt.getMonth()===St;)zr=Ot(nt),zr==0&&($t={days:[]},sr.push($t)),$t.days.push({label:_r.toString(),isCurrent:nt.getFullYear()==Kr.getFullYear()&&nt.getMonth()==Kr.getMonth()&&nt.getDate()==Kr.getDate(),isSelected:R.value.local?R.value.local.getFullYear()==nt.getFullYear()&&R.value.local.getMonth()==nt.getMonth()&&R.value.local.getDate()==nt.getDate():!1,isWeekend:zr==5||zr==6,isBlank:!1,number:_r}),_r++,nt.setDate(nt.getDate()+1);for(zr=Ot(nt);zr!=6;)$t.days.push({label:_r.toString(),isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:0}),nt.setDate(nt.getDate()+1),zr=Ot(nt);T.value=sr},at=()=>{let dt=new Date;dt.setHours(0),dt.setMinutes(0),dt.setSeconds(0),et(null),gt(dt),g("changed",R.value)};return(dt,nt)=>(E.openBlock(),E.createElementBlock("div",iAt,[E.createElementVNode("div",aAt,[E.createElementVNode("div",{class:"cc-btn",onClick:nt[0]||(nt[0]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()-1),gt(St)})}," < "),E.createElementVNode("div",{class:"cc-btn",onClick:nt[1]||(nt[1]=St=>Ge.value="years")},E.toDisplayString(ee.value),1),E.createElementVNode("div",{class:"cc-btn",onClick:nt[2]||(nt[2]=St=>Ge.value="months")},E.toDisplayString(W.value),1),E.createElementVNode("div",{class:"cc-btn",onClick:nt[3]||(nt[3]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()+1),gt(St)})}," > ")]),Ge.value=="calendar"?(E.openBlock(),E.createElementBlock("div",sAt,[E.createElementVNode("div",oAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(A.value,St=>(E.openBlock(),E.createElementBlock("div",null,E.toDisplayString(St),1))),256))]),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(T.value,St=>(E.openBlock(),E.createElementBlock("div",cAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(St.days,sr=>(E.openBlock(),E.createElementBlock("div",{class:E.normalizeClass(["d-flex flex-row justify-content-center cc-day",{"cc-day-weekend":sr.isWeekend,"cc-day-blank":sr.isBlank,"cc-day-current":sr.isCurrent,"cc-day-selected":sr.isSelected}]),onClick:()=>{let $t=new Date(le.value.getFullYear(),le.value.getMonth(),sr.number,Number.parseInt(te.value),Number.parseInt(_e.value));et($t),gt($t)}},E.toDisplayString(sr.label),11,lAt))),256))]))),256)),dt.dateOnly?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",uAt,[E.createElementVNode("div",null,E.toDisplayString(te.value)+":"+E.toDisplayString(_e.value),1),E.createElementVNode("div",fAt,[E.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"23",disabled:!Be.value,value:te.value,onInput:nt[4]||(nt[4]=St=>{R.value.local.setHours(St.target.value),et(R.value.local)})},null,40,_At),E.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"59",disabled:!Be.value,value:_e.value,onInput:nt[5]||(nt[5]=St=>{R.value.local.setMinutes(St.target.value),et(R.value.local)})},null,40,pAt)])])),E.createElementVNode("div",dAt,[E.createElementVNode("button",{type:"button",class:"btn btn-outline-secondary w-100",onClick:at},"Töröl"),E.createElementVNode("button",{type:"button",class:"btn btn-primary w-100",onClick:nt[6]||(nt[6]=St=>g("changed",R.value))},"Beállít")])])):E.createCommentVNode("",!0),Ge.value=="months"?(E.openBlock(),E.createElementBlock("div",mAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(I.value,(St,sr)=>(E.openBlock(),E.createElementBlock("div",{class:"cc-btn-light",onClick:$t=>{let _r=new Date(le.value);_r.setMonth(sr),gt(_r),Ge.value="calendar",$t.stopPropagation()}},E.toDisplayString(St),9,gAt))),256))])):E.createCommentVNode("",!0),Ge.value=="years"?(E.openBlock(),E.createElementBlock("div",hAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList($.value,St=>(E.openBlock(),E.createElementBlock("div",{class:"cc-btn-light",onClick:sr=>{let $t=new Date(le.value);$t.setFullYear(St),gt($t),Ge.value="calendar",sr.stopPropagation()}},E.toDisplayString(St),9,vAt))),256))])):E.createCommentVNode("",!0)]))}}),yAt={class:"d-flex flex-column flex-md-row gap-2"},bAt={class:"d-flex flex-row gap-2 w-100"},SAt={class:"vf-input-group"},TAt={key:0,class:"vf-floating-wrapper"},xAt={class:"vf-floating-label vf-floating-label-visible vf-floating-label-success"},kAt=["value","placeholder"],oV=E.defineComponent({__name:"DateTimePicker",props:{placeholder:{},initial:{},dateOnly:{type:Boolean}},emits:["changed","calendar"],setup(l,{emit:f}){const _=l,g=f,T=E.ref(null),A=E.ref(null),I=E.ref(""),$=E.ref(null),W=E.ref(null);E.onMounted(()=>{_.initial&&(T.value=_.initial.local,A.value=_.initial.utc,ee())});const ee=()=>{const _e=_.dateOnly?sV(T.value):QVe(T.value);I.value=_e??""},R=E.ref(!1),le=_e=>{R.value?R.value=!1:(R.value=!0,E.nextTick(()=>{const Be=W.value,et=$.value.getBoundingClientRect();Be.style.left=et.left+"px",Be.style.top=et.top+et.height+"px"})),_e&&_e.stopPropagation()},te=_e=>{const Be=new Date(Date.parse(_e)),Ge=gne(Be,_.dateOnly);if(!Ge){A.value=null,E.nextTick(()=>A.value="");return}A.value=Ge,T.value=Be,ee(),g("changed",{local:T.value,utc:A.value})};return E.watch(R,()=>{g("calendar",R.value)}),(_e,Be)=>(E.openBlock(),E.createElementBlock("div",yAt,[E.createElementVNode("div",bAt,[E.createElementVNode("div",SAt,[A.value?(E.openBlock(),E.createElementBlock("div",TAt,[E.createElementVNode("span",xAt,E.toDisplayString(_e.placeholder),1)])):E.createCommentVNode("",!0),E.createElementVNode("input",{type:"text",id:"dateTimeInputText",ref_key:"dateTimeInputTextRef",ref:$,class:"vf-input-field",value:I.value,onChange:Be[0]||(Be[0]=Ge=>te(Ge.target.value)),placeholder:_e.placeholder},null,40,kAt)]),E.createElementVNode("div",{ref:"iconBtn",class:"dateTime-picker__iconbtn",onClick:le},[...Be[2]||(Be[2]=[E.createElementVNode("i",{class:"fa-regular fa-calendar"},null,-1)])],512)]),R.value?(E.openBlock(),E.createElementBlock("div",{key:0,ref_key:"calendarRef",ref:W,class:"dateTime-picker__popup"},[E.createVNode(JTe,{init:T.value,dateOnly:_e.dateOnly,onChanged:Be[1]||(Be[1]=Ge=>{T.value=Ge.local,A.value=Ge.utc,le(null),ee(),g("changed",{local:T.value,utc:A.value})})},null,8,["init","dateOnly"])],512)):E.createCommentVNode("",!0)]))}}),CAt={class:"fltrc-container"},EAt={class:"fltrc-container"},wAt=["placeholder","value"],DAt={key:1,class:"d-flex flex-row input-group align-items-center"},AAt=["value"],PAt=["value"],zTe=E.defineComponent({__name:"FilterCompact",props:{items:{}},setup(l){const f=l,_=E.ref(0),g=E.ref(0),T=E.computed(()=>f.items[_.value].filter),A=R=>{let le=f.items[g.value];le.filter.filtered(le.filter.key,""),_.value=R,g.value=R,ee.value+=1},I=E.ref(void 0);E.onMounted(()=>{let R=[];for(let le=0;le<f.items.length;le++)R.push({icon:f.items[le].icon,label:f.items[le].label,command:()=>A(le)});I.value=R});const $=E.ref({}),W=E.ref(void 0),ee=E.ref(0);return(R,le)=>(E.openBlock(),E.createElementBlock("div",CAt,[I.value?(E.openBlock(),E.createBlock(Lne,{key:0,id:"ddm",icon:R.items[_.value].icon,item:R.items[_.value],label:"",options:I.value},null,8,["icon","item","options"])):E.createCommentVNode("",!0),E.createElementVNode("div",EAt,[T.value.type=="text"?(E.openBlock(),E.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:T.value.placeholder,value:T.value.defaultv??"",onInput:le[0]||(le[0]=te=>{T.value.filtered(T.value.key,te.target.value),T.value.defaultv=te.target.value})},null,40,wAt)):E.createCommentVNode("",!0),T.value.type=="date"?(E.openBlock(),E.createElementBlock("div",DAt,[E.createElementVNode("input",{type:"date",class:"form-control",value:T.value.defFrom??"",onInput:le[1]||(le[1]=te=>{$.value.from=te.target.value==""?null:te.target.value,T.value.defFrom=te.target.value==""?null:te.target.value,T.value.filtered(T.value.key,$.value)})},null,40,AAt),le[5]||(le[5]=E.createElementVNode("span",{class:"input-group-text"},"-",-1)),E.createElementVNode("input",{type:"date",class:"form-control",value:T.value.defTil??"",onInput:le[2]||(le[2]=te=>{$.value.until=te.target.value==""?null:te.target.value,T.value.defTil=te.target.value==""?null:te.target.value,T.value.filtered(T.value.key,$.value)})},null,40,PAt)])):E.createCommentVNode("",!0),T.value.type=="dropdown"?(E.openBlock(),E.createBlock(JM,{key:ee.value,selected:W.value,options:T.value.options,filterevent:T.value.filterevent,onFiltered:le[3]||(le[3]=te=>{T.value.onfiltered&&T.value.onfiltered(te)}),id:T.value.key,label:T.value.label,onSelected:le[4]||(le[4]=te=>T.value.filtered(T.value.key,te.id))},null,8,["selected","options","filterevent","id","label"])):E.createCommentVNode("",!0)])]))}}),NAt=["id"],IAt={class:"dtrp-label"},OAt="Törlés",FAt="Beállítás",MAt=E.defineComponent({__name:"DateRangePicker",props:{id:{},label:{}},emits:["changed"],setup(l,{emit:f}){const _=l,g=f,T=E.ref(!1),A=async()=>{T.value=!T.value,T.value&&await ee()},I=E.reactive({top:"0px",left:"0px",zIndex:1e3}),$=E.ref(null),W=E.ref(null),ee=async()=>{await E.nextTick();const sr=W.value.getBoundingClientRect(),$t=$.value;if(!$t)return;const _r=$t.getBoundingClientRect(),Ot=window.innerWidth;I.top=sr.top+sr.height+"px",sr.left<Ot/3?I.left=sr.left+"px":sr.left>2*Ot/3?I.left=sr.left+sr.width-_r.width+"px":I.left=sr.right-sr.width/2-_r.width/2+"px"},R=E.reactive({utc:null,local:null}),le=E.reactive({utc:null,local:null}),te=E.ref(""),_e=async()=>{R.local||le.local?te.value=`'${sV(R.local)??""}'-'${sV(le.local)??""}'`:te.value=_.label,await ee()},Be=St=>{const sr=document.getElementById(`${_.id}-popup`);sr&&!sr.contains(St.target)&&(T.value=!1)};let Ge=!1;E.onMounted(()=>{_e()}),E.onUnmounted(()=>{Ge&&window.removeEventListener("click",Be)});const et=()=>{R.utc=null,R.local=null,le.local=null,le.utc=null,_e(),T.value=!1,g("changed",{fromUtc:R.utc,toUtc:le.utc})},gt=()=>{_e(),T.value=!1,g("changed",{fromUtc:R.utc,toUtc:le.utc})},at=()=>{Ge||setTimeout(()=>{window.addEventListener("click",Be),Ge=!0},100)},dt=()=>{Ge&&setTimeout(()=>{window.removeEventListener("click",Be),Ge=!1},100)},nt=St=>{St?dt():at()};return E.watch(T,()=>{T.value?at():dt()}),(St,sr)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",{id:St.id,class:"dtrp-flex"},[E.createElementVNode("button",{ref_key:"popupBtnRef",ref:W,class:"btn btn-outline-secondary dtrp-flex dtrp-button",type:"button",onClick:A},[E.createElementVNode("div",IAt,E.toDisplayString(te.value),1)],512)],8,NAt),T.value?(E.openBlock(),E.createElementBlock("div",{key:0,ref_key:"popupRef",ref:$,class:"dtrp-popup d-flex flex-column gap-2",style:E.normalizeStyle(I)},[E.createVNode(oV,{placeholder:"Ettől",id:St.id+"-from",onChanged:sr[0]||(sr[0]=$t=>{R.local=$t.local,R.utc=$t.utc}),dateOnly:!0,initial:R,onCalendar:nt},null,8,["id","initial"]),E.createVNode(oV,{placeholder:"Eddig",id:St.id+"-to",onChanged:sr[1]||(sr[1]=$t=>{le.local=$t.local,le.utc=$t.utc}),dateOnly:!0,initial:le,onCalendar:nt},null,8,["id","initial"]),E.createElementVNode("div",{class:"d-flex w-100 gap-2"},[E.createElementVNode("button",{class:"btn btn-outline-secondary w-50",onClick:et},E.toDisplayString(OAt)),E.createElementVNode("button",{class:"btn btn-outline-primary w-50",onClick:gt},E.toDisplayString(FAt))])],4)):E.createCommentVNode("",!0)],64))}});class LAt{constructor(f,_){qf(this,"storageKey");qf(this,"allowedItems",[]);qf(this,"compareFn");this.storageKey=f,this.compareFn=_||((g,T)=>g===T)}getSelected(){try{const f=localStorage.getItem(this.storageKey);if(f){const g=JSON.parse(f).filter(T=>this.allowedItems.some(A=>this.compareFn(T,A)));return g.length>0?g:this.allowedItems}}catch(f){console.warn(`Error reading from localStorage key "${this.storageKey}":`,f)}return this.allowedItems}saveSelected(f){const _=f.length>0?f.filter(g=>this.allowedItems.some(T=>this.compareFn(g,T))):this.allowedItems;try{localStorage.setItem(this.storageKey,JSON.stringify(_))}catch(g){console.error(`Error writing to localStorage key "${this.storageKey}":`,g)}return _}updateAllowedItems(f){this.allowedItems=f}getAllowedItems(){return[...this.allowedItems]}}const qTe=E.defineComponent({__name:"SiteIdSelector",props:{entityType:{},label:{},sites:{}},emits:["selected"],setup(l,{emit:f}){const _=l,g=f,T=new LAt(`selectedSiteIds_${_.entityType}`),A=E.ref([]),I=E.ref([]);E.onMounted(()=>{const W=_.sites.map(ee=>ee.id);T.updateAllowedItems(W),I.value=_.sites.map(ee=>({id:`${_.entityType}-${ee.id}`,label:ee.name})),A.value=T.getSelected().map(ee=>`${_.entityType}-${ee}`),$(A.value)});const $=W=>{const ee=W.map(le=>le.replace(`${_.entityType}-`,"")),R=T.saveSelected(ee);ee.length===0?A.value=[]:A.value=R.map(le=>`${_.entityType}-${le}`),g("selected",R)};return(W,ee)=>(E.openBlock(),E.createBlock(Rne,{id:`site-selector-${W.entityType}`,label:W.label,selectedIds:A.value,options:E.ref(I.value),onSelected:$},null,8,["id","label","selectedIds","options"]))}}),RAt={class:"fltrctrl-container"},jAt=["placeholder","value"],BAt={key:1,class:"d-flex flex-row input-group align-items-center"};class $At{constructor(f,_,g){qf(this,"type");this.key=f,this.placeholder=_,this.filtered=g,this.type="text"}}class JAt{constructor(f,_,g,T,A,I,$){qf(this,"type");this.key=f,this.label=_,this.options=g,this.filterevent=T,this.onfiltered=A,this.filtered=I,this.selected=$,this.type="dropdown"}}class zAt{constructor(f,_,g,T,A,I,$){qf(this,"type");this.key=f,this.label=_,this.options=g,this.filterevent=T,this.onfiltered=A,this.filtered=I,this.selectedIds=$,this.type="dropdowncheckbox"}}class qAt{constructor(f,_,g,T,A){qf(this,"type");this.key=f,this.entityType=_,this.label=g,this.sites=T,this.filtered=A,this.type="siteidselector"}}class VAt{constructor(f,_,g,T,A){qf(this,"type");this.key=f,this.label=_,this.filtered=g,this.defFrom=T,this.defTil=A,this.type="date"}}const vSe=E.ref({}),VTe=E.defineComponent({__name:"FilterControl",props:{item:{}},setup(l){const f=l;E.onMounted(()=>{var g;if(f.item.type=="dropdown"){const T=f.item;_.value=(g=T.options.value.find(A=>A.id==f.item.defaultv))==null?void 0:g.id,T.selected&&E.watch(T.selected,()=>{var A,I;_.value=(I=(A=T.selected)==null?void 0:A.value)==null?void 0:I.id})}});const _=E.ref(void 0);return(g,T)=>(E.openBlock(),E.createElementBlock("div",RAt,[g.item.type=="text"?(E.openBlock(),E.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:g.item.placeholder,value:g.item.defaultv??"",onInput:T[0]||(T[0]=A=>g.item.filtered(g.item.key,A.target.value))},null,40,jAt)):E.createCommentVNode("",!0),g.item.type=="date"?(E.openBlock(),E.createElementBlock("div",BAt,[E.createVNode(MAt,{id:g.item.key+"-dtrp",label:g.item.label,onChanged:T[1]||(T[1]=A=>{vSe.value.from=A.fromUtc,vSe.value.until=A.toUtc,g.item.filtered(g.item.key,vSe.value)})},null,8,["id","label"])])):E.createCommentVNode("",!0),g.item.type=="dropdown"?(E.openBlock(),E.createBlock(JM,{key:2,selected:_.value,options:E.ref(g.item.options),filterevent:g.item.filterevent,onFiltered:T[2]||(T[2]=A=>{g.item.onfiltered&&g.item.onfiltered(A)}),id:g.item.key,label:g.item.label,onSelected:T[3]||(T[3]=A=>{g.item.selected&&(g.item.selected.value=g.item.options.value.find(I=>I.id==A.id)),g.item.filtered(g.item.key,A.id)})},null,8,["selected","options","filterevent","id","label"])):E.createCommentVNode("",!0),g.item.type=="dropdowncheckbox"?(E.openBlock(),E.createBlock(Rne,{key:3,selectedIds:g.item.selectedIds,options:E.ref(g.item.options),filterevent:g.item.filterevent,onFiltered:T[4]||(T[4]=A=>{g.item.onfiltered&&g.item.onfiltered(A)}),id:g.item.key,label:g.item.label,onSelected:T[5]||(T[5]=A=>g.item.filtered(g.item.key,A))},null,8,["selectedIds","options","filterevent","id","label"])):E.createCommentVNode("",!0),g.item.type=="siteidselector"?(E.openBlock(),E.createBlock(qTe,{key:4,"entity-type":g.item.entityType,label:g.item.label,sites:g.item.sites,onSelected:T[6]||(T[6]=A=>g.item.filtered(g.item.key,A))},null,8,["entity-type","label","sites"])):E.createCommentVNode("",!0)]))}}),UAt=["title"],R8=E.defineComponent({__name:"IconButton",props:{icon:{},active:{type:Boolean},big:{type:Boolean},title:{}},emits:["click"],setup(l,{emit:f}){const _=l,g=E.computed(()=>`${_.icon} ${_.big?"ib-button-big":""}`),T=f;return(A,I)=>(E.openBlock(),E.createElementBlock("div",{onClick:I[0]||(I[0]=$=>T("click")),class:"ib-container"},[E.createElementVNode("div",{class:E.normalizeClass(["ib-button",{"ib-button-active":A.active}]),title:A.title},[E.createElementVNode("i",{class:E.normalizeClass(g.value)},null,2)],10,UAt)]))}}),WAt={class:"pc-container"},HAt=["value","max"],UTe=E.defineComponent({__name:"PaginatorControl",props:{settings:{}},emits:["pagesize","page"],setup(l,{emit:f}){const _=l,g=f,T=()=>{let ee=E.ref([]);return _.settings.value.sizes.forEach(R=>ee.value.push({label:R.toString(),id:R.toString()})),ee},A=E.ref(1);E.watch(()=>_.settings.value,()=>{A.value=1});const I=E.computed(()=>Math.floor(_.settings.value.total/_.settings.value.pagesize)+1),$=()=>{A.value>1&&(A.value-=1,g("page",A.value))},W=()=>{A.value<I.value&&(A.value+=1,g("page",A.value))};return(ee,R)=>(E.openBlock(),E.createElementBlock("div",WAt,[E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:$},"<"),E.createElementVNode("input",{class:"form-control pc-input",type:"number",value:A.value,min:"1",max:I.value,onChange:R[0]||(R[0]=le=>ee.$emit("page",le.target.value))},null,40,HAt),E.createTextVNode("/"+E.toDisplayString(I.value)+" ",1),E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:W},">"),E.createVNode(JM,{opentop:!0,class:"pc-dropdown",id:"pagecount",label:"10",selected:ee.settings.value.pagesize.toString(),options:T(),onSelected:R[1]||(R[1]=le=>{A.value=1,ee.$emit("pagesize",parseInt(le.id))})},null,8,["selected","options"])]))}}),GAt={class:"form-check"},YAt=["name","id","checked"],XAt=["for"],WTe=E.defineComponent({__name:"RadioButton",props:{group:{},label:{},id:{},selected:{type:Boolean}},emits:["selected"],setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",GAt,[E.createElementVNode("input",{class:"form-check-input",type:"radio",name:f.group,id:f.id,checked:f.selected,onChange:_[0]||(_[0]=g=>f.$emit("selected",f.id))},null,40,YAt),E.createElementVNode("label",{class:"form-check-label",for:f.id},E.toDisplayString(f.label),9,XAt)]))}}),QAt={class:"d-flex flex-column gap-2 justify-content-around"},eUe=E.defineComponent({__name:"RadioButtonGroup",props:{group:{},items:{}},emits:["selected"],setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",QAt,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.items,g=>(E.openBlock(),E.createBlock(WTe,{key:g.id,id:g.id,label:g.label,group:f.group,selected:g.selected,onSelected:_[0]||(_[0]=T=>f.$emit("selected",T))},null,8,["id","label","group","selected"]))),128))]))}}),ZAt={key:0,class:"spinner-border",role:"status"},HTe=E.defineComponent({__name:"SpinningProgress",props:{loading:{type:Boolean}},setup(l){return(f,_)=>f.loading?(E.openBlock(),E.createElementBlock("div",ZAt,[..._[0]||(_[0]=[E.createElementVNode("span",{class:"visually-hidden"},"Loading...",-1)])])):E.createCommentVNode("",!0)}}),KAt={key:0,class:"t2l-table-view t2l-table-header-label"},e4t={key:0,class:"t2l-select"},t4t={key:1,class:"t2l-cell"},r4t={class:"t2l-table-view t2l-table-header-filter"},n4t={key:0,class:"t2l-select"},i4t={key:1,class:"t2l-cell"},a4t={class:"t2l-table-view t2l-rows"},s4t={key:0,class:"t2l-select"},o4t=["id","onChange"],c4t=["innerHTML"],l4t={key:1,class:"t2l-cell t2l-actions"},u4t=["title","disabled","onClick"],f4t={class:"t2l-card-view t2l-card-filters"},_4t={class:"t2l-card-filter-order"},p4t={class:"t2l-card-filter-search"},d4t={class:"t2l-card-view t2l-rows"},m4t={key:0,class:"t2l-card-select"},g4t=["id","onChange"],h4t={class:"t2l-label"},v4t=["innerHTML"],y4t={class:"d-flex align-items-center"},b4t={key:2,class:"d-flex justify-content-center t2l-footer"},tUe=E.defineComponent({__name:"TableToList",props:{items:{},config:{}},emits:["pagesize","page"],setup(l){const f=R=>R&&R.component!==void 0,_=l,g=E.computed(()=>_.config.columns.filter(R=>R.visible!=!1)),T=E.computed(()=>_.config.columns.filter(R=>R.visible!=!1&&R.filter)),A=E.computed(()=>g.value.filter(R=>R.sort&&R.sort.active&&R.sort.active.value)),I=E.computed(()=>Math.ceil(g.value.length/_.config.smColCount)),$=(R,le)=>{var te=R-1+(le-1)*I.value;return te<g.value.length?g.value[te]:null},W=(R,le)=>R.converter?R.converter(le[R.property],le):le[R.property],ee=R=>{if(R.sort&&R.sort.active){let le=!R.sort.active.value;_.config.columns.forEach(te=>{te.sort&&te.sort.active&&(te.sort.active.value=!1)}),R.sort.active.value=le,R.sort.callback(le?R.property:"")}};return(R,le)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[R.config.compact?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",KAt,[R.config.selectableId?(E.openBlock(),E.createElementBlock("span",e4t)):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,te=>{var _e,Be;return E.openBlock(),E.createElementBlock("span",{class:E.normalizeClass(["t2l-cell gap-2",te.headerClass]),key:te.property},[te.sort?(E.openBlock(),E.createBlock(R8,{key:0,icon:te.sort.icon,onClick:Ge=>ee(te),active:(Be=(_e=te.sort)==null?void 0:_e.active)==null?void 0:Be.value},null,8,["icon","onClick","active"])):E.createCommentVNode("",!0),E.createTextVNode(" "+E.toDisplayString(te.label),1)],2)}),128)),R.config.actionHeader?(E.openBlock(),E.createElementBlock("span",t4t,E.toDisplayString(R.config.actionHeader),1)):E.createCommentVNode("",!0)])),E.createElementVNode("div",r4t,[R.config.selectableId?(E.openBlock(),E.createElementBlock("span",n4t)):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,te=>(E.openBlock(),E.createElementBlock("span",{class:E.normalizeClass(["t2l-cell",te.class]),key:te.label},[te.filter?(E.openBlock(),E.createBlock(VTe,{key:0,item:te.filter},null,8,["item"])):E.createCommentVNode("",!0)],2))),128)),R.config.actionHeader?(E.openBlock(),E.createElementBlock("span",i4t)):E.createCommentVNode("",!0)]),E.createElementVNode("div",a4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.items,te=>(E.openBlock(),E.createElementBlock("div",{key:te,class:"t2l-row"},[R.config.selectableId?(E.openBlock(),E.createElementBlock("div",s4t,[E.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:_e=>te.selected=!te.selected},null,40,o4t)])):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,_e=>(E.openBlock(),E.createElementBlock("div",{class:E.normalizeClass(["t2l-cell",_e.class]),key:_e.property},[E.isVNode(W(_e,te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W(_e,te)),{key:0})):f(W(_e,te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W(_e,te).component),E.mergeProps({key:1,ref_for:!0},W(_e,te).props),null,16)):(E.openBlock(),E.createElementBlock("span",{key:2,innerHTML:String(W(_e,te)??"")},null,8,c4t))],2))),128)),R.config.actions?(E.openBlock(),E.createElementBlock("div",l4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.config.actions,_e=>(E.openBlock(),E.createElementBlock("button",{key:_e.label,type:"button",class:"btn btn-outline-secondary",title:_e.label,disabled:!_e.enabled(te),onClick:Be=>_e.command(te)},[E.createElementVNode("i",{class:E.normalizeClass(_e.icon)},null,2)],8,u4t))),128))])):E.createCommentVNode("",!0)]))),128))]),E.createElementVNode("div",f4t,[E.createElementVNode("div",_4t,[E.createVNode($Te,{id:"card-filter-order",default:{icon:"fa-solid fa-chevron-down",label:"rendezés"},selected:A.value.length>0?A.value[0].property:"",enabled:R.config.sortEnabled,options:E.ref(g.value.filter(te=>te.sort).map(te=>({icon:te.sort.icon,label:te.sort.label,value:te.property,callback:te.sort.callback})))},null,8,["selected","enabled","options"])]),E.createElementVNode("div",p4t,[E.createVNode(zTe,{items:T.value.map(te=>({filter:te.filter,icon:te.filterIcon,label:te.label}))},null,8,["items"])])]),E.createElementVNode("div",d4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.items,(te,_e)=>(E.openBlock(),E.createElementBlock("div",{class:"t2l-row",key:_e},[R.config.selectableId?(E.openBlock(),E.createElementBlock("div",m4t,[E.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:Be=>te.selected=!te.selected},null,40,g4t)])):E.createCommentVNode("",!0),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(R.config.smColCount,Be=>(E.openBlock(),E.createElementBlock("div",{class:"t2l-card-col",key:Be},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(I.value,Ge=>{var et;return E.openBlock(),E.createElementBlock(E.Fragment,{key:Ge},[$(Ge,Be)?(E.openBlock(),E.createElementBlock("div",{key:0,class:E.normalizeClass(["t2l-property",(et=$(Ge,Be))==null?void 0:et.class])},[E.createElementVNode("span",h4t,E.toDisplayString($(Ge,Be).label),1),E.isVNode(W($(Ge,Be),te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W($(Ge,Be),te)),{key:0})):f(W($(Ge,Be),te))?(E.openBlock(),E.createBlock(E.resolveDynamicComponent(W($(Ge,Be),te).component),E.mergeProps({key:1,ref_for:!0},W($(Ge,Be),te).props),null,16)):(E.openBlock(),E.createElementBlock("span",{key:2,innerHTML:String(W($(Ge,Be),te)??"")},null,8,v4t))],2)):E.createCommentVNode("",!0)],64)}),128))]))),128)),E.createElementVNode("div",y4t,[_.config.actions?(E.openBlock(),E.createBlock(Lne,{key:0,item:te,options:_.config.actions,label:"...",id:_e.toString(),right:!0},null,8,["item","options","id"])):E.createCommentVNode("",!0)])]))),128))]),R.config.paginatorSettings?(E.openBlock(),E.createBlock(UTe,{key:1,settings:R.config.paginatorSettings,onPagesize:le[0]||(le[0]=te=>R.$emit("pagesize",te)),onPage:le[1]||(le[1]=te=>R.$emit("page",te))},null,8,["settings"])):E.createCommentVNode("",!0),R.config.paginatorSettings?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",b4t," Elemek: "+E.toDisplayString(_.items.length),1))],64))}}),S4t={class:"d-flex flex flex-row"},T4t={key:1,class:"d-flex flex-column gap-2 options-body flex-grow-1"},x4t={class:"d-flex flex-grow-1 flex-column"},k4t={class:"d-flex flex-row"},C4t={class:"d-flex align-items-end"},E4t=["disabled"],rUe=E.defineComponent({__name:"TableToListOptions",props:{colCount:{},options:{},config:{}},emits:["save"],setup(l,{emit:f}){const _=l,g=E.ref([]);E.onMounted(()=>{g.value=_.options,R()});const T=E.computed(()=>_.colCount!=0?Math.ceil(_.options.length/_.colCount):0),A=(le,te)=>{var _e=_.options[(le-1)*T.value+te-1];return _e},I=()=>{$("save",g.value)},$=f,W=E.ref(!1),ee=E.ref(!0),R=()=>{ee.value=g.value.filter(le=>le.checked).length<=1};return(le,te)=>(E.openBlock(),E.createElementBlock("div",S4t,[W.value?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",{key:0,class:"d-flex flex-row align-items-center gap-2 options-header justify-content-start",onClick:te[0]||(te[0]=_e=>W.value=!W.value)},[...te[3]||(te[3]=[E.createElementVNode("i",{class:"fa-solid fa-cog"},null,-1),E.createElementVNode("div",{class:"options-header-label"},"beállítások",-1)])])),W.value?(E.openBlock(),E.createElementBlock("div",T4t,[te[5]||(te[5]=E.createElementVNode("div",{class:"options-header-label"},"Táblázat tulajdonságai",-1)),E.createElementVNode("div",x4t,[E.createVNode(OM,{id:"compact",label:"Kompakt",checked:!!le.config.compact,onChanged:te[1]||(te[1]=_e=>le.config.compact=_e.checked)},null,8,["checked"])]),te[6]||(te[6]=E.createElementVNode("div",{class:"options-header-label"},"Látható oszlopok",-1)),E.createElementVNode("div",k4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(le.colCount,_e=>(E.openBlock(),E.createElementBlock("div",{class:"d-flex flex-grow-1 flex-column",key:_e},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(T.value,Be=>(E.openBlock(),E.createElementBlock(E.Fragment,{key:Be},[A(_e,Be)?(E.openBlock(),E.createBlock(OM,{key:0,id:A(_e,Be).property,label:A(_e,Be).label,checked:A(_e,Be).checked,onChanged:te[2]||(te[2]=Ge=>{g.value.find(et=>et.property==Ge.id).checked=Ge.checked,R()})},null,8,["id","label","checked"])):E.createCommentVNode("",!0)],64))),128))]))),128)),E.createElementVNode("div",C4t,[E.createElementVNode("button",{class:"btn btn-outline-secondary",type:"button",onClick:I,disabled:ee.value},[...te[4]||(te[4]=[E.createElementVNode("i",{class:"fa-solid fa-save"},null,-1)])],8,E4t)])])])):E.createCommentVNode("",!0)]))}}),w4t={class:"tlb-container d-flex flex-column flex-grow-1"},D4t={class:"d-flex flex-row tlb-item"},A4t={class:"d-flex flex-column flex-grow-1 flex-sm-row justify-content-between tlb-item"},P4t=["id"],N4t={key:0,class:"d-flex id"},I4t={class:"d-flex flex-row align-items-center tlb-children-container"},nUe=E.defineComponent({__name:"TextListBox",props:{items:{}},emits:["deleted"],setup(l){return(f,_)=>{const g=E.resolveComponent("TextListBox",!0);return E.openBlock(),E.createElementBlock("div",w4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.items,T=>(E.openBlock(),E.createElementBlock("div",{class:"d-flex flex-column",key:T.id},[E.createElementVNode("div",D4t,[E.createElementVNode("div",A4t,[E.createElementVNode("div",{class:"d-flex flex-grow-1",id:T.id},E.toDisplayString(T.label),9,P4t),T.showId?(E.openBlock(),E.createElementBlock("div",N4t,E.toDisplayString(T.id),1)):E.createCommentVNode("",!0)]),T.hideDelete?E.createCommentVNode("",!0):(E.openBlock(),E.createBlock(R8,{key:0,icon:"fa-solid fa-trash",onClick:A=>f.$emit("deleted",T.id)},null,8,["onClick"]))]),E.createElementVNode("div",I4t,[T.childrend?(E.openBlock(),E.createBlock(g,{key:0,items:T.childrend,showId:T.showId,hideDelete:T.hideDelete},null,8,["items","showId","hideDelete"])):E.createCommentVNode("",!0)])]))),128))])}}}),O4t={key:0,class:"toast-container position-fixed bottom-0 start-50 translate-middle-x p-4 toast-zindex"},F4t={class:"toast-header"},M4t={class:"me-auto"},L4t={class:"text-body-secondary"},R4t=["onClick"],j4t=["innerHTML"],Eze=500,GTe=E.defineComponent({__name:"ToastComponent",props:{defaultDisplayDuration:{}},setup(l,{expose:f}){const _=l,g=E.ref([]);return f({addToast:A=>{A.displayDuration||(A.displayDuration=_.defaultDisplayDuration),A.id=new Date,g.value.filter(function(I){return I.id!==A.id}),g.value.push(A)}}),setInterval(()=>{g.value=g.value.map(A=>(A.displayDuration-=Eze,A)),g.value=g.value.filter(A=>A.displayDuration>0)},Eze),(A,I)=>g.value.length>0?(E.openBlock(),E.createElementBlock("div",O4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(g.value,$=>(E.openBlock(),E.createElementBlock("div",{key:$.message,class:E.normalizeClass(["toast d-block",{"toast-info":$.type==="info","toast-success":$.type==="success","toast-warning":$.type==="warning","toast-error":$.type==="error"}]),role:"alert","aria-live":"assertive","aria-atomic":"true"},[E.createElementVNode("div",F4t,[E.createElementVNode("strong",M4t,E.toDisplayString($.title),1),E.createElementVNode("small",L4t,E.toDisplayString($.id.toLocaleTimeString()),1),E.createElementVNode("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close",onClick:W=>g.value=g.value.filter(ee=>ee.id!==$.id)},null,8,R4t)]),E.createElementVNode("div",{class:"toast-body",innerHTML:$.message},null,8,j4t)],2))),128))])):E.createCommentVNode("",!0)}}),iUe=E.defineComponent({__name:"ToastWrapper",setup(l){const f=E.ref(),_=[{id:"toast-notification-message",handler:g=>{let T=g.detail;f.value.addToast({title:T.title,message:T.message,type:T.severity,displayDuration:T.displayDuration?T.displayDuration:5e3})}},{id:"fetch-error",handler:g=>{let T=g.detail;f.value.addToast({title:T.title,message:T.message,type:"error",displayDuration:1e4})}}];return E.onMounted(()=>{_.forEach(g=>window.addEventListener(g.id,g.handler))}),E.onUnmounted(()=>{_.forEach(g=>window.removeEventListener(g.id,g.handler))}),(g,T)=>(E.openBlock(),E.createBlock(GTe,{ref_key:"toast",ref:f,defaultDisplayDuration:5e3},null,512))}}),Zk=class Zk{};qf(Zk,"getId",(f,_)=>`${f}_${_}`),qf(Zk,"saveOptions",(f,_,g,T)=>{localStorage.setItem(Zk.getId(f,_),JSON.stringify({ttlcos:T,ttlc:{compact:g.compact}})),window.location.reload()}),qf(Zk,"cleanOptions",(f,_)=>{for(let g=0;g<localStorage.length;g++)localStorage.key(g).includes(f)&&localStorage.key(g)!=Zk.getId(f,_)&&localStorage.removeItem(localStorage.key(g))}),qf(Zk,"loadOptions",(f,_,g,T,A)=>{Zk.cleanOptions(f,_);const I=Zk.getId(f,_);if(localStorage.getItem(I))try{const $=JSON.parse(localStorage.getItem(I));A.value=$.ttlcos,A.value.forEach(W=>T.columns.find(ee=>ee.property==W.property).visible=W.checked),T.compact=$.ttlc.compact}catch{localStorage.removeItem(I),Zk.loadOptions(f,_,g,T,A)}else g||(g=[]),A.value=T.columns.map($=>($.visible=g.indexOf($.property)==-1,{label:$.label,property:$.property,checked:$.visible}))});let iTe=Zk;const B4t={class:"hdr-container d-flex flex-row flex-wrap align-items-center gap-3"},$4t=["onClick","title"],J4t={class:"hdr-title d-flex align-items-center"},z4t=["onClick","title","disabled"],q4t={class:"d-flex flex-grow-1 justify-content-end gap-3"},V4t=["onClick","title","disabled"],aUe=E.defineComponent({__name:"HeaderComponent",props:{title:{},isFetching:{type:Boolean},buttons:{}},setup(l){return(f,_)=>(E.openBlock(),E.createElementBlock("div",B4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.buttons,g=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[g.align=="pretitle"&&g.type=="iconButton"?(E.openBlock(),E.createBlock(R8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):E.createCommentVNode("",!0),g.align=="pretitle"&&g.type=="button"?(E.openBlock(),E.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},E.toDisplayString(g.title),9,$4t)):E.createCommentVNode("",!0)],64))),256)),E.createElementVNode("div",J4t,E.toDisplayString(f.title),1),E.createVNode(HTe,{loading:f.isFetching},null,8,["loading"]),(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.buttons,g=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[g.align=="left"&&g.type=="iconButton"?(E.openBlock(),E.createBlock(R8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):E.createCommentVNode("",!0),g.align=="left"&&g.type=="button"?(E.openBlock(),E.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title,disabled:g.disabled},E.toDisplayString(g.title),9,z4t)):E.createCommentVNode("",!0)],64))),256)),E.createElementVNode("div",q4t,[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(f.buttons,g=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[g.align=="right"&&g.type=="iconButton"?(E.openBlock(),E.createBlock(R8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):E.createCommentVNode("",!0),g.align=="right"&&g.type=="button"?(E.openBlock(),E.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title,disabled:g.disabled},E.toDisplayString(g.title),9,V4t)):E.createCommentVNode("",!0)],64))),256))])]))}}),U4t={class:"image-picker"},W4t={key:0},H4t=["src"],G4t={key:1},Y4t=["src"],X4t={key:1},Q4t={key:0,class:"d-flex flex-column flex-grow-1 gap-2"},Z4t=["value","disabled"],K4t=["value","disabled"],ePt=["disabled"],tPt=["id"],rPt=["causationid","viewid","environment","aeurl"],zM=E.defineComponent({__name:"ImagePickerComponent",props:{modelValue:{},details:{type:Boolean},editable:{type:Boolean},direction:{},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _=l,g=f,T={id:"",url:"",isAdult:!1,source:"",title:""},A=E.ref(T);E.watch(()=>A,()=>{g("update:modelValue",A.value)},{deep:!0}),E.watch(()=>_.modelValue,et=>{et&&(A.value=et)},{deep:!0,immediate:!0});const I=_.searchImageWidgetUrl,$=_.imageBaseUrl,W=_.imageViewId,ee=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`ipe-${Date.now()}-${Math.random().toString(36).slice(2)}`,R=E.ref(`${ee}-image-picker-causation-id`);E.onMounted(()=>{if(!document.querySelector(`script[src="${I}"]`)){const et=document.createElement("script");et.type="text/javascript",et.src=I,et.async=!0,document.head.appendChild(et)}});const le=E.computed(()=>A.value&&(A.value.url&&A.value.url.length>0||A.value.id&&A.value.id.length>0)),te=E.computed(()=>{if(le.value)return A.value.url&&A.value.url.length>0?A.value.url:`${$}/${W}/${A.value.id}.img`}),_e=et=>{et.preventDefault(),E.nextTick(()=>{var gt;(gt=document.getElementById(R.value))==null||gt.showModal()})},Be=et=>{et.preventDefault(),A.value=T},Ge=et=>{var gt,at;((gt=et==null?void 0:et.detail)==null?void 0:gt.causationid)===R.value&&((at=document.getElementById(R.value))==null||at.close(),A.value={id:et.detail.image.id,url:"",isAdult:et.detail.image.isAdult,source:et.detail.image.source,title:et.detail.image.title})};return E.onMounted(()=>{window.addEventListener("image-selected",Ge)}),E.onUnmounted(()=>{window.removeEventListener("image-selected",Ge)}),(et,gt)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",U4t,[E.createElementVNode("div",{class:E.normalizeClass(["d-flex gap-2",_.direction==="horizontal"?"flex-sm-row flex-column":"flex-column"])},[E.createElementVNode("div",{class:E.normalizeClass(["d-flex flex-column",_.direction==="horizontal"?"image-picker__preview":""])},[_.direction==="horizontal"?(E.openBlock(),E.createElementBlock("div",W4t,[le.value?(E.openBlock(),E.createElementBlock("img",{key:0,class:"image-picker__preview",alt:"",src:te.value},null,8,H4t)):(E.openBlock(),E.createElementBlock("p",G4t,"Nincs kép kiválasztva!"))])):E.createCommentVNode("",!0),_.direction!=="horizontal"?(E.openBlock(),E.createElementBlock(E.Fragment,{key:1},[le.value?(E.openBlock(),E.createElementBlock("img",{key:0,alt:"",src:te.value},null,8,Y4t)):(E.openBlock(),E.createElementBlock("p",X4t,"Nincs kép kiválasztva!"))],64)):E.createCommentVNode("",!0),E.createElementVNode("div",{class:"btn-group mt-2 w-100",role:"group","aria-label":"Képválasztó gombok"},[E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:_e},"Kép választás"),E.createElementVNode("button",{class:"btn btn-outline-danger",onClick:Be},"Eltávolítás")])],2),_.details&&A.value&&A.value.id?(E.openBlock(),E.createElementBlock("div",Q4t,[E.createElementVNode("div",null,[gt[3]||(gt[3]=E.createElementVNode("label",{for:"imgSrc",class:"form-label"},"Forrás",-1)),E.createElementVNode("input",{id:"imgSrc",class:"form-control",type:"text",placeholder:"Forrás",value:A.value.source,onInput:gt[0]||(gt[0]=at=>{A.value.source=at.target.value}),disabled:!_.editable},null,40,Z4t)]),E.createElementVNode("div",null,[gt[4]||(gt[4]=E.createElementVNode("label",{for:"imgAlt",class:"form-label"},"Képalá",-1)),E.createElementVNode("textarea",{id:"imgAlt",class:"form-control",type:"text",placeholder:"Képalá",value:A.value.title,onInput:gt[1]||(gt[1]=at=>{A.value.title=at.target.value}),disabled:!_.editable},null,40,K4t)]),E.createElementVNode("div",null,[gt[5]||(gt[5]=E.createElementVNode("label",{for:"isAdult",class:"form-check-label"},"Felnőtt tartalom",-1)),E.withDirectives(E.createElementVNode("input",{id:"isAdult",class:"m-1 form-check-input",type:"checkbox","onUpdate:modelValue":gt[2]||(gt[2]=at=>A.value.isAdult=at),disabled:!_.editable},null,8,ePt),[[E.vModelCheckbox,A.value.isAdult]])])])):E.createCommentVNode("",!0)],2)]),E.createElementVNode("dialog",{id:R.value},[E.createElementVNode("hvg-search-image",{causationid:R.value,viewid:E.unref(W),environment:et.environment,aeurl:et.articleEditorUrl,selectonly:"true"},null,8,rPt)],8,tPt)],64))}}),nPt={class:"selector"},iPt={class:"form-label",for:"format"},aPt=["value"],sPt=E.defineComponent({__name:"SelectorComponent",props:{modelValue:{},label:{},options:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _=l,g=f,T=E.computed({get:()=>_.modelValue,set:A=>g("update:modelValue",A)});return E.watchEffect(async()=>{var I;if(!((I=_.options)!=null&&I.length))return;const A=_.options.map($=>$.value);(_.modelValue==null||!A.includes(_.modelValue))&&(g("update:modelValue",A[0]),await E.nextTick())}),(A,I)=>(E.openBlock(),E.createElementBlock("div",nPt,[E.createElementVNode("label",iPt,E.toDisplayString(A.label),1),E.withDirectives(E.createElementVNode("select",{class:"form-control",id:"format","onUpdate:modelValue":I[0]||(I[0]=$=>T.value=$)},[(E.openBlock(!0),E.createElementBlock(E.Fragment,null,E.renderList(A.options,$=>(E.openBlock(),E.createElementBlock("option",{key:$.value,value:$.value},E.toDisplayString($.label),9,aPt))),128))],512),[[E.vModelSelect,T.value]])]))}}),sUe=cC(sPt,[["__scopeId","data-v-701e6d6d"]]),oPt={class:"d-flex flex-column gap-2"},cPt={class:"btn-group mt-2 w-100",role:"group","aria-label":"Cikkválasztó gombok"},lPt={key:0,class:"w-100 gap-1 d-flex"},uPt={class:"w-100"},fPt=["value"],_Pt={class:"w-100"},pPt=["value"],dPt=["value"],mPt=["value"],gPt=["id"],hPt=["id","apiurl"],vPt="00000000-0000-0000-0000-000000000000",YTe=E.defineComponent({__name:"InternalArticleOfferComponent",props:{modelValue:{},searchArticleApiUrl:{},searchArticleWidgetUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},showIds:{type:Boolean,default:!0},formats:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _={article:{siteId:"",id:"",imageId:"",title:"",lead:""},format:""},g=f,T=l,A=E.ref(_),I=E.ref({id:A.value.article.imageId||"",url:"",source:"",title:"",isAdult:!1});E.watch(()=>T.modelValue,le=>{le?A.value=le:A.value=_},{deep:!0,immediate:!0}),E.watch(()=>A,le=>{g("update:modelValue",A.value),I.value.id=le.value.article.imageId},{deep:!0,immediate:!0}),E.watch(()=>I.value.id,le=>{A.value.article.imageId=le},{deep:!0,immediate:!0});const $=E.ref(new Date().getTime().toString()+"article");E.onUnmounted(()=>{window.removeEventListener("search_posts_selected",W)}),E.onMounted(()=>{window.addEventListener("search_posts_selected",W)});const W=le=>{var te;if(le.detail.id==$.value){if(le.detail.result&&le.detail.posts.length>0){A.value.article.id=le.detail.posts[0].id,A.value.article.siteId=le.detail.posts[0].siteId,A.value.article.title=le.detail.posts[0].title,A.value.article.lead=le.detail.posts[0].lead;const _e=le.detail.posts[0].featuredImage;A.value.article.imageId=_e||vPt}(te=document.getElementById($.value))==null||te.close()}},ee=()=>{var le;(le=document.getElementById($.value))==null||le.showModal()},R=le=>{if(!document.querySelector(`script[src="${le}"]`)){let te=document.createElement("script");te.type="text/javascript",te.src=le,document.head.appendChild(te)}};return R(T.searchImageWidgetUrl),R(T.searchArticleWidgetUrl),(le,te)=>(E.openBlock(),E.createElementBlock(E.Fragment,null,[E.createElementVNode("div",oPt,[E.createElementVNode("div",cPt,[E.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:te[0]||(te[0]=()=>ee())},"Cikk Választás")]),le.showIds?(E.openBlock(),E.createElementBlock("div",lPt,[E.createElementVNode("div",uPt,[E.createElementVNode("input",{type:"text",id:"articleId",class:"form-control",placeholder:"Cikk azonosító",disabled:"",value:A.value.article.id},null,8,fPt)]),E.createElementVNode("div",_Pt,[E.createElementVNode("input",{type:"text",id:"articleSiteId",class:"form-control",placeholder:"Site azonosító",disabled:"",value:A.value.article.siteId},null,8,pPt)])])):E.createCommentVNode("",!0),E.createElementVNode("div",null,[te[5]||(te[5]=E.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),E.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:A.value.article.title,onInput:te[1]||(te[1]=_e=>{var Be;return A.value.article.title=((Be=_e.target)==null?void 0:Be.value)||""})},null,40,dPt)]),E.createElementVNode("div",null,[te[6]||(te[6]=E.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),E.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:A.value.article.lead,onInput:te[2]||(te[2]=_e=>{var Be;return A.value.article.lead=((Be=_e.target)==null?void 0:Be.value)||""})},null,40,mPt)]),E.createVNode(zM,{modelValue:I.value,"onUpdate:modelValue":te[3]||(te[3]=_e=>I.value=_e),details:!1,editable:!1,"article-editor-url":T.searchArticleApiUrl,environment:T.environment,"search-image-widget-url":T.searchImageWidgetUrl,"image-base-url":T.imageBaseUrl,"image-view-id":T.imageViewId},null,8,["modelValue","article-editor-url","environment","search-image-widget-url","image-base-url","image-view-id"]),E.createVNode(sUe,{modelValue:A.value.format,"onUpdate:modelValue":te[4]||(te[4]=_e=>A.value.format=_e),options:T.formats,label:"Formátum"},null,8,["modelValue","options"])]),E.createElementVNode("dialog",{id:$.value},[E.createElementVNode("search-posts-widget",{id:$.value,selector:"true",apiurl:T.searchArticleApiUrl,wpurl:"",searchurl:"",style:{height:"100%"}},null,8,hPt)],8,gPt)],64))}}),yPt={class:"d-flex flex-column gap-2"},bPt=["value"],SPt=["value"],TPt=["value"],XTe=E.defineComponent({__name:"ExternalArticleOfferComponent",props:{modelValue:{},onArticleUrlChanged:{type:Function},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},formats:{}},emits:["update:modelValue"],setup(l,{emit:f}){const _={article:{url:"",imageUrl:"",imageId:"",title:"",lead:""},format:""},g=f,T=l,A=E.ref(_),I=E.ref({id:A.value.article.imageId,url:"",source:"",title:"",isAdult:!1});E.watch(()=>T.modelValue,ee=>{ee?A.value=ee:A.value=_},{deep:!0,immediate:!0}),E.watch(()=>A,ee=>{g("update:modelValue",A.value),I.value.id=ee.value.article.imageId,I.value.url=ee.value.article.imageUrl},{deep:!0,immediate:!0}),E.watch(()=>I.value.id,ee=>{A.value.article.imageId=ee},{deep:!0,immediate:!0}),E.watch(()=>I.value.url,ee=>{A.value.article.imageUrl=ee},{deep:!0,immediate:!0});const $=ee=>{var R;A.value.article.url=((R=ee.target)==null?void 0:R.value)||"",A.value.article.url&&T.onArticleUrlChanged(A.value.article.url,le=>{A.value.article=le})};return(ee=>{if(!document.querySelector(`script[src="${ee}"]`)){let R=document.createElement("script");R.type="text/javascript",R.src=ee,document.head.appendChild(R)}})(T.searchImageWidgetUrl),(ee,R)=>(E.openBlock(),E.createElementBlock("div",yPt,[E.createElementVNode("div",null,[R[4]||(R[4]=E.createElementVNode("label",{for:"articleUrl",class:"form-label"},"Cikk URL",-1)),E.createElementVNode("textarea",{id:"articleUrl",class:"form-control",placeholder:"Cikk URL",value:A.value.article.url,onInput:$},null,40,bPt)]),E.createElementVNode("div",null,[R[5]||(R[5]=E.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),E.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:A.value.article.title,onInput:R[0]||(R[0]=le=>{var te;return A.value.article.title=((te=le.target)==null?void 0:te.value)||""})},null,40,SPt)]),E.createElementVNode("div",null,[R[6]||(R[6]=E.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),E.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:A.value.article.lead,onInput:R[1]||(R[1]=le=>{var te;return A.value.article.lead=((te=le.target)==null?void 0:te.value)||""})},null,40,TPt)]),E.createVNode(zM,{modelValue:I.value,"onUpdate:modelValue":R[2]||(R[2]=le=>I.value=le),details:!1,editable:!1,environment:T.environment,"article-editor-url":T.articleEditorUrl,"search-image-widget-url":T.searchImageWidgetUrl,"image-base-url":T.imageBaseUrl,"image-view-id":T.imageViewId},null,8,["modelValue","environment","article-editor-url","search-image-widget-url","image-base-url","image-view-id"]),E.createVNode(sUe,{modelValue:A.value.format,"onUpdate:modelValue":R[3]||(R[3]=le=>A.value.format=le),options:T.formats,label:"Formátum"},null,8,["modelValue","options"])]))}});function oUe(l,f){return function(){return l.apply(f,arguments)}}const{toString:xPt}=Object.prototype,{getPrototypeOf:QTe}=Object,{iterator:Bne,toStringTag:cUe}=Symbol,$ne=(l=>f=>{const _=xPt.call(f);return l[_]||(l[_]=_.slice(8,-1).toLowerCase())})(Object.create(null)),lC=l=>(l=l.toLowerCase(),f=>$ne(f)===l),Jne=l=>f=>typeof f===l,{isArray:qM}=Array,FM=Jne("undefined");function gV(l){return l!==null&&!FM(l)&&l.constructor!==null&&!FM(l.constructor)&&p2(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const lUe=lC("ArrayBuffer");function kPt(l){let f;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?f=ArrayBuffer.isView(l):f=l&&l.buffer&&lUe(l.buffer),f}const CPt=Jne("string"),p2=Jne("function"),uUe=Jne("number"),hV=l=>l!==null&&typeof l=="object",EPt=l=>l===!0||l===!1,Kre=l=>{if($ne(l)!=="object")return!1;const f=QTe(l);return(f===null||f===Object.prototype||Object.getPrototypeOf(f)===null)&&!(cUe in l)&&!(Bne in l)},wPt=l=>{if(!hV(l)||gV(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},DPt=lC("Date"),APt=lC("File"),PPt=lC("Blob"),NPt=lC("FileList"),IPt=l=>hV(l)&&p2(l.pipe),OPt=l=>{let f;return l&&(typeof FormData=="function"&&l instanceof FormData||p2(l.append)&&((f=$ne(l))==="formdata"||f==="object"&&p2(l.toString)&&l.toString()==="[object FormData]"))},FPt=lC("URLSearchParams"),[MPt,LPt,RPt,jPt]=["ReadableStream","Request","Response","Headers"].map(lC),BPt=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vV(l,f,{allOwnKeys:_=!1}={}){if(l===null||typeof l>"u")return;let g,T;if(typeof l!="object"&&(l=[l]),qM(l))for(g=0,T=l.length;g<T;g++)f.call(null,l[g],g,l);else{if(gV(l))return;const A=_?Object.getOwnPropertyNames(l):Object.keys(l),I=A.length;let $;for(g=0;g<I;g++)$=A[g],f.call(null,l[$],$,l)}}function fUe(l,f){if(gV(l))return null;f=f.toLowerCase();const _=Object.keys(l);let g=_.length,T;for(;g-- >0;)if(T=_[g],f===T.toLowerCase())return T;return null}const M8=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_Ue=l=>!FM(l)&&l!==M8;function aTe(){const{caseless:l,skipUndefined:f}=_Ue(this)&&this||{},_={},g=(T,A)=>{const I=l&&fUe(_,A)||A;Kre(_[I])&&Kre(T)?_[I]=aTe(_[I],T):Kre(T)?_[I]=aTe({},T):qM(T)?_[I]=T.slice():(!f||!FM(T))&&(_[I]=T)};for(let T=0,A=arguments.length;T<A;T++)arguments[T]&&vV(arguments[T],g);return _}const $Pt=(l,f,_,{allOwnKeys:g}={})=>(vV(f,(T,A)=>{_&&p2(T)?l[A]=oUe(T,_):l[A]=T},{allOwnKeys:g}),l),JPt=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),zPt=(l,f,_,g)=>{l.prototype=Object.create(f.prototype,g),l.prototype.constructor=l,Object.defineProperty(l,"super",{value:f.prototype}),_&&Object.assign(l.prototype,_)},qPt=(l,f,_,g)=>{let T,A,I;const $={};if(f=f||{},l==null)return f;do{for(T=Object.getOwnPropertyNames(l),A=T.length;A-- >0;)I=T[A],(!g||g(I,l,f))&&!$[I]&&(f[I]=l[I],$[I]=!0);l=_!==!1&&QTe(l)}while(l&&(!_||_(l,f))&&l!==Object.prototype);return f},VPt=(l,f,_)=>{l=String(l),(_===void 0||_>l.length)&&(_=l.length),_-=f.length;const g=l.indexOf(f,_);return g!==-1&&g===_},UPt=l=>{if(!l)return null;if(qM(l))return l;let f=l.length;if(!uUe(f))return null;const _=new Array(f);for(;f-- >0;)_[f]=l[f];return _},WPt=(l=>f=>l&&f instanceof l)(typeof Uint8Array<"u"&&QTe(Uint8Array)),HPt=(l,f)=>{const g=(l&&l[Bne]).call(l);let T;for(;(T=g.next())&&!T.done;){const A=T.value;f.call(l,A[0],A[1])}},GPt=(l,f)=>{let _;const g=[];for(;(_=l.exec(f))!==null;)g.push(_);return g},YPt=lC("HTMLFormElement"),XPt=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(_,g,T){return g.toUpperCase()+T}),wze=(({hasOwnProperty:l})=>(f,_)=>l.call(f,_))(Object.prototype),QPt=lC("RegExp"),pUe=(l,f)=>{const _=Object.getOwnPropertyDescriptors(l),g={};vV(_,(T,A)=>{let I;(I=f(T,A,l))!==!1&&(g[A]=I||T)}),Object.defineProperties(l,g)},ZPt=l=>{pUe(l,(f,_)=>{if(p2(l)&&["arguments","caller","callee"].indexOf(_)!==-1)return!1;const g=l[_];if(p2(g)){if(f.enumerable=!1,"writable"in f){f.writable=!1;return}f.set||(f.set=()=>{throw Error("Can not rewrite read-only method '"+_+"'")})}})},KPt=(l,f)=>{const _={},g=T=>{T.forEach(A=>{_[A]=!0})};return qM(l)?g(l):g(String(l).split(f)),_},e3t=()=>{},t3t=(l,f)=>l!=null&&Number.isFinite(l=+l)?l:f;function r3t(l){return!!(l&&p2(l.append)&&l[cUe]==="FormData"&&l[Bne])}const n3t=l=>{const f=new Array(10),_=(g,T)=>{if(hV(g)){if(f.indexOf(g)>=0)return;if(gV(g))return g;if(!("toJSON"in g)){f[T]=g;const A=qM(g)?[]:{};return vV(g,(I,$)=>{const W=_(I,T+1);!FM(W)&&(A[$]=W)}),f[T]=void 0,A}}return g};return _(l,0)},i3t=lC("AsyncFunction"),a3t=l=>l&&(hV(l)||p2(l))&&p2(l.then)&&p2(l.catch),dUe=((l,f)=>l?setImmediate:f?((_,g)=>(M8.addEventListener("message",({source:T,data:A})=>{T===M8&&A===_&&g.length&&g.shift()()},!1),T=>{g.push(T),M8.postMessage(_,"*")}))(`axios@${Math.random()}`,[]):_=>setTimeout(_))(typeof setImmediate=="function",p2(M8.postMessage)),s3t=typeof queueMicrotask<"u"?queueMicrotask.bind(M8):typeof process<"u"&&process.nextTick||dUe,o3t=l=>l!=null&&p2(l[Bne]),ki={isArray:qM,isArrayBuffer:lUe,isBuffer:gV,isFormData:OPt,isArrayBufferView:kPt,isString:CPt,isNumber:uUe,isBoolean:EPt,isObject:hV,isPlainObject:Kre,isEmptyObject:wPt,isReadableStream:MPt,isRequest:LPt,isResponse:RPt,isHeaders:jPt,isUndefined:FM,isDate:DPt,isFile:APt,isBlob:PPt,isRegExp:QPt,isFunction:p2,isStream:IPt,isURLSearchParams:FPt,isTypedArray:WPt,isFileList:NPt,forEach:vV,merge:aTe,extend:$Pt,trim:BPt,stripBOM:JPt,inherits:zPt,toFlatObject:qPt,kindOf:$ne,kindOfTest:lC,endsWith:VPt,toArray:UPt,forEachEntry:HPt,matchAll:GPt,isHTMLForm:YPt,hasOwnProperty:wze,hasOwnProp:wze,reduceDescriptors:pUe,freezeMethods:ZPt,toObjectSet:KPt,toCamelCase:XPt,noop:e3t,toFiniteNumber:t3t,findKey:fUe,global:M8,isContextDefined:_Ue,isSpecCompliantForm:r3t,toJSONObject:n3t,isAsyncFn:i3t,isThenable:a3t,setImmediate:dUe,asap:s3t,isIterable:o3t};function ru(l,f,_,g,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=l,this.name="AxiosError",f&&(this.code=f),_&&(this.config=_),g&&(this.request=g),T&&(this.response=T,this.status=T.status?T.status:null)}ki.inherits(ru,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ki.toJSONObject(this.config),code:this.code,status:this.status}}});const mUe=ru.prototype,gUe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(l=>{gUe[l]={value:l}});Object.defineProperties(ru,gUe);Object.defineProperty(mUe,"isAxiosError",{value:!0});ru.from=(l,f,_,g,T,A)=>{const I=Object.create(mUe);ki.toFlatObject(l,I,function(R){return R!==Error.prototype},ee=>ee!=="isAxiosError");const $=l&&l.message?l.message:"Error",W=f==null&&l?l.code:f;return ru.call(I,$,W,_,g,T),l&&I.cause==null&&Object.defineProperty(I,"cause",{value:l,configurable:!0}),I.name=l&&l.name||"Error",A&&Object.assign(I,A),I};const c3t=null;function sTe(l){return ki.isPlainObject(l)||ki.isArray(l)}function hUe(l){return ki.endsWith(l,"[]")?l.slice(0,-2):l}function Dze(l,f,_){return l?l.concat(f).map(function(T,A){return T=hUe(T),!_&&A?"["+T+"]":T}).join(_?".":""):f}function l3t(l){return ki.isArray(l)&&!l.some(sTe)}const u3t=ki.toFlatObject(ki,{},null,function(f){return/^is[A-Z]/.test(f)});function zne(l,f,_){if(!ki.isObject(l))throw new TypeError("target must be an object");f=f||new FormData,_=ki.toFlatObject(_,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ge,et){return!ki.isUndefined(et[Ge])});const g=_.metaTokens,T=_.visitor||R,A=_.dots,I=_.indexes,W=(_.Blob||typeof Blob<"u"&&Blob)&&ki.isSpecCompliantForm(f);if(!ki.isFunction(T))throw new TypeError("visitor must be a function");function ee(Be){if(Be===null)return"";if(ki.isDate(Be))return Be.toISOString();if(ki.isBoolean(Be))return Be.toString();if(!W&&ki.isBlob(Be))throw new ru("Blob is not supported. Use a Buffer instead.");return ki.isArrayBuffer(Be)||ki.isTypedArray(Be)?W&&typeof Blob=="function"?new Blob([Be]):Buffer.from(Be):Be}function R(Be,Ge,et){let gt=Be;if(Be&&!et&&typeof Be=="object"){if(ki.endsWith(Ge,"{}"))Ge=g?Ge:Ge.slice(0,-2),Be=JSON.stringify(Be);else if(ki.isArray(Be)&&l3t(Be)||(ki.isFileList(Be)||ki.endsWith(Ge,"[]"))&&(gt=ki.toArray(Be)))return Ge=hUe(Ge),gt.forEach(function(dt,nt){!(ki.isUndefined(dt)||dt===null)&&f.append(I===!0?Dze([Ge],nt,A):I===null?Ge:Ge+"[]",ee(dt))}),!1}return sTe(Be)?!0:(f.append(Dze(et,Ge,A),ee(Be)),!1)}const le=[],te=Object.assign(u3t,{defaultVisitor:R,convertValue:ee,isVisitable:sTe});function _e(Be,Ge){if(!ki.isUndefined(Be)){if(le.indexOf(Be)!==-1)throw Error("Circular reference detected in "+Ge.join("."));le.push(Be),ki.forEach(Be,function(gt,at){(!(ki.isUndefined(gt)||gt===null)&&T.call(f,gt,ki.isString(at)?at.trim():at,Ge,te))===!0&&_e(gt,Ge?Ge.concat(at):[at])}),le.pop()}}if(!ki.isObject(l))throw new TypeError("data must be an object");return _e(l),f}function Aze(l){const f={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(g){return f[g]})}function ZTe(l,f){this._pairs=[],l&&zne(l,this,f)}const vUe=ZTe.prototype;vUe.append=function(f,_){this._pairs.push([f,_])};vUe.toString=function(f){const _=f?function(g){return f.call(this,g,Aze)}:Aze;return this._pairs.map(function(T){return _(T[0])+"="+_(T[1])},"").join("&")};function f3t(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yUe(l,f,_){if(!f)return l;const g=_&&_.encode||f3t;ki.isFunction(_)&&(_={serialize:_});const T=_&&_.serialize;let A;if(T?A=T(f,_):A=ki.isURLSearchParams(f)?f.toString():new ZTe(f,_).toString(g),A){const I=l.indexOf("#");I!==-1&&(l=l.slice(0,I)),l+=(l.indexOf("?")===-1?"?":"&")+A}return l}class Pze{constructor(){this.handlers=[]}use(f,_,g){return this.handlers.push({fulfilled:f,rejected:_,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(f){this.handlers[f]&&(this.handlers[f]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(f){ki.forEach(this.handlers,function(g){g!==null&&f(g)})}}const bUe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_3t=typeof URLSearchParams<"u"?URLSearchParams:ZTe,p3t=typeof FormData<"u"?FormData:null,d3t=typeof Blob<"u"?Blob:null,m3t={isBrowser:!0,classes:{URLSearchParams:_3t,FormData:p3t,Blob:d3t},protocols:["http","https","file","blob","url","data"]},KTe=typeof window<"u"&&typeof document<"u",oTe=typeof navigator=="object"&&navigator||void 0,g3t=KTe&&(!oTe||["ReactNative","NativeScript","NS"].indexOf(oTe.product)<0),h3t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v3t=KTe&&window.location.href||"http://localhost",y3t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:KTe,hasStandardBrowserEnv:g3t,hasStandardBrowserWebWorkerEnv:h3t,navigator:oTe,origin:v3t},Symbol.toStringTag,{value:"Module"})),By={...y3t,...m3t};function b3t(l,f){return zne(l,new By.classes.URLSearchParams,{visitor:function(_,g,T,A){return By.isNode&&ki.isBuffer(_)?(this.append(g,_.toString("base64")),!1):A.defaultVisitor.apply(this,arguments)},...f})}function S3t(l){return ki.matchAll(/\w+|\[(\w*)]/g,l).map(f=>f[0]==="[]"?"":f[1]||f[0])}function T3t(l){const f={},_=Object.keys(l);let g;const T=_.length;let A;for(g=0;g<T;g++)A=_[g],f[A]=l[A];return f}function SUe(l){function f(_,g,T,A){let I=_[A++];if(I==="__proto__")return!0;const $=Number.isFinite(+I),W=A>=_.length;return I=!I&&ki.isArray(T)?T.length:I,W?(ki.hasOwnProp(T,I)?T[I]=[T[I],g]:T[I]=g,!$):((!T[I]||!ki.isObject(T[I]))&&(T[I]=[]),f(_,g,T[I],A)&&ki.isArray(T[I])&&(T[I]=T3t(T[I])),!$)}if(ki.isFormData(l)&&ki.isFunction(l.entries)){const _={};return ki.forEachEntry(l,(g,T)=>{f(S3t(g),T,_,0)}),_}return null}function x3t(l,f,_){if(ki.isString(l))try{return(f||JSON.parse)(l),ki.trim(l)}catch(g){if(g.name!=="SyntaxError")throw g}return(_||JSON.stringify)(l)}const yV={transitional:bUe,adapter:["xhr","http","fetch"],transformRequest:[function(f,_){const g=_.getContentType()||"",T=g.indexOf("application/json")>-1,A=ki.isObject(f);if(A&&ki.isHTMLForm(f)&&(f=new FormData(f)),ki.isFormData(f))return T?JSON.stringify(SUe(f)):f;if(ki.isArrayBuffer(f)||ki.isBuffer(f)||ki.isStream(f)||ki.isFile(f)||ki.isBlob(f)||ki.isReadableStream(f))return f;if(ki.isArrayBufferView(f))return f.buffer;if(ki.isURLSearchParams(f))return _.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),f.toString();let $;if(A){if(g.indexOf("application/x-www-form-urlencoded")>-1)return b3t(f,this.formSerializer).toString();if(($=ki.isFileList(f))||g.indexOf("multipart/form-data")>-1){const W=this.env&&this.env.FormData;return zne($?{"files[]":f}:f,W&&new W,this.formSerializer)}}return A||T?(_.setContentType("application/json",!1),x3t(f)):f}],transformResponse:[function(f){const _=this.transitional||yV.transitional,g=_&&_.forcedJSONParsing,T=this.responseType==="json";if(ki.isResponse(f)||ki.isReadableStream(f))return f;if(f&&ki.isString(f)&&(g&&!this.responseType||T)){const I=!(_&&_.silentJSONParsing)&&T;try{return JSON.parse(f,this.parseReviver)}catch($){if(I)throw $.name==="SyntaxError"?ru.from($,ru.ERR_BAD_RESPONSE,this,null,this.response):$}}return f}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:By.classes.FormData,Blob:By.classes.Blob},validateStatus:function(f){return f>=200&&f<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ki.forEach(["delete","get","head","post","put","patch"],l=>{yV.headers[l]={}});const k3t=ki.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),C3t=l=>{const f={};let _,g,T;return l&&l.split(`
2
2
  `).forEach(function(I){T=I.indexOf(":"),_=I.substring(0,T).trim().toLowerCase(),g=I.substring(T+1).trim(),!(!_||f[_]&&k3t[_])&&(_==="set-cookie"?f[_]?f[_].push(g):f[_]=[g]:f[_]=f[_]?f[_]+", "+g:g)}),f},Nze=Symbol("internals");function Iq(l){return l&&String(l).trim().toLowerCase()}function ene(l){return l===!1||l==null?l:ki.isArray(l)?l.map(ene):String(l)}function E3t(l){const f=Object.create(null),_=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let g;for(;g=_.exec(l);)f[g[1]]=g[2];return f}const w3t=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function ySe(l,f,_,g,T){if(ki.isFunction(g))return g.call(this,f,_);if(T&&(f=_),!!ki.isString(f)){if(ki.isString(g))return f.indexOf(g)!==-1;if(ki.isRegExp(g))return g.test(f)}}function D3t(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(f,_,g)=>_.toUpperCase()+g)}function A3t(l,f){const _=ki.toCamelCase(" "+f);["get","set","has"].forEach(g=>{Object.defineProperty(l,g+_,{value:function(T,A,I){return this[g].call(this,f,T,A,I)},configurable:!0})})}let d2=class{constructor(f){f&&this.set(f)}set(f,_,g){const T=this;function A($,W,ee){const R=Iq(W);if(!R)throw new Error("header name must be a non-empty string");const le=ki.findKey(T,R);(!le||T[le]===void 0||ee===!0||ee===void 0&&T[le]!==!1)&&(T[le||W]=ene($))}const I=($,W)=>ki.forEach($,(ee,R)=>A(ee,R,W));if(ki.isPlainObject(f)||f instanceof this.constructor)I(f,_);else if(ki.isString(f)&&(f=f.trim())&&!w3t(f))I(C3t(f),_);else if(ki.isObject(f)&&ki.isIterable(f)){let $={},W,ee;for(const R of f){if(!ki.isArray(R))throw TypeError("Object iterator must return a key-value pair");$[ee=R[0]]=(W=$[ee])?ki.isArray(W)?[...W,R[1]]:[W,R[1]]:R[1]}I($,_)}else f!=null&&A(_,f,g);return this}get(f,_){if(f=Iq(f),f){const g=ki.findKey(this,f);if(g){const T=this[g];if(!_)return T;if(_===!0)return E3t(T);if(ki.isFunction(_))return _.call(this,T,g);if(ki.isRegExp(_))return _.exec(T);throw new TypeError("parser must be boolean|regexp|function")}}}has(f,_){if(f=Iq(f),f){const g=ki.findKey(this,f);return!!(g&&this[g]!==void 0&&(!_||ySe(this,this[g],g,_)))}return!1}delete(f,_){const g=this;let T=!1;function A(I){if(I=Iq(I),I){const $=ki.findKey(g,I);$&&(!_||ySe(g,g[$],$,_))&&(delete g[$],T=!0)}}return ki.isArray(f)?f.forEach(A):A(f),T}clear(f){const _=Object.keys(this);let g=_.length,T=!1;for(;g--;){const A=_[g];(!f||ySe(this,this[A],A,f,!0))&&(delete this[A],T=!0)}return T}normalize(f){const _=this,g={};return ki.forEach(this,(T,A)=>{const I=ki.findKey(g,A);if(I){_[I]=ene(T),delete _[A];return}const $=f?D3t(A):String(A).trim();$!==A&&delete _[A],_[$]=ene(T),g[$]=!0}),this}concat(...f){return this.constructor.concat(this,...f)}toJSON(f){const _=Object.create(null);return ki.forEach(this,(g,T)=>{g!=null&&g!==!1&&(_[T]=f&&ki.isArray(g)?g.join(", "):g)}),_}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([f,_])=>f+": "+_).join(`
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(f){return f instanceof this?f:new this(f)}static concat(f,..._){const g=new this(f);return _.forEach(T=>g.set(T)),g}static accessor(f){const g=(this[Nze]=this[Nze]={accessors:{}}).accessors,T=this.prototype;function A(I){const $=Iq(I);g[$]||(A3t(T,I),g[$]=!0)}return ki.isArray(f)?f.forEach(A):A(f),this}};d2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ki.reduceDescriptors(d2.prototype,({value:l},f)=>{let _=f[0].toUpperCase()+f.slice(1);return{get:()=>l,set(g){this[_]=g}}});ki.freezeMethods(d2);function bSe(l,f){const _=this||yV,g=f||_,T=d2.from(g.headers);let A=g.data;return ki.forEach(l,function($){A=$.call(_,A,T.normalize(),f?f.status:void 0)}),T.normalize(),A}function TUe(l){return!!(l&&l.__CANCEL__)}function VM(l,f,_){ru.call(this,l??"canceled",ru.ERR_CANCELED,f,_),this.name="CanceledError"}ki.inherits(VM,ru,{__CANCEL__:!0});function xUe(l,f,_){const g=_.config.validateStatus;!_.status||!g||g(_.status)?l(_):f(new ru("Request failed with status code "+_.status,[ru.ERR_BAD_REQUEST,ru.ERR_BAD_RESPONSE][Math.floor(_.status/100)-4],_.config,_.request,_))}function P3t(l){const f=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return f&&f[1]||""}function N3t(l,f){l=l||10;const _=new Array(l),g=new Array(l);let T=0,A=0,I;return f=f!==void 0?f:1e3,function(W){const ee=Date.now(),R=g[A];I||(I=ee),_[T]=W,g[T]=ee;let le=A,te=0;for(;le!==T;)te+=_[le++],le=le%l;if(T=(T+1)%l,T===A&&(A=(A+1)%l),ee-I<f)return;const _e=R&&ee-R;return _e?Math.round(te*1e3/_e):void 0}}function I3t(l,f){let _=0,g=1e3/f,T,A;const I=(ee,R=Date.now())=>{_=R,T=null,A&&(clearTimeout(A),A=null),l(...ee)};return[(...ee)=>{const R=Date.now(),le=R-_;le>=g?I(ee,R):(T=ee,A||(A=setTimeout(()=>{A=null,I(T)},g-le)))},()=>T&&I(T)]}const hne=(l,f,_=3)=>{let g=0;const T=N3t(50,250);return I3t(A=>{const I=A.loaded,$=A.lengthComputable?A.total:void 0,W=I-g,ee=T(W),R=I<=$;g=I;const le={loaded:I,total:$,progress:$?I/$:void 0,bytes:W,rate:ee||void 0,estimated:ee&&$&&R?($-I)/ee:void 0,event:A,lengthComputable:$!=null,[f?"download":"upload"]:!0};l(le)},_)},Ize=(l,f)=>{const _=l!=null;return[g=>f[0]({lengthComputable:_,total:l,loaded:g}),f[1]]},Oze=l=>(...f)=>ki.asap(()=>l(...f)),O3t=By.hasStandardBrowserEnv?((l,f)=>_=>(_=new URL(_,By.origin),l.protocol===_.protocol&&l.host===_.host&&(f||l.port===_.port)))(new URL(By.origin),By.navigator&&/(msie|trident)/i.test(By.navigator.userAgent)):()=>!0,F3t=By.hasStandardBrowserEnv?{write(l,f,_,g,T,A){const I=[l+"="+encodeURIComponent(f)];ki.isNumber(_)&&I.push("expires="+new Date(_).toGMTString()),ki.isString(g)&&I.push("path="+g),ki.isString(T)&&I.push("domain="+T),A===!0&&I.push("secure"),document.cookie=I.join("; ")},read(l){const f=document.cookie.match(new RegExp("(^|;\\s*)("+l+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove(l){this.write(l,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function M3t(l){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function L3t(l,f){return f?l.replace(/\/?\/$/,"")+"/"+f.replace(/^\/+/,""):l}function kUe(l,f,_){let g=!M3t(f);return l&&(g||_==!1)?L3t(l,f):f}const Fze=l=>l instanceof d2?{...l}:l;function J8(l,f){f=f||{};const _={};function g(ee,R,le,te){return ki.isPlainObject(ee)&&ki.isPlainObject(R)?ki.merge.call({caseless:te},ee,R):ki.isPlainObject(R)?ki.merge({},R):ki.isArray(R)?R.slice():R}function T(ee,R,le,te){if(ki.isUndefined(R)){if(!ki.isUndefined(ee))return g(void 0,ee,le,te)}else return g(ee,R,le,te)}function A(ee,R){if(!ki.isUndefined(R))return g(void 0,R)}function I(ee,R){if(ki.isUndefined(R)){if(!ki.isUndefined(ee))return g(void 0,ee)}else return g(void 0,R)}function $(ee,R,le){if(le in f)return g(ee,R);if(le in l)return g(void 0,ee)}const W={url:A,method:A,data:A,baseURL:I,transformRequest:I,transformResponse:I,paramsSerializer:I,timeout:I,timeoutMessage:I,withCredentials:I,withXSRFToken:I,adapter:I,responseType:I,xsrfCookieName:I,xsrfHeaderName:I,onUploadProgress:I,onDownloadProgress:I,decompress:I,maxContentLength:I,maxBodyLength:I,beforeRedirect:I,transport:I,httpAgent:I,httpsAgent:I,cancelToken:I,socketPath:I,responseEncoding:I,validateStatus:$,headers:(ee,R,le)=>T(Fze(ee),Fze(R),le,!0)};return ki.forEach(Object.keys({...l,...f}),function(R){const le=W[R]||T,te=le(l[R],f[R],R);ki.isUndefined(te)&&le!==$||(_[R]=te)}),_}const CUe=l=>{const f=J8({},l);let{data:_,withXSRFToken:g,xsrfHeaderName:T,xsrfCookieName:A,headers:I,auth:$}=f;if(f.headers=I=d2.from(I),f.url=yUe(kUe(f.baseURL,f.url,f.allowAbsoluteUrls),l.params,l.paramsSerializer),$&&I.set("Authorization","Basic "+btoa(($.username||"")+":"+($.password?unescape(encodeURIComponent($.password)):""))),ki.isFormData(_)){if(By.hasStandardBrowserEnv||By.hasStandardBrowserWebWorkerEnv)I.setContentType(void 0);else if(ki.isFunction(_.getHeaders)){const W=_.getHeaders(),ee=["content-type","content-length"];Object.entries(W).forEach(([R,le])=>{ee.includes(R.toLowerCase())&&I.set(R,le)})}}if(By.hasStandardBrowserEnv&&(g&&ki.isFunction(g)&&(g=g(f)),g||g!==!1&&O3t(f.url))){const W=T&&A&&F3t.read(A);W&&I.set(T,W)}return f},R3t=typeof XMLHttpRequest<"u",j3t=R3t&&function(l){return new Promise(function(_,g){const T=CUe(l);let A=T.data;const I=d2.from(T.headers).normalize();let{responseType:$,onUploadProgress:W,onDownloadProgress:ee}=T,R,le,te,_e,Be;function Ge(){_e&&_e(),Be&&Be(),T.cancelToken&&T.cancelToken.unsubscribe(R),T.signal&&T.signal.removeEventListener("abort",R)}let et=new XMLHttpRequest;et.open(T.method.toUpperCase(),T.url,!0),et.timeout=T.timeout;function gt(){if(!et)return;const dt=d2.from("getAllResponseHeaders"in et&&et.getAllResponseHeaders()),St={data:!$||$==="text"||$==="json"?et.responseText:et.response,status:et.status,statusText:et.statusText,headers:dt,config:l,request:et};xUe(function($t){_($t),Ge()},function($t){g($t),Ge()},St),et=null}"onloadend"in et?et.onloadend=gt:et.onreadystatechange=function(){!et||et.readyState!==4||et.status===0&&!(et.responseURL&&et.responseURL.indexOf("file:")===0)||setTimeout(gt)},et.onabort=function(){et&&(g(new ru("Request aborted",ru.ECONNABORTED,l,et)),et=null)},et.onerror=function(nt){const St=nt&&nt.message?nt.message:"Network Error",sr=new ru(St,ru.ERR_NETWORK,l,et);sr.event=nt||null,g(sr),et=null},et.ontimeout=function(){let nt=T.timeout?"timeout of "+T.timeout+"ms exceeded":"timeout exceeded";const St=T.transitional||bUe;T.timeoutErrorMessage&&(nt=T.timeoutErrorMessage),g(new ru(nt,St.clarifyTimeoutError?ru.ETIMEDOUT:ru.ECONNABORTED,l,et)),et=null},A===void 0&&I.setContentType(null),"setRequestHeader"in et&&ki.forEach(I.toJSON(),function(nt,St){et.setRequestHeader(St,nt)}),ki.isUndefined(T.withCredentials)||(et.withCredentials=!!T.withCredentials),$&&$!=="json"&&(et.responseType=T.responseType),ee&&([te,Be]=hne(ee,!0),et.addEventListener("progress",te)),W&&et.upload&&([le,_e]=hne(W),et.upload.addEventListener("progress",le),et.upload.addEventListener("loadend",_e)),(T.cancelToken||T.signal)&&(R=dt=>{et&&(g(!dt||dt.type?new VM(null,l,et):dt),et.abort(),et=null)},T.cancelToken&&T.cancelToken.subscribe(R),T.signal&&(T.signal.aborted?R():T.signal.addEventListener("abort",R)));const at=P3t(T.url);if(at&&By.protocols.indexOf(at)===-1){g(new ru("Unsupported protocol "+at+":",ru.ERR_BAD_REQUEST,l));return}et.send(A||null)})},B3t=(l,f)=>{const{length:_}=l=l?l.filter(Boolean):[];if(f||_){let g=new AbortController,T;const A=function(ee){if(!T){T=!0,$();const R=ee instanceof Error?ee:this.reason;g.abort(R instanceof ru?R:new VM(R instanceof Error?R.message:R))}};let I=f&&setTimeout(()=>{I=null,A(new ru(`timeout ${f} of ms exceeded`,ru.ETIMEDOUT))},f);const $=()=>{l&&(I&&clearTimeout(I),I=null,l.forEach(ee=>{ee.unsubscribe?ee.unsubscribe(A):ee.removeEventListener("abort",A)}),l=null)};l.forEach(ee=>ee.addEventListener("abort",A));const{signal:W}=g;return W.unsubscribe=()=>ki.asap($),W}},$3t=function*(l,f){let _=l.byteLength;if(_<f){yield l;return}let g=0,T;for(;g<_;)T=g+f,yield l.slice(g,T),g=T},J3t=async function*(l,f){for await(const _ of z3t(l))yield*$3t(_,f)},z3t=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const f=l.getReader();try{for(;;){const{done:_,value:g}=await f.read();if(_)break;yield g}}finally{await f.cancel()}},Mze=(l,f,_,g)=>{const T=J3t(l,f);let A=0,I,$=W=>{I||(I=!0,g&&g(W))};return new ReadableStream({async pull(W){try{const{done:ee,value:R}=await T.next();if(ee){$(),W.close();return}let le=R.byteLength;if(_){let te=A+=le;_(te)}W.enqueue(new Uint8Array(R))}catch(ee){throw $(ee),ee}},cancel(W){return $(W),T.return()}},{highWaterMark:2})},Lze=64*1024,{isFunction:jre}=ki,q3t=(({Request:l,Response:f})=>({Request:l,Response:f}))(ki.global),{ReadableStream:Rze,TextEncoder:jze}=ki.global,Bze=(l,...f)=>{try{return!!l(...f)}catch{return!1}},V3t=l=>{l=ki.merge.call({skipUndefined:!0},q3t,l);const{fetch:f,Request:_,Response:g}=l,T=f?jre(f):typeof fetch=="function",A=jre(_),I=jre(g);if(!T)return!1;const $=T&&jre(Rze),W=T&&(typeof jze=="function"?(Be=>Ge=>Be.encode(Ge))(new jze):async Be=>new Uint8Array(await new _(Be).arrayBuffer())),ee=A&&$&&Bze(()=>{let Be=!1;const Ge=new _(By.origin,{body:new Rze,method:"POST",get duplex(){return Be=!0,"half"}}).headers.has("Content-Type");return Be&&!Ge}),R=I&&$&&Bze(()=>ki.isReadableStream(new g("").body)),le={stream:R&&(Be=>Be.body)};T&&["text","arrayBuffer","blob","formData","stream"].forEach(Be=>{!le[Be]&&(le[Be]=(Ge,et)=>{let gt=Ge&&Ge[Be];if(gt)return gt.call(Ge);throw new ru(`Response type '${Be}' is not supported`,ru.ERR_NOT_SUPPORT,et)})});const te=async Be=>{if(Be==null)return 0;if(ki.isBlob(Be))return Be.size;if(ki.isSpecCompliantForm(Be))return(await new _(By.origin,{method:"POST",body:Be}).arrayBuffer()).byteLength;if(ki.isArrayBufferView(Be)||ki.isArrayBuffer(Be))return Be.byteLength;if(ki.isURLSearchParams(Be)&&(Be=Be+""),ki.isString(Be))return(await W(Be)).byteLength},_e=async(Be,Ge)=>{const et=ki.toFiniteNumber(Be.getContentLength());return et??te(Ge)};return async Be=>{let{url:Ge,method:et,data:gt,signal:at,cancelToken:dt,timeout:nt,onDownloadProgress:St,onUploadProgress:sr,responseType:$t,headers:_r,withCredentials:Ot="same-origin",fetchOptions:zr}=CUe(Be),Kr=f||fetch;$t=$t?($t+"").toLowerCase():"text";let nr=B3t([at,dt&&dt.toAbortSignal()],nt),Ai=null;const ii=nr&&nr.unsubscribe&&(()=>{nr.unsubscribe()});let Dt;try{if(sr&&ee&&et!=="get"&&et!=="head"&&(Dt=await _e(_r,gt))!==0){let Oi=new _(Ge,{method:"POST",body:gt,duplex:"half"}),ua;if(ki.isFormData(gt)&&(ua=Oi.headers.get("content-type"))&&_r.setContentType(ua),Oi.body){const[ts,Rn]=Ize(Dt,hne(Oze(sr)));gt=Mze(Oi.body,Lze,ts,Rn)}}ki.isString(Ot)||(Ot=Ot?"include":"omit");const Qn=A&&"credentials"in _.prototype,hn={...zr,signal:nr,method:et.toUpperCase(),headers:_r.normalize().toJSON(),body:gt,duplex:"half",credentials:Qn?Ot:void 0};Ai=A&&new _(Ge,hn);let sn=await(A?Kr(Ai,zr):Kr(Ge,hn));const _n=R&&($t==="stream"||$t==="response");if(R&&(St||_n&&ii)){const Oi={};["status","statusText","headers"].forEach(_i=>{Oi[_i]=sn[_i]});const ua=ki.toFiniteNumber(sn.headers.get("content-length")),[ts,Rn]=St&&Ize(ua,hne(Oze(St),!0))||[];sn=new g(Mze(sn.body,Lze,ts,()=>{Rn&&Rn(),ii&&ii()}),Oi)}$t=$t||"text";let qi=await le[ki.findKey(le,$t)||"text"](sn,Be);return!_n&&ii&&ii(),await new Promise((Oi,ua)=>{xUe(Oi,ua,{data:qi,headers:d2.from(sn.headers),status:sn.status,statusText:sn.statusText,config:Be,request:Ai})})}catch(Qn){throw ii&&ii(),Qn&&Qn.name==="TypeError"&&/Load failed|fetch/i.test(Qn.message)?Object.assign(new ru("Network Error",ru.ERR_NETWORK,Be,Ai),{cause:Qn.cause||Qn}):ru.from(Qn,Qn&&Qn.code,Be,Ai)}}},U3t=new Map,EUe=l=>{let f=l?l.env:{};const{fetch:_,Request:g,Response:T}=f,A=[g,T,_];let I=A.length,$=I,W,ee,R=U3t;for(;$--;)W=A[$],ee=R.get(W),ee===void 0&&R.set(W,ee=$?new Map:V3t(f)),R=ee;return ee};EUe();const cTe={http:c3t,xhr:j3t,fetch:{get:EUe}};ki.forEach(cTe,(l,f)=>{if(l){try{Object.defineProperty(l,"name",{value:f})}catch{}Object.defineProperty(l,"adapterName",{value:f})}});const $ze=l=>`- ${l}`,W3t=l=>ki.isFunction(l)||l===null||l===!1,wUe={getAdapter:(l,f)=>{l=ki.isArray(l)?l:[l];const{length:_}=l;let g,T;const A={};for(let I=0;I<_;I++){g=l[I];let $;if(T=g,!W3t(g)&&(T=cTe[($=String(g)).toLowerCase()],T===void 0))throw new ru(`Unknown adapter '${$}'`);if(T&&(ki.isFunction(T)||(T=T.get(f))))break;A[$||"#"+I]=T}if(!T){const I=Object.entries(A).map(([W,ee])=>`adapter ${W} `+(ee===!1?"is not supported by the environment":"is not available in the build"));let $=_?I.length>1?`since :
4
4
  `+I.map($ze).join(`
@@ -477,4 +477,4 @@ Project '${d.projectName}' (${BI[d.projectKind]}) ${o}
477
477
  `,o++};this.projectService.externalProjects.forEach(c),this.projectService.configuredProjects.forEach(c),this.projectService.inferredProjects.forEach(c)}}this.logger.msg(a,"Err")}send(t){if(t.type==="event"&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${ST(t)}`);return}this.writeMessage(t)}writeMessage(t){const n=Aye(t,this.logger,this.byteLength,this.host.newLine);this.host.write(n)}event(t,n){this.send(Pye(n,t))}doOutput(t,n,i,a,o,c){const d={seq:0,type:"response",command:n,request_seq:i,success:a,performanceData:o&&OMe(o)};if(a){let p;if(Ja(t))d.body=t,p=t.metadata,delete t.metadata;else if(typeof t=="object")if(t.metadata){const{metadata:y,...b}=t;d.body=b,p=y}else d.body=t;else d.body=t;p&&(d.metadata=p)}else F.assert(t===void 0);c&&(d.message=c),this.send(d)}semanticCheck(t,n){var i,a;const o=Lc();(i=$n)==null||i.push($n.Phase.Session,"semanticCheck",{file:t,configFilePath:n.canonicalConfigFilePath});const c=TMe(n,t)?of:n.getLanguageService().getSemanticDiagnostics(t).filter(d=>!!d.file);this.sendDiagnosticsEvent(t,n,c,"semanticDiag",o),(a=$n)==null||a.pop()}syntacticCheck(t,n){var i,a;const o=Lc();(i=$n)==null||i.push($n.Phase.Session,"syntacticCheck",{file:t,configFilePath:n.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,n,n.getLanguageService().getSyntacticDiagnostics(t),"syntaxDiag",o),(a=$n)==null||a.pop()}suggestionCheck(t,n){var i,a;const o=Lc();(i=$n)==null||i.push($n.Phase.Session,"suggestionCheck",{file:t,configFilePath:n.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,n,n.getLanguageService().getSuggestionDiagnostics(t),"suggestionDiag",o),(a=$n)==null||a.pop()}regionSemanticCheck(t,n,i){var a,o,c;const d=Lc();(a=$n)==null||a.push($n.Phase.Session,"regionSemanticCheck",{file:t,configFilePath:n.canonicalConfigFilePath});let p;if(!this.shouldDoRegionCheck(t)||!(p=n.getLanguageService().getRegionSemanticDiagnostics(t,i))){(o=$n)==null||o.pop();return}this.sendDiagnosticsEvent(t,n,p.diagnostics,"regionSemanticDiag",d,p.spans),(c=$n)==null||c.pop()}shouldDoRegionCheck(t){var n;const i=(n=this.projectService.getScriptInfoForNormalizedPath(t))==null?void 0:n.textStorage.getLineInfo().getLineCount();return!!(i&&i>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(t,n,i,a,o,c){try{const d=F.checkDefined(n.getScriptInfo(t)),p=Lc()-o,y={file:t,diagnostics:i.map(b=>xMe(t,n,b)),spans:c==null?void 0:c.map(b=>L0(b,d))};this.event(y,a),this.addDiagnosticsPerformanceData(t,a,p)}catch(d){this.logError(d,a)}}updateErrorCheck(t,n,i,a=!0){if(n.length===0)return;F.assert(!this.suppressDiagnosticEvents);const o=this.changeSeq,c=Math.min(i,200);let d=0;const p=()=>{if(d++,n.length>d)return t.delay("checkOne",c,b)},y=(S,w)=>{if(this.semanticCheck(S,w),this.changeSeq===o){if(this.getPreferences(S).disableSuggestions)return p();t.immediate("suggestionCheck",()=>{this.suggestionCheck(S,w),p()})}},b=()=>{if(this.changeSeq!==o)return;let S,w=n[d];if(ha(w)?w=this.toPendingErrorCheck(w):"ranges"in w&&(S=w.ranges,w=this.toPendingErrorCheck(w.file)),!w)return p();const{fileName:D,project:O}=w;if($g(O),!!O.containsFile(D,a)&&(this.syntacticCheck(D,O),this.changeSeq===o)){if(O.projectService.serverMode!==0)return p();if(S)return t.immediate("regionSemanticCheck",()=>{const M=this.projectService.getScriptInfoForNormalizedPath(D);M&&this.regionSemanticCheck(D,O,S.map(L=>this.getRange({file:D,...L},M))),this.changeSeq===o&&t.immediate("semanticCheck",()=>y(D,O))});t.immediate("semanticCheck",()=>y(D,O))}};n.length>d&&this.changeSeq===o&&t.delay("checkOne",i,b)}cleanProjects(t,n){if(n){this.logger.info(`cleaning ${t}`);for(const i of n)i.getLanguageService(!1).cleanupSemanticCache(),i.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",_a(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t);return i.getEncodedSyntacticClassifications(n,t)}getEncodedSemanticClassifications(t){const{file:n,project:i}=this.getFileAndProject(t),a=t.format==="2020"?"2020":"original";return i.getLanguageService().getEncodedSemanticClassifications(n,t,a)}getProject(t){return t===void 0?void 0:this.projectService.findProject(t)}getConfigFileAndProject(t){const n=this.getProject(t.projectFileName),i=Dc(t.file);return{configFile:n&&n.hasConfigFile(i)?i:void 0,project:n}}getConfigFileDiagnostics(t,n,i){const a=n.getAllProjectErrors(),o=n.getLanguageService().getCompilerOptionsDiagnostics(),c=nr(bn(a,o),d=>!!d.file&&d.file.fileName===t);return i?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):Dt(c,d=>a9(d,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(n=>({message:I0(n.messageText,this.host.newLine),start:n.start,length:n.length,category:gC(n),code:n.code,source:n.source,startLocation:n.file&&K4(to(n.file,n.start)),endLocation:n.file&&K4(to(n.file,n.start+n.length)),reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated,relatedInformation:Dt(n.relatedInformation,Cee)}))}getCompilerOptionsDiagnostics(t){const n=this.getProject(t.projectFileName);return this.convertToDiagnosticsWithLinePosition(nr(n.getLanguageService().getCompilerOptionsDiagnostics(),i=>!i.file),void 0)}convertToDiagnosticsWithLinePosition(t,n){return t.map(i=>({message:I0(i.messageText,this.host.newLine),start:i.start,length:i.length,category:gC(i),code:i.code,source:i.source,startLocation:n&&n.positionToLineOffset(i.start),endLocation:n&&n.positionToLineOffset(i.start+i.length),reportsUnnecessary:i.reportsUnnecessary,reportsDeprecated:i.reportsDeprecated,relatedInformation:Dt(i.relatedInformation,Cee)}))}getDiagnosticsWorker(t,n,i,a){const{project:o,file:c}=this.getFileAndProject(t);if(n&&TMe(o,c))return of;const d=o.getScriptInfoForNormalizedPath(c),p=i(o,c);return a?this.convertToDiagnosticsWithLinePosition(p,d):p.map(y=>xMe(c,o,y))}getDefinition(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapDefinitionInfoLocations(a.getLanguageService().getDefinitionAtPosition(i,o)||of,a);return n?this.mapDefinitionInfo(c,a):c.map(dne.mapToOriginalLocation)}mapDefinitionInfoLocations(t,n){return t.map(i=>{const a=PMe(i,n);return a?{...a,containerKind:i.containerKind,containerName:i.containerName,kind:i.kind,name:i.name,failedAliasResolution:i.failedAliasResolution,...i.unverified&&{unverified:i.unverified}}:i})}getDefinitionAndBoundSpan(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=F.checkDefined(a.getScriptInfo(i)),d=a.getLanguageService().getDefinitionAndBoundSpan(i,o);if(!d||!d.definitions)return{definitions:of,textSpan:void 0};const p=this.mapDefinitionInfoLocations(d.definitions,a),{textSpan:y}=d;return n?{definitions:this.mapDefinitionInfo(p,a),textSpan:L0(y,c)}:{definitions:p.map(dne.mapToOriginalLocation),textSpan:y}}findSourceDefinition(t){var n;const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=a.getLanguageService().getDefinitionAtPosition(i,o);let d=this.mapDefinitionInfoLocations(c||of,a).slice();if(this.projectService.serverMode===0&&(!vt(d,D=>Dc(D.fileName)!==i&&!D.isAmbient)||vt(d,D=>!!D.failedAliasResolution))){const D=em(J=>J.textSpan.start,RQ(this.host.useCaseSensitiveFileNames));d==null||d.forEach(J=>D.add(J));const O=a.getNoDtsResolutionProject(i),M=O.getLanguageService(),L=(n=M.getDefinitionAtPosition(i,o,!0,!1))==null?void 0:n.filter(J=>Dc(J.fileName)!==i);if(vt(L))for(const J of L){if(J.unverified){const V=S(J,a.getLanguageService().getProgram(),M.getProgram());if(vt(V)){for(const q of V)D.add(q);continue}}D.add(J)}else{const J=d.filter(V=>Dc(V.fileName)!==i&&V.isAmbient);for(const V of vt(J)?J:b()){const q=y(V.fileName,i,O);if(!q)continue;const G=this.projectService.getOrCreateScriptInfoNotOpenedByClient(q,O.currentDirectory,O.directoryStructureHost,!1);if(!G)continue;O.containsScriptInfo(G)||(O.addRoot(G),O.updateGraph());const K=M.getProgram(),ne=F.checkDefined(K.getSourceFile(q));for(const oe of w(V.name,ne,K))D.add(oe)}}d=_a(D.values())}return d=d.filter(D=>!D.isAmbient&&!D.failedAliasResolution),this.mapDefinitionInfo(d,a);function y(D,O,M){var L,J,V;const q=vj(D);if(q&&D.lastIndexOf(_y)===q.topLevelNodeModulesIndex){const G=D.substring(0,q.packageRootIndex),K=(L=a.getModuleResolutionCache())==null?void 0:L.getPackageJsonInfoCache(),ne=a.getCompilationSettings(),oe=WN(es(G,a.getCurrentDirectory()),UN(K,a,ne));if(!oe)return;const re=iY(oe,{moduleResolution:2},a,a.getModuleResolutionCache()),Ee=D.substring(q.topLevelPackageNameIndex+1,q.packageRootIndex),pe=HN(DF(Ee)),Z=a.toPath(D);if(re&&vt(re,ve=>a.toPath(ve)===Z))return(J=M.resolutionCache.resolveSingleModuleNameWithoutWatching(pe,O).resolvedModule)==null?void 0:J.resolvedFileName;{const ve=D.substring(q.packageRootIndex+1),ge=`${pe}/${hp(ve)}`;return(V=M.resolutionCache.resolveSingleModuleNameWithoutWatching(ge,O).resolvedModule)==null?void 0:V.resolvedFileName}}}function b(){const D=a.getLanguageService(),O=D.getProgram(),M=Up(O.getSourceFile(i),o);return(rc(M)||Ke(M))&&Yc(M.parent)&&Ice(M,L=>{var J;if(L===M)return;const V=(J=D.getDefinitionAtPosition(i,L.getStart(),!0,!1))==null?void 0:J.filter(q=>Dc(q.fileName)!==i&&q.isAmbient).map(q=>({fileName:q.fileName,name:Zm(M)}));if(vt(V))return V})||of}function S(D,O,M){var L;const J=M.getSourceFile(D.fileName);if(!J)return;const V=Up(O.getSourceFile(i),o),q=O.getTypeChecker().getSymbolAtLocation(V),G=q&&_l(q,276);if(!G)return;const K=((L=G.propertyName)==null?void 0:L.text)||G.name.text;return w(K,J,M)}function w(D,O,M){const L=Qc.Core.getTopMostDeclarationNamesInFile(D,O);return Rn(L,J=>{const V=M.getTypeChecker().getSymbolAtLocation(J),q=U3(J);if(V&&q)return G4.createDefinitionInfo(q,M.getTypeChecker(),V,q,!0)})}}getEmitOutput(t){const{file:n,project:i}=this.getFileAndProject(t);if(!i.shouldEmitFile(i.getScriptInfo(n)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};const a=i.getLanguageService().getEmitOutput(n);return t.richResponse?{...a,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(a.diagnostics):a.diagnostics.map(o=>a9(o,!0))}:a}mapJSDocTagInfo(t,n,i){return t?t.map(a=>{var o;return{...a,text:i?this.mapDisplayParts(a.text,n):(o=a.text)==null?void 0:o.map(c=>c.text).join("")}}):[]}mapDisplayParts(t,n){return t?t.map(i=>i.kind!=="linkName"?i:{...i,target:this.toFileSpan(i.target.fileName,i.target.textSpan,n)}):[]}mapSignatureHelpItems(t,n,i){return t.map(a=>({...a,documentation:this.mapDisplayParts(a.documentation,n),parameters:a.parameters.map(o=>({...o,documentation:this.mapDisplayParts(o.documentation,n)})),tags:this.mapJSDocTagInfo(a.tags,n,i)}))}mapDefinitionInfo(t,n){return t.map(i=>({...this.toFileSpanWithContext(i.fileName,i.textSpan,i.contextSpan,n),...i.unverified&&{unverified:i.unverified}}))}static mapToOriginalLocation(t){return t.originalFileName?(F.assert(t.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...t,fileName:t.originalFileName,textSpan:t.originalTextSpan,targetFileName:t.fileName,targetTextSpan:t.textSpan,contextSpan:t.originalContextSpan,targetContextSpan:t.contextSpan}):t}toFileSpan(t,n,i){const a=i.getLanguageService(),o=a.toLineColumnOffset(t,n.start),c=a.toLineColumnOffset(t,Il(n));return{file:t,start:{line:o.line+1,offset:o.character+1},end:{line:c.line+1,offset:c.character+1}}}toFileSpanWithContext(t,n,i,a){const o=this.toFileSpan(t,n,a),c=i&&this.toFileSpan(t,i,a);return c?{...o,contextStart:c.start,contextEnd:c.end}:o}getTypeDefinition(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,n),o=this.mapDefinitionInfoLocations(i.getLanguageService().getTypeDefinitionAtPosition(n,a)||of,i);return this.mapDefinitionInfo(o,i)}mapImplementationLocations(t,n){return t.map(i=>{const a=PMe(i,n);return a?{...a,kind:i.kind,displayParts:i.displayParts}:i})}getImplementation(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapImplementationLocations(a.getLanguageService().getImplementationAtPosition(i,o)||of,a);return n?c.map(({fileName:d,textSpan:p,contextSpan:y})=>this.toFileSpanWithContext(d,p,y,a)):c.map(dne.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){const{configFile:n}=this.getConfigFileAndProject(t);return n?of:this.getDiagnosticsWorker(t,!1,(i,a)=>i.getLanguageService().getSyntacticDiagnostics(a),!!t.includeLinePosition)}getSemanticDiagnosticsSync(t){const{configFile:n,project:i}=this.getConfigFileAndProject(t);return n?this.getConfigFileDiagnostics(n,i,!!t.includeLinePosition):this.getDiagnosticsWorker(t,!0,(a,o)=>a.getLanguageService().getSemanticDiagnostics(o).filter(c=>!!c.file),!!t.includeLinePosition)}getSuggestionDiagnosticsSync(t){const{configFile:n}=this.getConfigFileAndProject(t);return n?of:this.getDiagnosticsWorker(t,!0,(i,a)=>i.getLanguageService().getSuggestionDiagnostics(a),!!t.includeLinePosition)}getJsxClosingTag(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=i.getJsxClosingTagAtPosition(n,a);return o===void 0?void 0:{newText:o.newText,caretOffset:0}}getLinkedEditingRange(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=i.getLinkedEditingRangeAtPosition(n,a),c=this.projectService.getScriptInfoForNormalizedPath(n);if(!(c===void 0||o===void 0))return hvt(o,c)}getDocumentHighlights(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=a.getLanguageService().getDocumentHighlights(i,o,t.filesToSearch);return c?n?c.map(({fileName:d,highlightSpans:p})=>{const y=a.getScriptInfo(d);return{file:d,highlightSpans:p.map(({textSpan:b,kind:S,contextSpan:w})=>({...Iye(b,w,y),kind:S}))}}):c:of}provideInlayHints(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(n);return i.getLanguageService().provideInlayHints(n,t,this.getPreferences(n)).map(c=>{const{position:d,displayParts:p}=c;return{...c,position:a.positionToLineOffset(d),displayParts:p==null?void 0:p.map(({text:y,span:b,file:S})=>{if(b){F.assertIsDefined(S,"Target file should be defined together with its span.");const w=this.projectService.getScriptInfo(S);return{text:y,span:{start:w.positionToLineOffset(b.start),end:w.positionToLineOffset(b.start+b.length),file:S}}}else return{text:y}})}})}mapCode(t){var n;const i=this.getHostFormatOptions(),a=this.getHostPreferences(),{file:o,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),d=this.projectService.getScriptInfoForNormalizedPath(o),p=(n=t.mapping.focusLocations)==null?void 0:n.map(b=>b.map(S=>{const w=d.lineOffsetToPosition(S.start.line,S.start.offset),D=d.lineOffsetToPosition(S.end.line,S.end.offset);return{start:w,length:D-w}})),y=c.mapCode(o,t.mapping.contents,p,i,a);return this.mapTextChangesToCodeEdits(y)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(t){this.projectService.setCompilerOptionsForInferredProjects(t.options,t.projectRootPath)}getProjectInfo(t){return this.getProjectInfoWorker(t.file,t.projectFileName,t.needFileNameList,t.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(t,n,i,a,o){const{project:c}=this.getFileAndProjectWorker(t,n);return $g(c),{configFileName:c.getProjectName(),languageServiceDisabled:!c.languageServiceEnabled,fileNames:i?c.getFileNames(!1,o):void 0,configuredProjectInfo:a?this.getDefaultConfiguredProjectInfo(t):void 0}}getDefaultConfiguredProjectInfo(t){var n;const i=this.projectService.getScriptInfo(t);if(!i)return;const a=this.projectService.findDefaultConfiguredProjectWorker(i,3);if(!a)return;let o,c;return a.seenProjects.forEach((d,p)=>{p!==a.defaultProject&&(d!==3?(o??(o=[])).push(Dc(p.getConfigFilePath())):(c??(c=[])).push(Dc(p.getConfigFilePath())))}),(n=a.seenConfigs)==null||n.forEach(d=>(o??(o=[])).push(d)),{notMatchedByConfig:o,notInProject:c,defaultProject:a.defaultProject&&Dc(a.defaultProject.getConfigFilePath())}}getRenameInfo(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,n),o=this.getPreferences(n);return i.getLanguageService().getRenameInfo(n,a,o)}getProjects(t,n,i){let a,o;if(t.projectFileName){const c=this.getProject(t.projectFileName);c&&(a=[c])}else{const c=n?this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file):this.projectService.getScriptInfo(t.file);if(c)n||this.projectService.ensureDefaultProjectForFile(c);else return i?of:(this.projectService.logErrorForScriptInfoNotFound(t.file),_1.ThrowNoProject());a=c.containingProjects,o=this.projectService.getSymlinkedProjects(c)}return a=nr(a,c=>c.languageServiceEnabled&&!c.isOrphan()),!i&&(!a||!a.length)&&!o?(this.projectService.logErrorForScriptInfoNotFound(t.file??t.projectFileName),_1.ThrowNoProject()):o?{projects:a,symLinkedProjects:o}:a}getDefaultProject(t){if(t.projectFileName){const i=this.getProject(t.projectFileName);if(i)return i;if(!t.file)return _1.ThrowNoProject()}return this.projectService.getScriptInfo(t.file).getDefaultProject()}getRenameLocations(t,n){const i=Dc(t.file),a=this.getPositionInFile(t,i),o=this.getProjects(t),c=this.getDefaultProject(t),d=this.getPreferences(i),p=this.mapRenameInfo(c.getLanguageService().getRenameInfo(i,a,d),F.checkDefined(this.projectService.getScriptInfo(i)));if(!p.canRename)return n?{info:p,locs:[]}:[];const y=fvt(o,c,{fileName:t.file,pos:a},!!t.findInStrings,!!t.findInComments,d,this.host.useCaseSensitiveFileNames);return n?{info:p,locs:this.toSpanGroups(y)}:y}mapRenameInfo(t,n){if(t.canRename){const{canRename:i,fileToRename:a,displayName:o,fullDisplayName:c,kind:d,kindModifiers:p,triggerSpan:y}=t;return{canRename:i,fileToRename:a,displayName:o,fullDisplayName:c,kind:d,kindModifiers:p,triggerSpan:L0(y,n)}}else return t}toSpanGroups(t){const n=new Map;for(const{fileName:i,textSpan:a,contextSpan:o,originalContextSpan:c,originalTextSpan:d,originalFileName:p,...y}of t){let b=n.get(i);b||n.set(i,b={file:i,locs:[]});const S=F.checkDefined(this.projectService.getScriptInfo(i));b.locs.push({...Iye(a,o,S),...y})}return _a(n.values())}getReferences(t,n){const i=Dc(t.file),a=this.getProjects(t),o=this.getPositionInFile(t,i),c=_vt(a,this.getDefaultProject(t),{fileName:t.file,pos:o},this.host.useCaseSensitiveFileNames,this.logger);if(!n)return c;const d=this.getPreferences(i),p=this.getDefaultProject(t),y=p.getScriptInfoForNormalizedPath(i),b=p.getLanguageService().getQuickInfoAtPosition(i,o),S=b?A5(b.displayParts):"",w=b&&b.textSpan,D=w?y.positionToLineOffset(w.start).offset:0,O=w?y.getSnapshot().getText(w.start,Il(w)):"";return{refs:_n(c,L=>L.references.map(J=>MMe(this.projectService,J,d))),symbolName:O,symbolStartOffset:D,symbolDisplayString:S}}getFileReferences(t,n){const i=this.getProjects(t),a=Dc(t.file),o=this.getPreferences(a),c={fileName:a,pos:0},d=Nye(i,this.getDefaultProject(t),c,c,wMe,b=>(this.logger.info(`Finding references to file ${a} in project ${b.getProjectName()}`),b.getLanguageService().getFileReferences(a)));let p;if(Ja(d))p=d;else{p=[];const b=Eee(this.host.useCaseSensitiveFileNames);d.forEach(S=>{for(const w of S)b.has(w)||(p.push(w),b.add(w))})}return n?{refs:p.map(b=>MMe(this.projectService,b,o)),symbolName:`"${t.file}"`}:p}openClientFile(t,n,i,a){this.projectService.openClientFileWithNormalizedPath(t,n,i,!1,a)}getPosition(t,n){return t.position!==void 0?t.position:n.lineOffsetToPosition(t.line,t.offset)}getPositionInFile(t,n){const i=this.projectService.getScriptInfoForNormalizedPath(n);return this.getPosition(t,i)}getFileAndProject(t){return this.getFileAndProjectWorker(t.file,t.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(t){const{file:n,project:i}=this.getFileAndProject(t);return{file:n,languageService:i.getLanguageService(!1)}}getFileAndProjectWorker(t,n){const i=Dc(t),a=this.getProject(n)||this.projectService.ensureDefaultProjectForFile(i);return{file:i,project:a}}getOutliningSpans(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getOutliningSpans(i);if(n){const c=this.projectService.getScriptInfoForNormalizedPath(i);return o.map(d=>({textSpan:L0(d.textSpan,c),hintSpan:L0(d.hintSpan,c),bannerText:d.bannerText,autoCollapse:d.autoCollapse,kind:d.kind}))}else return o}getTodoComments(t){const{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().getTodoComments(n,t.descriptors)}getDocCommentTemplate(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getDocCommentTemplateAtPosition(n,a,this.getPreferences(n),this.getFormatOptions(n))}getSpanOfEnclosingComment(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.onlyMultiLine,o=this.getPositionInFile(t,n);return i.getSpanOfEnclosingComment(n,o,a)}getIndentation(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=t.options?Z4(t.options):this.getFormatOptions(n),c=i.getIndentationAtPosition(n,a,o);return{position:a,indentation:c}}getBreakpointStatement(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getBreakpointStatementAtPosition(n,a)}getNameOrDottedNameSpan(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getNameOrDottedNameSpan(n,a,a)}isValidBraceCompletion(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.isValidBraceCompletionAtPosition(n,a,t.openingBrace.charCodeAt(0))}getQuickInfoWorker(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getQuickInfoAtPosition(i,this.getPosition(t,o));if(!c)return;const d=!!this.getPreferences(i).displayPartsForJSDoc;if(n){const p=A5(c.displayParts);return{kind:c.kind,kindModifiers:c.kindModifiers,start:o.positionToLineOffset(c.textSpan.start),end:o.positionToLineOffset(Il(c.textSpan)),displayString:p,documentation:d?this.mapDisplayParts(c.documentation,a):A5(c.documentation),tags:this.mapJSDocTagInfo(c.tags,a,d)}}else return d?c:{...c,tags:this.mapJSDocTagInfo(c.tags,a,!1)}}getFormattingEditsForRange(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(n),o=a.lineOffsetToPosition(t.line,t.offset),c=a.lineOffsetToPosition(t.endLine,t.endOffset),d=i.getFormattingEditsForRange(n,o,c,this.getFormatOptions(n));if(d)return d.map(p=>this.convertTextChangeToCodeEdit(p,a))}getFormattingEditsForRangeFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Z4(t.options):this.getFormatOptions(n);return i.getFormattingEditsForRange(n,t.position,t.endPosition,a)}getFormattingEditsForDocumentFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Z4(t.options):this.getFormatOptions(n);return i.getFormattingEditsForDocument(n,a)}getFormattingEditsAfterKeystrokeFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Z4(t.options):this.getFormatOptions(n);return i.getFormattingEditsAfterKeystroke(n,t.position,t.key,a)}getFormattingEditsAfterKeystroke(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(n),o=a.lineOffsetToPosition(t.line,t.offset),c=this.getFormatOptions(n),d=i.getFormattingEditsAfterKeystroke(n,o,t.key,c);if(t.key===`
478
478
  `&&(!d||d.length===0||cvt(d,o))){const{lineText:p,absolutePosition:y}=a.textStorage.getAbsolutePositionAndLineText(t.line);if(p&&p.search("\\S")<0){const b=i.getIndentationAtPosition(n,o,c);let S=0,w,D;for(w=0,D=p.length;w<D;w++)if(p.charAt(w)===" ")S++;else if(p.charAt(w)===" ")S+=c.tabSize;else break;if(b!==S){const O=y+w;d.push({span:su(y,O),newText:Lu.getIndentationString(b,c)})}}}if(d)return d.map(p=>({start:a.positionToLineOffset(p.span.start),end:a.positionToLineOffset(Il(p.span)),newText:p.newText?p.newText:""}))}getCompletions(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getLanguageService().getCompletionsAtPosition(i,c,{...pye(this.getPreferences(i)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},a.projectService.getFormatCodeOptions(i));if(d===void 0)return;if(n==="completions-full")return d;const p=t.prefix||"",y=Rn(d.entries,S=>{if(d.isMemberCompletion||za(S.name.toLowerCase(),p.toLowerCase())){const w=S.replacementSpan?L0(S.replacementSpan,o):void 0;return{...S,replacementSpan:w,hasAction:S.hasAction||void 0,symbol:void 0}}});return n==="completions"?(d.metadata&&(y.metadata=d.metadata),y):{...d,optionalReplacementSpan:d.optionalReplacementSpan&&L0(d.optionalReplacementSpan,o),entries:y}}getCompletionEntryDetails(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.projectService.getFormatCodeOptions(i),p=!!this.getPreferences(i).displayPartsForJSDoc,y=Rn(t.entryNames,b=>{const{name:S,source:w,data:D}=typeof b=="string"?{name:b,source:void 0,data:void 0}:b;return a.getLanguageService().getCompletionEntryDetails(i,c,S,d,w,this.getPreferences(i),D?Is(D,Tvt):void 0)});return n?p?y:y.map(b=>({...b,tags:this.mapJSDocTagInfo(b.tags,a,!1)})):y.map(b=>({...b,codeActions:Dt(b.codeActions,S=>this.mapCodeAction(S)),documentation:this.mapDisplayParts(b.documentation,a),tags:this.mapJSDocTagInfo(b.tags,a,p)}))}getCompileOnSaveAffectedFileList(t){const n=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?uvt(i,a=>this.projectService.getScriptInfoForPath(a),n,(a,o)=>{if(!a.compileOnSaveEnabled||!a.languageServiceEnabled||a.isOrphan())return;const c=a.getCompilationSettings();if(!(c.noEmit||sf(o.fileName)&&!ovt(c)))return{projectFileName:a.getProjectName(),fileNames:a.getCompileOnSaveAffectedFileList(o),projectUsesOutFile:!!c.outFile}}):of}emitFile(t){const{file:n,project:i}=this.getFileAndProject(t);if(i||_1.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;const a=i.getScriptInfo(n),{emitSkipped:o,diagnostics:c}=i.emitFile(a,(d,p,y)=>this.host.writeFile(d,p,y));return t.richResponse?{emitSkipped:o,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(d=>a9(d,!0))}:!o}getSignatureHelpItems(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getLanguageService().getSignatureHelpItems(i,c,t),p=!!this.getPreferences(i).displayPartsForJSDoc;if(d&&n){const y=d.applicableSpan;return{...d,applicableSpan:{start:o.positionToLineOffset(y.start),end:o.positionToLineOffset(y.start+y.length)},items:this.mapSignatureHelpItems(d.items,a,p)}}else return p||!d?d:{...d,items:d.items.map(y=>({...y,tags:this.mapJSDocTagInfo(y.tags,a,!1)}))}}toPendingErrorCheck(t){const n=Dc(t),i=this.projectService.tryGetDefaultProjectForFile(n);return i&&{fileName:n,project:i}}getDiagnostics(t,n,i){this.suppressDiagnosticEvents||i.length>0&&this.updateErrorCheck(t,i,n)}change(t){const n=this.projectService.getScriptInfo(t.file);F.assert(!!n),n.textStorage.switchToScriptVersionCache();const i=n.lineOffsetToPosition(t.line,t.offset),a=n.lineOffsetToPosition(t.endLine,t.endOffset);i>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(n,Wa({span:{start:i,length:a-i},newText:t.insertString})))}reload(t){const n=Dc(t.file),i=t.tmpfile===void 0?void 0:Dc(t.tmpfile),a=this.projectService.getScriptInfoForNormalizedPath(n);a&&(this.changeSeq++,a.reloadFromFile(i))}saveToTmp(t,n){const i=this.projectService.getScriptInfo(t);i&&i.saveTo(n)}closeClientFile(t){if(!t)return;const n=oo(t);this.projectService.closeClientFile(n)}mapLocationNavigationBarItems(t,n){return Dt(t,i=>({text:i.text,kind:i.kind,kindModifiers:i.kindModifiers,spans:i.spans.map(a=>L0(a,n)),childItems:this.mapLocationNavigationBarItems(i.childItems,n),indent:i.indent}))}getNavigationBarItems(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getNavigationBarItems(i);return o?n?this.mapLocationNavigationBarItems(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}toLocationNavigationTree(t,n){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(i=>L0(i,n)),nameSpan:t.nameSpan&&L0(t.nameSpan,n),childItems:Dt(t.childItems,i=>this.toLocationNavigationTree(i,n))}}getNavigationTree(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getNavigationTree(i);return o?n?this.toLocationNavigationTree(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}getNavigateToItems(t,n){const i=this.getFullNavigateToItems(t);return n?_n(i,({project:a,navigateToItems:o})=>o.map(c=>{const d=a.getScriptInfo(c.fileName),p={name:c.name,kind:c.kind,kindModifiers:c.kindModifiers,isCaseSensitive:c.isCaseSensitive,matchKind:c.matchKind,file:c.fileName,start:d.positionToLineOffset(c.textSpan.start),end:d.positionToLineOffset(Il(c.textSpan))};return c.kindModifiers&&c.kindModifiers!==""&&(p.kindModifiers=c.kindModifiers),c.containerName&&c.containerName.length>0&&(p.containerName=c.containerName),c.containerKind&&c.containerKind.length>0&&(p.containerKind=c.containerKind),p})):_n(i,({navigateToItems:a})=>a)}getFullNavigateToItems(t){const{currentFileOnly:n,searchValue:i,maxResultCount:a,projectFileName:o}=t;if(n){F.assertIsDefined(t.file);const{file:w,project:D}=this.getFileAndProject(t);return[{project:D,navigateToItems:D.getLanguageService().getNavigateToItems(i,a,w)}]}const c=this.getHostPreferences(),d=[],p=new Map;if(!t.file&&!o)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(w=>y(w));else{const w=this.getProjects(t);EMe(w,void 0,D=>y(D))}return d;function y(w){const D=w.getLanguageService().getNavigateToItems(i,a,void 0,w.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),O=nr(D,M=>b(M)&&!wee($I(M),w));O.length&&d.push({project:w,navigateToItems:O})}function b(w){const D=w.name;if(!p.has(D))return p.set(D,[w]),!0;const O=p.get(D);for(const M of O)if(S(M,w))return!1;return O.push(w),!0}function S(w,D){return w===D?!0:!w||!D?!1:w.containerKind===D.containerKind&&w.containerName===D.containerName&&w.fileName===D.fileName&&w.isCaseSensitive===D.isCaseSensitive&&w.kind===D.kind&&w.kindModifiers===D.kindModifiers&&w.matchKind===D.matchKind&&w.name===D.name&&w.textSpan.start===D.textSpan.start&&w.textSpan.length===D.textSpan.length}}getSupportedCodeFixes(t){if(!t)return VZ();if(t.file){const{file:i,project:a}=this.getFileAndProject(t);return a.getLanguageService().getSupportedCodeFixes(i)}const n=this.getProject(t.projectFileName);return n||_1.ThrowNoProject(),n.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,n){let i,a;return this.isLocation(t)?i=o(t):a=this.getRange(t,n),F.checkDefined(i===void 0?a:i);function o(c){return c.position!==void 0?c.position:n.lineOffsetToPosition(c.line,c.offset)}}getRange(t,n){const{startPosition:i,endPosition:a}=this.getStartAndEndPosition(t,n);return{pos:i,end:a}}getApplicableRefactors(t){const{file:n,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getApplicableRefactors(n,this.extractPositionOrRange(t,a),this.getPreferences(n),t.triggerReason,t.kind,t.includeInteractiveActions).map(c=>({...c,actions:c.actions.map(d=>({...d,range:d.range?{start:K4({line:d.range.start.line,character:d.range.start.offset}),end:K4({line:d.range.end.line,character:d.range.end.offset})}:void 0}))}))}getEditsForRefactor(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=a.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getEditsForRefactor(i,this.getFormatOptions(i),this.extractPositionOrRange(t,o),t.refactor,t.action,this.getPreferences(i),t.interactiveRefactorArguments);if(c===void 0)return{edits:[]};if(n){const{renameFilename:d,renameLocation:p,edits:y}=c;let b;if(d!==void 0&&p!==void 0){const S=a.getScriptInfoForNormalizedPath(Dc(d));b=Oye(jD(S.getSnapshot()),d,p,y)}return{renameLocation:b,renameFilename:d,edits:this.mapTextChangesToCodeEdits(y),notApplicableReason:c.notApplicableReason}}return c}getMoveToRefactoringFileSuggestions(t){const{file:n,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getMoveToRefactoringFileSuggestions(n,this.extractPositionOrRange(t,a),this.getPreferences(n))}preparePasteEdits(t){const{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().preparePasteEditsForFile(n,t.copiedTextSpan.map(a=>this.getRange({file:n,startLine:a.start.line,startOffset:a.start.offset,endLine:a.end.line,endOffset:a.end.offset},this.projectService.getScriptInfoForNormalizedPath(n))))}getPasteEdits(t){const{file:n,project:i}=this.getFileAndProject(t);if(jI(n))return;const a=t.copiedFrom?{file:t.copiedFrom.file,range:t.copiedFrom.spans.map(c=>this.getRange({file:t.copiedFrom.file,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(Dc(t.copiedFrom.file))))}:void 0,o=i.getLanguageService().getPasteEdits({targetFile:n,pastedText:t.pastedText,pasteLocations:t.pasteLocations.map(c=>this.getRange({file:n,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(n))),copiedFrom:a,preferences:this.getPreferences(n)},this.getFormatOptions(n));return o&&this.mapPasteEditsAction(o)}organizeImports(t,n){F.assert(t.scope.type==="file");const{file:i,project:a}=this.getFileAndProject(t.scope.args),o=a.getLanguageService().organizeImports({fileName:i,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(i),this.getPreferences(i));return n?this.mapTextChangesToCodeEdits(o):o}getEditsForFileRename(t,n){const i=Dc(t.oldFilePath),a=Dc(t.newFilePath),o=this.getHostFormatOptions(),c=this.getHostPreferences(),d=new Set,p=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(y=>{const b=y.getLanguageService().getEditsForFileRename(i,a,o,c),S=[];for(const w of b)d.has(w.fileName)||(p.push(w),S.push(w.fileName));for(const w of S)d.add(w)}),n?p.map(y=>this.mapTextChangeToCodeEdit(y)):p}getCodeFixes(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=a.getScriptInfoForNormalizedPath(i),{startPosition:c,endPosition:d}=this.getStartAndEndPosition(t,o);let p;try{p=a.getLanguageService().getCodeFixesAtPosition(i,c,d,t.errorCodes,this.getFormatOptions(i),this.getPreferences(i))}catch(y){const b=a.getLanguageService(),S=[...b.getSyntacticDiagnostics(i),...b.getSemanticDiagnostics(i),...b.getSuggestionDiagnostics(i)].map(D=>v7(c,d-c,D.start,D.length)&&D.code),w=t.errorCodes.find(D=>!S.includes(D));throw w!==void 0&&(y.message=`BADCLIENT: Bad error code, ${w} not found in range ${c}..${d} (found: ${S.join(", ")}); could have caused this error:
479
479
  ${y.message}`),y}return n?p.map(y=>this.mapCodeFixAction(y)):p}getCombinedCodeFix({scope:t,fixId:n},i){F.assert(t.type==="file");const{file:a,project:o}=this.getFileAndProject(t.args),c=o.getLanguageService().getCombinedCodeFix({type:"file",fileName:a},n,this.getFormatOptions(a),this.getPreferences(a));return i?{changes:this.mapTextChangesToCodeEdits(c.changes),commands:c.commands}:c}applyCodeActionCommand(t){const n=t.command;for(const i of Eh(n)){const{file:a,project:o}=this.getFileAndProject(i);o.getLanguageService().applyCodeActionCommand(i,this.getFormatOptions(a)).then(c=>{},c=>{})}return{}}getStartAndEndPosition(t,n){let i,a;return t.startPosition!==void 0?i=t.startPosition:(i=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=i),t.endPosition!==void 0?a=t.endPosition:(a=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=a),{startPosition:i,endPosition:a}}mapCodeAction({description:t,changes:n,commands:i}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:i}}mapCodeFixAction({fixName:t,description:n,changes:i,commands:a,fixId:o,fixAllDescription:c}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(i),commands:a,fixId:o,fixAllDescription:c}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(n=>this.mapTextChangeToCodeEdit(n))}mapTextChangeToCodeEdit(t){const n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),F.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(i=>gvt(i,n))}:yvt(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getBraceMatchingAtPosition(i,c);return d?n?d.map(p=>L0(p,o)):d:void 0}getDiagnosticsForProject(t,n,i){if(this.suppressDiagnosticEvents)return;const{fileNames:a,languageServiceDisabled:o}=this.getProjectInfoWorker(i,void 0,!0,void 0,!0);if(o)return;const c=a.filter(M=>!M.includes("lib.d.ts"));if(c.length===0)return;const d=[],p=[],y=[],b=[],S=Dc(i),w=this.projectService.ensureDefaultProjectForFile(S);for(const M of c)this.getCanonicalFileName(M)===this.getCanonicalFileName(i)?d.push(M):this.projectService.getScriptInfo(M).isScriptOpen()?p.push(M):sf(M)?b.push(M):y.push(M);const O=[...d,...p,...y,...b].map(M=>({fileName:M,project:w}));this.updateErrorCheck(t,O,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){const{locations:i}=t,{file:a,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=F.checkDefined(this.projectService.getScriptInfo(a));return Dt(i,d=>{const p=this.getPosition(d,c),y=o.getSmartSelectionRange(a,p);return n?this.mapSelectionRange(y,c):y})}toggleLineComment(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfo(i),c=this.getRange(t,o),d=a.toggleLineComment(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}toggleMultilineComment(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.toggleMultilineComment(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}commentSelection(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.commentSelection(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}uncommentSelection(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.uncommentSelection(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}mapSelectionRange(t,n){const i={textSpan:L0(t.textSpan,n)};return t.parent&&(i.parent=this.mapSelectionRange(t.parent,n)),i}getScriptInfoFromProjectService(t){const n=Dc(t),i=this.projectService.getScriptInfoForNormalizedPath(n);return i||(this.projectService.logErrorForScriptInfoNotFound(n),_1.ThrowNoProject())}toProtocolCallHierarchyItem(t){const n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:L0(t.span,n),selectionSpan:L0(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){const n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>L0(i,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>L0(i,n))}}prepareCallHierarchy(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(n);if(a){const o=this.getPosition(t,a),c=i.getLanguageService().prepareCallHierarchy(n,o);return c&&eZ(c,d=>this.toProtocolCallHierarchyItem(d))}}provideCallHierarchyIncomingCalls(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyIncomingCall(c))}provideCallHierarchyOutgoingCalls(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyOutgoingCall(c,a))}getCanonicalFileName(t){const n=this.host.useCaseSensitiveFileNames?t:_0(t);return oo(n)}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){F.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){F.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,i){const a=this.performanceData;try{return this.performanceData=i,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=a}}executeCommand(t){const n=this.handlers.get(t.command);if(n){const i=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),i}else return this.logger.msg(`Unrecognized JSON command:${ST(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,i,a,o,c,d,p;this.gcTimer.scheduleCollect();let y;const b=this.performanceData;this.logger.hasLevel(2)&&(y=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${uI(this.toStringMessage(t))}`));let S,w;try{S=this.parseMessage(t),w=S.arguments&&S.arguments.file?S.arguments:void 0,(n=$n)==null||n.instant($n.Phase.Session,"request",{seq:S.seq,command:S.command}),(i=$n)==null||i.push($n.Phase.Session,"executeCommand",{seq:S.seq,command:S.command},!0);const{response:D,responseRequired:O,performanceData:M}=this.executeCommand(S);if((a=$n)==null||a.pop(),this.logger.hasLevel(2)){const L=svt(this.hrtime(y)).toFixed(4);O?this.logger.perftrc(`${S.seq}::${S.command}: elapsed time (in milliseconds) ${L}`):this.logger.perftrc(`${S.seq}::${S.command}: async elapsed time (in milliseconds) ${L}`)}(o=$n)==null||o.instant($n.Phase.Session,"response",{seq:S.seq,command:S.command,success:!!D}),D?this.doOutput(D,S.command,S.seq,!0,M):O&&this.doOutput(void 0,S.command,S.seq,!1,M,"No content available.")}catch(D){if((c=$n)==null||c.popAll(),D instanceof l3){(d=$n)==null||d.instant($n.Phase.Session,"commandCanceled",{seq:S==null?void 0:S.seq,command:S==null?void 0:S.command}),this.doOutput({canceled:!0},S.command,S.seq,!0,this.performanceData);return}this.logErrorWorker(D,this.toStringMessage(t),w),(p=$n)==null||p.instant($n.Phase.Session,"commandError",{seq:S==null?void 0:S.seq,command:S==null?void 0:S.command,message:D.message}),this.doOutput(void 0,S?S.command:"unknown",S?S.seq:0,!1,this.performanceData,"Error processing request. "+D.message+`
480
- `+D.stack)}finally{this.performanceData=b}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function OMe(e){const t=e.diagnosticsDuration&&_a(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function L0(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Il(e))}}function Iye(e,t,n){const i=L0(e,n),a=t&&L0(t,n);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function gvt(e,t){return{start:FMe(t,e.span.start),end:FMe(t,Il(e.span)),newText:e.newText}}function FMe(e,t){return Cye(e)?vvt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function hvt(e,t){const n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function vvt(e){return{line:e.line+1,offset:e.character+1}}function yvt(e){F.assert(e.textChanges.length===1);const t=Ns(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Oye(e,t,n,i){const a=bvt(e,t,i),{line:o,character:c}=mA(Dw(a),n);return{line:o+1,offset:c+1}}function bvt(e,t,n){for(const{fileName:i,textChanges:a}of n)if(i===t)for(let o=a.length-1;o>=0;o--){const{newText:c,span:{start:d,length:p}}=a[o];e=e.slice(0,d)+c+e.slice(d+p)}return e}function MMe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:a,isDefinition:o},{disableLineTextInReferences:c}){const d=F.checkDefined(e.getScriptInfo(t)),p=Iye(n,i,d),y=c?void 0:Svt(d,p);return{file:t,...p,lineText:y,isWriteAccess:a,isDefinition:o}}function Svt(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Il(n)).replace(/\r|\n/g,"")}function Tvt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var eP=4,Fye=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Fye||{}),xvt=class{constructor(){this.goSubtree=!0,this.lineIndex=new s9,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new tP,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=s9.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,o;for(let d=this.endBranch.length-1;d>=0;d--)this.endBranch[d].updateCounts(),this.endBranch[d].charCount()===0&&(o=this.endBranch[d],d>0?a=this.endBranch[d-1]:a=this.branchNode);o&&a.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let d=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)d[S-1]=new sz(i[S]);let y=this.startPath.length-2;for(;y>=0;){const S=this.startPath[y];d=S.insertAt(p,d),y--,p=S}let b=d.length;for(;b>0;){const S=new tP;S.add(this.lineIndex.root),d=S.insertAt(this.lineIndex.root,d),b=d.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let d=this.startPath.length-2;d>=0;d--)this.startPath[d].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,a){const o=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function d(p){return p.isLeaf()?new sz(""):new tP}switch(a){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=d(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=d(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},kvt=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return y7(Yf(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Dee=class pw{constructor(){this.changes=[],this.versions=new Array(pw.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%pw.maxVersions}currentVersionToIndex(){return this.currentVersion%pw.maxVersions}edit(t,n,i){this.changes.push(new kvt(t,n,i)),(this.changes.length>pw.changeNumberThreshold||n>pw.changeLengthThreshold||i&&i.length>pw.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new LMe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=pw.maxVersions&&(this.minVersion=this.currentVersion-pw.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const n=this._getSnapshot().index,{lineText:i,absolutePosition:a}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-a;return Yf(a,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){const i=[];for(let a=t+1;a<=n;a++){const o=this.versions[this.versionToIndex(a)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return mse(i)}else return;else return kL}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new pw,i=new LMe(0,n,new s9);n.versions[n.currentVersion]=i;const a=s9.linesFromText(t);return i.index.load(a.lines),n}};Dee.changeNumberThreshold=8,Dee.changeLengthThreshold=256,Dee.maxVersions=8;var Aee=Dee,LMe=class mQe{constructor(t,n,i,a=of){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=a}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof mQe&&this.cache===t.cache)return this.version<=t.version?kL:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},s9=class jTe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const n=this.getLineCount();if(t<=n){const{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let i=0;i<t.length;i++)n[i]=new sz(t[i]);this.root=jTe.buildTreeFromBottom(n)}else this.root=new tP}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(a,o,c)=>{i=i.concat(c.text.substring(a,a+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());const a={goSubtree:!0,done:!1,leaf(o,c,d){t(d,o,c)||(this.done=!0)}};return this.walk(n,i-n,a),!a.done}edit(t,n,i){if(this.root.charCount()===0)return F.assert(n===0),i!==void 0?(this.load(jTe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){const d=this.getText(0,this.root.charCount());a=d.slice(0,t)+i+d.slice(t+n)}const o=new xvt;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const d=this.getText(t,1);i?i=d+i:i=d,n=0,c=!0}else if(n>0){const d=t+n,{zeroBasedColumn:p,lineText:y}=this.positionToColumnAndLineText(d);p===0&&(n+=y.length,i=i?i+y:y)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){const d=o.lineIndex.getText(0,o.lineIndex.getLength());F.assert(a===d,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<eP)return new tP(t);const n=new Array(Math.ceil(t.length/eP));let i=0;for(let a=0;a<n.length;a++){const o=Math.min(i+eP,t.length);n[a]=new tP(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){const n=Dw(t);if(n.length===0)return{lines:[],lineMap:n};const i=new Array(n.length),a=n.length-1;for(let c=0;c<a;c++)i[c]=t.substring(n[c],n[c+1]);const o=t.substring(n[a]);return o.length>0?i[a]=o:i.pop(),{lines:i,lineMap:n}}},tP=class BTe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,a,o){return i.pre&&i.pre(t,n,this.children[a],this,o),i.goSubtree?(this.children[a].walk(t,n,i),i.post&&i.post(t,n,this.children[a],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,a,o){a.pre&&!a.done&&(a.pre(t,n,this.children[i],this,o),a.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let a=0,o=this.children[a].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,a,i,0),c-=o,a++,o=this.children[a].charCount();if(c+n<=o){if(this.execWalk(c,n,i,a,2))return}else{if(this.execWalk(c,o-c,i,a,1))return;let d=n-(o-c);for(a++,o=this.children[a].charCount();d>o;){if(this.execWalk(0,o,i,a,3))return;d-=o,a++,o=this.children[a].charCount()}if(d>0&&this.execWalk(0,d,i,a,4))return}if(i.pre){const d=this.children.length;if(a<d-1)for(let p=a+1;p<d;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(const o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const a=F.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(const i of this.children){const a=i.lineCount();if(a>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=a,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n;const i=this.children.length;t++;const a=t;if(t<i){for(n=new BTe;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=a,n}remove(t){const n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let a=n;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){const n=this.children.indexOf(t);return F.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t);const a=this.children.length,o=n.length;if(a<eP&&i===a-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{const c=this.splitAfter(i);let d=0;for(i++;i<eP&&d<o;)this.children[i]=n[d],i++,d++;let p=[],y=0;if(d<o){y=Math.ceil((o-d)/eP),p=new Array(y);let b=0;for(let w=0;w<y;w++)p[w]=new BTe;let S=p[0];for(;d<o;)S.add(n[d]),d++,S.children.length===eP&&(b++,S=p[b]);for(let w=p.length-1;w>=0;w--)p[w].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let b=0;b<y;b++)p[b].updateCounts();return p}}add(t){this.children.push(t),F.assert(this.children.length<=eP)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},sz=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},RMe=class gQe{constructor(t,n,i,a,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=a,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Fp(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return K2.validatePackageName(t)!==K2.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;const n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){const a=Jve(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${ST(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${ST(t)}`),t.kind){case QX:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case k$:{const a=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);F.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case Upe:{const a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case ZX:{const a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case KX:{if(this.telemetryEnabled){const c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}const a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case x$:{this.projectService.updateTypingsForProject(t);break}case T$:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case e5:this.projectService.watchTypingLocations(t);break}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${ST(t)}`),this.installer.send(t)},gQe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};RMe.requestDelayMillis=100;var jMe=RMe,BMe={};T(BMe,{ActionInvalidate:()=>x$,ActionPackageInstalled:()=>k$,ActionSet:()=>T$,ActionWatchTypingLocations:()=>e5,Arguments:()=>eQ,AutoImportProviderProject:()=>cye,AuxiliaryProject:()=>sye,CharRangeSection:()=>Fye,CloseFileWatcherEvent:()=>hee,CommandNames:()=>kMe,ConfigFileDiagEvent:()=>_ee,ConfiguredProject:()=>lye,ConfiguredProjectLoadKind:()=>mye,CreateDirectoryWatcherEvent:()=>gee,CreateFileWatcherEvent:()=>mee,Errors:()=>_1,EventBeginInstallTypes:()=>ZX,EventEndInstallTypes:()=>KX,EventInitializationFailed:()=>Upe,EventTypesRegistry:()=>QX,ExternalProject:()=>see,GcTimer:()=>Gve,InferredProject:()=>aye,LargeFileReferencedEvent:()=>fee,LineIndex:()=>s9,LineLeaf:()=>sz,LineNode:()=>tP,LogLevel:()=>Bve,Msg:()=>$ve,OpenFileInfoTelemetryEvent:()=>uye,Project:()=>ZD,ProjectInfoTelemetryEvent:()=>dee,ProjectKind:()=>BI,ProjectLanguageServiceStateEvent:()=>pee,ProjectLoadingFinishEvent:()=>uee,ProjectLoadingStartEvent:()=>lee,ProjectService:()=>kye,ProjectsUpdatedInBackgroundEvent:()=>nz,ScriptInfo:()=>Zve,ScriptVersionCache:()=>Aee,Session:()=>IMe,TextStorage:()=>Qve,ThrottledOperations:()=>Hve,TypingsInstallerAdapter:()=>jMe,allFilesAreJsOrDts:()=>rye,allRootFilesAreJsOrDts:()=>tye,asNormalizedPath:()=>X9e,convertCompilerOptions:()=>iz,convertFormatOptions:()=>Z4,convertScriptKindName:()=>yee,convertTypeAcquisition:()=>_ye,convertUserPreferences:()=>pye,convertWatchOptions:()=>i9,countEachFileTypes:()=>e9,createInstallTypingsRequest:()=>Jve,createModuleSpecifierCache:()=>wye,createNormalizedPathMap:()=>Q9e,createPackageJsonCache:()=>Dye,createSortedArray:()=>Wve,emptyArray:()=>of,findArgument:()=>QAe,formatDiagnosticToProtocol:()=>a9,formatMessage:()=>Aye,getBaseConfigFileName:()=>aee,getDetailWatchInfo:()=>xee,getLocationInNewDocument:()=>Oye,hasArgument:()=>XAe,hasNoTypeScriptSource:()=>nye,indent:()=>uI,isBackgroundProject:()=>r9,isConfigFile:()=>Cye,isConfiguredProject:()=>Ab,isDynamicFileName:()=>jI,isExternalProject:()=>t9,isInferredProject:()=>Q4,isInferredProjectName:()=>zve,isProjectDeferredClose:()=>n9,makeAutoImportProviderProjectName:()=>Vve,makeAuxiliaryProjectName:()=>Uve,makeInferredProjectName:()=>qve,maxFileSize:()=>cee,maxProgramSizeForNonTsFiles:()=>oee,normalizedPathToPath:()=>X4,nowString:()=>ZAe,nullCancellationToken:()=>SMe,nullTypingsInstaller:()=>az,protocol:()=>Yve,scriptInfoIsContainedByBackgroundProject:()=>Kve,scriptInfoIsContainedByDeferredClosedProject:()=>eye,stringifyIndented:()=>ST,toEvent:()=>Pye,toNormalizedPath:()=>Dc,tryConvertScriptKindName:()=>vee,typingsInstaller:()=>jve,updateProjectIfDirty:()=>$g}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return f},set exports(_){f=_,l.exports&&(l.exports=_)}})})(rTe)),rTe.exports}Grr();const Yrr=uA({name:"PartnerPickerElement",setup(l,f){const{value:_}=f.element,g=E.ref(""),T=E.ref("");E.watch(_,W=>{W&&I(W)},{deep:!0});const A=exports.ppeconfig.onFetchData,I=W=>{W&&exports.ppeconfig.onFetchData(W,$)},$=(W,ee,R)=>{g.value=ee,T.value=R,_.value!=W&&(_.value=W)};return{logoUrl:g,pname:T,value:_,fetchData:I,onFetchData:A,gotData:$}}}),Xrr={class:"d-flex flex-column flex-md-row gap-2"},Qrr={class:"d-flex flex-row gap-2 w-100"},Zrr=["src"],Krr={class:"w-100"},enr=["value"],tnr={class:"w-100"},rnr=["value"];function nnr(l,f,_,g,T,A){const I=E.resolveComponent("ElementLayout");return E.openBlock(),E.createBlock(I,null,E.createSlots({element:E.withCtx(()=>[E.createElementVNode("div",Xrr,[E.createElementVNode("div",Qrr,[E.createElementVNode("img",{class:"partner-picker__logo__preview",alt:"",src:l.logoUrl},null,8,Zrr),E.createElementVNode("div",Krr,[E.createElementVNode("input",{type:"text",class:"form-control",value:l.pname,disabled:"",placeholder:"Neve"},null,8,enr)])]),E.createElementVNode("div",tnr,[E.createElementVNode("input",{id:"partner-id",type:"text",class:"form-control",value:l.value,onChange:f[0]||(f[0]=$=>l.fetchData($.target.value)),placeholder:"Azonoító"},null,40,rnr)])])]),_:2},[E.renderList(l.elementSlots,($,W)=>({name:W,fn:E.withCtx(()=>[E.renderSlot(l.$slots,W,{el$:l.el$},()=>[(E.openBlock(),E.createBlock(E.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const inr=cC(Yrr,[["render",nnr]]);exports.gisConfig=void 0;const anr=l=>(exports.gisConfig=l,exports.gisConfig),snr=uA({name:"GalleryImageSelectorElement",setup(l,f){const{value:_}=f.element,g=E.ref([]),T=W=>{_.value.activeImageIndex=0,_.value.galleryId=W.target.value,exports.gisConfig.onFetchGallery(W.target.value,ee=>{g.value=ee.items||[],$()})};E.watch(()=>_.value,(W,ee)=>{!W||(W==null?void 0:W.galleryId)===(ee==null?void 0:ee.galleryId)||exports.gisConfig.onFetchGallery(W==null?void 0:W.galleryId,R=>{g.value=R.items||[],$()})},{immediate:!0,deep:!0});const A=W=>{_.value.activeImageIndex=W.target.value,$()},I=E.ref(),$=()=>{var W;if(g.value&&_.value.activeImageIndex>=0){const ee=(W=g.value[_.value.activeImageIndex])==null?void 0:W.url;I.value=ee;return}I.value=null};return{onGalleryIdChanged:T,onActiveIndexChanged:A,imageUrl:I,value:_}}}),onr={key:0},cnr=["src"],lnr={key:1},unr=["value"],fnr=["value"];function _nr(l,f,_,g,T,A){const I=E.resolveComponent("ElementLayout");return E.openBlock(),E.createBlock(I,null,E.createSlots({_:2},[l.value?{name:"element",fn:E.withCtx(()=>[l.imageUrl?(E.openBlock(),E.createElementBlock("div",onr,[E.createElementVNode("img",{class:"gallery__preview",alt:"",src:l.imageUrl},null,8,cnr)])):E.createCommentVNode("",!0),l.imageUrl?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",lnr,[...f[2]||(f[2]=[E.createElementVNode("p",{class:"gallery__preview-empty"},"Nincs kép kiválasztva!",-1)])])),E.createElementVNode("div",null,[f[3]||(f[3]=E.createElementVNode("label",{for:"galleryId",class:"form-label"},"Galéria azonosító",-1)),E.createElementVNode("input",{type:"text",id:"galleryId",placeholder:"Galéria azonosító",class:"form-control",value:l.value.galleryId,onInput:f[0]||(f[0]=$=>l.onGalleryIdChanged($))},null,40,unr)]),E.createElementVNode("div",null,[f[4]||(f[4]=E.createElementVNode("label",{for:"activeImageIndex",class:"form-label"},"Aktív kép index",-1)),E.createElementVNode("input",{type:"number",id:"activeImageIndex",placeholder:"Aktív kép index",class:"form-control",value:l.value.activeImageIndex,onInput:f[1]||(f[1]=$=>l.onActiveIndexChanged($))},null,40,fnr)])]),key:"0"}:void 0,E.renderList(l.elementSlots,($,W)=>({name:W,fn:E.withCtx(()=>[E.renderSlot(l.$slots,W,{el$:l.el$},()=>[(E.openBlock(),E.createBlock(E.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const pnr=cC(snr,[["render",_nr]]);class dnr{constructor(f,_){qf(this,"_base",{});qf(this,"router");qf(this,"apply",(f,_)=>{Object.keys(this._base).forEach(g=>{const T=f.find(I=>I.property==g);if(!T)return;const A=this.getQuery();T&&A[g]!=="undefined"&&A[g]!==null&&(T.filter.defaultv=A[g],_[g]=A[g])})});qf(this,"getBase",()=>this._base);qf(this,"castValue",(f,_)=>{if(_===void 0)return null;if(typeof f=="boolean"){if(_==="")return null;if(_===!1)return!1;if(_===!0)return!0;if(_==="false")return!1;if(_==="true")return!0}return _===null?null:typeof f=="number"?isNaN(Number(_))?null:Number(_):typeof f=="string"?String(_):null});qf(this,"getQuery",()=>{const _={...this.router.currentRoute.value.query};for(const g in this._base)_[g]=this.castValue(this._base[g],_[g]);return _});qf(this,"setQuery",(f,_)=>{this.router.replace({query:{...this.router.currentRoute.value.query,[f]:_}})});this.router=f,this._base=_}}function mnr(l){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:l}))}const gnr={CheckBox:OM,CheckBoxList:WVe,DropDown:JM,DropDownButton:HVe,DateTimePicker:oV,DropDownMenu:Lne,DropDownCallBack:$Te,DropDownCheckBox:Rne,ExternalArticleOfferComponent:XTe,FilterCompact:zTe,FilterControl:VTe,IconButton:R8,ImagePickerComponent:zM,InternalArticleOfferComponent:YTe,PaginatorControl:UTe,RadioButton:WTe,RadioButtonGroup:eUe,SpinningProgress:HTe,TableToList:tUe,TableToListOptions:rUe,TextListBox:nUe,ToastComponent:GTe,ToastWrapper:iUe,CalendarComponent:JTe,HeaderComponent:aUe,SiteIdSelector:qTe},hnr={install(l){Object.entries(gnr).forEach(([f,_])=>{l.component(f,_)})}};exports.ArticleEditorService=KVe;exports.ArticleOfferElement=arr;exports.ArticlePickerElement=Err;exports.CalendarComponent=JTe;exports.CheckBox=OM;exports.CheckBoxList=WVe;exports.DateTimePicker=oV;exports.DateTimePickerElement=qrr;exports.DropDown=JM;exports.DropDownButton=HVe;exports.DropDownCallBack=$Te;exports.DropDownCheckBox=Rne;exports.DropDownMenu=Lne;exports.ExternalArticleOfferComponent=XTe;exports.ExternalArticleOfferElement=$rr;exports.FetchDetails=q6;exports.FetchError=jne;exports.FilterCompact=zTe;exports.FilterControl=VTe;exports.FilterDate=VAt;exports.FilterDropDown=JAt;exports.FilterDropDownCheckBox=zAt;exports.FilterSiteIdSelector=qAt;exports.FilterText=$At;exports.GalleryImageSelectorElement=pnr;exports.HeaderComponent=aUe;exports.IconButton=R8;exports.ImagePickerComponent=zM;exports.ImagePickerDetailsElement=Irr;exports.ImagePickerElement=Arr;exports.InternalArticleOfferComponent=YTe;exports.InternalArticleOfferElement=Lrr;exports.Methods=Kk;exports.PaginatorControl=UTe;exports.PartnerPickerElement=inr;exports.QueryManipulations=dnr;exports.RadioButton=WTe;exports.RadioButtonGroup=eUe;exports.SiteIdSelector=qTe;exports.SpinningProgress=HTe;exports.TableToList=tUe;exports.TableToListOptions=rUe;exports.TableToListOptionsPersister=iTe;exports.TextListBox=nUe;exports.ToastComponent=GTe;exports.ToastWrapper=iUe;exports.configureArticleOfferElement=Gtr;exports.configureArticlePickerElement=srr;exports.configureExternalArticleOfferElement=Rrr;exports.configureGalleryImageSelectorElement=anr;exports.configureImagePickerElement=orr;exports.configureInternalArticleOfferElement=Orr;exports.configurePartnerPickerElement=Vrr;exports.debounce=tAt;exports.default=hnr;exports.getCurrentSite=nAt;exports.initRequest=V6;exports.localDateTimeToDate=eAt;exports.localDateTimeToUTC=Z6t;exports.localDateTimeToUTCDate=K6t;exports.localToDateStr=sV;exports.localToStr=QVe;exports.localToUtcStr=gne;exports.sendMsgToToast=mnr;exports.toDateString=G6t;exports.toDateStringFromUtc=Q6t;exports.toDateTimeString=Y6t;exports.toDateTimeStringFromUtc=X6t;exports.useArticleEditorService=ZVe;exports.useCurrentUser=rAt;
480
+ `+D.stack)}finally{this.performanceData=b}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function OMe(e){const t=e.diagnosticsDuration&&_a(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function L0(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Il(e))}}function Iye(e,t,n){const i=L0(e,n),a=t&&L0(t,n);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function gvt(e,t){return{start:FMe(t,e.span.start),end:FMe(t,Il(e.span)),newText:e.newText}}function FMe(e,t){return Cye(e)?vvt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function hvt(e,t){const n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function vvt(e){return{line:e.line+1,offset:e.character+1}}function yvt(e){F.assert(e.textChanges.length===1);const t=Ns(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Oye(e,t,n,i){const a=bvt(e,t,i),{line:o,character:c}=mA(Dw(a),n);return{line:o+1,offset:c+1}}function bvt(e,t,n){for(const{fileName:i,textChanges:a}of n)if(i===t)for(let o=a.length-1;o>=0;o--){const{newText:c,span:{start:d,length:p}}=a[o];e=e.slice(0,d)+c+e.slice(d+p)}return e}function MMe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:a,isDefinition:o},{disableLineTextInReferences:c}){const d=F.checkDefined(e.getScriptInfo(t)),p=Iye(n,i,d),y=c?void 0:Svt(d,p);return{file:t,...p,lineText:y,isWriteAccess:a,isDefinition:o}}function Svt(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Il(n)).replace(/\r|\n/g,"")}function Tvt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var eP=4,Fye=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Fye||{}),xvt=class{constructor(){this.goSubtree=!0,this.lineIndex=new s9,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new tP,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=s9.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,o;for(let d=this.endBranch.length-1;d>=0;d--)this.endBranch[d].updateCounts(),this.endBranch[d].charCount()===0&&(o=this.endBranch[d],d>0?a=this.endBranch[d-1]:a=this.branchNode);o&&a.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let d=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)d[S-1]=new sz(i[S]);let y=this.startPath.length-2;for(;y>=0;){const S=this.startPath[y];d=S.insertAt(p,d),y--,p=S}let b=d.length;for(;b>0;){const S=new tP;S.add(this.lineIndex.root),d=S.insertAt(this.lineIndex.root,d),b=d.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let d=this.startPath.length-2;d>=0;d--)this.startPath[d].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,a){const o=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function d(p){return p.isLeaf()?new sz(""):new tP}switch(a){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=d(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=d(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},kvt=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return y7(Yf(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Dee=class pw{constructor(){this.changes=[],this.versions=new Array(pw.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%pw.maxVersions}currentVersionToIndex(){return this.currentVersion%pw.maxVersions}edit(t,n,i){this.changes.push(new kvt(t,n,i)),(this.changes.length>pw.changeNumberThreshold||n>pw.changeLengthThreshold||i&&i.length>pw.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new LMe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=pw.maxVersions&&(this.minVersion=this.currentVersion-pw.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const n=this._getSnapshot().index,{lineText:i,absolutePosition:a}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-a;return Yf(a,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){const i=[];for(let a=t+1;a<=n;a++){const o=this.versions[this.versionToIndex(a)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return mse(i)}else return;else return kL}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new pw,i=new LMe(0,n,new s9);n.versions[n.currentVersion]=i;const a=s9.linesFromText(t);return i.index.load(a.lines),n}};Dee.changeNumberThreshold=8,Dee.changeLengthThreshold=256,Dee.maxVersions=8;var Aee=Dee,LMe=class mQe{constructor(t,n,i,a=of){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=a}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof mQe&&this.cache===t.cache)return this.version<=t.version?kL:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},s9=class jTe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const n=this.getLineCount();if(t<=n){const{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let i=0;i<t.length;i++)n[i]=new sz(t[i]);this.root=jTe.buildTreeFromBottom(n)}else this.root=new tP}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(a,o,c)=>{i=i.concat(c.text.substring(a,a+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());const a={goSubtree:!0,done:!1,leaf(o,c,d){t(d,o,c)||(this.done=!0)}};return this.walk(n,i-n,a),!a.done}edit(t,n,i){if(this.root.charCount()===0)return F.assert(n===0),i!==void 0?(this.load(jTe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){const d=this.getText(0,this.root.charCount());a=d.slice(0,t)+i+d.slice(t+n)}const o=new xvt;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const d=this.getText(t,1);i?i=d+i:i=d,n=0,c=!0}else if(n>0){const d=t+n,{zeroBasedColumn:p,lineText:y}=this.positionToColumnAndLineText(d);p===0&&(n+=y.length,i=i?i+y:y)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){const d=o.lineIndex.getText(0,o.lineIndex.getLength());F.assert(a===d,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<eP)return new tP(t);const n=new Array(Math.ceil(t.length/eP));let i=0;for(let a=0;a<n.length;a++){const o=Math.min(i+eP,t.length);n[a]=new tP(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){const n=Dw(t);if(n.length===0)return{lines:[],lineMap:n};const i=new Array(n.length),a=n.length-1;for(let c=0;c<a;c++)i[c]=t.substring(n[c],n[c+1]);const o=t.substring(n[a]);return o.length>0?i[a]=o:i.pop(),{lines:i,lineMap:n}}},tP=class BTe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,a,o){return i.pre&&i.pre(t,n,this.children[a],this,o),i.goSubtree?(this.children[a].walk(t,n,i),i.post&&i.post(t,n,this.children[a],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,a,o){a.pre&&!a.done&&(a.pre(t,n,this.children[i],this,o),a.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let a=0,o=this.children[a].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,a,i,0),c-=o,a++,o=this.children[a].charCount();if(c+n<=o){if(this.execWalk(c,n,i,a,2))return}else{if(this.execWalk(c,o-c,i,a,1))return;let d=n-(o-c);for(a++,o=this.children[a].charCount();d>o;){if(this.execWalk(0,o,i,a,3))return;d-=o,a++,o=this.children[a].charCount()}if(d>0&&this.execWalk(0,d,i,a,4))return}if(i.pre){const d=this.children.length;if(a<d-1)for(let p=a+1;p<d;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(const o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const a=F.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(const i of this.children){const a=i.lineCount();if(a>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=a,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n;const i=this.children.length;t++;const a=t;if(t<i){for(n=new BTe;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=a,n}remove(t){const n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let a=n;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){const n=this.children.indexOf(t);return F.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t);const a=this.children.length,o=n.length;if(a<eP&&i===a-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{const c=this.splitAfter(i);let d=0;for(i++;i<eP&&d<o;)this.children[i]=n[d],i++,d++;let p=[],y=0;if(d<o){y=Math.ceil((o-d)/eP),p=new Array(y);let b=0;for(let w=0;w<y;w++)p[w]=new BTe;let S=p[0];for(;d<o;)S.add(n[d]),d++,S.children.length===eP&&(b++,S=p[b]);for(let w=p.length-1;w>=0;w--)p[w].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let b=0;b<y;b++)p[b].updateCounts();return p}}add(t){this.children.push(t),F.assert(this.children.length<=eP)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},sz=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},RMe=class gQe{constructor(t,n,i,a,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=a,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Fp(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return K2.validatePackageName(t)!==K2.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;const n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){const a=Jve(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${ST(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${ST(t)}`),t.kind){case QX:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case k$:{const a=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);F.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case Upe:{const a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case ZX:{const a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case KX:{if(this.telemetryEnabled){const c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}const a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case x$:{this.projectService.updateTypingsForProject(t);break}case T$:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case e5:this.projectService.watchTypingLocations(t);break}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${ST(t)}`),this.installer.send(t)},gQe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};RMe.requestDelayMillis=100;var jMe=RMe,BMe={};T(BMe,{ActionInvalidate:()=>x$,ActionPackageInstalled:()=>k$,ActionSet:()=>T$,ActionWatchTypingLocations:()=>e5,Arguments:()=>eQ,AutoImportProviderProject:()=>cye,AuxiliaryProject:()=>sye,CharRangeSection:()=>Fye,CloseFileWatcherEvent:()=>hee,CommandNames:()=>kMe,ConfigFileDiagEvent:()=>_ee,ConfiguredProject:()=>lye,ConfiguredProjectLoadKind:()=>mye,CreateDirectoryWatcherEvent:()=>gee,CreateFileWatcherEvent:()=>mee,Errors:()=>_1,EventBeginInstallTypes:()=>ZX,EventEndInstallTypes:()=>KX,EventInitializationFailed:()=>Upe,EventTypesRegistry:()=>QX,ExternalProject:()=>see,GcTimer:()=>Gve,InferredProject:()=>aye,LargeFileReferencedEvent:()=>fee,LineIndex:()=>s9,LineLeaf:()=>sz,LineNode:()=>tP,LogLevel:()=>Bve,Msg:()=>$ve,OpenFileInfoTelemetryEvent:()=>uye,Project:()=>ZD,ProjectInfoTelemetryEvent:()=>dee,ProjectKind:()=>BI,ProjectLanguageServiceStateEvent:()=>pee,ProjectLoadingFinishEvent:()=>uee,ProjectLoadingStartEvent:()=>lee,ProjectService:()=>kye,ProjectsUpdatedInBackgroundEvent:()=>nz,ScriptInfo:()=>Zve,ScriptVersionCache:()=>Aee,Session:()=>IMe,TextStorage:()=>Qve,ThrottledOperations:()=>Hve,TypingsInstallerAdapter:()=>jMe,allFilesAreJsOrDts:()=>rye,allRootFilesAreJsOrDts:()=>tye,asNormalizedPath:()=>X9e,convertCompilerOptions:()=>iz,convertFormatOptions:()=>Z4,convertScriptKindName:()=>yee,convertTypeAcquisition:()=>_ye,convertUserPreferences:()=>pye,convertWatchOptions:()=>i9,countEachFileTypes:()=>e9,createInstallTypingsRequest:()=>Jve,createModuleSpecifierCache:()=>wye,createNormalizedPathMap:()=>Q9e,createPackageJsonCache:()=>Dye,createSortedArray:()=>Wve,emptyArray:()=>of,findArgument:()=>QAe,formatDiagnosticToProtocol:()=>a9,formatMessage:()=>Aye,getBaseConfigFileName:()=>aee,getDetailWatchInfo:()=>xee,getLocationInNewDocument:()=>Oye,hasArgument:()=>XAe,hasNoTypeScriptSource:()=>nye,indent:()=>uI,isBackgroundProject:()=>r9,isConfigFile:()=>Cye,isConfiguredProject:()=>Ab,isDynamicFileName:()=>jI,isExternalProject:()=>t9,isInferredProject:()=>Q4,isInferredProjectName:()=>zve,isProjectDeferredClose:()=>n9,makeAutoImportProviderProjectName:()=>Vve,makeAuxiliaryProjectName:()=>Uve,makeInferredProjectName:()=>qve,maxFileSize:()=>cee,maxProgramSizeForNonTsFiles:()=>oee,normalizedPathToPath:()=>X4,nowString:()=>ZAe,nullCancellationToken:()=>SMe,nullTypingsInstaller:()=>az,protocol:()=>Yve,scriptInfoIsContainedByBackgroundProject:()=>Kve,scriptInfoIsContainedByDeferredClosedProject:()=>eye,stringifyIndented:()=>ST,toEvent:()=>Pye,toNormalizedPath:()=>Dc,tryConvertScriptKindName:()=>vee,typingsInstaller:()=>jve,updateProjectIfDirty:()=>$g}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return f},set exports(_){f=_,l.exports&&(l.exports=_)}})})(rTe)),rTe.exports}Grr();const Yrr=uA({name:"PartnerPickerElement",setup(l,f){const{value:_}=f.element,g=E.ref(""),T=E.ref("");E.watch(_,W=>{W&&I(W)},{deep:!0});const A=exports.ppeconfig.onFetchData,I=W=>{W&&exports.ppeconfig.onFetchData(W,$)},$=(W,ee,R)=>{g.value=ee,T.value=R,_.value!=W&&(_.value=W)};return{logoUrl:g,pname:T,value:_,fetchData:I,onFetchData:A,gotData:$}}}),Xrr={class:"d-flex flex-column flex-md-row gap-2"},Qrr={class:"d-flex flex-row gap-2 w-100"},Zrr=["src"],Krr={class:"w-100"},enr=["value"],tnr={class:"w-100"},rnr=["value"];function nnr(l,f,_,g,T,A){const I=E.resolveComponent("ElementLayout");return E.openBlock(),E.createBlock(I,null,E.createSlots({element:E.withCtx(()=>[E.createElementVNode("div",Xrr,[E.createElementVNode("div",Qrr,[E.createElementVNode("img",{class:"partner-picker__logo__preview",alt:"",src:l.logoUrl},null,8,Zrr),E.createElementVNode("div",Krr,[E.createElementVNode("input",{type:"text",class:"form-control",value:l.pname,disabled:"",placeholder:"Neve"},null,8,enr)])]),E.createElementVNode("div",tnr,[E.createElementVNode("input",{id:"partner-id",type:"text",class:"form-control",value:l.value,onChange:f[0]||(f[0]=$=>l.fetchData($.target.value)),placeholder:"Azonoító"},null,40,rnr)])])]),_:2},[E.renderList(l.elementSlots,($,W)=>({name:W,fn:E.withCtx(()=>[E.renderSlot(l.$slots,W,{el$:l.el$},()=>[(E.openBlock(),E.createBlock(E.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const inr=cC(Yrr,[["render",nnr]]);exports.gisConfig=void 0;const anr=l=>(exports.gisConfig=l,exports.gisConfig),snr=uA({name:"GalleryImageSelectorElement",setup(l,f){const{value:_}=f.element,g=E.ref([]),T=W=>{_.value.activeImageIndex=0,_.value.galleryId=W.target.value,exports.gisConfig.onFetchGallery(W.target.value,ee=>{g.value=ee.items||[],$()})};E.watch(()=>_.value,(W,ee)=>{!W||(W==null?void 0:W.galleryId)===(ee==null?void 0:ee.galleryId)||exports.gisConfig.onFetchGallery(W==null?void 0:W.galleryId,R=>{g.value=R.items||[],$()})},{immediate:!0,deep:!0});const A=W=>{_.value.activeImageIndex=W.target.value,$()},I=E.ref(),$=()=>{var W;if(g.value&&_.value.activeImageIndex>=0){const ee=(W=g.value[_.value.activeImageIndex])==null?void 0:W.url;I.value=ee;return}I.value=null};return{onGalleryIdChanged:T,onActiveIndexChanged:A,imageUrl:I,value:_}}}),onr={key:0},cnr=["src"],lnr={key:1},unr=["value"],fnr=["value"];function _nr(l,f,_,g,T,A){const I=E.resolveComponent("ElementLayout");return E.openBlock(),E.createBlock(I,null,E.createSlots({_:2},[l.value?{name:"element",fn:E.withCtx(()=>[l.imageUrl?(E.openBlock(),E.createElementBlock("div",onr,[E.createElementVNode("img",{class:"gallery__preview",alt:"",src:l.imageUrl},null,8,cnr)])):E.createCommentVNode("",!0),l.imageUrl?E.createCommentVNode("",!0):(E.openBlock(),E.createElementBlock("div",lnr,[...f[2]||(f[2]=[E.createElementVNode("p",{class:"gallery__preview-empty"},"Nincs kép kiválasztva!",-1)])])),E.createElementVNode("div",null,[f[3]||(f[3]=E.createElementVNode("label",{for:"galleryId",class:"form-label"},"Galéria azonosító",-1)),E.createElementVNode("input",{type:"text",id:"galleryId",placeholder:"Galéria azonosító",class:"form-control",value:l.value.galleryId,onInput:f[0]||(f[0]=$=>l.onGalleryIdChanged($))},null,40,unr)]),E.createElementVNode("div",null,[f[4]||(f[4]=E.createElementVNode("label",{for:"activeImageIndex",class:"form-label"},"Aktív kép index",-1)),E.createElementVNode("input",{type:"number",id:"activeImageIndex",placeholder:"Aktív kép index",class:"form-control",value:l.value.activeImageIndex,onInput:f[1]||(f[1]=$=>l.onActiveIndexChanged($))},null,40,fnr)])]),key:"0"}:void 0,E.renderList(l.elementSlots,($,W)=>({name:W,fn:E.withCtx(()=>[E.renderSlot(l.$slots,W,{el$:l.el$},()=>[(E.openBlock(),E.createBlock(E.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const pnr=cC(snr,[["render",_nr]]);class dnr{constructor(f,_){qf(this,"_base",{});qf(this,"router");qf(this,"apply",(f,_)=>{Object.keys(this._base).forEach(g=>{const T=f.find(I=>I.property==g);if(!T)return;const A=this.getQuery();T&&A[g]!=="undefined"&&A[g]!==null&&(T.filter.defaultv=A[g],_[g]=A[g])})});qf(this,"getBase",()=>this._base);qf(this,"castValue",(f,_)=>{if(_===void 0)return null;if(typeof f=="boolean"){if(_==="")return null;if(_===!1)return!1;if(_===!0)return!0;if(_==="false")return!1;if(_==="true")return!0}if(_===null)return null;if(typeof f=="number")return isNaN(Number(_))?null:Number(_);if(typeof f=="string")return String(_);if(Array.isArray(f)){if(_==="")return null;if(Array.isArray(_))return _}return null});qf(this,"getQuery",()=>{const _={...this.router.currentRoute.value.query};for(const g in this._base)_[g]=this.castValue(this._base[g],_[g]);return _});qf(this,"setQuery",(f,_)=>{this.router.replace({query:{...this.router.currentRoute.value.query,[f]:_}})});this.router=f,this._base=_}}function mnr(l){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:l}))}const gnr={CheckBox:OM,CheckBoxList:WVe,DropDown:JM,DropDownButton:HVe,DateTimePicker:oV,DropDownMenu:Lne,DropDownCallBack:$Te,DropDownCheckBox:Rne,ExternalArticleOfferComponent:XTe,FilterCompact:zTe,FilterControl:VTe,IconButton:R8,ImagePickerComponent:zM,InternalArticleOfferComponent:YTe,PaginatorControl:UTe,RadioButton:WTe,RadioButtonGroup:eUe,SpinningProgress:HTe,TableToList:tUe,TableToListOptions:rUe,TextListBox:nUe,ToastComponent:GTe,ToastWrapper:iUe,CalendarComponent:JTe,HeaderComponent:aUe,SiteIdSelector:qTe},hnr={install(l){Object.entries(gnr).forEach(([f,_])=>{l.component(f,_)})}};exports.ArticleEditorService=KVe;exports.ArticleOfferElement=arr;exports.ArticlePickerElement=Err;exports.CalendarComponent=JTe;exports.CheckBox=OM;exports.CheckBoxList=WVe;exports.DateTimePicker=oV;exports.DateTimePickerElement=qrr;exports.DropDown=JM;exports.DropDownButton=HVe;exports.DropDownCallBack=$Te;exports.DropDownCheckBox=Rne;exports.DropDownMenu=Lne;exports.ExternalArticleOfferComponent=XTe;exports.ExternalArticleOfferElement=$rr;exports.FetchDetails=q6;exports.FetchError=jne;exports.FilterCompact=zTe;exports.FilterControl=VTe;exports.FilterDate=VAt;exports.FilterDropDown=JAt;exports.FilterDropDownCheckBox=zAt;exports.FilterSiteIdSelector=qAt;exports.FilterText=$At;exports.GalleryImageSelectorElement=pnr;exports.HeaderComponent=aUe;exports.IconButton=R8;exports.ImagePickerComponent=zM;exports.ImagePickerDetailsElement=Irr;exports.ImagePickerElement=Arr;exports.InternalArticleOfferComponent=YTe;exports.InternalArticleOfferElement=Lrr;exports.Methods=Kk;exports.PaginatorControl=UTe;exports.PartnerPickerElement=inr;exports.QueryManipulations=dnr;exports.RadioButton=WTe;exports.RadioButtonGroup=eUe;exports.SiteIdSelector=qTe;exports.SpinningProgress=HTe;exports.TableToList=tUe;exports.TableToListOptions=rUe;exports.TableToListOptionsPersister=iTe;exports.TextListBox=nUe;exports.ToastComponent=GTe;exports.ToastWrapper=iUe;exports.configureArticleOfferElement=Gtr;exports.configureArticlePickerElement=srr;exports.configureExternalArticleOfferElement=Rrr;exports.configureGalleryImageSelectorElement=anr;exports.configureImagePickerElement=orr;exports.configureInternalArticleOfferElement=Orr;exports.configurePartnerPickerElement=Vrr;exports.debounce=tAt;exports.default=hnr;exports.getCurrentSite=nAt;exports.initRequest=V6;exports.localDateTimeToDate=eAt;exports.localDateTimeToUTC=Z6t;exports.localDateTimeToUTCDate=K6t;exports.localToDateStr=sV;exports.localToStr=QVe;exports.localToUtcStr=gne;exports.sendMsgToToast=mnr;exports.toDateString=G6t;exports.toDateStringFromUtc=Q6t;exports.toDateTimeString=Y6t;exports.toDateTimeStringFromUtc=X6t;exports.useArticleEditorService=ZVe;exports.useCurrentUser=rAt;
@@ -1588,7 +1588,7 @@ const Knr = () => {
1588
1588
  }, L = Rr(!1), ce = (fe) => {
1589
1589
  L.value ? L.value = !1 : (L.value = !0, Fc(() => {
1590
1590
  const je = W.value, et = B.value.getBoundingClientRect();
1591
- je.style.left = et.left + window.scrollX + "px", je.style.top = et.top + window.scrollY + et.height + "px";
1591
+ je.style.left = et.left + "px", je.style.top = et.top + et.height + "px";
1592
1592
  })), fe && fe.stopPropagation();
1593
1593
  }, ee = (fe) => {
1594
1594
  const je = new Date(Date.parse(fe)), He = $Te(je, _.dateOnly);
@@ -192927,7 +192927,15 @@ class Bir {
192927
192927
  if (_ === "false") return !1;
192928
192928
  if (_ === "true") return !0;
192929
192929
  }
192930
- return _ === null ? null : typeof f == "number" ? isNaN(Number(_)) ? null : Number(_) : typeof f == "string" ? String(_) : null;
192930
+ if (_ === null) return null;
192931
+ if (typeof f == "number")
192932
+ return isNaN(Number(_)) ? null : Number(_);
192933
+ if (typeof f == "string") return String(_);
192934
+ if (Array.isArray(f)) {
192935
+ if (_ === "") return null;
192936
+ if (Array.isArray(_)) return _;
192937
+ }
192938
+ return null;
192931
192939
  });
192932
192940
  n_(this, "getQuery", () => {
192933
192941
  const _ = { ...this.router.currentRoute.value.query };
@@ -6,7 +6,7 @@ export declare class QueryManipulations<T extends Record<string, any>> {
6
6
  constructor(router: Router, base: T);
7
7
  apply: (columns: Column[], payload: object) => void;
8
8
  getBase: () => T;
9
- castValue: (baseValue: any, sourceValue: any) => string | number | boolean | null;
9
+ castValue: (baseValue: any, sourceValue: any) => string | number | boolean | string[] | null;
10
10
  getQuery: () => T;
11
- setQuery: (key: keyof T, value: string | number | boolean | null) => void;
11
+ setQuery: (key: keyof T, value: string | number | boolean | string[] | null) => void;
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admins-components",
3
- "version": "6.0.3",
3
+ "version": "6.0.5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"