import{bO as Se,cu as Ce,cv as $e,cw as Ie,cx as Ve,cy as Oe,bQ as Je,cz as Ze,bS as Te,bU as Pe,cA as qe,cB as et,cC as Be,cD as De,cE as Re,aS as E,b5 as le,af as Ee,cF as tt,bC as z,aC as Z,cG as st,q as L,b$ as at,cH as fe,I as i,cI as Ae,cJ as Ne,c7 as ce,ar as F,c9 as nt,aF as Le,cK as it,cL as ot,bD as rt,as as Fe,cd as M,aK as c,u as g,bH as r,c5 as oe,s as p,v as k,b9 as m,t as f,bM as lt,cj as O,cl as J,cm as ue,H as q,cn as ze,co as se,cp as _e,cq as he,cr as ct,bi as R,cM as Me,ak as re,aX as T,F as G,aV as H,ch as B,ci as V,az as dt,ce as ut,bc as me,cN as _t,a1 as ht,a0 as Ue,aI as pt,bs as ft,cO as be,cf as mt,cP as bt,aQ as gt,cQ as yt,cR as vt,cS as kt,cc as wt,cT as jt,cU as xt,cV as St,cW as Ct,cX as $t,cY as It,cZ as Vt,c_ as Ot,bW as Tt,bd as Pt,bT as qt,ct as Bt,at as ge,cs as Dt}from"./index-DhjTmrEH.js";import{T as Rt}from"./ThreeColumnLayout-BaCMHCZn.js";import{_ as Et}from"./PlaceHolderImage-C01akGGw.js";import{d as $,I as At,O as Nt}from"./MainPartTS-B5e3g0G5.js";import{V as W,C as Lt}from"./ChildTreeSearchButton-DcejRHJf.js";import{V as Ge}from"./VDialog-Bwq53O74.js";import{t as ye,a as Ft,c as zt}from"./triplestore-sdYc2Txr.js";import{S as Mt,B as Ut,N as Gt,g as X,Q as Wt,G as Qt,D as Ht,a as Kt,F as Xt}from"./graph-BAAuNxoy.js";import{O as ve,a as We}from"./ObjectCard-DtbQkk1B.js";import{V as Qe}from"./VContainer-BOcOMT30.js";import{L as Yt}from"./LoadingSpinner-CcBTGWGa.js";import{V as Jt,b as Zt,a as es,c as ts}from"./VTabs-DznFB9Ns.js";import{u as ke}from"./vue.8fc199ce-CZeT4yPY.js";import"./Anchor-marHyV97.js";import"./ImageViewer-ChivyoqU.js";import"./_commonjsHelpers-C4iS2aBk.js";import"./VSlider-DgcfJc3Q.js";import"./VSliderTrack-B-vIiqcL.js";import"./VInput-CUqlG48K.js";import"./relationship_base-DFa1AHeT.js";import"./transform-CA9Jdjju.js";import"./VSlideGroup-B1ukK6YJ.js";function ss(e){const t=le(e());let s=-1;function a(){clearInterval(s)}function o(){a(),Fe(()=>t.value=e())}function n(l){const d=l?getComputedStyle(l):{transitionDuration:.2},x=parseFloat(d.transitionDuration)*1e3||200;if(a(),t.value<=0)return;const v=performance.now();s=window.setInterval(()=>{const h=performance.now()-v+x;t.value=Math.max(e()-h,0),t.value<=0&&a()},x)}return Le(a),{clear:a,time:t,start:n,reset:o}}const as=Se({multiLine:Boolean,text:String,timer:[Boolean,String],timeout:{type:[Number,String],default:5e3},vertical:Boolean,...Ce({location:"bottom"}),...$e(),...Ie(),...Ve(),...Oe(),...Je(Ze({transition:"v-snackbar-transition"}),["persistent","noClickAnimation","scrim","scrollStrategy"])},"VSnackbar"),He=Te()({name:"VSnackbar",props:as(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:s}=t;const a=Pe(e,"modelValue"),{positionClasses:o}=qe(e),{scopeId:n}=et(),{themeClasses:l}=Be(e),{colorClasses:d,colorStyles:x,variantClasses:v}=De(e),{roundedClasses:h}=Re(e),_=ss(()=>Number(e.timeout)),y=E(),w=E(),j=le(!1),A=le(0),u=E(),b=Ee(it,void 0);tt(()=>!!b,()=>{const D=ot();rt(()=>{u.value=D.mainStyles.value})}),z(a,I),z(()=>e.timeout,I),Z(()=>{a.value&&I()});let C=-1;function I(){_.reset(),window.clearTimeout(C);const D=Number(e.timeout);if(!a.value||D===-1)return;const te=st(w.value);_.start(te),C=window.setTimeout(()=>{a.value=!1},D)}function S(){_.reset(),window.clearTimeout(C)}function P(){j.value=!0,S()}function N(){j.value=!1,I()}function ee(D){A.value=D.touches[0].clientY}function U(D){Math.abs(A.value-D.changedTouches[0].clientY)>50&&(a.value=!1)}function ae(){j.value&&N()}const Q=L(()=>e.location.split(" ").reduce((D,te)=>(D[`v-snackbar--${te}`]=!0,D),{}));return at(()=>{const D=fe.filterProps(e),te=!!(s.default||s.text||e.text);return i(fe,F({ref:y,class:["v-snackbar",{"v-snackbar--active":a.value,"v-snackbar--multi-line":e.multiLine&&!e.vertical,"v-snackbar--timer":!!e.timer,"v-snackbar--vertical":e.vertical},Q.value,o.value,e.class],style:[u.value,e.style]},D,{modelValue:a.value,"onUpdate:modelValue":ne=>a.value=ne,contentProps:F({class:["v-snackbar__wrapper",l.value,d.value,h.value,v.value],style:[x.value],onPointerenter:P,onPointerleave:N},D.contentProps),persistent:!0,noClickAnimation:!0,scrim:!1,scrollStrategy:"none",_disableGlobalStack:!0,onTouchstartPassive:ee,onTouchend:U,onAfterLeave:ae},n),{default:()=>{var ne,pe;return[Ae(!1,"v-snackbar"),e.timer&&!j.value&&i("div",{key:"timer",class:"v-snackbar__timer"},[i(Ne,{ref:w,color:typeof e.timer=="string"?e.timer:"info",max:e.timeout,"model-value":_.time.value},null)]),te&&i("div",{key:"content",class:"v-snackbar__content",role:"status","aria-live":"polite"},[((ne=s.text)==null?void 0:ne.call(s))??e.text,(pe=s.default)==null?void 0:pe.call(s)]),s.actions&&i(ce,{defaults:{VBtn:{variant:"text",ripple:!1,slim:!0}}},{default:()=>[i("div",{class:"v-snackbar__actions"},[s.actions({isActive:a})])]})]},activator:s.activator})}),nt({},y)}}),ns={props:{path:{type:String,default:""},id:{type:String,default:""}},data:function(){return{dialog:!1,snackbar:!1,timeout:1e3,base_url:"https://db.antiquitatum-thesaurus.eu"}},computed:{today(){return new Date().toLocaleDateString()},perma_url(){return`${this.base_url}/${this.path}/${this.id}`}},methods:{copy_inner_text(e){this.copy_to_clipboard(e.target.innerText)},async copy_to_clipboard(e){try{await navigator.clipboard.writeText(e),this.snackbar=!0}catch{alert("Cannot copy")}}}},is={class:"text-caption permalink text-primary"},os={class:"mt-4 text-body"},rs={italic:""},ls={class:"permalink-title"},cs={key:0};function ds(e,t,s,a,o,n){return c(),g("span",is,[i(O,{size:"20",icon:"mdi-information-outline",onClick:t[0]||(t[0]=lt(l=>e.dialog=!0,["stop"]))},{default:r(()=>[i(oe,{size:"18"}),e.$vuetify.display.sm||e.$vuetify.display.xs?f("",!0):(c(),p(W,{key:0,location:"left","open-delay":"500",activator:"parent"},{default:r(()=>[k("span",null,m(e.$t("user_info.permalink_info_short")),1)]),_:1}))]),_:1}),i(Ge,{modelValue:e.dialog,"onUpdate:modelValue":t[3]||(t[3]=l=>e.dialog=l),width:"500"},{default:r(()=>[i(J,null,{default:r(()=>[i(ue,{class:"text-h5 mt-2 px-5"},{default:r(()=>t[7]||(t[7]=[q(" Zitierhinweis ")])),_:1}),i(ze,{class:"px-5 pt-0",style:{"font-size":"0.875rem"}},{default:r(()=>[i(se),k("p",os,m(e.$t("user_info.citation_note_p1")),1),t[8]||(t[8]=k("br",null,null,-1)),k("p",null,m(e.$t("user_info.citation_note_p2")),1),t[9]||(t[9]=k("br",null,null,-1)),k("p",rs,[i(W,{location:"bottom","open-delay":"300"},{activator:r(({props:l})=>[k("a",F(l,{onClick:t[1]||(t[1]=(...d)=>n.copy_inner_text&&n.copy_inner_text(...d))}),"Antiquitatum Thesaurus, ID "+m(s.id)+", "+m(n.perma_url)+" ("+m(e.$t("user_info.citation_note_accessed"))+" "+m(n.today)+").",17)]),default:r(()=>[k("span",null,m(e.$t("user_info.copy_to_clipboard_info")),1)]),_:1})])]),_:1}),i(_e,null,{default:r(()=>[i(he),i(O,{color:"#c60c30",variant:"text",onClick:t[2]||(t[2]=l=>e.dialog=!1)},{default:r(()=>[q(m(e.$t("site_navigation.close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),k("span",ls,[t[10]||(t[10]=q(" Permalink: ")),e.$vuetify.display.xs?(c(),g("br",cs)):f("",!0),k("a",{onClick:t[4]||(t[4]=(...l)=>n.copy_inner_text&&n.copy_inner_text(...l))},[q(m(n.perma_url)+" ",1),e.$vuetify.display.sm||e.$vuetify.display.xs?f("",!0):(c(),p(W,{key:0,location:"bottom","open-delay":"300",activator:"parent"},{default:r(()=>[k("span",null,m(e.$t("user_info.copy_to_clipboard_info")),1)]),_:1}))])]),i(He,{modelValue:e.snackbar,"onUpdate:modelValue":t[6]||(t[6]=l=>e.snackbar=l),timeout:e.timeout},{actions:r(({attrs:l})=>[i(O,F({color:"rgb(198, 12, 48)",variant:"text"},l,{onClick:t[5]||(t[5]=d=>e.snackbar=!1)}),{default:r(()=>[q(m(e.$t("site_navigation.close")),1)]),_:2},1040)]),default:r(()=>[q(m(e.$t("user_info.copied"))+" ",1)]),_:1},8,["modelValue","timeout"])])}const us=M(ns,[["render",ds],["__scopeId","data-v-0f0998d3"]]),_s={key:0},hs={__name:"BackToSearchButton",setup(e){const t=ct();return(s,a)=>R(t).last_search?(c(),g("div",_s,[i(O,{variant:"text",color:"primary",to:{name:"Search",query:R(t).last_search}},{default:r(()=>[q(m(s.$t("label.back_to_search")),1)]),_:1},8,["to"])])):f("",!0)}},ps=Me("comparison",{state:()=>({savedObject:null}),actions:{saveObject(e){this.savedObject=e},deleteSavedObject(){this.savedObject=null}}}),fs={__name:"ObjectComparisonButtons",setup(e){const t=ps();let s=E(!1);return(a,o)=>(c(),g("div",null,[R(t).savedObject?(c(),p(W,{key:0,location:"right","open-delay":"300"},{activator:r(({props:n})=>[i(O,F({class:"mt-2",icon:"mdi-pin-off",size:"28"},n,{onClick:R(t).deleteSavedObject}),{default:r(()=>[i(oe,{color:"rgb(198, 12, 48)"})]),_:2},1040,["onClick"])]),default:r(()=>[k("span",null,m(a.$t("site_navigation.delete_preselection")),1)]),_:1})):(c(),p(W,{key:1,location:"right","open-delay":"300"},{activator:r(({props:n})=>[i(O,F({class:"mt-2",icon:"mdi-pin",size:"28"},n,{onClick:o[0]||(o[0]=()=>{re(s)?s.value=!0:s=!0,R(t).saveObject(a.$route.params.objectid)})}),null,16)]),default:r(()=>[k("span",null,m(a.$t("site_navigation.preselect_for_comparison")),1)]),_:1})),R(t).savedObject&&R(t).savedObject!=a.$route.params.objectid?(c(),p(W,{key:2,location:"right","open-delay":"300"},{activator:r(({props:n})=>[i(O,F({class:"mt-2",icon:"mdi-compare",size:"28"},n,{onClick:o[1]||(o[1]=l=>a.$router.push(`/comparison/${R(t).savedObject}/with/${a.$route.params.objectid}`))}),null,16)]),default:r(()=>[k("span",null,m(a.$t("site_navigation.compare_with_preselection")),1)]),_:1})):f("",!0),i(He,{modelValue:R(s),"onUpdate:modelValue":o[3]||(o[3]=n=>re(s)?s.value=n:s=n),"multi-line":"",timeout:"8000"},{actions:r(({attrs:n})=>[i(O,F({color:"rgb(198, 12, 48)",variant:"text"},n,{onClick:o[2]||(o[2]=l=>re(s)?s.value=!1:s=!1)}),{default:r(()=>[q(m(a.$t("site_navigation.close")),1)]),_:2},1040)]),default:r(()=>[q(m(a.$t("site_navigation.comparison_instructions"))+" ",1)]),_:1},8,["modelValue"])]))}},we={sorting:"production_date_asc",results_per_page:60},ms={name:"DetailPaginator",inject:["parent_ac"],data(){return{ac:this.parent_ac,filter_object_id:null,results_per_page:null,page:null,sort:null,result:[],total_count:null,results_loaded:!1}},computed:{current_index(){return this.results_loaded?this.result.findIndex(e=>e.iri.endsWith("/"+this.$route.params.objectid)):-1}},created(){this.ac=new AbortController,this.read_component_states_from_url(),this.dispatch_search()},unmounted(){this.ac.abort()},methods:{read_component_states_from_url(){this.page=parseInt(this.$route.query.page)||1,this.results_per_page=parseInt(this.$route.query.items)||we.results_per_page,this.sort=this.$route.query.sorting||we.sorting,this.filter_object_id=this.$route.query.parent_id||null},async dispatch_search(){this.results_loaded=!1;try{this.result=await ye.search({q:this.$route.query.q,qfilter:this.$route.query.qfilter,filter_object_id:this.filter_object_id,limit:this.results_per_page,offset:this.results_per_page*(this.page-1),sorting:this.sort,signal:this.ac.signal}),this.total_count=await ye.get_total_count({q:this.$route.query.q,qfilter:this.$route.query.qfilter,filter_object_id:this.filter_object_id,signal:this.ac.signal}),this.results_loaded=!0}catch(e){e.name!="AbortError"&&(this.results_loaded=!1,console.error(e))}},async next_object(e){let t=Object.assign({},this.$route.query),s=null;e=="forward"?this.current_index+1==this.result.length?(this.page++,this.ac.abort(),this.ac=new AbortController,await this.dispatch_search(),t.page?t.page++:t.page=2,s=this.result[0].iri.split("/").slice(-1)[0]):s=this.result[this.current_index+1].iri.split("/").slice(-1)[0]:this.current_index==0?(this.page--,this.ac.abort(),this.ac=new AbortController,await this.dispatch_search(),t.page==2?delete t.page:t.page--,s=this.result[this.results_per_page-1].iri.split("/").slice(-1)[0]):s=this.result[this.current_index-1].iri.split("/").slice(-1)[0],this.$router.push({name:"Object",params:{objectid:s},query:t})}}},bs={key:0},gs={class:"text-button text-primary",style:{"user-select":"none"}};function ys(e,t,s,a,o,n){return o.results_loaded?(c(),g("div",bs,[i(O,{icon:"mdi-chevron-left",size:"24",disabled:n.current_index==0&&o.page==1,onClick:t[0]||(t[0]=l=>n.next_object("backward"))},null,8,["disabled"]),k("span",gs,m(n.current_index+1+o.results_per_page*(o.page-1))+" / "+m(o.total_count),1),i(O,{icon:"mdi-chevron-right",size:"24",disabled:n.current_index+1+o.results_per_page*(o.page-1)==o.total_count,onClick:t[1]||(t[1]=l=>n.next_object("forward"))},null,8,["disabled"])])):f("",!0)}const vs=M(ms,[["render",ys]]),Ke=Me("graph",{state:()=>({saved_raw_networks:{inverted_idx:{}},saved_prepared_networks:{},graph_empty:!1}),actions:{save_tree(e,t){e.forEach(s=>this.saved_prepared_networks[s]=t)},save_networks(e){this.saved_raw_networks=e}},getters:{getNetworkForId:e=>t=>{const s=e.saved_raw_networks.inverted_idx[t],a={nodes:{},links:[]};for(let o of s){let n=e.saved_raw_networks.links[o];n.source in a.nodes||(a.nodes[n.source]=e.saved_raw_networks.nodes[n.source]),n.target in a.nodes||(a.nodes[n.target]=e.saved_raw_networks.nodes[n.target]),a.links.push(n)}return a}}}),ks={class:"d-flex flex-nowrap"},ws={class:"d-flex flex-nowrap"},js={style:{"min-width":"70px"}},xs={style:{"max-width":"calc(100% - 70px)"}},Ss={__name:"ObjectTree",props:{children:{type:Array,default:()=>[]}},setup(e){async function t(s){if(s.children.length==0){let a=s.iri.split("/").slice(-1)[0],n=(await $.get_children(a)).children;for(let l of n)l.has_child&&(l.children=[]);s.children=n}}return(s,a)=>{const o=T("v-treeview");return c(),g("div",null,[i(o,{items:e.children,"load-children":t,density:"compact"},{title:r(({item:n})=>[k("div",ks,[n.has_child?f("",!0):(c(),p(he,{key:0,style:{width:"34px"}})),i(J,{variant:"outlined",width:"100%",class:"ma-1 object-card text-decoration-none",to:{name:"Object",params:{objectid:n.iri.split("/").slice(-1)[0]}}},{default:r(()=>[k("div",ws,[k("div",js,[i(R(ve),{images:n.images,"with-tree-button":!1,"image-height":60},null,8,["images"])]),k("div",xs,[i(ue,{class:"text-body-2 hyphenate",style:{"line-height":"1.25rem","white-space":"normal"}},{default:r(()=>[q(m(n.title),1)]),_:2},1024)]),n.children?(c(),p(_e,{key:0,class:"ml-auto"},{default:r(()=>[i(R(Lt),{objectid:n.iri.split("/").slice(-1)[0]},null,8,["objectid"])]),_:2},1024)):f("",!0),n&&!(s.$vuetify.display.sm||s.$vuetify.display.xs)?(c(),p(W,{key:1,activator:"parent",location:"left",width:"40vh","open-delay":"600","content-class":"image-tooltip"},{default:r(()=>[i(R(ve),{images:n.images,"image-height":"40vh"},null,8,["images"])]),_:2},1024)):f("",!0)])]),_:2},1032,["to"])])]),_:1},8,["items"])])}}},Cs=M(Ss,[["__scopeId","data-v-9ce54215"]]),$s={components:{ObjectCard:We,ObjectTree:Cs},props:{data:{type:Array,default:()=>[]},panels:{type:Boolean,default:!1},tree:{type:Boolean,default:!1}},data:function(){return{image_height:140,active_panel:[]}},methods:{fill_row:function(e){let t=e.length%3;return t?3-t:0},has_comment:function(e){return e.comment?!0:(this.$emit("show_error","missing_objectdata"),!1)}}},Is={key:0};function Vs(e,t,s,a,o,n){const l=T("ObjectTree"),d=T("ObjectCard");return s.data.length?(c(),g("span",Is,[s.tree?(c(),p(l,{key:0,children:s.data},null,8,["children"])):(c(),p(B,{key:1},{default:r(()=>[(c(!0),g(G,null,H(s.data,(x,v)=>(c(),p(V,{key:v,class:"d-flex child-flex",cols:"6",md:"6",lg:"4",sm:"4"},{default:r(()=>[i(d,{iri:x,"image-height":140,"with-breadcrumbs":"","tooltip-enabled":""},null,8,["iri"])]),_:2},1024))),128))]),_:1}))])):f("",!0)}const Os=M($s,[["render",Vs]]);class ie extends Mt{constructor(t,s){super(s),this.object_iris=t}}let Y=class{constructor(t,s=100,a=100,o="",n=!1){this.url=t,this.width=s,this.height=a,this.style=o,this.is_placeholder=n}};class de extends Gt{constructor(t,s,a,o,n,l){super(t,s,a,o),this.node_iri=n,this.node_img=l}}class je extends de{constructor(t,s,a,o,n,l,d){super(t,s,a,o,n,l),this.dating=d}}class Ts extends Ut{constructor(){super()}get_root_node(t){const s=t.split("/").slice(-1)[0],a=new ie([t],null);return new de("","","root",s,a,t,new Y(""))}create_node(t,s){const a=t.node_iri.split("/").slice(-1)[0],o=new ie([t.node_iri],s);let n=null;t.node_img?n=new Y(t.node_img):n=new Y("/logo.jpg",70,70,"",!0);let l="";return t.node_label&&(l=t.node_label),new de(l,"object",a,o,t.node_iri,n)}}class Ps extends Ts{constructor(){super()}get_root_node(t){const s=t.split("/").slice(-1)[0],a=new ie([t],null);return new je("","","root",s,a,t,new Y(""),{from:"",to:""})}create_node(t,s){const a=t.node_iri.split("/").slice(-1)[0],o=new ie([t.node_iri],s);let n=null;return t.node_img?n=new Y(t.node_img):n=new Y("/logo.jpg",70,70,"",!0),new je(`${t.node_label}`,"object",a,o,t.node_iri,n,t.dating||{from:"",to:""})}}class qs extends Wt{async get_children(t,s){return X.get_relations_for(t,s)}async get_node(t,s){const a=await X.get_node(t,s);return a.node.edge_label="",a}}class Bs extends qs{async get_children(t,s){return X.get_relations_for(t,s,!1)}async get_dating(t,s){return $.get_dating_for_object(t,s)}async get_all_relations(t){return X.get_all_relations(t)}async get_all_nodes(t){return X.get_all_nodes(t)}}const xe={__name:"ObjectGraph",props:{objectId:{type:Number,required:!0},width:{type:String,default:""},height:{type:String,default:""},reload:{type:Boolean,default:!1},graphtype:{type:String,default:"time"},expanded:{type:Boolean,default:!1}},setup(e){dt(()=>s.graph_empty=!1);const t=ut(),s=Ke(),a=e,o=E(!1),n=L(()=>a.expanded?"outlined":"flat");z(()=>a.graphtype,(u,b)=>{u!=b&&y()}),z(()=>a.height,(u,b)=>{u!=b&&y()});const l=new Ps,d=new Bs;let x=Ee("parent_ac");function v(u){let b=[];return u.forEach(C=>{var I;(I=C.dating)!=null&&I.from||b.push(d.get_dating(`https://db.antiquitatum-thesaurus.eu/object/${C.id}`,x.value.signal))}),b}function h(){o.value=!0,a.objectId in s.saved_prepared_networks||a.objectId in s.saved_raw_networks.inverted_idx?y():new Xt(l,d).create_networks(x.value.signal).then(b=>{s.save_networks(b),y()})}function _(u){const{getNetworkForId:b}=_t(s),C=[u],I=new Set([u]);let S={nodes:{},links:[]};for(;C.length>0;){const P=C.shift();let N=b.value(P);const ee=new Set([...S.links,...N.links]);S={nodes:{...S.nodes,...N.nodes},links:[...ee]};for(const U of Object.values(N.nodes))I.has(U.id)||(I.add(U.id),C.push(U.id))}return S}function y(){if(a.objectId&&a.width&&a.height)if(o.value=!0,a.objectId in s.saved_prepared_networks){o.value=!1;let u=s.saved_prepared_networks[a.objectId];u={nodes:Object.values(u.nodes),links:u.links},u=w(a.objectId,u),j(u)}else{o.value=!1;let u=_(a.objectId);const b=v(Object.values(u.nodes));Promise.allSettled(b).then(async C=>{console.info("load dating"),o.value=!1,C.forEach(S=>{const P=S.value,N=u.nodes[P.obj];P.dating&&(N.dating=P.dating)}),u.links.forEach(S=>{const P=u.nodes[S.source],N=u.nodes[S.target];S.source=me(P),S.target=me(N)}),u={nodes:Object.values(u.nodes),links:u.links};const I=u.nodes.map(S=>S.id);s.save_tree(I,u),u=w(a.objectId,u),console.info("render loaded graph"),j(u)})}}a.reload&&Z(()=>{h()});function w(u,b){const C=b.nodes.find(S=>S.type=="root");C&&(C.type="object");const I=b.nodes.find(S=>S.id==u);return I.type="root",b}async function j(u){let b=null;if(u.nodes.length>1){s.graph_empty=!1;const C={object:"#F5F5F5",root:"#C60C30",links:{depiction:"#d37676",copy:"#B0C5A4",precursor:"#F1EF99",duplicate:"#AD88C6",version:"#6CB8F4"}},I=new Qt({width:a.width,height:a.height});a.graphtype=="network"?b=new Ht(I,C,{width:50,height:50}):b=new Kt(I,C),b.clear_canvas(),b.draw_network(u,"div#tree").then(async()=>{await new Promise(P=>setTimeout(P,500)),b.zoom_to_full_extent(),console.info("Graph drawn")},P=>console.log(P))}else console.info("No children can't render tree"),s.graph_empty=!0}function A(u){t.push({name:"Object",params:{objectid:u.detail.node.id},query:{graphtype:a.graphtype}})}return(u,b)=>(c(),p(Qe,{class:"py-4 pb-4 pt-1"},{default:r(()=>[o.value?(c(),p(B,{key:0},{default:r(()=>[i(V,null,{default:r(()=>[i(Ne,{indeterminate:"",color:"red-lighten-2"})]),_:1})]),_:1})):f("",!0),i(J,{class:"pa-0",height:e.height,variant:n.value},{default:r(()=>[k("div",{id:"tree","on:nodeClicked":A},null,32)]),_:1},8,["height","variant"])]),_:1}))}};function Ds(e){return ht()?(Le(e),!0):!1}function Xe(e){return typeof e=="function"?e():R(e)}const Rs=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function Es(e){return Ue()}function As(e,t=!0,s){Es()?Z(e,s):t?e():Fe(e)}const Ye=Rs?window:void 0;function K(e){var t;const s=Xe(e);return(t=s==null?void 0:s.$el)!=null?t:s}function Ns(){const e=E(!1),t=Ue();return t&&Z(()=>{e.value=!0},t),e}function Ls(e){const t=Ns();return L(()=>(t.value,!!e()))}function Fs(e,t,s={}){const{window:a=Ye,...o}=s;let n;const l=Ls(()=>a&&"ResizeObserver"in a),d=()=>{n&&(n.disconnect(),n=void 0)},x=L(()=>{const _=Xe(e);return Array.isArray(_)?_.map(y=>K(y)):[K(_)]}),v=z(x,_=>{if(d(),l.value&&a){n=new ResizeObserver(t);for(const y of _)y&&n.observe(y,o)}},{immediate:!0,flush:"post"}),h=()=>{d(),v()};return Ds(h),{isSupported:l,stop:h}}function zs(e,t={width:0,height:0},s={}){const{window:a=Ye,box:o="content-box"}=s,n=L(()=>{var _,y;return(y=(_=K(e))==null?void 0:_.namespaceURI)==null?void 0:y.includes("svg")}),l=E(t.width),d=E(t.height),{stop:x}=Fs(e,([_])=>{const y=o==="border-box"?_.borderBoxSize:o==="content-box"?_.contentBoxSize:_.devicePixelContentBoxSize;if(a&&n.value){const w=K(e);if(w){const j=w.getBoundingClientRect();l.value=j.width,d.value=j.height}}else if(y){const w=Array.isArray(y)?y:[y];l.value=w.reduce((j,{inlineSize:A})=>j+A,0),d.value=w.reduce((j,{blockSize:A})=>j+A,0)}else l.value=_.contentRect.width,d.value=_.contentRect.height},s);As(()=>{const _=K(e);_&&(l.value="offsetWidth"in _?_.offsetWidth:t.width,d.value="offsetHeight"in _?_.offsetHeight:t.height)});const v=z(()=>K(e),_=>{l.value=_?t.width:0,d.value=_?t.height:0});function h(){x(),v()}return{width:l,height:d,stop:h}}const Ms={__name:"RelationsGraph",props:{objectId:{type:Number,required:!0}},setup(e){const t=E(!0),s=E(!1),a=E(!1),o=E("time"),n=mt();z(()=>n.params.objectid,async v=>{console.log("new id",v)}),z(s,v=>{v==!1&&(a.value=!1)}),Z(()=>{n.query&&n.query.graphtype&&(o.value=n.query.graphtype)}),pt(()=>{n.query&&n.query.graphtype&&(o.value=n.query.graphtype)});function l(){s.value=!s.value}const d=ft("expandview_container"),x=L(()=>{const{height:v}=zs(d);return v.value*.9||10});return(v,h)=>(c(),p(Qe,null,{default:r(()=>[s.value?f("",!0):(c(),p(J,{key:0,variant:"outlined"},{default:r(()=>[i(B,null,{default:r(()=>[i(V,{class:"pb-1"},{default:r(()=>[i(O,{icon:"mdi-expand-all-outline",onClick:l}),i(be,{modelValue:o.value,"onUpdate:modelValue":h[0]||(h[0]=_=>o.value=_),variant:"plain",mandatory:""},{default:r(()=>[i(O,{class:"network_btn timeline_icon",icon:"mdi-chart-timeline",value:"time"}),i(O,{class:"network_btn",icon:"mdi-hub-outline",value:"network"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),i(xe,{"object-id":e.objectId,reload:t.value,graphtype:o.value,expanded:s.value,width:"100%",height:"550"},null,8,["object-id","reload","graphtype","expanded"])]),_:1})),i(Ge,{modelValue:s.value,"onUpdate:modelValue":h[3]||(h[3]=_=>s.value=_),width:"80%",height:"90%"},{default:r(()=>[i(J,{ref:"expandview_container",class:"expand_content"},{default:r(()=>[i(B,null,{default:r(()=>[i(V,{class:"pb-1"},{default:r(()=>[i(O,{class:"collapse_icon",icon:"mdi-collapse-all-outline",onClick:h[1]||(h[1]=_=>s.value=!1)}),i(be,{modelValue:o.value,"onUpdate:modelValue":h[2]||(h[2]=_=>o.value=_),variant:"plain",mandatory:""},{default:r(()=>[i(O,{class:"network_btn timeline_icon",icon:"mdi-chart-timeline",value:"time"}),i(O,{class:"network_btn",icon:"mdi-hub-outline",value:"network"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),i(B,null,{default:r(()=>[i(V,null,{default:r(()=>[s.value?(c(),p(xe,{key:0,"object-id":e.objectId,graphtype:o.value,reload:t.value,expanded:s.value,width:"100%",height:x.value},null,8,["object-id","graphtype","reload","expanded","height"])):f("",!0)]),_:1})]),_:1})]),_:1},512)]),_:1},8,["modelValue"])]),_:1}))}},Us=M(Ms,[["__scopeId","data-v-083333b2"]]),Gs={methods:{parse_children_mixin(e){let t=[];if(e&&e.length)for(let s of e)s.has_child?t.push({...s,children:[]}):t.push(s);return t}}},Ws=`
    BASE <https://db.antiquitatum-thesaurus.eu>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
    PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/> 
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX at: <https://db.antiquitatum-thesaurus.eu/ontology/> `,Qs={async get_census_documents(e,t=null){let s=`
        ${Ws}
        SELECT ?document ?census_id_content ?ref_label ?instance_name_content ?mid ?path_title WHERE {

            SERVICE <https://censussparql.culture.hu-berlin.de/CENSUS/query> {
                VALUES ?instance {<https://semantic.census.de/physicalthing/${e}>}
    
                ?instance crm:P2_has_type <http://vocab.getty.edu/aat/300133025> .
                ?instance crm:P67i_is_referred_to_by ?ref .
                ?ref crm:P128i_is_carried_by ?document .
                ?document crm:P2_has_type <http://vocab.getty.edu/aat/300026030> .

                ?document crm:P1_is_identified_by ?instance_name .
                ?instance_name crm:P190_has_symbolic_content ?instance_name_content .
                ?instance_name crm:P2_has_type <http://vocab.getty.edu/aat/300404670> .

                ?document crm:P1_is_identified_by ?census_id .
                ?census_id crm:P190_has_symbolic_content ?census_id_content .
                ?census_id crm:P2_has_type <http://vocab.getty.edu/aat/300435704> .

                ?document crm:P46i_forms_part_of* ?mid .
                ?mid crm:P1_is_identified_by ?title_path_iri .
                ?title_path_iri crm:P2_has_type <http://vocab.getty.edu/aat/300404670> .
                ?title_path_iri crm:P190_has_symbolic_content ?path_title .
                
            }
        }`;const a=await Ft(s,{signal:t});return zt(a,{census:[{document:"document",id:"census_id_content",ref_label:"ref_label",name:"instance_name_content",path:{title:"path_title",objectId:"mid"}}]})}},Hs={key:0},Ks={class:"external-doc-headline text-primary"},Xs={__name:"ExternalDocuments",props:{sourceKey:{type:String,default:""},sourceName:{type:String,default:""}},setup(e){const t=E([]),s=e;function a(){s.sourceName&&s.sourceKey&&s.sourceName=="Census"&&Qs.get_census_documents(s.sourceKey).then(o=>{if(Object.keys(o).length){const n=o.census.reduce((l,d)=>(d.id in l?l[d.id].path.push(d.path):l[d.id]={title:d.name,link:`https://database.census.de/#/detail/${d.id}`,path:[],images:["C"]},l),{});for(const l in n)n[l].path.reverse();t.value=Object.values(n).toSorted((l,d)=>l.path.length==0||!l.path[0].title?1:d.path.length==0||!d.path[0].title?-1:l.path[0].title.localeCompare(d.path[0].title))}})}return Z(()=>{a()}),z(()=>s.sourceKey,o=>{o?a():t.value=[]}),(o,n)=>t.value?(c(),g("div",Hs,[i(se,{class:"mt-4"}),i(B,{class:"mt-0"},{default:r(()=>[i(V,null,{default:r(()=>[k("span",Ks,m(o.$t("label.external_documents"))+":",1)]),_:1})]),_:1}),i(B,null,{default:r(()=>[i(V,null,{default:r(()=>[k("h5",null,m(e.sourceName),1)]),_:1})]),_:1}),i(B,null,{default:r(()=>[(c(!0),g(G,null,H(t.value,(l,d)=>(c(),p(V,{key:d,class:"d-flex child-flex",cols:"6",md:"6",lg:"4",sm:"4"},{default:r(()=>[i(R(We),{"object-data":l,"image-height":140,"with-breadcrumbs":""},null,8,["object-data"])]),_:2},1024))),128))]),_:1})])):f("",!0)}},Ys=M(Xs,[["__scopeId","data-v-c71b0ed0"]]),Js={components:{Relations:Os,RelationsGraph:Us,ExternalDocuments:Ys,LoadingSpinner:Yt},mixins:[Gs],inject:["parent_ac"],props:{objectId:{type:Number,default:0},objectTitle:{type:String,default:""},hasChildren:{type:Boolean,default:!1}},data(){return{active_tab:0,loaded_dates:0,sidebar_tabs:{relations:{type:"relations",loading:!0,loading_relations:{},loading_dating:{},count:0},relations_graph:{type:"relations_graph",loading:!0,count:0},children:{type:"children",loading:!0,count:0},artefacts:{type:"artefacts",loading:!0,count:0}},relations:new Map([]),has_relationships:!1,external_reference:[],retrievable_refs:{Census:{key:e=>{let t="";return e.ref_link.indexOf("censusID=")!=-1?t=e.ref_link.substring(e.ref_link.indexOf("censusID=")+9):t=e.ref_link.split("/").slice(-1)[0],t}}},artefacts:[],children:[],depictions:[]}},computed:{...bt(Ke),display_data(){return this.has_relationships||this.hasChildren}},watch:{objectId(){this.reset_data(),this.load_from_ts()},relations(){if(this.relations&&this.relations.length)for(let e of this.relations)e.iris=e.rels.split(","),this.sidebar_tabs.relations.count+=Number(e.rel_cnt),this.sidebar_tabs.relations_graph.count+=Number(e.rel_cnt)}},mounted(){this.$router.query&&this.$router.query.keys().includes("graphtype")&&(this.active_tab=1)},created(){this.reset_data(),this.load_from_ts(),this.graphStore.$subscribe((e,t)=>{t.graph_empty&&this.clear_graph_tab()})},methods:{buildQueryBuilderQuery(e){let s=[{field:{is_depicted_in:"depicts"}[e],iri:[{value:`object/${this.objectId}`,label:this.objectTitle}]}];return JSON.stringify(s)},node_clicked(){this.active_tab=1},check_relation_map(){this.relations.size==0&&delete this.sidebar_tabs.relations},clear_graph_tab(){delete this.sidebar_tabs.relations_graph},is_valid_response(e){return e===null?!1:!(e.id&&e.id!=this.objectId)},read_response(e,t){if(e&&this.is_valid_response(e)&&e.relations&&e.relations.length){this.sidebar_tabs.relations.loading_relations[t]=e.relations.length;const s=gt({loading:!0,loaded:0,from:e.relations.length});this.sidebar_tabs.relations.loading_dating[t]=s,this.relations.set(t,"loading");const a=[];e.relations.forEach(o=>{a.push($.get_dating_for_object(o.obj).then(n=>(s.loaded++,n)))}),Promise.allSettled(a).then(o=>{const n=o.map(l=>l.value).toSorted((l,d)=>{if(!l.dating&&!d.dating)return 0;if(!l.dating&&d.dating)return 1;if(l.dating&&!d.dating)return-1;{const x=new Date(l.dating.from),v=new Date(d.dating.from);return x-v}}).map(l=>l.obj);this.sidebar_tabs.relations.loading_dating[t]=!1,this.relations.set(t,n),this.sidebar_tabs.relations.count+=n.length})}},load_from_ts(){X.has_relationships(this.objectId,this.parent_ac.signal).then(e=>{e.exists?(this.has_relationships=!0,this.graphStore.graph_empty=!1):(this.has_relationships=!1,delete this.sidebar_tabs.relations_graph)}).then(()=>{const e=[];this.has_relationships?(e.push($.get_depicts_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"depicts")})),e.push($.get_depicted_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_depicted_in")})),e.push($.get_duplicate_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_duplicate_of")})),e.push($.get_is_copy_after_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_copy_after")})),e.push($.get_has_copy_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"has_copy")})),e.push($.get_has_precursor_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_based_on")})),e.push($.get_was_precursor_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_precursor_for")})),e.push($.get_related_to_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_related_to")})),e.push($.get_has_version_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"has_version")})),e.push($.get_is_version_of_relations(this.objectId,this.parent_ac.signal).then(t=>{this.read_response(t,"is_version_of")})),Promise.allSettled(e).then(()=>{this.sidebar_tabs.relations.loading=!1,this.check_relation_map()})):delete this.sidebar_tabs.relations}),$.get_children(this.objectId,this.parent_ac.signal).then(e=>{if(e&&e.children&&e.children.length&&e.id==this.objectId){let t=this.parse_children_mixin(e.children);this.children=t,this.sidebar_tabs.children.loading=!1,this.sidebar_tabs.children.count=t.length}else delete this.sidebar_tabs.children}),$.get_external_reference(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{if(e&&Object.keys(e).includes("references")){const t=e.references.filter(a=>a.ref_source in this.retrievable_refs),s=[];for(let a of t){const n=this.retrievable_refs[a.ref_source].key(a);s.push({source:a.ref_source,key:n})}this.external_reference=s}else this.external_reference=[]}),$.get_related_artefacts(this.objectId,this.parent_ac.signal).then(e=>{e&&e.artefacts&&e.artefacts.length&&e.id==this.objectId?(this.artefacts=e.artefacts,this.sidebar_tabs.artefacts.loading=!1,this.sidebar_tabs.artefacts.count=e.artefacts.length):delete this.sidebar_tabs.artefacts})},reset_data(){this.relations=new Map([["depicts",[]],["is_depicted_in",[]],["is_copy_after",[]],["has_copy",[]],["is_based_on",[]],["is_precursor_for",[]],["is_duplicate_of",[]],["is_version_of",[]],["has_version",[]],["is_related_to",[]]]),this.children=[],this.sidebar_tabs={relations:{type:"relations",loading:!0,count:0,loading_relations:{},loading_dating:{}},children:{type:"children",loading:!0,count:0},artefacts:{type:"artefacts",loading:!0,count:0},relations_graph:{type:"relations_graph",loading:!1,count:0}}}}},Zs={key:0},ea={key:0,class:"pl-1"},ta={key:1,class:"pl-1"},sa={key:0},aa={key:0},na={key:2},ia={key:3};function oa(e,t,s,a,o,n){const l=T("loading-spinner"),d=T("Relations"),x=T("external-documents"),v=T("RelationsGraph");return n.display_data?(c(),g("div",Zs,[i(Jt,{modelValue:o.active_tab,"onUpdate:modelValue":t[0]||(t[0]=h=>o.active_tab=h),"show-arrows":"",class:"text-primary"},{default:r(()=>[(c(!0),g(G,null,H(o.sidebar_tabs,(h,_,y)=>(c(),p(es,{key:y},{default:r(()=>[q(m(e.$t("label."+h.type))+" ",1),h.loading?(c(),g("span",ea,[i(yt,{width:3,size:20,indeterminate:"",color:"grey-lighten-1"})])):f("",!0),h.count?(c(),g("span",ta,"("+m(h.count)+")",1)):f("",!0)]),_:2},1024))),128))]),_:1},8,["modelValue"]),i(Zt,{modelValue:o.active_tab,"onUpdate:modelValue":t[2]||(t[2]=h=>o.active_tab=h)},{default:r(()=>[(c(!0),g(G,null,H(o.sidebar_tabs,(h,_,y)=>(c(),p(ts,{key:y,class:"px-1 pt-4",value:`${h.type}`},{default:r(()=>[h.type=="relations"?(c(),g("div",sa,[(c(!0),g(G,null,H(o.relations,([w,j])=>(c(),p(B,{key:w},{default:r(()=>[j.length?(c(),p(V,{key:0,class:"mb-1"},{default:r(()=>[i(B,{align:"center"},{default:r(()=>[i(V,{cols:"11"},{default:r(()=>[k("h5",null,m(e.$t("label."+w)),1)]),_:2},1024),j.length>1&&w=="is_depicted_in"?(c(),p(V,{key:0,cols:"1",class:"ma-0 pa-0"},{default:r(()=>[i(O,{style:{"text-decoration":"none"},density:"compact",icon:"mdi-text-search-variant",to:{name:"Search",query:{q:n.buildQueryBuilderQuery(w)}}},null,8,["to"]),e.$vuetify.display.sm||e.$vuetify.display.xs?f("",!0):(c(),p(W,{key:0,location:"bottom","open-delay":"500",activator:"parent"},{default:r(()=>[k("span",null,m(e.$t("user_info.open_as_search_result")),1)]),_:1}))]),_:2},1024)):f("",!0)]),_:2},1024),i(B,null,{default:r(()=>[j=="loading"?(c(),p(V,{key:0,class:"ma-0 pa-0"},{default:r(()=>[i(l)]),_:1})):j.length?(c(),p(V,{key:1},{default:r(()=>[i(d,{data:j},null,8,["data"])]),_:2},1024)):f("",!0)]),_:2},1024)]),_:2},1024)):f("",!0)]),_:2},1024))),128)),o.external_reference?(c(),g("span",aa,[(c(!0),g(G,null,H(o.external_reference,(w,j)=>(c(),p(B,{key:`${w.source}-${j}`},{default:r(()=>[i(V,{class:"mb-1"},{default:r(()=>[i(x,{"source-key":w.key,"source-name":w.source},null,8,["source-key","source-name"])]),_:2},1024)]),_:2},1024))),128))])):f("",!0)])):h.type=="relations_graph"?(c(),g("div",{key:1,"on:nodeClicked":t[1]||(t[1]=(...w)=>n.node_clicked&&n.node_clicked(...w))},[i(B,null,{default:r(()=>[i(V,{class:"mb-1"},{default:r(()=>[i(v,{"object-id":s.objectId},null,8,["object-id"])]),_:1})]),_:1})],32)):h.type=="artefacts"?(c(),g("div",na,[i(V,{class:"mb-1"},{default:r(()=>[i(d,{data:o.artefacts},null,8,["data"])]),_:1})])):h.type=="children"?(c(),g("div",ia,[i(d,{data:o.children,tree:""},null,8,["data"])])):f("",!0)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])):f("",!0)}const ra=M(Js,[["render",oa],["__scopeId","data-v-7518c5d7"]]),la=vt("v-alert-title"),ca=["success","info","warning","error"],da=Se({border:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["top","end","bottom","start"].includes(e)},borderColor:String,closable:Boolean,closeIcon:{type:kt,default:"$close"},closeLabel:{type:String,default:"$vuetify.close"},icon:{type:[Boolean,String,Function,Object],default:null},modelValue:{type:Boolean,default:!0},prominent:Boolean,title:String,text:String,type:{type:String,validator:e=>ca.includes(e)},...wt(),...jt(),...xt(),...St(),...Ce(),...$e(),...Ie(),...Ct(),...Oe(),...Ve({variant:"flat"})},"VAlert"),ua=Te()({name:"VAlert",props:da(),emits:{"click:close":e=>!0,"update:modelValue":e=>!0},setup(e,t){let{emit:s,slots:a}=t;const o=Pe(e,"modelValue"),n=L(()=>{if(e.icon!==!1)return e.type?e.icon??`$${e.type}`:e.icon}),l=L(()=>({color:e.color??e.type,variant:e.variant})),{themeClasses:d}=Be(e),{colorClasses:x,colorStyles:v,variantClasses:h}=De(l),{densityClasses:_}=$t(e),{dimensionStyles:y}=It(e),{elevationClasses:w}=Vt(e),{locationStyles:j}=Ot(e),{positionClasses:A}=qe(e),{roundedClasses:u}=Re(e),{textColorClasses:b,textColorStyles:C}=Tt(Pt(e,"borderColor")),{t:I}=qt(),S=L(()=>({"aria-label":I(e.closeLabel),onClick(P){o.value=!1,s("click:close",P)}}));return()=>{const P=!!(a.prepend||n.value),N=!!(a.title||e.title),ee=!!(a.close||e.closable);return o.value&&i(e.tag,{class:["v-alert",e.border&&{"v-alert--border":!!e.border,[`v-alert--border-${e.border===!0?"start":e.border}`]:!0},{"v-alert--prominent":e.prominent},d.value,x.value,_.value,w.value,A.value,u.value,h.value,e.class],style:[v.value,y.value,j.value,e.style],role:"alert"},{default:()=>{var U,ae;return[Ae(!1,"v-alert"),e.border&&i("div",{key:"border",class:["v-alert__border",b.value],style:C.value},null),P&&i("div",{key:"prepend",class:"v-alert__prepend"},[a.prepend?i(ce,{key:"prepend-defaults",disabled:!n.value,defaults:{VIcon:{density:e.density,icon:n.value,size:e.prominent?44:28}}},a.prepend):i(oe,{key:"prepend-icon",density:e.density,icon:n.value,size:e.prominent?44:28},null)]),i("div",{class:"v-alert__content"},[N&&i(la,{key:"title"},{default:()=>{var Q;return[((Q=a.title)==null?void 0:Q.call(a))??e.title]}}),((U=a.text)==null?void 0:U.call(a))??e.text,(ae=a.default)==null?void 0:ae.call(a)]),a.append&&i("div",{key:"append",class:"v-alert__append"},[a.append()]),ee&&i("div",{key:"close",class:"v-alert__close"},[a.close?i(ce,{key:"close-defaults",defaults:{VBtn:{icon:e.closeIcon,size:"x-small",variant:"text"}}},{default:()=>{var Q;return[(Q=a.close)==null?void 0:Q.call(a,{props:S.value})]}}):i(O,F({key:"close-btn",icon:e.closeIcon,size:"x-small",variant:"text"},S.value),null)])]}})}}}),_a={name:"ErrorResponse",props:{type:{type:String,default:""},error:{type:Error,default:null}},computed:{error_message:function(){let e="";return this.error&&(this.error.response?e="error.not_found":this.error.request?e="error.network_error":this.error.message?e="error."+this.error.message:e="error.unknown"),e},error_color:function(){let e="error";return this.error&&this.error.response&&(e="accent"),e}}},ha={key:0};function pa(e,t,s,a,o,n){return s.type?(c(),g("span",ha,[s.type==="symbole"?(c(),g(G,{key:0},[i(oe,{size:"large",color:n.error_color},{default:r(()=>t[0]||(t[0]=[q("mdi-alert-circle-outline")])),_:1},8,["color"]),q("  "+m(e.$t(n.error_message)),1)],64)):s.type==="bar"?(c(),p(ua,{key:1,density:"compact",variant:"outlined",type:"error"},{default:r(()=>[q("  "+m(e.$t(n.error_message)),1)]),_:1})):f("",!0)])):f("",!0)}const fa=M(_a,[["render",pa]]),ma={name:"ObjectDetail",components:{MainContainer:Bt,ThreeColumnLayout:Rt,ImageSection:At,PermaLink:us,Sidebar:ra,ObjectComparisonButtons:fs,DetailPaginator:vs,ErrorResponse:fa,BackToSearchButton:hs,ObjectDetailTS:Nt,ObjectTitle:Et},provide(){return{parent_ac:L(()=>this.ac)}},data(){return{loading:!0,objectId:null,object_path:[],title:"",has_children:!1,errors:[],trip_data:[],cataloging:[],ac:null,exists:2,close_siblings:{},all_siblings:[]}},computed:{mailto_link:function(){return"mailto:thesaurus@bbaw.de?subject=Feedback zu Objekt: "+this.objectId}},watch:{objectId(e,t){t&&e!=t&&(this.ac.abort(),this.ac=new AbortController,this.object_path=[],this.title="",this.has_children=!1,this.cataloging=[],this.load_from_ts())}},updated(){this.objectId=Number(this.$route.params.objectid)},created(){this.ac=new AbortController,this.objectId=Number(this.$route.params.objectid),this.load_from_ts()},mounted(){ke({title:()=>`${this.title} - Antiquitatum Thesaurus`,meta:[{property:"og:title",content:()=>`${this.title} - Antiquitatum Thesaurus`}]})},unmounted(){ke({title:()=>"Antiquitatum Thesaurus",meta:[{property:"og:title",content:()=>"Antiquitatum Thesaurus"}]})},methods:{onShowError:function(e){this.errors.push(new Error(e))},find_close_siblings(){const e=this.all_siblings.findIndex(a=>a.id==this.objectId);let t=null;e>0&&(t=this.all_siblings[e-1]);let s=null;e<this.all_siblings.length-1&&(s=this.all_siblings[e+1]),this.close_siblings={self:this.objectId,prev:t,next:s}},load_data(){$.get_preferred_title(this.objectId,"de",this.ac.signal).then(e=>{e&&(this.title=e)}),$.get_parents_path(this.objectId,this.ac.signal).then(e=>{e&&e.path&&e.id==this.objectId&&(this.object_path=e.path)}),$.has_children(this.objectId,this.ac.signal).then(e=>{e&&e.children&&e.id==this.objectId&&(this.has_children=e.children)}),this.all_siblings.length&&this.all_siblings.some(e=>e.id==this.objectId)?this.find_close_siblings():$.get_siblings(this.objectId,this.ac.signal).then(e=>{e&&e.siblings?(this.all_siblings=e.siblings,this.find_close_siblings.call()):this.close_siblings={}})},load_from_ts(){$.object_exists(this.objectId).then(e=>{this.exists=e.exists,this.exists&&this.load_data()})}}},ba={key:0},ga={key:0},ya={class:"sticky t-100"},va={key:0,class:"text-center"},ka={class:"pa-2",align:"right"},wa=["href"],ja={key:1};function xa(e,t,s,a,o,n){const l=T("ErrorResponse"),d=T("BackToSearchButton"),x=T("DetailPaginator"),v=T("PermaLink"),h=T("ObjectTitle"),_=T("ImageSection"),y=T("ObjectComparisonButtons"),w=T("ObjectDetailTS"),j=T("Sidebar"),A=T("ThreeColumnLayout"),u=T("MainContainer");return c(),p(u,null,{default:r(()=>[o.exists===!0?(c(),g("div",ba,[o.errors.length?(c(),p(B,{key:0,onShow_error:n.onShowError},{default:r(()=>[(c(!0),g(G,null,H(o.errors,(b,C)=>(c(),p(l,{key:C,type:"bar",error:b},null,8,["error"]))),128))]),_:1},8,["onShow_error"])):f("",!0),i(B,{class:"ma-0 pa-0",align:"center",justify:"center",style:{"min-height":"40px"}},{default:r(()=>[i(V,{class:ge(["ma-0 pa-0",{"text-center":e.$vuetify.display.sm||e.$vuetify.display.xs}]),cols:"12",md:"5"},{default:r(()=>[e.$route.query.mode=="objects"|!e.$route.query.mode?(c(),p(d,{key:0})):f("",!0)]),_:1},8,["class"]),i(V,{class:"ma-0 pa-0 text-center",cols:"12",md:"2"},{default:r(()=>[e.$route.query.mode=="objects"?(c(),p(x,{key:0})):(c(),p(he,{key:1,style:{height:"36px"}}))]),_:1}),e.$vuetify.display.xs?f("",!0):(c(),p(V,{key:0,class:ge(["ma-0 pa-0",{"text-center":e.$vuetify.display.sm||e.$vuetify.display.xs,"text-right":!(e.$vuetify.display.sm||e.$vuetify.display.xs)}]),cols:"12","align-self":"end",md:"5"},{default:r(()=>[i(v,{id:o.objectId.toString(),path:"object"},null,8,["id"])]),_:1},8,["class"]))]),_:1}),i(se),i(A,null,{"col-1":r(()=>[e.$vuetify.display.xs?(c(),g("div",ga,[i(h,{title:o.title,"object-path":o.object_path,"has-children":o.has_children,siblings:o.close_siblings},null,8,["title","object-path","has-children","siblings"]),i(se,{class:"mt-4"})])):f("",!0),k("div",ya,[i(_,{"object-id":o.objectId,max_width:430},null,8,["object-id"]),e.$vuetify.display.xs||e.$vuetify.display.sm?f("",!0):(c(),p(y,{key:0}))])]),"col-2":r(()=>[i(Dt,{class:"px-2 pb-2"},{default:r(()=>[e.$vuetify.display.xs?f("",!0):(c(),p(h,{key:0,title:o.title,"object-path":o.object_path,"has-children":o.has_children,siblings:o.close_siblings},null,8,["title","object-path","has-children","siblings"])),i(w,{"object-id":o.objectId},null,8,["object-id"])]),_:1}),i(se),e.$vuetify.display.xs?(c(),g("div",va,[i(v,{id:o.objectId.toString(),path:"object"},null,8,["id"])])):f("",!0),k("div",ka,[k("a",{class:"text-caption feedback",href:n.mailto_link},"Feedback",8,wa)])]),"col-3":r(()=>[i(j,{style:{"margin-top":"3.5px"},"object-id":o.objectId,"object-title":o.title,"has-children":o.has_children},null,8,["object-id","object-title","has-children"])]),_:1})])):o.exists===!1?(c(),g("div",ja,[i(J,{variant:"outlined",rounded:"0","max-width":"500",class:"mx-auto my-10"},{default:r(()=>[i(ue,null,{default:r(()=>[q(m(e.$t("error.object_not_found")),1)]),_:1}),i(ze,null,{default:r(()=>[q(m(e.$t("error.wrong_object_id")),1)]),_:1}),i(_e,null,{default:r(()=>[i(O,{variant:"text",color:"#C60C30",to:{name:"Search"}},{default:r(()=>t[0]||(t[0]=[q("Suche")])),_:1})]),_:1})]),_:1})])):f("",!0)]),_:1})}const Ha=M(ma,[["render",xa],["__scopeId","data-v-a881b77c"]]);export{Ha as default};