/*! Wed May 27 2020 14:43:47 */

!function(u,p,t){"use strict";var e="https://www.xing-share.com",n={css:"/plugins/css/spi-button.css",js:"/plugins/share.js"},a={de:{label:"Teilen",title:"Teilen auf XING: Vor dem Teilen sehen Sie eine Vorschau."},en:{label:"Share",title:"Share on XING: You'll be able to see a preview before sharing."}},r={h:530,w:570},l={};function i(e,t){(e=e||{}).resource={},this.validateConfigEntry(e,"plugin",["login","share","follow"],"login").validateConfigEntry(e,"language",["en","de"],"en").validateConfigEntry(e,"visibleOnRender",[!0,!1],!0),this.config=e,this.node=t,this.content=null}function o(e){var t,n=this;switch(e=e||"share",t=l.capitalize(e),e){case"follow":n.product=FollowPlugin;break;default:n.product=s}return n.plugins=[],n.PLUGIN_SELECTOR=['div[data-type="xing/'+e+'"]','div[data-type="XING/'+t+'"]','script[type="xing/'+e+'"]','script[type="XING/'+t+'"]','script[data-type="xing/'+e+'"]','script[data-type="XING/'+t+'"]'].join(","),n}(l=l||{}).capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},(l=l||{}).encodeQuery=function(e){var t,n=[];for(t in e)e.hasOwnProperty(t)&&null!=t&&n.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return n.join("&")},(l=l||{}).environment=function(e,r){var i="prod",o="sandbox",a="preview",s=e.split("/").pop();function c(e){if(null===e.match(s+"$"))return null;var t=e.match(/xing(-share)?\.com(:\d*)?\//i);if(t){var n=t[0];return(e.split(n)[0]+n).replace(/\/+$/,"")}return null}function t(){for(var e,t=p.getElementsByTagName("script"),n=0;n<t.length;n++)if(e=c(t[n].src)){r=e;break}return r}function u(e){return null!==(e||r).match(/preview\.xing(-share)?\.com$/)}function l(e){return null!==(e||r).match(/env\.xing\.com$/)}function h(e){var t=e||r,n=i;return u(t)?n=a:l(t)&&(n=o),n}return t(),{PRODUCTION:i,SANDBOX:o,PREVIEW:a,config:function(e){var t,n="xingcomdev";switch(e||h()){case i:t="https://www.xing.com",n="xingcomprod";break;case o:t=r;break;default:t=r.replace(".xing-share.",".xing.")}return{STATICS_HOST:r,BACKEND_HOST:t,TRACKING_ACCOUNT:n}},host:t,hostFrom:c,isPreviewEnvironment:u,isSandboxEnvironment:l,name:h}},(l=l||{}).events=l.events||{},l.events.attach=function(e,t,n){var r;return e.addEventListener?r=e.addEventListener(t,n,!1):e.attachEvent&&(r=e.attachEvent("on"+t,n)),r},l.events.detach=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},(l=l||{}).extend=function(e,t){var n;for(n in t)e[n]=t[n];return e},(l=l||{}).factoryInitializer=function(t){"loading"===p.readyState?l.events.attach(p,"readystatechange",function e(){"interactive"===p.readyState&&(l.events.detach(p,"readystatechange",e),t.init())}):t.init()},(l=l||{}).getDocumentFrom=function(e){var t=e.contentWindow||e.contentDocument;return t&&t.document&&(t=t.document),t},(l=l||{}).getHost=function(e){var t,n;return(t=(e=e||((n=p.createElement("a")).href=" ",n.href)).split("/"))[0]+"//"+t[2]+"/"},(l=l||{}).indexOf=function(e,t,n){if(n=n||0,Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},(l=l||{}).noop=function(){return t},(l=l||{}).openPopup=function(e,t,n){var r=530,i=570,o=n.h||r,a=n.w||i,s=Math.floor((u.screen.width-a)/2),c=Math.floor((u.screen.height-o)/2);return u.open(e,t,"toolbar=0, menubar=0, status=0, directories=0, location=0, resizable=1, scrollbars=1, width="+a+", height="+o+", top="+c+", left="+s)},(l=l||{}).parseJson=function(e){try{return"string"==typeof e&&e?(e=this.trim(e),/^[\],:{}\s]*$/.test(e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))?u.JSON&&u.JSON.parse?u.JSON.parse(e):new Function("return "+e)():{err:"Invalid JSON config"}):null}catch(e){return{err:e}}},(l=l||{}).setAttributes=function(e,t){for(var n in t)e.setAttribute(n,t[n])},(l=l||{}).setStyles=function(e,t){for(var n in t)e.style[n]=t[n]},(l=l||{}).subclass=function(e,t,n){function r(){}return r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t,n&&this.extend(t.prototype,n),t},(l=l||{}).trim=function(e){return String.prototype.trim?e.trim():e.replace(/^\s\s*/,"")},(l=l||{}).writeContentToFrame=function(e,t,n){var r=l.getDocumentFrom(e),i={height:18,width:1};r&&(l.setStyles(e,{height:[i.height,"px"].join(""),visibility:"hidden",width:[i.width,"px"].join("")}),n&&l.events.attach(e,"load",function(){setTimeout(function(){l.setIframeDimensions(e)},50)}),r.open(),r.write(t),r.close())},l.setIframeDimensions=function(e){var t=l.getDocumentFrom(e),n={};if(t&&t.body){var r=t.scrollingElement?t.scrollingElement:t.body;18<r.scrollWidth?(n={height:Math.floor(r.scrollHeight),width:Math.floor(r.scrollWidth)+1},e.height=n.height,e.width=n.width,l.setStyles(e,{height:[n.height,"px"].join(""),visibility:"visible",width:[n.width,"px"].join("")})):setTimeout(function(){l.setIframeDimensions(e)},100)}},(l=l||{}).xdomainEvents=[],l.xdomain=function(n,r,e,i){var t,o="m"+(new Date).getTime(),a={attributes:{height:0,id:o,name:o,width:0},styles:{display:"none",height:0,width:0}},s=n.document.createElement("iframe"),c=null;t=[r,e,"?","callback_domain","=",encodeURIComponent(l.getHost()),"&","id","=",o].join(""),i.path&&(c={path:i.path,id:o},i.data&&(c.data=i.data),i.method&&(c.method=i.method),i.dataType&&(c.dataType=i.dataType)),null===p.getElementById(o)&&(l.xdomainEvents[o]=function(e){!function(e){var t;e.origin===r&&(t=function(e){var t="",n={};if(e){t=e;try{n=JSON.parse(e)}catch(e){n={}}}return{string:t,json:n}}(e.data)).json.id===o&&function(e){switch(e.json.success){case"READY":c&&(s.contentWindow.postMessage(JSON.stringify(c),r),c=null);break;default:i.callback(e.string),function(){var e;l.events.detach(n,"message",l.xdomainEvents[o]),delete l.xdomainEvents[o],(e=n.document.getElementById(o)).parentNode.removeChild(e)}()}}(t)}(e)},a.attributes.src=t,l.setAttributes(s,a.attributes),l.setStyles(s,a.styles),n.document.getElementsByTagName("body")[0].appendChild(s),l.events.attach(n,"message",l.xdomainEvents[o]))},i.prototype={rendered:!1,extendConfigTo:function(e){return l.extend(e,this),this},render:function(){var e,t,n=this,r=n.node,i='<link type="text/css" rel="stylesheet" href="'+n.config.resource.css+'">';!n.rendered&&r.parentNode&&(e=p.createElement("iframe"),l.setAttributes(e,{allowTransparency:!0,frameBorder:"none",seamless:"seamless",scrolling:"no",src:"javascript:'<html></html>'"}),l.setStyles(e,{background:"transparent",border:"none",padding:"0"}),r.parentNode.insertBefore(e,r),r.parentNode.removeChild(r),t='<!DOCTYPE html><html><head><meta charset="utf-8">'+i+'</head><body><div class="spi-wrapper">'+n.config.resource.html+"</div></body></html>",l.writeContentToFrame(e,t,n.config.visibleOnRender),n.frame=e,n.frameDocument=l.getDocumentFrom(n.frame),n.rendered=!0,n.attachEvents())},validateConfigEntry:function(e,t,n,r,i){return(e[t]&&n&&-1===l.indexOf(n,e[t])||!e[t])&&(e[t]=r),this},attachEvents:function(){return this}},o.prototype.init=function(){var e;e=this.collectElements(),this.createPlugins(e),this.renderPlugins()},o.prototype.collectElements=function(){return p.querySelectorAll(this.PLUGIN_SELECTOR)},o.prototype.createPlugins=function(e){for(var t=0,n=e.length;t<n;t++)this.plugins.push(new this.product(e[t]))},o.prototype.renderPlugins=function(){for(var e=0,t=this.plugins.length;e<t;e++)this.renderPluginWithDelay(this.plugins[e],e)},o.prototype.renderPluginWithDelay=function(e,t){setTimeout(function(){e.render()},50*(t+1))};var s=l.subclass(i,function(e){var t={plugin:"share"};return i.call(this,t,e),this.config=this.setConfig(t,e),this},{resources:{css:n.css,js:n.js,html:'<div id="xing-share" class="spi-button spi-button-<%shape%> spi-button-green" title="<%title%>"><i></i><%label%></div>',counter:'<div id="share-counter" class="spi-button-counter spi-button-counter-<%counter-position%> spi-button-<%shape%>-counter">&hellip;</div>',beak:'<div class="spi-button-counter-<%counter-position%>-beak spi-button-<%shape%>-counter-beak"><i></i></div>'},getSharePageUrl:function(){var e=this,t=[e.config.shape,(e.config.counter||"no")+"_counter"].join("-");return[h.BACKEND_HOST+"/spi/shares/new","?url=",encodeURIComponent(e.config.url),"&button_style=",t,e.config.followUrl?"&follow_url="+encodeURIComponent(e.config.followUrl):""].join("")},setConfig:function(e,t){var n,r,i,o=this;return e.url=o.getShareUrl(),e.language=t.getAttribute("data-lang")||e.language,o.validateConfigEntry(e,"language",["en","de"],"en"),e.shape=t.getAttribute("data-shape")||t.getAttribute("data-button-shape")||e.shape,"small_square"===e.shape&&(e.shape="square"),o.validateConfigEntry(e,"shape",["rectangle","square"],"rectangle"),e.counter=t.getAttribute("data-counter")||null,"no_count"===e.counter&&(e.counter=null),e.counter&&o.validateConfigEntry(e,"counter",["right","top"],"right"),e.followUrl=t.getAttribute("data-follow-url")||null,r=a[e.language].label,e.resource.css=h.STATICS_HOST+o.resources.css,e.resource.html=o.resources.html.replace(/<%shape%>/g,e.shape).replace(/<%label%>/g,r).replace(/<%title%>/g,a[e.language].title),e.counter&&(n=o.resources.beak.replace(/<%counter-position%>/g,e.counter).replace(/<%shape%>/g,e.shape),i=o.resources.counter.replace(/<%counter-position%>/g,e.counter).replace(/<%shape%>/g,e.shape),"top"===e.counter?e.resource.html=i+n+e.resource.html:e.resource.html+=n+i),e},attachEvents:function(){var t=this;function n(){var e=t.getSharePageUrl();t.popup=l.openPopup(e,"xing_share_popup",r),t.config.counter&&t.checkIfShared()}return function e(){t.frameDocument&&t.frameDocument.getElementById("xing-share")?(l.events.attach(t.frameDocument.getElementById("xing-share"),"click",n),t.config.counter&&t.getStatisticsFor(t.config.url)):setTimeout(e,100)}(),t},getShareUrl:function(){var e=this.node.getAttribute("data-url");return e=e||u.location.href},getStatisticsFor:function(e){var t=this,n={callback:function(e){t.showStatistics.call(t,e)},data:{url:e},path:"/shares/statistics",method:"POST",scope:"xing-share"};new l.xdomain(u,h.STATICS_HOST,"/spi/message_proxy",n)},showStatistics:function(e){var t,n;n=l.parseJson(e),t=parseInt(n.share_counter),isNaN(t)||(this.frameDocument.getElementById("share-counter").innerHTML=t),l.setIframeDimensions(this.frame)},checkIfShared:function(){var e=this;e.popup&&!e.popup.closed?setTimeout(function(){e.checkIfShared.call(e)},350):(e.popup=t,e.getStatisticsFor(e.config.url))}}),c=new o("share"),h=l.environment(n.js,e).config();l.factoryInitializer(c)}(window,document);