import{$ as o}from"./iframe-DSGyX7_4.js";import{c as e,f as v}from"./helpers-DDTkKuvc.js";const b=[{name:"Max Mustermann",image:"./dummy/placeholder-3-2.svg",copy:"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",mail:"mm@ihk.de",phone:"+49 (0) 12 345678-90",fax:null,vcard:"https://www.ihk.de/blueprint/vcard/?contentId=1134770"},{name:"Erika Musterfrau",image:"./dummy/placeholder-3-2.svg",copy:"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",mail:"aa@ihk.de",phone:"+49 (0) 12 345678-94",fax:"+49 (0) 12 345678-00",vcard:"https://www.ihk.de/blueprint/vcard/?contentId=1134770"},{name:"Bernd Beispiel",image:"./dummy/placeholder-3-2.svg",copy:null,mail:"mm@ihk.de",phone:"+49 (0) 12 345678-90",fax:null,vcard:null}],w=[{name:"Max Mustermann",image:"./dummy/placeholder-3-2.svg",copy:"Bereiche: Aus- und Weiterbildung, Kaufmännische Weiterbildung",mail:"mm@ihk.de",phone:"+49 (0) 12 345678-90",fax:null,vcard:"https://www.ihk.de/blueprint/vcard/?contentId=1134770"}],C=[{name:"Industrie- und Handelskammer Stade für den Elbe-Weser-Raum",image:null,copy:'<div class="text">Am Schäferstieg 2<br>21680 Stade</div><div class="text"><a href="#">Geschäftsstellen und Öffnungszeiten</a></div>',mail:"info@stade.ihk.de",phone:"04141/524-0",fax:null,vcard:null}];class g{constructor(a){this.wrapper=a,this.wrapper=a.addClass("initiated"),this.contactsWrapper=a.find(".contacts"),this.contacts=this.contactsWrapper.find(".contact-person"),this.current=0,this.tabStyle=a.data("tab-style"),this.TABS_CLOSED="closed",this.TABS_OPEN="open",this.initTabs(),this.initSizeObserver()}initTabs(){if(this.tabStyle===this.TABS_OPEN||this.contacts.length<2){this.contacts.addClass("active");return}this.tabs=o("<ul />").addClass("tab-buttons").insertBefore(this.contactsWrapper),this.contacts.each((i,r)=>{const n=o(r),s=o('<a href="'+n.attr("id")+'" />').attr("data-index",i).text(n.data("contact-tab"));s.addClass("btn").addClass("btn-small"),n.data("contact-tab")||s.text(i<9?"0"+(i+1):i+1),o("<li />").append(s).appendTo(this.tabs)});const a=this.tabs.find("a");a.on("click",i=>{i.preventDefault();const r=o(i.currentTarget),n=parseInt(r.attr("data-index"));this.contacts.eq(n).addClass("active").siblings(".active").removeClass("active"),r.parent("li").addClass("active").siblings(".active").removeClass("active"),this.changeHeight(this.current,n),this.current=n}),this.tabStyle!==this.TABS_CLOSED&&a.first().trigger("click")}changeHeight(a,i){a!==i&&(this.contactsWrapper.css("height",this.contacts.eq(a).outerHeight()+"px"),setTimeout(()=>{this.contactsWrapper.css("height",this.contacts.eq(i).outerHeight()+"px")},40),setTimeout(()=>{this.contactsWrapper.removeAttr("style").trigger("resize")},500))}initSizeObserver(){new ResizeObserver(i=>{i.map(r=>{const n=r.borderBoxSize[0].inlineSize,s=this.wrapper.get(0);n<500?s.dataset.size="sm":n<1e3?s.dataset.size="md":s.dataset.size="lg"})}).observe(this.wrapper.get(0))}}o("body").on("ihk-init dynamic-component-loaded gfi-dynamic-init",function(){o(".contact-wrapper:not(.initiated)").each(function(){new g(o(this))})});const S=({headline:d="Ich helfe Ihnen gerne weiter",contacts:a=b,contactCount:i=2,addContainer:r=!1})=>{const n=e("div",["contact-wrapper","variant-subtle-primary"]);d&&d.length>0&&e("div",["like-h2"],d,n);const s=e("div",["contacts"],null,n);if(a.map((t,f)=>{if(f>=i)return;const p=e("div",["contact-person"],null,s);if(p.dataset.contactTab=t.name,t.image&&t.image.length>0){const c=e("div",["image-box"],null,p);v(t.image,360,240,t.name,[],c)}const u=e("div",["text-box"],null,p);e("div",["like-h6"],t.name,u),e("p",[],t.copy,u);const h=e("ul",["contact-buttons"],null,u),m=["btn","white","btn-small","icon-left"];if(t.phone&&t.phone.length>0){const c=e("li",[],null,h),l=e("a",["icon-telefon",...m],t.phone,c);l.href="tel:"+t.phone.split("(").join("").split(")").join("")}if(t.mail&&t.mail.length>0){const c=e("li",[],null,h),l=e("a",["icon-email",...m],"E-Mail schreiben",c);l.href="mailto:"+t.mail}if(t.fax&&t.fax.length>0){const c=e("li",[],null,h);e("span",["icon-fax",...m],t.fax,c)}if(t.vcard&&t.vcard.length>0){const c=e("li",[],null,h),l=e("a",["icon-vcard",...m],"Kontakt speichern",c);l.href=t.vcard}}),new g(o(n)),r){const t=e("section",["contact"]);return e("div",["container"],null,t).appendChild(n),t}return n};export{b as C,C as O,w as S,S as c};
