import t from"../../../../index.ci.php/public/js/components/primevue/config/config.esm.min.js";import e from"../../../../index.ci.php/public/js/components/primevue/toast/toast.esm.min.js";import r from"../../../../index.ci.php/public/js/components/primevue/confirmdialog/confirmdialog.esm.min.js";import n from"../../../../index.ci.php/public/js/components/primevue/confirmationservice/confirmationservice.esm.min.js";var i={name:"SearchbarResultTemplateAction",emits:["actionexecuted"],props:{res:Object,action:Object},computed:{actionHref(){return"link"!==this.action.type?"javascript:void(0);":"function"==typeof this.action.action?this.action.action(this.res):this.action.action}},methods:{actionFunc(){"function"===this.action.type&&this.action.action(this.res),this.$emit("actionexecuted")},renderif:function(){return void 0===this.action?.renderif||this.action.renderif(this.res)}},template:'\n\t\n\t'},s={name:"SearchbarResultTemplateFrame",components:{ResultAction:i,ResultActions:{name:"SearchbarResultTemplateActions",components:{ResultAction:i},emits:["actionexecuted"],props:{res:Object,actions:Array},methods:{renderif:function(t){return void 0===t?.renderif||t.renderif(this.res)}},template:'\n\t
\n\t\t\n\t
'}},emits:["actionexecuted"],props:{res:Object,actions:Object,title:String,image:String,imageFallback:String},template:'\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t{{ title }}\n\t\t\t\t\n\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t
'},a={name:"SearchbarResultPerson",components:{TemplateFrame:s},emits:["actionexecuted"],props:{res:Object,actions:Object},computed:{emails(){return new Set(this.res.email)}},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/person_id\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.person_id }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_emails\') }}
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t'},o={name:"SearchbarResultRoom",components:{TemplateFrame:s},emits:["actionexecuted"],props:{mode:String,res:Object,actions:Object},computed:{equipment(){return this.res.equipment?this.res.equipment.replace(new RegExp("
","ig"),""):""},address(){let t=this.res.zip||"";return this.res.city&&(t+=(t?" ":"")+this.res.city),this.res.street&&(t+=(t?", ":"")+this.res.street),this.res.floor&&(t+=(t?" / ":"")+this.$p.t("search/result_address_floor",this.res)),t||this.$p.t("search/result_address_none")}},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_room_address\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ address }}\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_workplaces\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.sitzplaetze }}\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_building\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.building }}\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_equipment\') }}
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t'},l={name:"SearchbarResultEmployee",components:{TemplateFrame:s},emits:["actionexecuted"],props:{res:Object,actions:Object},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_stdkst\') }}
\n\t\t\t\t
\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • {{ stdkst }}
  • \n\t\t\t\t\t
\n\t\t\t\t\t{{ $p.t(\'search/result_stdkst_none\') }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'lehre/organisationseinheit\') }}
\n\t\t\t\t
\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • {{ oe }}
  • \n\t\t\t\t\t
\n\t\t\t\t\t{{ $p.t(\'search/result_oe_none\') }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_emails\') }}
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/telefon\') }}
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t'},c={name:"SearchbarResultOrganistationunit",components:{TemplateFrame:s},emits:["actionexecuted"],props:{res:Object,actions:Object},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_parent_oe\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.parentoe_name }}\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_group_emails\') }}
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t{{ res.mailgroup }}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_leader\') }}
\n\t\t\t\t
\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • {{ leader.name }}
  • \n\t\t\t\t\t
\n\t\t\t\t\t{{ $p.t(\'search/result_leader_none\') }}\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_number_of_employees\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.number_of_people }}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t'},d={name:"SearchbarResultStudent",components:{TemplateFrame:s},emits:["actionexecuted"],props:{mode:String,res:Object,actions:Object},computed:{photo_url(){return"simple"!=this.mode?this.res.photo_url:this.res.foto?"data:image/jpeg;base64,"+this.res.foto:null},emails(){return"simple"==this.mode?new Set([this.res.email]):new Set(this.res.email)}},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_student_uid\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.uid }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/person_id\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.person_id }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/matrikelnummer\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.matrikelnr }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_emails\') }}
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t'},p={name:"SearchbarResultPrestudent",components:{TemplateFrame:s},emits:["actionexecuted"],props:{mode:String,res:Object,actions:Object},computed:{title(){return"simple"==this.mode?this.res.name:this.res.name+" ("+this.res.status+" "+this.res.stg_kuerzel+")"},photo_url(){return"simple"!=this.mode?this.res.photo_url:this.res.foto?"data:image/jpeg;base64,"+this.res.foto:null},emails(){return"simple"==this.mode?new Set([this.res.email]):new Set(this.res.email)}},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/person_id\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.person_id }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_emails\') }}
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_student_uid\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.uid }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/matrikelnummer\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.matrikelnr }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_prestudent_id\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.prestudent_id }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'lehre/studiengang\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.bezeichnung }} {{ res.orgform ? \'(\' + res.orgform + \')\' : \'\' }}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t'},u={name:"SearchbarResultDms",components:{TemplateFrame:s},emits:["actionexecuted"],props:{res:Object,actions:Object},computed:{icon(){switch(this.res.mimetype){case"application/pdf":return"file-pdf";case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":case"application/msword":return"file-word";case"application/vnd.openxmlformats-officedocument.presentationml.presentation":case"application/mspowerpoint":return"file-powerpoint";case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":case"application/vnd.ms-excel":return"file-excel";case"application/x-zip":case"application/zip":return"file-zipper";case"image/jpeg":case"image/gif":case"image/png":return"file-image";default:return"file"}}},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_dms_id\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.dms_id }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_version\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.version }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_keywords\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.keywords }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'global/beschreibung\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ res.description }}\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t'},h={name:"SearchbarResultCms",components:{TemplateFrame:s},emits:["actionexecuted"],props:{res:Object,actions:Object},inject:["query"],computed:{preview(){if("redirect"!=this.res.template_kurzbz){let t=this.res.content.replace(//gi,"").replace(/<[^>]+>/gi,"").replace(/^\s+|\s+$/g,"");if(t.length>1e3){let e=t.toLowerCase(),r=Math.min(this.query.split(" ").reduce((t,r)=>{if("or"==r)return t;let n=r.indexOf(":");if(n<0||n>0&&["content","inhalt"].includes(r.split(":")[0])){let n=e.indexOf(r);n>=0&&t.push(n)}return t},[]));if(r){if(!(r+997>=t.length))return"..."+t.substr(r,994)+"...";if(r=t.length-997,r>0)return"..."+t.substr(r,997)}t=t.substr(0,997)+"..."}return t}let t=this.res.content_url;return"../index.ci.php/"==t.substr(0,16)?t=this.$fhcApi.getUri(t.substr(16)):"../"==t.substr(0,3)&&(t=FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/\/+$/,"")+t.substr(2)),''+t+""}},template:'\n\t\n\t\t
\n\t\t
\n\t\t\t{{ $p.t(\'search/result_content_none\') }}\n\t\t
\n\t'},f={name:"SearchbarResultMergedstudent",components:{ResultPrestudent:p,ResultStudent:d},emits:["actionexecuted"],props:{mode:String,res:Object,actions:Object},computed:{prestudent(){return this.res.list.filter(t=>"prestudent"==t.type).pop()}},template:'\n\t\n\t'},g={name:"SearchbarResultMergedperson",components:{TemplateFrame:s,TemplateAction:i},emits:["actionexecuted"],props:{mode:String,res:Object,actions:Object},computed:{person(){const t=this.res.list.reduce((t,e)=>[...t,...Array.isArray(e.email)?e.email:[e.email]],[]),e=this.res.list.find(t=>"person"==t.type);if(e)return{...e,email:t};const{person_id:r,name:n}=this.res.list[0];let i;if("simple"==this.mode){let t=(this.students?this.students.find(t=>t.foto):null)?.foto;t&&(t="data:image/jpeg;base64,"+t),i=t||this.employee?.photo_url}else i=((this.students?this.students.find(t=>t.photo_url):null)||this.employee)?.photo_url;return{person_id:r,name:n,photo_url:i,email:t}},employee(){return this.res.list.find(t=>["employee","unassigned_employee","mitarbeiter","mitarbeiter_ohne_zuordnung"].includes(t.type))||null},students(){const t=this.res.list.filter(t=>["student","prestudent","studentcis","studentStv"].includes(t.type)).filter((t,e,r)=>{if("prestudent"===t.type)return!0;return!r.some(e=>e.uid===t.uid&&"prestudent"===e.type)}).sort((t,e)=>(t.sort||0)-(e.sort||0));return t.length?t:null},emails(){return new Set(this.person.email)},telurl(){return"tel:"+this.employee?.phone},inaktiv(){return this.res.list.some(t=>!1===t?.aktiv)}},template:'\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'person/person_id\') }}
\n\t\t\t\t
\n\t\t\t\t\t{{ person.person_id }}\n\t\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
{{ $p.t(\'search/result_emails\') }}
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t\n\n\t\t\t\n\t\t
\n\t'},v={name:"FhcSearchbar",components:{person:a,room:o,employee:l,organisationunit:c,student:d,prestudent:p,dms:u,cms:h,mergedStudent:f,mergedPerson:g},props:{searchoptions:{type:Object,required:!0},searchfunction:{type:Function,required:!0},showBtnSubmit:Boolean},provide(){return{query:Vue.computed(()=>this.lastQuery)}},data:function(){return{searchtimer:null,hidetimer:null,searchsettings:{searchstr:this.getSearchStr(),types:this.getInitiallySelectedTypes()},searchresult:[],searchmode:"",showresult:!1,searching:!1,error:null,abortController:null,settingsDropdown:null,lastQuery:""}},computed:{searchTypesPlaceholder(){return this.searchsettings.types.length?this.searchsettings.types.map(t=>this.typeLabels[t]).join(" / "):Object.values(this.typeLabels).join(" / ")},types(){return this.searchoptions.types?Array.isArray(this.searchoptions.types)?this.searchoptions.types:Object.keys(this.searchoptions.types):[]},typeLabels(){return this.searchoptions.types?Array.isArray(this.searchoptions.types)?this.searchoptions.types.reduce((t,e)=>(t[e]=e,t),{}):this.searchoptions.types:{}}},template:'\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n