import{A as M}from"./Anchor-B6I4eTNC.js";import{_ as B,I as ie,u as se}from"./ImageViewer-C0ruojiu.js";import{c3 as w,aR as y,aE as n,u as _,s as u,F as E,H as j,b3 as h,t as d,bx as s,I as o,c8 as l,v as P,c7 as g,aQ as V,ce as R,aP as T,aq as J,cb as Q,ao as oe,ap as re,a3 as _e,am as ce,c6 as Y,aM as D,aa as U,ax as z,bs as G,bc as Z,aI as le,aF as de,cc as ue,cd as me,cf as he,c9 as fe,ci as pe,aK as be,q as ye}from"./index-pVvkWKzi.js";import{P as ge,F as X}from"./PlaceHolderImage-CBAhttrD.js";import{L as Pe}from"./LoadingSpinner-BjU99GiU.js";import{a as $,c as v}from"./triplestore-DD4Ytlqh.js";import{V as Ie}from"./ChildTreeSearchButton-DaF4HIkT.js";const je={name:"FormatedLink",components:{Anchor:M},props:{data:{type:Object,default:()=>{}},textAsLink:{type:Boolean,default:!1},anchorText:{type:String,default:""}},data:function(){return{sources:["descr_link","state_link"]}},computed:{intended:function(){return"px-"+(2+this.intend)},anchor_label:function(){return this.anchorText?this.anchorText:this.data.alt?this.data.alt:this.data.name?this.data.name:this.host(this.data.uri)},has_plain_text:function(){return this.anchorText||this.data.descr},plain_text:function(){return this.anchorText?this.anchorText:this.data.descr?this.data.descr:""},has_something_to_show:function(){return this.data&&this.data.uri||this.anchorText||this.data.descr}},methods:{host:function(e){return new URL(e).hostname}}},ke={key:0,class:"not_formated_link"};function $e(e,i,t,r,a,c){const m=y("Anchor");return c.has_something_to_show?(n(),_("span",ke,[t.data&&t.data.uri?(n(),u(m,{key:0,text:c.anchor_label,url:t.data.uri,"text-as-link":t.textAsLink},null,8,["text","url","text-as-link"])):c.has_plain_text?(n(),_(E,{key:1},[j(h(c.plain_text),1)],64)):d("",!0)])):d("",!0)}const W=w(je,[["render",$e]]),Oe={components:{FormatedLink:W,Dating:B},props:{data:{type:Object,default:()=>{}},headline:{type:String,default:"legal_status.record"},cols:{type:Array,default:()=>[]},isEditor:{type:Boolean,default:!1},useDefaultLicense:{type:Boolean,default:!1},noLicense:{type:Boolean,default:!1},isCreation:{type:Boolean,default:!1}},data(){return{default_license:{name:"CC BY-NC-SA 4.0",uri:"http://creativecommons.org/licenses/by-nc-sa/4.0"}}},computed:{label_person(){return this.isEditor?"legal_status.editor":"legal_status.rightholder"},label_dating(){return this.isCreation?"legal_status.created":"legal_status.dating"},license_link(){if(this.data&&this.data.license){if(this.data.license.uri)return this.data.license;if(typeof this.data.license=="string")return{name:this.data.license,uri:""}}return{name:"",uri:""}}}},Ee={key:0,class:"legal-status"};function ve(e,i,t,r,a,c){const m=y("FormatedLink"),p=y("Dating");return t.data?(n(),_("div",Ee,[t.headline?(n(),u(g,{key:0,dense:"",align:"center"},{default:s(()=>[o(l,null,{default:s(()=>[P("h5",null,h(e.$t(t.headline)),1)]),_:1})]),_:1})):d("",!0),t.data.rightholder?(n(),u(g,{key:1,dense:"",align:"center"},{default:s(()=>[o(l,{cols:t.cols[0]},{default:s(()=>[P("h5",null,h(e.$t(c.label_person))+":",1)]),_:1},8,["cols"]),o(l,{cols:t.cols[1]},{default:s(()=>[j(h(t.data.rightholder),1)]),_:1},8,["cols"])]),_:1})):d("",!0),t.data.credit_line?(n(),u(g,{key:2,dense:"",align:"center"},{default:s(()=>[o(l,{cols:t.cols[0]},{default:s(()=>[P("h5",null,h(e.$t("legal_status.credits"))+":",1)]),_:1},8,["cols"]),o(l,{cols:t.cols[1]},{default:s(()=>[j(h(t.data.credit_line),1)]),_:1},8,["cols"])]),_:1})):d("",!0),t.data.link?(n(),u(g,{key:3,dense:"",align:"center"},{default:s(()=>[o(l,{cols:t.cols[0]},{default:s(()=>[P("h5",null,h(e.$t("legal_status.link"))+":",1)]),_:1},8,["cols"]),o(l,{cols:t.cols[1]},{default:s(()=>[o(m,{data:t.data.link,"text-as-link":""},null,8,["data"])]),_:1},8,["cols"])]),_:1})):d("",!0),t.data.dating?(n(),u(g,{key:4,dense:"",align:"center"},{default:s(()=>[o(l,{cols:t.cols[0]},{default:s(()=>[P("h5",null,h(e.$t(c.label_dating))+":",1)]),_:1},8,["cols"]),o(l,{cols:t.cols[1]},{default:s(()=>[o(p,{data:t.data.dating},null,8,["data"])]),_:1},8,["cols"])]),_:1})):d("",!0),t.data.note?(n(),u(g,{key:5,dense:"",align:"center"},{default:s(()=>[o(l,{cols:t.cols[0]},{default:s(()=>[P("h5",null,h(e.$t("legal_status.changes"))+":",1)]),_:1},8,["cols"]),o(l,{cols:t.cols[1]},{default:s(()=>[j(h(t.data.note),1)]),_:1},8,["cols"])]),_:1})):d("",!0),t.data.license&&!t.noLicense?(n(),u(g,{key:6,dense:"",align:"center"},{default:s(()=>[o(l,{cols:t.cols[0]},{default:s(()=>[P("h5",null,h(e.$t("legal_status.license"))+":",1)]),_:1},8,["cols"]),t.useDefaultLicense?t.useDefaultLicense?(n(),u(l,{key:1,cols:t.cols[1]},{default:s(()=>[o(m,{data:a.default_license,"anchor-text":a.default_license.name},null,8,["data","anchor-text"])]),_:1},8,["cols"])):d("",!0):(n(),u(l,{key:0,cols:t.cols[1]},{default:s(()=>[o(m,{data:c.license_link,"anchor-text":c.license_link.name},null,8,["data","anchor-text"])]),_:1},8,["cols"]))]),_:1})):d("",!0)])):d("",!0)}const ee=w(Oe,[["render",ve],["__scopeId","data-v-229957c7"]]),O=`
    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/>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> `,N={async object_exists(e){let i=`
      ${O}
      ASK { <object/${e}> a crm:E24_Physical_Human-Made_Thing }
    `;return{exists:(await $(i)).boolean||!1}},async has_bibliography(e){let i=`
      ${O}
      ASK { <object/${e}> crm:P01i_is_domain_of / crm:P67.1_has_type <type/bibliographic_reference> . }
    `;return{exists:(await $(i)).boolean||!1}},async has_external_references(e){let i=`
      ${O}
      ASK { <object/${e}> crm:P01i_is_domain_of / crm:P67.1_has_type <type/external_reference> . }
    `;return{exists:(await $(i)).boolean||!1}},async has_base_facts(e){let i=`
      ${O}
      ASK {   
        VALUES ?o { <object/${e}> }
              { ?o crm:P2_has_type ?x  } 
        UNION { ?o crm:P128_carries ?x }
        UNION { ?o crm:P67i_is_referred_to_by ?x . 
                ?o crm:P2_has_type <type/description> . }
        UNION { ?o crm:P45_consists_of ?x . }
        UNION { ?o crm:P44_has_condition ?x .}
        UNION { ?o crm:P39i_was_measured_by ?x .} }
    `;return{exists:(await $(i)).boolean||!1}},async is_deleted(e){let i=`
      ${O}
      ASK { <object/${e}> crm:P67i_is_referred_to_by / crm:P93i_was_taken_out_of_existence_by / crm:P2_has_type <type/deleting> }
    `;return{is_deleted:(await $(i)).boolean||!1}},async load_forward_id_if_exists(e,i){let t=`
      ${O}
      PREFIX dcterms: <http://purl.org/dc/terms/>
      SELECT ?fwd_id WHERE {
        <object/${e}> crm:P67i_is_referred_to_by / crm:P93i_was_taken_out_of_existence_by / dcterms:isReplacedBy ?fwd_id .
      }
    `;try{let r=await $(t,i);return v(r,{forward_iri:"fwd_id"})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_title(e,i,t){let r=`
        ${O}
        SELECT DISTINCT * WHERE {
            BIND (${e} as ?id)
            # title 
            <object/${e}> crm:P1_is_identified_by ?title .
            ?title a crm:E41_Appellation .
            ?title crm:P190_has_symbolic_content ?title_text .
            ?title crm:P2_has_type  ?title_type .
            ?title_type rdfs:label ?title_type_label .
            FILTER (lang(?title_type_label) = "${i}")
            OPTIONAL {
              ?title crm:P141i_was_assigned_by / crm:P16_used_specific_object / crm:P1_is_identified_by / crm:P190_has_symbolic_content ?source . 
            }
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",title:[{value:"title_text",type:"title_type",type_label:"title_type_label",sources:[{name:"source"}]}]})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_preferred_title(e,i,t){var a;let r=`
    ${O}
    SELECT DISTINCT ?title_text WHERE {
      <object/${e}> crm:P1_is_identified_by ?title .
      ?title crm:P2_has_type <type/preferred_title> .
      ?title crm:P190_has_symbolic_content ?title_text .
      FILTER (lang(?title_text) = "${i}")
    }`;try{return(a=(await $(r,{signal:t})).results.bindings[0])==null?void 0:a.title_text.value}catch(c){if(c.name=="AbortError")return null;throw c}},async get_custody(e,i,t){let r=`
        ${O}
        SELECT DISTINCT 
          ?id ?acqui_type ?location_name ?acqui_custody_gnd ?acqui_custody ?acqui_dating_begin ?acqui_dating_end ?acqui_date_note ?acqui_context ?inv_no_id ?inv_no 
          WHERE {
            BIND (${e} as ?id)
            # acquisition 
            <object/${e}> crm:P30i_custody_transferred_through ?custody_transfer . 
  			    ?custody_transfer crm:P2_has_type <type/acquisition> .
    		    ?custody_transfer crm:P29_custody_received_by ?acqui_custody .
            ?acqui_custody crm:P1_is_identified_by / crm:P190_has_symbolic_content ?location_name .
            OPTIONAL {
              ?acqui_custody owl:sameAs ?acqui_custody_gnd .
            }

            OPTIONAL {
              ?custody_transfer crm:P2_has_type ?t .
              ?t rdfs:label  ?acqui_type .
              FILTER NOT EXISTS {?t owl:sameAs ?x}
              FILTER (lang(?acqui_type) = "${i}") 
            }
    
            OPTIONAL {
              ?custody_transfer crm:P4_has_time-span ?time_span .
              ?time_span crm:P82a_begin_of_the_beginning ?acqui_dating_begin .
              ?time_span crm:P82b_end_of_the_end ?acqui_dating_end .
            }
            OPTIONAL {
              ?custody_transfer crm:P4_has_time-span / crm:P3_has_note ?acqui_date_note .
            }
    
            OPTIONAL{ 
              ?custody_transfer crm:P3_has_note ?acqui_context .
            }
    
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",custody:{type:"acqui_type",location:{name:"location_name",iri:"acqui_custody",gnd:"acqui_custody_gnd"},dating:{from_date:"acqui_dating_begin",to_date:"acqui_dating_end",text:"acqui_date_note"},note:"acqui_context"}})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_provenances(e,i){let t=`
      ${O}
      SELECT ?id ?prov ?prov_note ?place ?place_name ?place_gnd ?custodian_name ?custodian ?custodian_type ?custodian_gnd ?dating WHERE {
        BIND (${e} as ?id)

        <object/${e}> crm:P30i_custody_transferred_through ?prov .
        ?prov crm:P2_has_type <type/provenance> .
        OPTIONAL { 
          ?prov crm:P3_has_note ?prov_note .
        }
        
        OPTIONAL { 
          ?prov crm:P9_consists_of ?move .
          ?move crm:P26_moved_to|crm:P27_moved_from ?place .
          ?place crm:P1_is_identified_by / crm:P190_has_symbolic_content ?place_name .
          OPTIONAL {
            ?place owl:sameAs ?place_gnd .
          }
        }
        
        OPTIONAL { 
          ?prov crm:P29_custody_received_by|crm:P28_custody_surrendered_by ?custodian .
          ?custodian a ?crm_type .
          BIND( if( ?crm_type = crm:E21_Person, "person", "actor") as ?custodian_type ) .
          ?custodian crm:P1_is_identified_by / crm:P190_has_symbolic_content ?custodian_name .
          OPTIONAL {
            ?custodian owl:sameAs ?custodian_gnd .
          }
        } 
        
        OPTIONAL { 
          ?prov crm:P175_starts_before_or_with_the_start_of|crm:P175i_starts_after_or_with_the_start_of ?prov_date .
          ?prov_date crm:P4_has_time-span / crm:P82a_begin_of_the_beginning ?dating 
        }
        
      } ORDER BY ?dating
    `;try{let r=await $(t,{signal:i});return v(r,{id:"id",provenances:[{iri:"prov",note:"prov_note",place:{iri:"place",name:"place_name",gnd:"place_gnd"},custodian:{name:"custodian_name",type:"custodian_type",iri:"custodian",gnd:"custodian_gnd"},dating:{from_date:"dating",to_date:"dating"}}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_inventory_no(e,i){let t=`
    ${O}
    SELECT ?pref_inv_no ?inv_no_id ?inv_no WHERE {
      <object/${e}> crm:P48_has_preferred_identifier ?pref_inv_no_id .
      ?pref_inv_no_id a crm:E42_Identifier . 
      ?pref_inv_no_id crm:P190_has_symbolic_content ?pref_inv_no .
      OPTIONAL { 
        <object/${e}> crm:P1_is_identified_by ?inv_no_id .
        ?inv_no_id a crm:E42_Identifier . 
        ?inv_no_id crm:P190_has_symbolic_content ?inv_no . 
      }
    }`;try{let r=await $(t,{signal:i});return v(r,{cur_inv_no:"pref_inv_no",old_inv_nos:[{inv_id:"inv_no_id",inv_no:"inv_no"}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_location(e,i){let t=`
    ${O}
    SELECT DISTINCT ?id ?location ?location_name ?location_gnd WHERE {
      BIND (${e} as ?id)
      # location 
      <object/${e}> crm:P55_has_current_location ?location .
      ?location crm:P1_is_identified_by / crm:P190_has_symbolic_content ?location_name .
      OPTIONAL {
        ?location owl:sameAs ?location_gnd .
      }
    }`;try{let r=await $(t,{signal:i});return v(r,{id:"id",location:{iri:"location",name:"location_name",gnd:"location_gnd"}})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_production(e,i,t){let r=`
        ${O}
        SELECT DISTINCT 
          ?id ?prod_note 
          ?date_from ?date_to ?date_note 
          ?artist ?artist_name ?artist_attribution_label ?artist_role ?artist_gnd
          ?place ?place_name ?place_gnd
          ?prod_technique_name ?prod_technique_gnd 
          ?commission_date_from ?commission_date_to ?commission_date_note 
          ?commissioner ?commissioner_name ?commissioner_gnd ?commission_note
          ?technic
        WHERE {
            BIND (${e} as ?id)
            # production 
            <object/${e}> crm:P108i_was_produced_by ?production .
            OPTIONAL {
              ?production crm:P3_has_note ?prod_note .
            }
            OPTIONAL { 
              ?production crm:P4_has_time-span / crm:P82a_begin_of_the_beginning ?date_from .
              ?production crm:P4_has_time-span / crm:P82b_end_of_the_end ?date_to .
            }
            OPTIONAL {
              ?production crm:P4_has_time-span / crm:P3_has_note ?date_note .
            }
            OPTIONAL {
              ?production crm:P01i_is_domain_of ?artist_in_role .
              ?artist_in_role crm:P02_has_range ?artist .
              ?artist crm:P1_is_identified_by / crm:P190_has_symbolic_content  ?artist_name .
              ?artist_in_role crm:P14.1_in_the_role_of / rdfs:label  ?artist_role .
              FILTER (lang(?artist_role) = "${i}")
              OPTIONAL {
                ?artist owl:sameAs ?artist_gnd .
              }
              OPTIONAL {
                ?artist crm:P141i_was_assigned_by ?assessment .
                ?assessment crm:P140_assigned_attribute_to ?production ;
                          crm:P2_has_type / rdfs:label ?artist_attribution_label .
                FILTER (lang(?artist_attribution_label) = "${i}")
              }
            }
            OPTIONAL {
              ?production crm:P7_took_place_at ?place . 
              ?place crm:P1_is_identified_by / crm:P190_has_symbolic_content ?place_name .
              OPTIONAL {
                ?place owl:sameAs ?place_gnd .
              }
            }
            OPTIONAL {
              ?production crm:P32_used_general_technique ?technic .
              ?technic rdfs:label ?prod_technique_name .
              OPTIONAL {
                ?technic owl:sameAs ?prod_technique_gnd .
              }
              FILTER (lang(?prod_technique_name) = "${i}")
            }
            OPTIONAL {
              ?production crm:P17_was_motivated_by ?motivation .
                OPTIONAL { ?motivation crm:P3_has_note  ?commission_note . }
                OPTIONAL {
                    ?motivation crm:P01i_is_domain_of / crm:P02_has_range ?commissioner .
                    ?commissioner crm:P1_is_identified_by / crm:P190_has_symbolic_content  ?commissioner_name .
                    ?commissioner owl:sameAs ?commissioner_gnd .
                }
                OPTIONAL { 
                    ?motivation crm:P4_has_time-span / crm:P82a_begin_of_the_beginning ?commission_date_from .
                    ?motivation crm:P4_has_time-span / crm:P82b_end_of_the_end ?commission_date_to .
                }
                OPTIONAL {
                    ?motivation crm:P4_has_time-span / crm:P3_has_note ?commission_date_note .
                }
            } 
        }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",production:{prod_note:"prod_note",dating:{from_date:"date_from",to_date:"date_to",text:"date_note"},artists:[{iri:"artist",name:"artist_name",role:"artist_role",attribution:"artist_attribution_label",gnd:"artist_gnd"}],locations:[{iri:"place",name:"place_name",gnd:"place_gnd"}],technics:[{iri:"technic",name:"prod_technique_name",gnd:"prod_technique_gnd"}],commission:{dating:{from_date:"commission_date_from",to_date:"commission_date_to",text:"commission_date_note"},commissioner:[{iri:"commissioner",name:"commissioner_name",gnd:"commissioner_gnd"}],note:"commission_note"}}})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_depiction_method(e,i,t){let r=`
        ${O}
        SELECT DISTINCT ?mode ?mode_label WHERE {
          <object/${e}> crm:P01i_is_domain_of ?depicts .
          ?depicts a crm:PC62_depicts .
          ?depicts crm:P62.1_mode_of_depiction ?mode .
          ?mode rdfs:label ?mode_label .
          FILTER (lang(?mode_label) = "${i}")
          } ORDER BY ?mode_label`;try{let a=await $(r,{signal:t});const c=v(a,{modes:[{iri:"mode",name:"mode_label"}]});return c.id=e,c}catch(a){if(a.name=="AbortError")return null;throw a}},async get_depiction_content(e,i,t){let r=`
    ${O}
    SELECT DISTINCT * WHERE {
      <object/${e}> crm:P62_depicts ?depiction .
      ?depiction a ?type_of_depicted_object .
      ?depiction crm:P1_is_identified_by / crm:P190_has_symbolic_content  ?depicted_object_name .
      OPTIONAL {
        ?depiction owl:sameAs ?gnd
      }	
    }`;try{let a=await $(r,{signal:t});const c=v(a,{depictions:[{iri:"depiction",gnd:"gnd",type:"type_of_depicted_object",name:"depicted_object_name"}]});return c.id=e,c}catch(a){if(a.name=="AbortError")return null;throw a}},async get_materials(e,i,t){let r=`
        ${O}
        SELECT DISTINCT ?id ?mat_label ?mat_gnd ?material WHERE {
            BIND (${e} as ?id)
            # material 
            <object/${e}> crm:P45_consists_of ?material .
            ?material rdfs:label ?mat_label .
            FILTER (lang(?mat_label) = "${i}")
            OPTIONAL {
              ?material owl:sameAs ?mat_gnd
            }	
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",materials:[{iri:"material",name:"mat_label",gnd:"mat_gnd"}]})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_descriptions(e,i,t="description",r){let a=`
        ${O}
        SELECT ?id ?type_label ?comment ?comment_lang ?name_label ?url WHERE {
          BIND (${e} as ?id)
          <object/${e}/${t}>  crm:P2_has_type  / rdfs:label ?type_label .
           FILTER (lang(?type_label) = "${i}")
           <object/${e}/${t}> crm:P190_has_symbolic_content ?comment .
           BIND(lang(?comment) AS ?comment_lang)
           OPTIONAL {
               <object/${e}/${t}> crm:P141i_was_assigned_by / crm:P16_used_specific_object  ?source_base .
               BIND(IRI(CONCAT(STR(?source_base), '/name')) AS ?name_iri)
               BIND(IRI(CONCAT(STR(?source_base), '/url')) AS ?url_iri)
               OPTIONAL { ?name_iri crm:P190_has_symbolic_content ?name_label . }
               OPTIONAL { ?url_iri crm:P190_has_symbolic_content ?url . }
               
           }
          }`;try{let c=await $(a,{signal:r});return v(c,{id:"id",descriptions:[{type:"type_label",note:"comment",language:"comment_lang",assignments:[{name:"name_label",link:{uri:"url"}}]}]})}catch(c){if(c.name=="AbortError")return null;throw c}},async get_condition(e,i,t){let r=`
        ${O}
        SELECT DISTINCT ?id ?condition ?condition_source ?web_link_text ?web_link_url WHERE {
            BIND (${e} as ?id)
            # condition 
            <object/${e}/condition> crm:P3_has_note ?condition .
            FILTER (lang(?condition) = "${i}")
            OPTIONAL {
              <object/${e}/condition/assessment> crm:P3_has_note ?condition_source .
            }
            OPTIONAL {
              <object/${e}/condition/assessment/reference/name> crm:P190_has_symbolic_content ?web_link_text .
              <object/${e}/condition/assessment/reference/url> crm:P190_has_symbolic_content ?web_link_url .
            }
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",condition:{note:"condition",source_note:"condition_source",source:{name:"web_link_text",uri:"web_link_url"}}})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_measurements(e,i,t){let r=`
        ${O}
        SELECT ?id ?meas_id ?val ?unit_name ?symbol ?type_label ?dim_descr
        (GROUP_CONCAT(?note;SEPARATOR=",") AS ?notes)
         WHERE {
          BIND (${e} as ?id)
          <object/${e}> crm:P39i_was_measured_by ?meas .
          BIND (STRAFTER(STR(?meas), 'measurements/') as ?meas_id)
          ?meas crm:P40_observed_dimension ?dim .
          OPTIONAL { ?meas crm:P3_has_note ?note . }
          OPTIONAL { ?dim rdfs:label ?dim_descr . }
          OPTIONAL {
            ?dim crm:P90_has_value ?val .
            ?dim crm:P2_has_type / rdfs:label ?type_label .
            ?dim crm:P91_has_unit ?dim_unit . 
            ?dim_unit rdfs:label ?unit_name .
            OPTIONAL { ?dim_unit crm:P48_has_preferred_identifier / crm:P190_has_symbolic_content ?symbol . }
            FILTER (lang(?unit_name) = "${i}")
            FILTER (lang(?type_label) = "${i}")
          }
         } 
         GROUP BY ?meas_id ?type_label ?val ?unit_name ?symbol ?dim_descr ?id
         ORDER BY ?type_label`;try{let a=await $(r,{signal:t}),c=v(a,{id:"id",measurements:[{id:"meas_id",type:"type_label",value:"val",unit:"unit_name",unit_symbol:"symbol",descr:"dim_descr",notes:"notes"}]});if(!c.measurements)return c;let m=[];for(let p of c.measurements){let b=m.find(f=>f.id==p.id);b||(b={id:p.id,measures:[],notes:p.notes},m.push(b)),delete p.id,delete p.notes,b.measures.push({...p})}return c.measurements=m,c}catch(a){if(a.name=="AbortError")return null;throw a}},async get_inscriptions(e,i){let t=`
        ${O}
        SELECT ?id ?insc_text ?descr_note_text ?pos_note_text WHERE {
            BIND (${e} as ?id)
            # inscriptions 
            <object/${e}> crm:P128_carries ?insc .
            ?insc crm:P190_has_symbolic_content ?insc_text .
            BIND(IRI(CONCAT(STR(?insc), '/description')) AS ?descr_note) 
                BIND(IRI(CONCAT(STR(?insc), '/position')) AS ?pos_note) 
                OPTIONAL{
              ?descr_note crm:P190_has_symbolic_content ?descr_note_text .
            }
            OPTIONAL {
              ?pos_note crm:P190_has_symbolic_content ?pos_note_text .
            }	
          }`;try{let r=await $(t,{signal:i});return v(r,{id:"id",inscriptions:[{text:"insc_text",descr_text:"descr_note_text",pos_text:"pos_note_text"}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_types(e,i,t){let r=`
        ${O}
        SELECT DISTINCT ?id ?type ?type_label ?type_gnd ?type_type ?type_type_label WHERE {
            BIND (${e} as ?id)
            # types 
            <object/${e}> crm:P2_has_type ?type . 
            ?type rdfs:label ?type_label .
            ?type crm:P2_has_type ?type_type .
            OPTIONAL {
              ?type owl:sameAs ?type_gnd .
            }
            ?type_type rdfs:label ?type_type_label .
            FILTER (lang(?type_label) = "${i}")
            FILTER (lang(?type_type_label) = "${i}")
            FILTER(?type_type in (<type/classification>, <type/object_type>))
          } ORDER BY ?type_type ?type_label`;try{let a=await $(r,{signal:t});return v(a,{id:"id",types:[{iri:"type",name:"type_label",gnd:"type_gnd",type_of_type_iri:"type_type",type_of_type:"type_type_label"}]})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_modifications(e,i,t){let r=`
        ${O}
        SELECT DISTINCT ?id ?mod ?note ?date_from ?date_to ?date_note 
          ?artist ?artist_name ?artist_role ?artist_gnd ?artist_attribution_label
          ?technique ?technique_name ?technique_gnd 
          ?mat_label ?mat_gnd 
        WHERE {
            BIND (${e} as ?id) 
            # inscriptions 
            <object/${e}> crm:P31i_was_modified_by ?mod  .
            ?mod a crm:E11_Modification .
            OPTIONAL {
              ?mod crm:P4_has_time-span ?dating
              OPTIONAL { 
                ?dating crm:P82a_begin_of_the_beginning ?date_from .
                ?dating crm:P82b_end_of_the_end ?date_to .
              }
              OPTIONAL {
                ?dating crm:P3_has_note ?date_note .
              }
            }
            OPTIONAL {
              ?mod crm:P3_has_note ?note
              FILTER (lang(?note) = "${i}")
            }
            OPTIONAL {
              ?mod crm:P01i_is_domain_of ?artist_in_role .
              ?artist_in_role crm:P02_has_range ?artist .
              ?artist crm:P1_is_identified_by / crm:P190_has_symbolic_content  ?artist_name .
              ?artist_in_role crm:P14.1_in_the_role_of / rdfs:label  ?artist_role .
              FILTER (lang(?artist_role) = "${i}")
              OPTIONAL {
                ?artist owl:sameAs ?artist_gnd
              }
              OPTIONAL {
                ?artist crm:P141i_was_assigned_by ?assessment .
                ?assessment crm:P140_assigned_attribute_to ?mod ;
                          crm:P2_has_type / rdfs:label ?artist_attribution_label .
                FILTER (lang(?artist_attribution_label) = "${i}")
              }
            }
            OPTIONAL {
              ?mod crm:P32_used_general_technique ?technique .
              ?technique rdfs:label ?technique_name .
              FILTER (lang(?technique_name) = "${i}")
              OPTIONAL {
                ?technique owl:sameAs ?technique_gnd .
              }
            }
            OPTIONAL {
              ?mod crm:P126_employed ?material .
              ?material rdfs:label ?mat_label .
                  FILTER (lang(?mat_label) = "${i}")
                  OPTIONAL {
                    ?material owl:sameAs ?mat_gnd
                  }	
            }
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",modifications:[{id:"mod",note:"note",dating:{from_date:"date_from",to_date:"date_to",text:"date_note"},artists:[{iri:"artist",name:"artist_name",role:"artist_role",attribution:"artist_attribution_label",gnd:"artist_gnd"}],technics:[{iri:"technique",name:"technique_name",gnd:"technique_gnd"}],materials:[{iri:"material",name:"mat_label",gnd:"mat_gnd"}]}]})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_find(e,i,t){let r=`
        ${O}
          SELECT DISTINCT 
            ?id ?note 
            ?date_from ?date_to ?date_note
            ?artist ?artist_name ?artist_role ?artist_gnd
            ?place ?place_name ?place_gnd
          WHERE {
            BIND (${e} as ?id)
            <object/${e}/find> a crm:S19_Encounter_Event .
            OPTIONAL {
              <object/${e}/find> crm:P3_has_note ?note .
            }
            OPTIONAL {
              <object/${e}/find> crm:P7_took_place_at ?place .
              ?place crm:P1_is_identified_by / crm:P190_has_symbolic_content ?place_name .
              OPTIONAL {
                ?place owl:sameAs ?place_gnd .
              }
            } 
            OPTIONAL { 
              <object/${e}/find/dating> crm:P82a_begin_of_the_beginning ?date_from .
                <object/${e}/find/dating> crm:P82b_end_of_the_end ?date_to .
            }
            OPTIONAL {
                <object/${e}/find/dating> crm:P3_has_note ?date_note .
            }
            OPTIONAL {
                <object/${e}/find> crm:P01i_is_domain_of ?artist_in_role .
                ?artist_in_role crm:P02_has_range ?artist .
                ?artist crm:P1_is_identified_by / crm:P190_has_symbolic_content  ?artist_name .
                ?artist_in_role crm:P14.1_in_the_role_of / rdfs:label  ?artist_role .
                FILTER (lang(?artist_role) = "${i}")
                OPTIONAL {
                  ?artist owl:sameAs ?artist_gnd .
                }
            }
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",find:{note:"note",dating:{from_date:"date_from",to_date:"date_to",text:"date_note"},artists:[{iri:"artist",name:"artist_name",role:"artist_role",gnd:"artist_gnd"}],location:{iri:"place",name:"place_name",gnd:"place_gnd"}}})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_external_reference(e,i,t){let r=`
            ${O}
          SELECT DISTINCT ?id ?type_label ?link ?note WHERE {
            BIND (${e} as ?id)
            <object/${e}> crm:P01i_is_domain_of ?domain .
            ?domain crm:P67.1_has_type <type/external_reference> .
            ?domain crm:P02_has_range ?external_ref .
            ?external_ref crm:P190_has_symbolic_content ?link .
            ?external_ref crm:P3_has_note ?note .
            ?external_ref crm:P2_has_type /  rdfs:label ?type_label .
            FILTER (lang(?type_label) = "${i}")
          }`;try{let a=await $(r,{signal:t});return v(a,{id:"id",references:[{ref_type:"type_label",ref_source:"note",ref_link:"link"}]})}catch(a){if(a.name=="AbortError")return null;throw a}},async get_bibliographic_reference(e,i){let t=`
            ${O}
          SELECT DISTINCT ?id ?link ?bib_citation ?bib_note ?access_date WHERE {
            BIND (${e} as ?id)
            <object/${e}> crm:P01i_is_domain_of ?domain .
            ?domain crm:P67.1_has_type <type/bibliographic_reference> .
            ?domain crm:P02_has_range ?bib_ref .
            OPTIONAL { 
              ?bib_ref crm:P48_has_preferred_identifier ?pref_id .
              ?pref_id crm:P190_has_symbolic_content ?link . 
              OPTIONAL { 
                ?pref_id crm:P3_has_note ?bib_citation . 
              }
            }
            OPTIONAL { ?bib_ref crm:P3_has_note ?bib_note . }
            OPTIONAL { ?bib_ref crm:P94i_was_created_by / crm:P4_has_time_span / crm:P82_at_some_time_within ?access_date .}
            
          } ORDER BY  ?bib_ref ?bib_citation ?bib_note`;try{let r=await $(t,{signal:i});return v(r,{id:"id",bib_refs:[{bib_ref_note:"bib_note",access_date:{from:"access_date"},citation:"bib_citation",link:{uri:"link"}}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_dating_for_object(e,i){const t=`
      ${O}
      SELECT ?obj ?date_from ?date_to (count(?mid) as ?distance) 
      {
        VALUES ?obj {<${e}>}
        {
          ?obj crm:P108i_was_produced_by / crm:P4_has_time-span ?time . 
          ?time crm:P82a_begin_of_the_beginning ?date_from ;
                  crm:P82b_end_of_the_end ?date_to .

        } UNION {
          ?obj crm:P46i_forms_part_of* ?mid .
          ?mid crm:P46i_forms_part_of+ ?final .
          ?final crm:P108i_was_produced_by / crm:P4_has_time-span ?time .
          ?time crm:P82a_begin_of_the_beginning ?date_from;
                crm:P82b_end_of_the_end ?date_to .

        } 
      } 
      GROUP BY ?time ?date_from ?date_to ?obj
      ORDER BY ?distance
      LIMIT 1
    `;try{let r=await $(t,{signal:i});const a=v(r,{dating:{from:"date_from",to:"date_to"}});return a.obj=e,a}catch(r){if(r.name=="AbortError")return null;throw r}},async _get_internal_relations_base(e,i,t,r="?title"){let a=`
        ${O}
        SELECT ?id ?obj
        WHERE {
          BIND (${e} as ?id) 
          ${t}
          ?obj crm:P1_is_identified_by ?title_iri .
          ?title_iri crm:P2_has_type <type/preferred_title> ;
                     crm:P190_has_symbolic_content ?title .
        }
        ORDER BY  ${r}
    `;try{let c=await $(a,{signal:i});return v(c,{id:"id",relations:[{obj:"obj"}]})}catch(c){if(c.name=="AbortError")return null;throw c}},async get_depicted_relations(e,i){return this._get_internal_relations_base(e,i,`{ 
          
          ?depicts crm:P02_has_range  <object/${e}>.
          ?depicts a crm:PC62_depicts .
          ?obj crm:P01i_is_domain_of ?depicts .
          OPTIONAL { 
            ?obj  at:is_part_of_source_work / crm:P1_is_identified_by ?source_title_iri .
            ?source_title_iri crm:P2_has_type <type/preferred_title> ;
                            crm:P190_has_symbolic_content ?source_title . 
          }
        }`,"?source_title ?title")},async get_depicts_relations(e,i){return this._get_internal_relations_base(e,i,`
      <object/${e}> crm:P01i_is_domain_of ?depicts .
      ?depicts a crm:PC62_depicts .
      ?depicts crm:P02_has_range ?obj .
      ?obj a crm:E24_Physical_Human-Made_Thing .
      `)},async get_duplicate_relations(e,i){return this._get_internal_relations_base(e,i,`<object/${e}> crm:P01i_is_domain_of ?rel.
        ?rel crm:P130.1_kind_of_similarity <type/1641767> .
        ?rel crm:P02_has_range ?obj .
       
      `)},async get_has_version_relations(e,i){return this._get_internal_relations_base(e,i,`
      ?rel crm:P130.1_kind_of_similarity <type/object_version> .
      ?rel crm:P01_has_domain <object/${e}> .
      ?rel crm:P02_has_range ?obj .
      `)},async get_is_version_of_relations(e,i){return this._get_internal_relations_base(e,i,`
      ?rel crm:P130.1_kind_of_similarity <type/object_version> .
      ?rel crm:P01_has_domain ?obj .
      ?rel crm:P02_has_range <object/${e}> .
      `)},async get_has_copy_relations(e,i){return this._get_internal_relations_base(e,i,`
      ?copies crm:P16.1_mode_of_use <type/original> ; 
          crm:P02_has_range <object/${e}> ;
          crm:P01_has_domain ?production .
      ?production ^crm:P108i_was_produced_by ?obj .
      `)},async get_was_precursor_relations(e,i){return this._get_internal_relations_base(e,i,`
      ?copies crm:P16.1_mode_of_use <type/precursor> ; 
          crm:P02_has_range <object/${e}> ;
          crm:P01_has_domain  ?production .
      ?production ^crm:P108i_was_produced_by ?obj .
      `)},async get_is_copy_after_relations(e,i){return this._get_internal_relations_base(e,i,`
      ?source crm:P16.1_mode_of_use <type/original> ;
          crm:P02_has_range ?obj ;
          crm:P01_has_domain <object/${e}/production> .
      `)},async get_has_precursor_relations(e,i){return this._get_internal_relations_base(e,i,`
      ?source crm:P16.1_mode_of_use <type/precursor> ;
              crm:P02_has_range ?obj ;
              crm:P01_has_domain <object/${e}/production> .
      `)},async get_related_to_relations(e,i){return this._get_internal_relations_base(e,i,`
      <object/${e}> crm:P01i_is_domain_of ?rel.
      ?rel crm:P130.1_kind_of_similarity <type/1022295> .
      ?rel crm:P02_has_range ?obj .
      `)},async has_children(e,i){let t=`
      ${O}
      ASK  {
        <object/${e}> crm:P46_is_composed_of ?part .
      }
    `;try{let r=await $(t,{signal:i});return{id:e,children:r.boolean||!1}}catch(r){if(r.name=="AbortError")return null;throw r}},async get_thumbnails(e,i){let t=`
      ${O}
      SELECT ?thumbnail_urls WHERE {
        <object/${e}> crm:P138i_has_representation / crm:P165i_is_incorporated_in ?image .
        ?image crm:P2_has_type <type/thumbnail> .
        ?image crm:P1_is_identified_by / crm:P190_has_symbolic_content ?thumbnail_urls .
      }
    `;try{let r=await $(t,{signal:i});return v(r,{thumbnails:[{url:"thumbnail_urls"}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_children(e,i){let t=`
        ${O}
        SELECT ?id ?part ?title (SAMPLE(?thumbnail_urls) as ?thumbnail) (isIRI(SAMPLE(?sub_part)) AS ?has_child) 
        WHERE {
          BIND (${e} as ?id)
          <object/${e}> crm:P46_is_composed_of ?part .
               ?part crm:P1_is_identified_by ?title_iri .
               ?title_iri crm:P2_has_type <type/preferred_title> .
               ?title_iri crm:P190_has_symbolic_content ?title .
               OPTIONAL {
                    ?part crm:P46_is_composed_of+ ?sub_part .
                    ?sub_part crm:P1_is_identified_by ?sub_title_iri .
                    ?sub_title_iri crm:P2_has_type <type/preferred_title> .
                    ?sub_title_iri crm:P190_has_symbolic_content ?sub_title .
               }
               OPTIONAL {
                    ?part crm:P138i_has_representation ?vi . 

                    ?vi at:has_sorting_index "1"^^xsd:int ;
                        crm:P165i_is_incorporated_in ?image .
                        
                    ?image crm:P2_has_type <type/thumbnail> .
                    ?image crm:P1_is_identified_by / crm:P190_has_symbolic_content ?thumbnail_urls .
               }
         } GROUP BY ?part ?title ?id  
         ORDER BY ?title ?sub_title `;try{let r=await $(t,{signal:i});return v(r,{id:"id",children:[{iri:"part",title:"title",has_child:"has_child",images:[{url:"thumbnail"}]}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_related_artefacts(e,i){let t=`
        ${O}
        SELECT DISTINCT ?id ?artefact WHERE {
          BIND (${e} as ?id)
          <object/${e}> crm:P46_is_composed_of+ ?part .
          ?part crm:P01i_is_domain_of ?depicts .
          ?depicts a crm:PC62_depicts .
          ?depicts crm:P02_has_range ?artefact .
          ?artefact a crm:E24_Physical_Human-Made_Thing .
         } `;try{let r=await $(t,{signal:i});return v(r,{id:"id",artefacts:["artefact"]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_cataloging_data(e,i){let t=`
      ${O}
      PREFIX dcterms: <http://purl.org/dc/terms/>
      SELECT ?id ?editor_name ?note ?dating  ?license_name ?license_iri ?type
      WHERE {
        BIND (${e} as ?id)
        {
          <object/${e}/cataloging> crm:P94i_was_created_by ?cat .
          ?cat crm:P2_has_type <type/cataloging> .
          BIND('creation' as ?type)

        } UNION {
          <object/${e}/cataloging> crm:P140i_was_attributed_by ?cat .
          ?cat crm:P2_has_type <type/cataloging> .
          BIND('editing' as ?type)
          
        } UNION {
          <object/${e}/cataloging> crm:P93i_was_taken_out_of_existence_by ?cat .
          ?cat crm:P2_has_type <type/deleting> .
          BIND('deleted' as ?type)
          
        }
        
        ?cat crm:P01i_is_domain_of / crm:P02_has_range ?editors .
        ?editors crm:P1_is_identified_by / crm:P190_has_symbolic_content ?editor_name .
        OPTIONAL {
          ?cat crm:P3_has_note ?note .
        }
        OPTIONAL {
          ?cat crm:P4_has_time-span / crm:P82a_begin_of_the_beginning ?dating .
        }
        OPTIONAL {
              <object/${e}/cataloging/right> crm:P2_has_type / rdfs:label ?license_name .
              <object/${e}/cataloging/right> dcterms:license ?license_iri.
        }
      } 
      ORDER BY ?dating
  
    `;try{let r=await $(t,{signal:i});return v(r,{id:"id",cataloging:[{rightholder:"editor_name",note:"note",dating:{from_date:"dating",to_date:"dating"},license:{name:"license_name",uri:"license_iri"}}]})}catch(r){if(r.name=="AbortError")return null;throw r}},async get_image_data(e,i){let t=`
        ${O}
        SELECT 
          ?id ?image_url ?iiif_url ?rotation_value ?representation_id ?representation
          ?area_iri ?area_width_value ?area_height_value 
          ?area_horizontal_offset_value ?area_vertical_offset_value ?area_rotation_value
        WHERE {
          BIND (${e} as ?id)
          <object/${e}> crm:P138i_has_representation | crm:P138i_has_representation / crm:P106i_forms_part_of ?representation .
        OPTIONAL {
          <object/${e}> crm:P138i_has_representation / crm:P106i_forms_part_of ?base_representation
        }
        FILTER (BOUND(?base_representation) = False || (?representation IN (?base_representation)))	

        ?representation ^crm:P138i_has_representation ?representation_id .

        ?representation crm:P165i_is_incorporated_in ?digital_image . 
        ?digital_image crm:P2_has_type <type/digital_image> .
        ?digital_image crm:P1_is_identified_by / crm:P190_has_symbolic_content ?image_url .

        OPTIONAL {
          ?representation crm:P165i_is_incorporated_in ?iiif_image . 
          ?iiif_image crm:P2_has_type <type/iiif_image> .
          ?iiif_image crm:P1_is_identified_by / crm:P190_has_symbolic_content ?iiif_url .
          ?iiif_image crm:P43_has_dimension ?rotation .
          ?rotation crm:P2_has_type <type/rotation> .
          ?rotation crm:P90_has_value ?rotation_value .
          
          OPTIONAL {
            ?iiif_image crm:L50i_has_propagated_area ?area .
            ?area ^crm:P165i_is_incorporated_in / ^crm:P138i_has_representation ?area_iri .
      
            # area height
            ?area crm:P43_has_dimension ?area_height .
            ?area_height crm:P2_has_type <type/height> .
            ?area_height crm:P90_has_value ?area_height_value .
      
            # area width
            ?area crm:P43_has_dimension ?area_width .
            ?area_width crm:P2_has_type <type/width> .
            ?area_width crm:P90_has_value ?area_width_value .
      
            # area horizontal offset
            ?area crm:P43_has_dimension ?area_horizontal_offset .
            ?area_horizontal_offset crm:P2_has_type <type/horizontal_offset> .
            ?area_horizontal_offset crm:P90_has_value ?area_horizontal_offset_value .
      
            # area vertical offset
            ?area crm:P43_has_dimension ?area_vertical_offset .
            ?area_vertical_offset crm:P2_has_type <type/vertical_offset> .
            ?area_vertical_offset crm:P90_has_value ?area_vertical_offset_value .
            
            # area rotation
            ?area crm:P43_has_dimension ?area_rotation .
            ?area_rotation crm:P2_has_type <type/rotation> .
            ?area_rotation crm:P90_has_value ?area_rotation_value .
          }
        }
      }
      `;try{let r=await $(t,{signal:i}),a=v(r,{id:"id",images:[{image_url:"image_url",iiif_url:"iiif_url",rotation:"rotation_value",object_iri:"representation_id",image_iri:"representation",areas:[{area_iri:"area_iri",width:"area_width_value",height:"area_height_value",h_offset:"area_horizontal_offset_value",v_offset:"area_vertical_offset_value",rotation:"area_rotation_value"}]}]});if("images"in a){let c={};for(let m of a.images)m.image_url in c?c[m.image_url].areas.push(m.areas[0]):c[m.image_url]=m;return{id:a.id,images:Object.values(c)}}else return null}catch(r){if(r.name=="AbortError")return null;throw r}},async get_image_meta(e,i,t,r=null){let a=`
      ${O}
      SELECT ?id ?credit_line ?right_name ?artist_name ?artist_role ?artist_gnd_url ?perspective ?dating ?rightholder ?ref_name ?ref_url WHERE {
        BIND (${e} as ?id)
        OPTIONAL {
          <${i}> crm:P104_is_subject_to ?right .
          OPTIONAL { ?right crm:P3_has_note ?credit_line. }
          ?right crm:P2_has_type / rdfs:label ?right_name .
          OPTIONAL {
            ?right  crm:P75i_is_possessed_by / crm:P1_is_identified_by / crm:P190_has_symbolic_content ?rightholder .
          }
        }
        OPTIONAL {
          <${i}> crm:P94i_was_created_by ?creation .
          ?creation crm:P01i_is_domain_of ?artist_in_role .
          ?artist_in_role crm:P02_has_range ?artist .
          OPTIONAL { ?artist owl:sameAs ?artist_gnd_url . }
          ?artist crm:P1_is_identified_by / crm:P190_has_symbolic_content  ?artist_name .
          ?artist_in_role crm:P14.1_in_the_role_of / rdfs:label  ?artist_role .
          FILTER (lang(?artist_role) = "${t}")
          OPTIONAL {
            ?creation crm:P4_has_time-span / crm:P82_at_some_time_within ?dating .
          }
          OPTIONAL {
            ?creation crm:P67i_is_referred_to_by ?reference .
      		  BIND( IRI(CONCAT(str(?reference), '/name' )) AS ?ref_name_iri )
      		  BIND( IRI(CONCAT(str(?reference), '/url' )) AS ?ref_url_iri )		
      		  ?ref_name_iri crm:P190_has_symbolic_content ?ref_name .
      		  ?ref_url_iri crm:P190_has_symbolic_content ?ref_url .
          }
        }
        OPTIONAL {
          <${i}/perspective> crm:P190_has_symbolic_content ?perspective .
        } 
      }`;try{let c=await $(a,{signal:r}),m=v(c,{id:"id",meta:{legal_status:{credit_line:"credit_line",license:"right_name",rightholder:"rightholder",dating:{from_date:"dating",to_date:"dating"},link:{name:"ref_name",uri:"ref_url"}},perspective:"perspective",artists:[{name:"artist_name",role:"artist_role",gnd:"artist_gnd_url"}]}});return JSON.stringify(m.meta)==JSON.stringify({artists:[]})?null:m}catch(c){if(c.name=="AbortError")return null;throw c}},async get_parents_path(e,i=null){let t=`
      ${O}
      SELECT ?id ?path_title ?parent_id (COUNT(?mid) as ?distance) 
      WHERE {
        BIND (${e} as ?id)
        <object/${e}> crm:P46i_forms_part_of* ?mid .
        ?mid a crm:E24_Physical_Human-Made_Thing .
        ?mid crm:P46i_forms_part_of+ ?final .
        ?final a crm:E24_Physical_Human-Made_Thing .
        ?final crm:P1_is_identified_by ?title_path_iri .
        ?title_path_iri crm:P2_has_type <type/preferred_title> .
        ?title_path_iri crm:P190_has_symbolic_content ?path_title .
        BIND(STRAFTER( STR(?final), "object/" ) as ?parent_id) .
      } 
      GROUP BY ?path_title ?parent_id ?id
      ORDER BY DESC(?distance)`;try{let r=await $(t,{signal:i});return v(r,{id:"id",path:[{title:"path_title",objectId:"parent_id"}]})}catch(r){if(r.name=="AbortError")return null;throw r}}},Te={components:{Anchor:M,Dating:B},props:{data:{type:Object,default:()=>{}},link:{type:Boolean,default:!0}},computed:{has_living_dates:function(){return"details"in this.data&&this.data.details&&("dateOfBirth"in this.data.details||"dateOfDeath"in this.data.details)}}},we={key:0},Le={key:0},Ne={key:0},Ae={key:1},Re={key:2};function xe(e,i,t,r,a,c){const m=y("Dating"),p=y("Anchor");return t.data?(n(),_("span",we,[V(e.$slots,"default"),c.has_living_dates?(n(),_("span",Le,[j(" ( "),"dateOfBirth"in t.data.details?(n(),_("span",Ne,[o(m,{data:{from_date:t.data.details.dateOfBirth},year_only:!0},null,8,["data"])])):d("",!0),"dateOfBirth"in t.data.details&&"dateOfDeath"in t.data.details?(n(),_("span",Ae,"–")):d("",!0),"dateOfDeath"in t.data.details?(n(),_("span",Re,[o(m,{data:{from_date:t.data.details.dateOfDeath},year_only:!0},null,8,["data"])])):d("",!0),j(" ) ")])):d("",!0),t.link&&t.data.uri?(n(),u(p,{key:1,url:t.data.uri,sup:""},{default:s(()=>[j("GND")]),_:1},8,["url"])):d("",!0)])):d("",!0)}const Se=w(Te,[["render",xe]]),Ce={components:{LegalStatus:ee,ExternalResource:Se},props:{iri:{type:String,default:""},objectId:{type:Number,default:0}},data(){return{meta_data:null}},watch:{iri(){this.reset_data(),this.load_from_ts()}},created(){this.load_from_ts()},methods:{load_from_ts(){this.iri&&N.get_image_meta(this.objectId,this.iri,this.$i18n.locale).then(e=>{e&&e.meta&&e.id==this.objectId&&(this.meta_data=e.meta)})},reset_data(){this.meta_data=null},artist_row_padding(e){return e+1<this.meta_data.artists.length||this.meta_data.legal_status?"":"pb-4"}}},De={key:0,class:"pa-3 pt-0 image-meta"};function qe(e,i,t,r,a,c){const m=y("ExternalResource"),p=y("legal-status");return a.meta_data?(n(),_("div",De,[a.meta_data.perspective||a.meta_data.authors&&a.meta_data.authors.length||a.meta_data.legal_status?(n(),u(R,{key:0,class:"py-2"})):d("",!0),a.meta_data.perspective?(n(),u(g,{key:1,dense:""},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[j(h(a.meta_data.perspective),1)]),_:1})]),_:1})):d("",!0),a.meta_data.artists&&a.meta_data.artists.length?(n(!0),_(E,{key:2},T(a.meta_data.artists,(b,f)=>(n(),u(g,{key:"artist"+f,dense:"",align:"center"},{default:s(()=>[o(l,{cols:"3"},{default:s(()=>[P("h5",null,h(b.role)+":",1)]),_:2},1024),o(l,{cols:"9",class:""},{default:s(()=>[o(m,{data:b},{default:s(()=>[j(h(b.name),1)]),_:2},1032,["data"])]),_:2},1024)]),_:2},1024))),128)):d("",!0),a.meta_data.legal_status?(n(),u(p,{key:3,data:a.meta_data.legal_status,headline:"","is-creation":"",cols:[3,9]},null,8,["data"])):d("",!0)])):d("",!0)}const Be=w(Ce,[["render",qe],["__scopeId","data-v-5488552d"]]),Fe={name:"ImageSection",components:{ImageMeta:Be,ImageViewer:ie,PlaceHolderImage:ge,LoadingSpinner:Pe},inject:["parent_ac"],props:{objectId:{type:Number,required:!0,default:0},maxWidth:{type:Number,default:null},imageHeight:{type:String,default:"430"},hideMetadata:{type:Boolean,default:!1},comparisonPage:{type:Boolean,default:!1,required:!1}},data(){return{image_data:[],loading:!0,image_index:0}},computed:{all_object_ids(){let e=[];if(this.image_data)for(let i of this.image_data){e.push(i.objectId);for(let t of i.areas)e.push(t.objectId)}return e},image_meta_iri(){return this.image_data&&this.image_data.length&&this.image_data[this.image_index]?this.image_data[this.image_index].image_iri:null}},watch:{async objectId(e){this.all_object_ids.includes(e)||(this.loading=!0,await this.load_image_data(),this.image_index=0,this.loading=!1)}},async created(){await this.load_image_data(),this.loading=!1},methods:{async load_image_data(){this.image_data=[];let e=await N.get_image_data(this.objectId,this.parent_ac.signal);e&&e.id==this.objectId&&(this.image_data=e.images),this.image_data&&(this.image_data.forEach(i=>i.rotation=parseInt(i.rotation)||0),this.image_data.forEach(i=>i.objectId=this.iri_to_id(i.object_iri)),this.image_data.forEach(i=>i.areas.forEach(t=>t.objectId=this.iri_to_id(t.area_iri))),this.image_data.forEach(i=>i.areas=this.calculate_z_index(i.areas)))},iri_to_id(e){return+e.split("/").slice(-1)[0]},calculate_z_index(e){return e.forEach(i=>i.area=i.width*i.height),e.sort((i,t)=>t.area-i.area),e.forEach((i,t)=>i.z_index=t),e}}},He={key:1};function Me(e,i,t,r,a,c){const m=y("LoadingSpinner"),p=y("ImageViewer"),b=y("ImageMeta"),f=y("PlaceHolderImage");return n(),u(Q,{variant:"outlined",rounded:"","min-height":t.imageHeight},{default:s(()=>[a.loading?(n(),u(m,{key:0,style:J(`height:${t.imageHeight}px !important`)},null,8,["style"])):a.image_data.length?(n(),_("div",He,[o(p,{objectid:t.objectId,"image-data":a.image_data,height:t.imageHeight,"comparison-page":t.comparisonPage,onImageIndexChange:i[0]||(i[0]=I=>a.image_index=I)},null,8,["objectid","image-data","height","comparison-page"]),t.hideMetadata?d("",!0):(n(),u(b,{key:0,"object-id":t.objectId,iri:c.image_meta_iri},null,8,["object-id","iri"]))])):(n(),u(f,{key:2,style:J(`height:${t.imageHeight}px !important`)},null,8,["style"]))]),_:1},8,["min-height"])}const Rn=w(Fe,[["render",Me]]),We={props:{data:{type:Object,default:()=>{}},withLabel:{type:Boolean,default:!1}},computed:{is_inline_flex(){return this.withLabel?"d-inline-flex":""}}},Ve={class:"d-flex align-baseline"},Ye={key:0},Ue={key:0};function ze(e,i,t,r,a,c){return t.data?(n(),_("span",{key:0,class:oe(c.is_inline_flex)},[P("div",Ve,[t.withLabel?(n(),_("h5",Ye,h(e.$t("label.source"))+": ",1)):d("",!0),V(e.$slots,"default",{},()=>[t.data&&t.data.name?(n(),_("div",Ue,h(t.data.name),1)):d("",!0)])])],2)):d("",!0)}const Ge=w(We,[["render",ze]]),Xe={name:"Citation",components:{FormatedLink:W,FormatText:X,CitationStaticSource:Ge},props:{data:{type:Object,validator(e){let i=Object.keys(e).includes("value")&&e.value;return Array.isArray(e.sources)&&e.sources.length||e.source&&console.warn("possible typo or male format in citation"),i},default(){return{value:""}}},sourceStyle:{type:String,default:""}},computed:{quote(){return this.data.quote?this.data.quote:this.data.value?this.data.value:this.data.text?this.data.text:""},sources(){return this.data.sources?this.data.sources:[]}},methods:{semicolon(e){return e+1<this.sources.length?";":""}}},Ke={key:0},Je={class:"quote"},Qe={key:0},Ze={key:0},et={key:1};function tt(e,i,t,r,a,c){const m=y("FormatText"),p=y("FormatedLink"),b=y("CitationStaticSource");return Object.keys(t.data).length?(n(),_("span",Ke,[P("div",Je,[o(m,{data:t.data.value},null,8,["data"]),j(" ")]),(n(!0),_(E,null,T(c.sources,(f,I)=>(n(),_("span",{key:"srcs"+I},[f.name||f.link?(n(),_("span",Qe,[o(b,{data:f,"with-label":I==0},{default:s(()=>[f.link&&f.name?(n(),_("span",Ze,[j(" "),o(p,{"anchor-text":f.name,data:f.link,"text-as-link":""},null,8,["anchor-text","data"])])):f.link?(n(),_("span",et,[j(" "),o(p,{data:f.link,"text-as-link":""},null,8,["data"])])):d("",!0)]),_:2},1032,["data","with-label"])])):d("",!0),j(h(c.semicolon(I)),1)]))),128))])):d("",!0)}const K=w(Xe,[["render",tt]]),at="/type/preferred_title",nt={name:"ObjectTitle",components:{Citation:K},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{titles:[],sorted_titles:{main_title:{},alt_titles:{}}}},watch:{objectId(){this.objectId&&this.load_data_from_ts()},titles(){if(this.titles&&this.titles.length){for(let e of this.titles)e.type.endsWith(at)?this.sorted_titles.main_title=e:(e.type in this.sorted_titles.alt_titles||(this.sorted_titles.alt_titles[e.type]=[]),this.sorted_titles.alt_titles[e.type].push(e));this.sorted_titles.alt_titles=Object.keys(this.sorted_titles.alt_titles).sort().reduce((e,i)=>(e[i]=this.sorted_titles.alt_titles[i],e),{})}}},created(){this.load_data_from_ts()},methods:{load_data_from_ts(){this.titles=[],this.has_children=!1,this.sorted_titles={main_title:{},alt_titles:{}},N.get_title(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.title&&e.id==this.objectId&&(this.titles=e.title)})}}},it={key:0},st={class:"d-inline"};function ot(e,i,t,r,a,c){const m=y("Citation");return t.objectId?(n(),_("span",it,[Object.keys(a.sorted_titles.alt_titles).length?(n(),u(R,{key:0,class:"mt-4 mb-2"})):d("",!0),a.sorted_titles.alt_titles?(n(!0),_(E,{key:1},T(a.sorted_titles.alt_titles,(p,b)=>(n(),_("span",{key:b,class:"text-body-2"},[(n(!0),_(E,null,T(p,(f,I)=>(n(),u(g,{key:I,dense:""},{default:s(()=>[I==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",st,h(p[0].type_label)+":",1)]),_:2},1024)):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(m,{data:f},null,8,["data"])]),_:2},1024)]),_:2},1024))),128))]))),128)):d("",!0)])):d("",!0)}const rt=w(nt,[["render",ot]]),_t={components:{Anchor:M},props:{data:{type:Object,default:()=>{}},path:{type:String,default:""}}};function ct(e,i,t,r,a,c){const m=y("router-link"),p=y("Anchor");return n(),_("span",null,["iri"in t.data&&t.data.iri?(n(),u(m,{key:0,class:"internal-resource-link",to:{name:t.path,params:{id:t.data.iri.split("/").slice(-1)[0]}}},{default:s(()=>[j(h(t.data.name),1)]),_:1},8,["to"])):d("",!0),t.data.gnd?(n(),u(p,{key:1,url:t.data.gnd,sup:""},{default:s(()=>[j("GND")]),_:1},8,["url"])):d("",!0)])}const q=w(_t,[["render",ct],["__scopeId","data-v-a46c7b92"]]),lt={components:{Anchor:M},props:{data:{type:Object,default:()=>{}},category:{type:String,default:""}},methods:{filter_string:function(){return this.category+"-IS_OR-"+this.data.iri.split("/").slice(-1)[0]}}};function dt(e,i,t,r,a,c){const m=y("router-link"),p=y("Anchor");return n(),_("span",null,[o(Ie,{location:"bottom","open-delay":"600"},{activator:s(({props:b})=>[P("span",re(_e(b)),[o(m,ce(b,{class:"filter_link",to:{name:"Search",query:{qfilter:c.filter_string()}}}),{default:s(()=>[j(h(t.data.name),1)]),_:2},1040,["to"])],16)]),default:s(()=>[P("span",null,h(e.$t("descr.filtered_search")),1)]),_:1}),t.data.gnd?(n(),u(p,{key:0,url:t.data.gnd,sup:""},{default:s(()=>[j("GND")]),_:1},8,["url"])):d("",!0)])}const x=w(lt,[["render",dt],["__scopeId","data-v-009345da"]]),ut={name:"Production",components:{Dating:B,FilterResourceLink:x,ResourceLink:q},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{production:null,artists_sorted:{}}},computed:{production_note(){return this.production.prod_note||""},production_locations(){return this.production&&this.production.locations?[...new Map(this.production.locations.map(e=>[e.iri,e])).values()]:!1},production_technics(){return this.production.technics&&this.production.technics.length?this.production.technics.filter((e,i,t)=>i===t.findIndex(r=>r.gnd===e.gnd&&r.name===e.name)):!1}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())},production(){this.production&&this.sort_artist_by_id()}},created(){this.reset_data(),this.load_from_ts()},methods:{load_from_ts(){N.get_production(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.production&&e.id==this.objectId&&(this.production=e.production)})},reset_data(){this.production=null,this.artists_sorted={}},sort_artist_by_id(){if(this.production.artists&&this.production.artists.length)for(let e of this.production.artists)e.role in this.artists_sorted||(this.artists_sorted[e.role]={}),this.artists_sorted[e.role][e.iri]=e}}},mt={key:0,class:"text-body-2"},ht={key:0},ft={key:1},pt={key:0},bt={key:1},yt={key:2},gt={key:0},Pt={key:1};function It(e,i,t,r,a,c){const m=y("ResourceLink"),p=y("Dating"),b=y("FilterResourceLink");return t.objectId&&a.production?(n(),_("span",mt,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label.production")),1)]),_:1})]),_:1}),a.artists_sorted?(n(!0),_(E,{key:0},T(a.artists_sorted,(f,I)=>(n(),_("span",{key:"artists"+I},[(n(!0),_(E,null,T(f,(L,A,k)=>(n(),u(g,{key:"art"+k,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[k==0?(n(),_("h5",ht,h(L.role)+":",1)):(n(),_("span",ft," "))]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[o(m,{data:L,path:"Person"},null,8,["data"]),L.attribution?(n(),_("span",pt," ("+h(L.attribution)+")",1)):d("",!0)]),_:2},1024)]),_:2},1024))),128))]))),128)):d("",!0),a.production.dating?(n(),_("span",bt,[o(g,{dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.dating"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(p,{data:a.production.dating},null,8,["data"])]),_:1})]),_:1})])):d("",!0),c.production_locations?(n(),_("span",yt,[(n(!0),_(E,null,T(c.production_locations,(f,I)=>(n(),u(g,{key:"place"+I,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[I==0?(n(),_("h5",gt,h(e.$t("label.place"))+":",1)):(n(),_("span",Pt," "))]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[o(m,{data:f,path:"Place"},null,8,["data"])]),_:2},1024)]),_:2},1024))),128))])):d("",!0),c.production_note?(n(),u(g,{key:3,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.note"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[P("div",null,h(c.production_note),1)]),_:1})]),_:1})):d("",!0),c.production_technics?(n(!0),_(E,{key:4},T(c.production_technics,(f,I)=>(n(),u(g,{key:"tec"+I,dense:""},{default:s(()=>[I==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.technic"))+":",1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(b,{data:f,category:"technic"},null,8,["data"])]),_:2},1024)]),_:2},1024))),128)):d("",!0),a.production.commission?(n(),_(E,{key:5},[(n(!0),_(E,null,T(a.production.commission.commissioner,(f,I)=>(n(),u(g,{key:"comi"+I,dense:""},{default:s(()=>[I==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.commissioners"))+":",1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(m,{data:f,path:"Person"},null,8,["data"])]),_:2},1024)]),_:2},1024))),128)),a.production.commission.note?(n(),u(g,{key:0,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.note"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[P("div",null,h(a.production.commission.note),1)]),_:1})]),_:1})):d("",!0)],64)):d("",!0)])):d("",!0)}const jt=w(ut,[["render",It]]),kt={name:"Modification",components:{Dating:B,FilterResourceLink:x,ResourceLink:q},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{modifications:[]}},watch:{objectId(){this.objectId&&(this.modifications=[],this.load_from_ts())},production(){this.production&&this.sort_artist_by_id()}},created(){this.modifications=[],this.load_from_ts()},methods:{load_from_ts(){N.get_modifications(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.modifications&&e.id==this.objectId&&(this.modifications=e.modifications)})},sort_artist_by_id(e){let i={};if(e&&e.length)for(let t of e)i[t.id]=t;return i}}},$t={key:0,class:"text-body-2"},Ot={class:"d-inline"},Et={key:0},vt={class:"d-inline"};function Tt(e,i,t,r,a,c){const m=y("Dating"),p=y("ResourceLink"),b=y("FilterResourceLink");return t.objectId&&a.modifications&&a.modifications.length?(n(),_("span",$t,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label.modifications")),1)]),_:1})]),_:1}),(n(!0),_(E,null,T(a.modifications,(f,I)=>(n(),u(g,{key:"mod"+I,dense:""},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[f.dating?(n(),u(g,{key:0,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.modification_dating"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(m,{data:f.dating},null,8,["data"])]),_:2},1024)]),_:2},1024)):d("",!0),f.note?(n(),u(g,{key:1,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.note"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[j(h(f.note),1)]),_:2},1024)]),_:2},1024)):d("",!0),f.artists?(n(!0),_(E,{key:2},T(c.sort_artist_by_id(f.artists),(L,A)=>(n(),u(g,{key:"art"+A,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",Ot,h(L.role)+":",1)]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[o(p,{data:L,path:"Person"},null,8,["data"]),L.attribution?(n(),_("span",Et," ("+h(L.attribution)+")",1)):d("",!0)]),_:2},1024)]),_:2},1024))),128)):d("",!0),f.technics&&f.technics.length?(n(!0),_(E,{key:3},T(f.technics,(L,A)=>(n(),u(g,{key:"tec"+A},{default:s(()=>[A==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",vt,h(e.$t("label.technic")),1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(b,{data:L,category:"technic"},null,8,["data"])]),_:2},1024)]),_:2},1024))),128)):d("",!0),I+1<a.modifications.length?(n(),u(R,{key:4,class:"mt-4 mb-2",inset:""})):d("",!0)]),_:2},1024)]),_:2},1024))),128))])):d("",!0)}const wt=w(kt,[["render",Tt]]),Lt={name:"Find",components:{Dating:B,ResourceLink:q},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{find:null}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_find(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.find&&e.id==this.objectId&&(this.find=e.find)})},reset_data(){this.find=null}}},Nt={key:0,class:"text-body-2"},At={key:0},Rt={key:1};function xt(e,i,t,r,a,c){const m=y("ResourceLink"),p=y("Dating");return a.find?(n(),_("span",Nt,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label.find")),1)]),_:1})]),_:1}),a.find?(n(),_(E,{key:0},[a.find.location?(n(),u(g,{key:0,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.find_place"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(m,{data:a.find.location,path:"Place"},null,8,["data"])]),_:1})]),_:1})):d("",!0),a.find.dating?(n(),u(g,{key:1,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.dating"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(p,{data:a.find.dating},null,8,["data"])]),_:1})]),_:1})):d("",!0),(n(!0),_(E,null,T(a.find.artists,(b,f)=>(n(),u(g,{key:"art"+f,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[f==0?(n(),_("h5",At,h(b.role)+":",1)):(n(),_("span",Rt," "))]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[o(m,{data:b,path:"Person"},null,8,["data"])]),_:2},1024)]),_:2},1024))),128)),a.find.note?(n(),u(g,{key:2,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.note"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[j(h(a.find.note),1)]),_:1})]),_:1})):d("",!0)],64)):d("",!0)])):d("",!0)}const St=w(Lt,[["render",xt]]),Ct="object_type",Dt="classification",qt="https://db.antiquitatum-thesaurus.eu".replace(/\/$/,""),Bt=`${qt}/type/object_type`,Ft={name:"Types",components:{FilterResourceLink:x},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{types:[],category:{"/type/classification":Dt,"/type/object_type":Ct},object_type:null,classifications:[]}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())},types(){this.types&&this.types.length&&this.sort_types()}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_types(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.types&&e.id==this.objectId&&(this.types=e.types)})},reset_data(){this.types=[],this.classifications=[],this.object_type=null},get_path(e){return new URL(e).pathname},sort_types(){if(this.types&&this.types.length)for(let e of this.types)e.type_of_type_iri==Bt?this.object_type=e:this.classifications.push(e)}}},Ht={key:0,class:"text-body-2 mb-1"},Mt={key:0},Wt={key:1};function Vt(e,i,t,r,a,c){const m=y("FilterResourceLink");return t.objectId&&a.types?(n(),_("div",Ht,[a.object_type?(n(),u(g,{key:0,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(a.object_type.type_of_type)+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(m,{data:a.object_type,category:a.category[c.get_path(a.object_type.type_of_type_iri)]},null,8,["data","category"])]),_:1})]),_:1})):d("",!0),a.classifications.length?(n(!0),_(E,{key:1},T(a.classifications,(p,b)=>(n(),u(g,{key:"t"+b,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[b==0?(n(),_("h5",Mt,h(p.type_of_type)+":",1)):(n(),_("span",Wt," "))]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[o(m,{data:p,category:a.category[c.get_path(p.type_of_type_iri)]},null,8,["data","category"])]),_:2},1024)]),_:2},1024))),128)):d("",!0)])):d("",!0)}const Yt=w(Ft,[["render",Vt]]),Ut={name:"Inscriptions",components:{FormatText:X},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{inscriptions:[]}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_inscriptions(this.objectId,this.parent_ac.signal).then(e=>{e&&e.inscriptions&&e.id==this.objectId&&(this.inscriptions=e.inscriptions)})},reset_data(){this.inscriptions=[]}}},zt={key:0,class:"text-body-2 mb-1"},Gt={key:0},Xt={class:"d-inline"},Kt={key:1},Jt={class:"d-inline"};function Qt(e,i,t,r,a,c){const m=y("FormatText");return t.objectId&&a.inscriptions&&a.inscriptions.length?(n(),_("div",zt,[(n(!0),_(E,null,T(a.inscriptions,(p,b)=>(n(),u(g,{key:"insc"+b,dense:""},{default:s(()=>[b>0?(n(),u(l,{key:0,cols:"12"},{default:s(()=>[o(R,{inset:""})]),_:1})):d("",!0),b==0?(n(),u(l,{key:1,cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.inscriptions"))+":",1)]),_:1})):(n(),u(l,{key:2,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(m,{data:p.text},null,8,["data"]),p.descr_text||p.pos_text?(n(),u(g,{key:0,dense:""},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[p.pos_text?(n(),_("div",Gt,[P("h5",Xt,h(e.$t("label.inscription_placement"))+":",1),j(" "+h(p.pos_text),1)])):d("",!0),p.descr_text?(n(),_("div",Kt,[P("h5",Jt,h(e.$t("label.note"))+":",1),j(" "+h(p.descr_text),1)])):d("",!0)]),_:2},1024)]),_:2},1024)):d("",!0)]),_:2},1024)]),_:2},1024))),128))])):d("",!0)}const Zt=w(Ut,[["render",Qt]]),ea={name:"Description",components:{Citation:K},inject:["parent_ac"],props:{objectId:{type:Number,default:0},type:{type:String,default:"description"},withHeader:{type:Boolean,default:!1}},data(){return{descriptions:[]}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_descriptions(this.objectId,this.$i18n.locale,this.type,this.parent_ac.signal).then(e=>{e&&e.descriptions&&e.id==this.objectId&&(this.descriptions=this.filterLanguages(e.descriptions))})},filterLanguages(e){let i=[];for(let t of e)["de","it"].includes(t.language)&&i.push(t);return i},reset_data(){this.descriptions=[]},formatData(e){let i={value:e.note};return e.assignments.length&&(i.sources=e.assignments),i}}},ta={key:0,class:"text-body-2 mb-1"},aa={key:0},na={key:0,class:"d-inline"},ia={key:1,class:"d-inline"};function sa(e,i,t,r,a,c){const m=y("Citation");return t.objectId&&a.descriptions&&a.descriptions.length>0?(n(),_("div",ta,[t.withHeader?(n(),_("div",aa,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label."+t.type)),1)]),_:1})]),_:1})])):d("",!0),(n(!0),_(E,null,T(a.descriptions,(p,b)=>(n(),_("div",{key:b},[o(g,{dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[a.descriptions.length>1|(a.descriptions.length==1&&a.descriptions[0].language!="de")?(n(),_("h5",na,h(p.type)+" ("+h(p.language)+"): ",1)):(n(),_("h5",ia,h(p.type)+":",1))]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[o(m,{data:c.formatData(p)},null,8,["data"])]),_:2},1024)]),_:2},1024)]))),128))])):d("",!0)}const te=w(ea,[["render",sa]]),ae=e=>(le("data-v-1fc0c464"),e=e(),de(),e),oa={class:"text-body-2 mb-1"},ra={class:"d-inline"},_a={key:0,class:"depicts"},ca=ae(()=>P("span",{class:"no-padding-text"},"(",-1)),la={class:"depicts"},da={key:0,class:"comma"},ua=ae(()=>P("span",{class:"no-padding-text"},")",-1)),ma={key:1},ha={__name:"DepictionMethod",props:{objectId:{type:Number,default:0}},setup(e){const{t:i,locale:t}=Y(),r=D([]),a=e,c=U("parent_ac");function m(f){return f.some(I=>I.iri.endsWith("oblique_view"))}function p(f){const I=[],L=[];return f.forEach(A=>{A.iri.endsWith("oblique_view")?(A.views=I,L.push(A)):A.iri.endsWith("view")?I.push(A):L.push(A)}),L}function b(){N.get_depiction_method(a.objectId,t.value,c.signal).then(f=>{f&&f.modes&&f.id==a.objectId?m(f.modes)?r.value=p(f.modes):r.value=f.modes:r.value=[]})}return z(()=>{b()}),G(()=>a.objectId,()=>{b()}),(f,I)=>(n(),_("div",oa,[(n(!0),_(E,null,T(r.value,(L,A)=>(n(),u(g,{key:"mode"+A,dense:""},{default:s(()=>[A==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",ra,h(Z(i)("label.mode_of_depiction"))+":",1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>["views"in L?(n(),_("span",_a,[o(x,{data:L,category:"mode_of_depiction"},null,8,["data"]),j(" "),ca,(n(!0),_(E,null,T(L.views,(k,S)=>(n(),_("span",{key:"submode"+S},[P("span",la,[o(x,{data:k,category:"mode_of_depiction"},null,8,["data"])]),S>=0&&S<L.views.length-1?(n(),_("span",da,",")):d("",!0)]))),128)),ua])):(n(),_("span",ma,[o(x,{data:L,category:"mode_of_depiction"},null,8,["data"])]))]),_:2},1024)]),_:2},1024))),128))]))}},fa=w(ha,[["__scopeId","data-v-1fc0c464"]]),pa={class:"text-body-2 mb-1"},ba={class:"d-inline"},ya={key:0},ga={key:1},Pa={__name:"DepictionContent",props:{objectId:{type:Number,default:0}},setup(e){const{t:i,locale:t}=Y(),r=D([]),a=e,c=U("parent_ac");function m(){N.get_depiction_content(a.objectId,t.value,c.signal).then(p=>{p&&p.id==a.objectId?r.value=p.depictions:r.value=[]})}return z(()=>{m()}),G(()=>a.objectId,()=>{m()}),(p,b)=>(n(),_("div",pa,[(n(!0),_(E,null,T(r.value,(f,I)=>(n(),u(g,{key:"depictionContent"+I,dense:""},{default:s(()=>[I==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",ba,h(Z(i)("label.depiction_content"))+":",1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[f.type.endsWith("E21_Person")?(n(),_("span",ya,[o(x,{data:f,category:"depicted_person"},null,8,["data"])])):(n(),_("span",ga,[o(x,{data:f,category:"depicted_place"},null,8,["data"])]))]),_:2},1024)]),_:2},1024))),128))]))}},Ia={name:"Materials",components:{FilterResourceLink:x},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{materials:[]}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_materials(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.materials&&e.id==this.objectId&&(this.materials=e.materials)})},reset_data(){this.materials=[]}}},ja={class:"text-body-2 mb-1"},ka={key:0,class:"d-inline"};function $a(e,i,t,r,a,c){const m=y("FilterResourceLink");return n(),_("div",ja,[(n(!0),_(E,null,T(a.materials,(p,b)=>(n(),u(g,{key:"mat"+b,dense:""},{default:s(()=>[b==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[b==0?(n(),_("h5",ka,h(e.$t("label.material"))+":",1)):d("",!0)]),_:2},1024)):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(m,{data:p,category:"material"},null,8,["data"])]),_:2},1024)]),_:2},1024))),128))])}const Oa=w(Ia,[["render",$a]]),Ea={name:"Condition",components:{Citation:K},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{condition:{}}},computed:{has_condition(){return!this.is_obj_empty(this.condition)},computed_condition(){let e={value:this.condition.note,sources:[]},i={name:""};return this.condition.source_note&&(i.name=this.condition.source_note),this.condition.source&&(i.link={uri:this.condition.source.uri},this.condition.source.name&&(i.name=this.condition.source.name)),e.sources.push(i),e}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.reset_data(),this.load_from_ts()},methods:{is_obj_empty(e){return typeof e<"u"&&Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype},load_from_ts(){N.get_condition(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.condition&&e.id==this.objectId&&(this.condition=e.condition)})},reset_data(){this.condition={}}}},va={key:0,class:"text-body-2 mb-1"},Ta={class:"d-inline"};function wa(e,i,t,r,a,c){const m=y("Citation");return a.condition&&c.has_condition?(n(),_("div",va,[o(g,{dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",Ta,h(e.$t("label.condition"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(m,{data:c.computed_condition},null,8,["data"])]),_:1})]),_:1})])):d("",!0)}const La=w(Ea,[["render",wa]]),Na={name:"Measurement",components:{},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{measurements:[]}},computed:{has_measurements(){return this.measurements.length}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.reset_data(),this.load_from_ts()},methods:{is_obj_empty(e){return typeof e<"u"&&Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype},load_from_ts(){N.get_measurements(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.measurements&&e.id==this.objectId&&(this.measurements=e.measurements)})},reset_data(){this.measurements={}}}},Aa={key:0,class:"text-body-2 mb-1"},Ra={key:0},xa={key:0},Sa={key:1},Ca={key:0};function Da(e,i,t,r,a,c){return c.has_measurements?(n(),_("div",Aa,[(n(!0),_(E,null,T(a.measurements,(m,p)=>(n(),u(g,{key:"mid"+p,dense:""},{default:s(()=>[p==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.measurements"))+":",1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[(n(!0),_(E,null,T(m.measures,(b,f)=>(n(),_("span",{key:"meas"+f},[b.type&&b.value&&b.unit_symbol?(n(),_("span",Ra,[j(h(b.type.charAt(0))+": "+h(parseFloat(b.value).toFixed(2).replace(".",","))+"  "+h(b.unit_symbol),1),f+1<m.measures.length?(n(),_("span",xa,", ")):d("",!0)])):b.descr?(n(),_("span",Sa,h(b.descr),1)):d("",!0)]))),128)),m.notes?(n(),_("span",Ca,"; "+h(m.notes),1)):d("",!0)]),_:2},1024)]),_:2},1024))),128))])):d("",!0)}const qa=w(Na,[["render",Da]]),Ba={name:"BaseFacts",components:{Types:Yt,Inscriptions:Zt,Description:te,Materials:Oa,Condition:La,Measurement:qa,DepictionMethod:fa,DepictionContent:Pa},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{is_deleted:!1,forward_iri:null}},watch:{objectId(){this.load_from_ts()}},created(){this.load_from_ts()},methods:{load_from_ts(){N.is_deleted(this.objectId).then(e=>{this.is_deleted=e.is_deleted,this.is_deleted&&N.load_forward_id_if_exists(this.objectId,this.parent_ac.signal).then(i=>{this.forward_iri=i.forward_iri})})}}},Fa={key:0,class:"text-body-2"},Ha={key:1};function Ma(e,i,t,r,a,c){const m=y("Types"),p=y("Inscriptions"),b=y("Description"),f=y("DepictionContent"),I=y("DepictionMethod"),L=y("Materials"),A=y("Condition"),k=y("Measurement");return t.objectId&&!a.is_deleted?(n(),_("div",Fa,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label.descriptive_data")),1)]),_:1})]),_:1}),o(m,{"object-id":t.objectId},null,8,["object-id"]),o(p,{"object-id":t.objectId},null,8,["object-id"]),o(b,{"object-id":t.objectId},null,8,["object-id"]),o(f,{"object-id":t.objectId},null,8,["object-id"]),o(I,{"object-id":t.objectId},null,8,["object-id"]),o(L,{"object-id":t.objectId},null,8,["object-id"]),o(A,{"object-id":t.objectId},null,8,["object-id"]),o(k,{"object-id":t.objectId},null,8,["object-id"])])):a.is_deleted?(n(),_("div",Ha,[o(Q,{variant:"outlined",rounded:"0","max-width":"500",class:"mx-auto my-10"},{default:s(()=>[o(ue,null,{default:s(()=>[j(h(e.$t("error.object_deleted")),1)]),_:1}),o(me,null,{default:s(()=>[j(h(e.$t("error.object_replaced_by")),1)]),_:1}),a.forward_iri?(n(),u(he,{key:0},{default:s(()=>[o(fe,{variant:"text",color:"#C60C30",to:{name:"Object",params:{objectid:a.forward_iri.split("/").slice(-1)[0]}},class:"forward_iri"},{default:s(()=>[j(h(a.forward_iri),1)]),_:1},8,["to"])]),_:1})):d("",!0)]),_:1})])):d("",!0)}const Wa=w(Ba,[["render",Ma],["__scopeId","data-v-76945a7b"]]),Va={name:"Comment",components:{Description:te},props:{objectId:{type:Number,default:0}}},Ya={class:"text-body-2"};function Ua(e,i,t,r,a,c){const m=y("Description");return n(),_("div",Ya,[o(m,{"object-id":t.objectId,type:"comment","with-header":""},null,8,["object-id"])])}const za=w(Va,[["render",Ua]]),Ga={name:"Provenance",components:{FormatText:X,Dating:B,ResourceLink:q},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{provs:[]}},watch:{objectId(){this.provs=[],this.load_from_ts()}},created(){this.load_from_ts()},methods:{not_last_row:function(e){return this.provs.length>e+1},sort_provenances(e){let i=new Map;return e.forEach(t=>{let r=t.iri.replace("/receiving_custody","").replace("/surrendering_custody","").split("/").slice(-1)[0];if(!i.has(r))i.set(r,t);else{let a=i.get(r);t.dating&&t.dating.to_date&&(typeof a.dating>"u"&&(a.dating={to_date:null}),a.dating.to_date=t.dating.to_date),i.set(r,a)}}),i=new Map([...i].sort()),Array.from(i.values())},load_from_ts(){N.get_provenances(this.objectId,this.parent_ac.signal).then(e=>{e&&e.provenances&&e.id==this.objectId&&(this.provs=this.sort_provenances(e.provenances))})}}},Xa={key:0,class:"text-body-2"},Ka={key:0},Ja={key:1},Qa={class:"d-inline"},Za={class:"d-inline"};function en(e,i,t,r,a,c){const m=y("ResourceLink"),p=y("Dating"),b=y("FormatText");return a.provs.length?(n(),_("span",Xa,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label.provenance")),1)]),_:1})]),_:1}),(n(!0),_(E,null,T(a.provs,(f,I)=>(n(),_("span",{key:I},[I>0?(n(),u(g,{key:0,class:"my-1",dense:""},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[o(R,{inset:""})]),_:1})]),_:1})):d("",!0),f.custodian?(n(),u(g,{key:1,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[f.custodian.type=="person"?(n(),_("h5",Ka,h(e.$t("label.custodian"))+":",1)):(n(),_("h5",Ja,h(e.$t("label.institution"))+":",1))]),_:2},1024),o(l,{cols:"8"},{default:s(()=>[f.custodian.type=="person"?(n(),u(m,{key:0,data:f.custodian,path:"Person"},null,8,["data"])):(n(),u(m,{key:1,data:f.custodian,path:"Institution"},null,8,["data"]))]),_:2},1024)]),_:2},1024)):d("",!0),f.place?(n(),u(g,{key:2,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.place"))+":",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(m,{data:f.place,path:"Place"},null,8,["data"])]),_:2},1024)]),_:2},1024)):d("",!0),"dating"in f&&f.dating?(n(),u(g,{key:3,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",Qa,h(e.$t("label.dating"))+": ",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(p,{data:f.dating},null,8,["data"])]),_:2},1024)]),_:2},1024)):d("",!0),"note"in f&&f.note?(n(),u(g,{key:4,dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[P("h5",Za,h(e.$t("label.note"))+": ",1)]),_:1}),o(l,{cols:"8"},{default:s(()=>[o(b,{data:f.note},null,8,["data"])]),_:2},1024)]),_:2},1024)):d("",!0)]))),128))])):d("",!0)}const tn=w(Ga,[["render",en]]),an={name:"Cataloging",components:{LegalStatus:ee},inject:["parent_ac"],props:{objectId:{type:Number,required:!0}},data(){return{catalogings:[],default_license:{name:"CC BY-NC-SA 4.0",uri:"http://creativecommons.org/licenses/by-nc-sa/4.0"}}},watch:{objectId(){this.catalogings=[],this.load_from_ts()}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_cataloging_data(this.objectId,this.parent_ac.signal).then(e=>{if(e&&e.cataloging&&e.id==this.objectId){let i=e.cataloging;i=i.reduce((r,a,c)=>{let m=a.dating.from_date;return c==0?(r[m]=a,r):(m in r?r[m].rightholder=r[m].rightholder.concat(", ",a.rightholder):r[m]=a,r)},{});let t=[];for(let r in i)t.push(i[r]);this.catalogings=t}})}}},nn={if:"catalogings"};function sn(e,i,t,r,a,c){const m=y("LegalStatus");return n(),_("div",nn,[o(R,{class:"mt-4"}),o(pe,{class:"mt-10 text-body-2"},{default:s(()=>[(n(!0),_(E,null,T(a.catalogings,(p,b)=>(n(),_("div",{key:b},[b>0?(n(),u(g,{key:0,class:"my-1"},{default:s(()=>[o(l,null,{default:s(()=>[o(R,{inset:""})]),_:1})]),_:1})):d("",!0),o(m,{data:p,cols:[4,8],headline:b==0?"legal_status.record":"","is-editor":"",no_license:b!=a.catalogings.length-1,"is-creation":b==0},null,8,["data","headline","no_license","is-creation"])]))),128))]),_:1})])}const on=w(an,[["render",sn]]),rn={name:"Literture",components:{FormatedLink:W},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{bib_refs:[]}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_bibliographic_reference(this.objectId,this.parent_ac.signal).then(e=>{e&&e.bib_refs&&e.id==this.objectId&&(this.bib_refs=e.bib_refs)})},reset_data(){this.bib_refs=[]}}},_n={class:"text-body-2"};function cn(e,i,t,r,a,c){const m=y("FormatedLink");return n(),_("span",_n,[(n(!0),_(E,null,T(a.bib_refs,(p,b)=>(n(),u(g,{key:b,dense:""},{default:s(()=>[b==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",null,h(e.$t("label.literatures_citations"))+":",1)]),_:1})):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),p.citation?(n(),u(l,{key:2,cols:"8"},{default:s(()=>[o(m,{"anchor-text":p.citation,data:p.link},null,8,["anchor-text","data"])]),_:2},1024)):p.bib_ref_note?(n(),u(l,{key:3,cols:"8"},{default:s(()=>[j(h(p.bib_ref_note),1)]),_:2},1024)):d("",!0)]),_:2},1024))),128))])}const ln=w(rn,[["render",cn]]),dn={name:"ExternalReferences",components:{FormatedLink:W},inject:["parent_ac"],props:{objectId:{type:Number,default:0}},data(){return{external_refs:null,censusId:null}},watch:{objectId(){this.objectId&&(this.reset_data(),this.load_from_ts())}},created(){this.load_from_ts()},methods:{load_from_ts(){N.get_external_reference(this.objectId,this.$i18n.locale,this.parent_ac.signal).then(e=>{e&&e.references&&e.id==this.objectId&&(this.external_refs={},e.references.forEach(i=>{this.external_refs[i.ref_type]||(this.external_refs[i.ref_type]=[]),this.external_refs[i.ref_type].push({text:i.ref_source,uri:i.ref_link})}))})},reset_data(){this.external_refs=null},hasExternalDocuments(e){return e.text=="Census"?(this.censusId=e.uri.substring(e.uri.indexOf("censusID=")+9),!0):!1}}},un={key:0,class:"text-body-2 mb-1"};function mn(e,i,t,r,a,c){const m=y("FormatedLink");return t.objectId&&a.external_refs?(n(),_("div",un,[(n(!0),_(E,null,T(a.external_refs,(p,b)=>(n(),_("span",{key:"ref"+b},[(n(!0),_(E,null,T(p,(f,I)=>(n(),u(g,{key:"refs"+I,dense:""},{default:s(()=>[I==0?(n(),u(l,{key:0,cols:"4"},{default:s(()=>[P("h5",null,h(b)+":",1)]),_:2},1024)):(n(),u(l,{key:1,cols:"4"},{default:s(()=>[j(" ")]),_:1})),o(l,{cols:"8"},{default:s(()=>[o(m,{data:f,"anchor-text":f.text,"text-as-link":""},null,8,["data","anchor-text"])]),_:2},1024)]),_:2},1024))),128))]))),128))])):d("",!0)}const hn=w(dn,[["render",mn]]),fn={name:"References",components:{Literature:ln,ExternalReferences:hn},props:{objectId:{type:Number,required:!0}},data(){return{has_bibliography:!1,has_external_references:!1}},watch:{objectId(){this.load_from_ts()}},created(){this.load_from_ts()},methods:{load_from_ts(){N.has_bibliography(this.objectId).then(e=>{this.has_bibliography=e.exists}),N.has_external_references(this.objectId).then(e=>{this.has_external_references=e.exists})}}},pn={key:0};function bn(e,i,t,r,a,c){const m=y("Literature"),p=y("ExternalReferences");return a.has_bibliography||a.has_external_references?(n(),_("div",pn,[o(R,{class:"mt-4"}),o(g,{class:"py-5 text-body-2"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(e.$t("label.references")),1)]),_:1})]),_:1}),a.has_bibliography?(n(),u(m,{key:0,"object-id":t.objectId},null,8,["object-id"])):d("",!0),a.has_bibliography&&a.has_external_references?(n(),u(g,{key:1,class:"my-1"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[o(R,{inset:""})]),_:1})]),_:1})):d("",!0),a.has_external_references?(n(),u(p,{key:2,"object-id":t.objectId},null,8,["object-id"])):d("",!0)])):d("",!0)}const yn=w(fn,[["render",bn]]),gn={key:0},Pn={key:1},C={__name:"MetaDataRow",props:{headlineLabel:{type:String,default:""}},setup(e){return(i,t)=>(n(),u(g,{dense:""},{default:s(()=>[o(l,{cols:"4"},{default:s(()=>[e.headlineLabel?(n(),_("h5",gn,h(e.headlineLabel)+":",1)):(n(),_("span",Pn," "))]),_:1}),o(l,{cols:"8"},{default:s(()=>[V(i.$slots,"default")]),_:3})]),_:3}))}},In={key:0,class:"text-body-2"},jn={__name:"Repository",props:{objectId:{type:Number,required:!0}},setup(e){const{t:i,locale:t}=Y(),r=e,a=U("parent_ac"),c=be({type:"",location:{name:"",iri:"",gnd:""},dating:{from:"",to:""},note:""}),m=D({}),p=D({}),b=D(""),f=D(!1);function I(){N.get_custody(r.objectId,t.value,a.signal).then(k=>{k&&k.custody&&k.id==r.objectId?(f.value=!0,c.type=k.custody.type||"",c.location=k.custody.location||{name:"",iri:"",gnd:""},c.dating=k.custody.dating||{from:"",to:""},c.note=k.custody.note||""):(c.type="",c.location={name:"",iri:"",gnd:""},c.dating={from:"",to:""},c.note="")}),N.get_location(r.objectId,a.signal).then(k=>{k&&k.location&&k.id==r.objectId?(f.value=!0,m.value=k.location):m.value={}}),N.get_inventory_no(r.objectId,a.signal).then(k=>{Object.keys(k).length&&(f.value=!0,k.old_inv_nos.length==0&&k.cur_inv_no.length>25?(b.value=k.cur_inv_no,p.value={}):(b.value="",p.value=k))})}function L(){if(c){const k=c.type,S=se(c.dating,!1,i,t),F=c.note,H=[k,S,F].filter(ne=>ne);return console.log(H),H.join("; ")}return""}const A=ye(L);return z(()=>{f.value=!1,I()}),G(()=>r.objectId,()=>{f.value=!1,I()}),(k,S)=>f.value?(n(),_("span",In,[o(R,{class:"mt-4"}),o(g,{class:"py-5"},{default:s(()=>[o(l,{cols:"12"},{default:s(()=>[P("h4",null,h(k.$t("label.repository")),1)]),_:1})]),_:1}),P("span",null,[c.location.name?(n(),u(C,{key:0,"headline-label":k.$t("label.collection")},{default:s(()=>[o(q,{data:c.location,path:"Institution"},null,8,["data"])]),_:1},8,["headline-label"])):d("",!0),Object.keys(m.value).length?(n(),u(C,{key:1,"headline-label":k.$t("label.location_places")},{default:s(()=>[o(q,{data:m.value,path:"Place"},null,8,["data"])]),_:1},8,["headline-label"])):d("",!0),p.value.cur_inv_no?(n(),u(C,{key:2,"headline-label":k.$t("label.location_inventory_no")},{default:s(()=>[j(h(p.value.cur_inv_no),1)]),_:1},8,["headline-label"])):d("",!0),(n(!0),_(E,null,T(p.value.old_inv_nos,(F,H)=>(n(),u(C,{key:"inv"+H,"headline-label":H==0?k.$t("label.historic_inventory_no"):""},{default:s(()=>[j(h(F.inv_no),1)]),_:2},1032,["headline-label"]))),128)),A.value?(n(),u(C,{key:3,"headline-label":k.$t("label.acquisition")},{default:s(()=>[j(h(A.value),1)]),_:1},8,["headline-label"])):d("",!0),b.value?(n(),u(C,{key:4,"headline-label":k.$t("label.note")},{default:s(()=>[j(h(b.value),1)]),_:1},8,["headline-label"])):d("",!0)])])):d("",!0)}},kn={name:"MainPartTS",components:{AlternativeTitles:rt,Production:jt,Modification:wt,Find:St,BaseFacts:Wa,Comment:za,Provenance:tn,Cataloging:on,References:yn,Repository:jn},props:{objectId:{type:Number,default:0}}},$n={key:0};function On(e,i,t,r,a,c){const m=y("AlternativeTitles"),p=y("Repository"),b=y("Production"),f=y("BaseFacts"),I=y("Find"),L=y("Provenance"),A=y("Modification"),k=y("Comment"),S=y("References"),F=y("Cataloging");return t.objectId?(n(),_("div",$n,[o(m,{"object-id":t.objectId},null,8,["object-id"]),o(p,{"object-id":t.objectId},null,8,["object-id"]),o(b,{"object-id":t.objectId},null,8,["object-id"]),o(f,{"object-id":t.objectId},null,8,["object-id"]),o(I,{"object-id":t.objectId},null,8,["object-id"]),o(L,{"object-id":t.objectId},null,8,["object-id"]),o(A,{"object-id":t.objectId},null,8,["object-id"]),o(k,{"object-id":t.objectId},null,8,["object-id"]),o(S,{"object-id":t.objectId},null,8,["object-id"]),o(F,{"object-id":t.objectId},null,8,["object-id"])])):d("",!0)}const xn=w(kn,[["render",On]]);export{Rn as I,xn as O,N as d};