(()=>{"use strict";function e(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],l=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,r)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if("wa.me"===t.hostname){const o=e(r(t),2),i=o[0],a=o[1];return/^\d+$/.test(i||"")||["message","qr"].includes(n(i))&&!!a}return!!t.searchParams.get("phone")}},{type:"messenger",schemes:["fb-messenger:"],hosts:["m.me","messenger.com"],hasRecipient:t=>{if("m.me"===t.hostname)return r(t).length>0;if("messenger.com"===t.hostname){const o=e(r(t),2),i=o[0],a=o[1];return"t"===n(i)&&!!a}return["user-thread","user"].includes(t.hostname)}},{type:"telegram",schemes:["tg:"],hosts:["t.me","telegram.me"],hasRecipient:t=>{if("tg:"===t.protocol)return"resolve"===t.hostname&&!!t.searchParams.get("domain");const o=e(r(t),1)[0];return!!o&&!o.startsWith("+")&&!["share","joinchat","addstickers","proxy"].includes(n(o))}},{type:"viber",schemes:["viber:"],hasRecipient:e=>["chat","add","pa"].includes(e.hostname)},{type:"signal",schemes:["sgnl:"],hosts:["signal.me"],hasRecipient:e=>"sgnl:"===e.protocol||e.hash.startsWith("#p/")&&e.hash.length>3},{type:"line",schemes:["line:"],hosts:["line.me","page.line.me"],hasRecipient:t=>{if("page.line.me"===t.hostname)return r(t).length>0;const o="line:"===t.protocol?[t.hostname,...r(t)]:r(t),i=e("r"===n(o[0])?o.slice(1):o,4),a=i[0],c=i[1],l=i[2],s=i[3];return"ti"===n(a)&&"p"===n(c)&&!!l&&!s}}],i=Object.create(null),a=Object.create(null);o.forEach(e=>{var t,r;null===(t=e.schemes)||void 0===t||t.forEach(t=>{i[t]=e}),null===(r=e.hosts)||void 0===r||r.forEach(t=>{a[t]=e})});const c=["sponsored","ugc","nofollow"];function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t0)return r}const r=t.pathname.split("/").filter(Boolean).pop()||"";if(/^\d+$/.test(r)){const e=parseInt(r,10);if(e>0)return e}}catch(e){}const r=parseInt((null===(t=e.textContent)||void 0===t?void 0:t.trim())||"",10);return r>0?r:1}const m="https://player.vimeo.com/api/player.js",y="data-googlesitekit-vimeo-sdk";function g(){return globalThis.Vimeo}function d(e,t){return new Promise((r,n)=>{let o;function i(e){return function(){clearTimeout(o),e(...arguments)}}e.addEventListener("load",i(()=>r()),{once:!0}),e.addEventListener("error",i(()=>n(new Error("Site Kit: failed to load the Vimeo Player SDK script."))),{once:!0}),void 0!==t&&(o=setTimeout(i(()=>n(new Error("Site Kit: timed out waiting for the Vimeo Player SDK script to load."))),t))})}let b=null;function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e;const t=null===(e=g())||void 0===e?void 0:e.Player;if("function"!=typeof t)throw new Error("Site Kit: the Vimeo Player SDK script did not expose Vimeo.Player.");return t}).catch(e=>{throw b=null,e})),b)}();await Promise.allSettled(Array.from(t).map(async(t,r)=>{await async function(e,t){const r=Promise.all([e.getVideoTitle(),e.getVideoUrl()]).then(e=>{let r=(o=2,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],l=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(n,o)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(e,t):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var n,o;return{video_provider:"vimeo",video_title:r[0],video_url:r[1],video_instance_index:t}});function n(e,t){r.then(r=>{var n,o;null===(n=globalThis._googlesitekit)||void 0===n||null===(o=n.gtagEvent)||void 0===o||o.call(n,e,w(w({},r),{},{video_percent:t}))}).catch(()=>{})}r.catch(e=>{console.error("Site Kit: failed to fetch this Vimeo video’s title/URL; its engagement events will not be tracked.",e)});let o=!1,i=!1;const a=new Set;e.on("play",()=>{o||(o=!0,n("video_start",0))}),e.on("timeupdate",e=>{if(a.size===P.length)return;const t=Math.floor(100*e.percent);P.forEach(e=>{t>=e&&!a.has(e)&&(a.add(e),n("video_progress",e))})}),e.on("ended",()=>{i||(i=!0,n("video_complete",100))}),await r}(new e(t),r)}))}catch(e){console.error("Site Kit: failed to load the Vimeo Player SDK; video engagement events will not be tracked on this page.",e)}}(E());try{_=E(),globalThis.document.addEventListener("click",e=>{try{var t,r;if(!(e.target instanceof Element))return;const n=e.target.closest("".concat(f,", ").concat("body.single-topic .bbp-pagination-links a.page-numbers"));if(!n)return;const o=n.matches(f)?"post":"bbpress";null===(t=globalThis._googlesitekit)||void 0===t||null===(r=t.gtagEvent)||void 0===r||r.call(t,"pagination_click",{pagination_type:o,page_number:h(n),post_id:_.postID,transport_type:"beacon"})}catch(e){console.error("Site Kit: failed to track this pagination click.",e)}})}catch(e){console.error("Site Kit: failed to initialize pagination click tracking.",e)}var _;try{globalThis.document.addEventListener("click",e=>{try{if(!(e.target instanceof Element))return;const l=e.target.closest("a[href]");if(!l)return;let u;try{u=new URL(l.href)}catch(e){return}const f=function(e){const t=new URL(e),r="http:"===t.protocol||"https:"===t.protocol;t.hostname=r?t.hostname.replace(/^www\./,""):t.hostname.toLowerCase();const n=r?a[t.hostname]:i[t.protocol];return n?n.hasRecipient?n.hasRecipient(t)?n.type:null:n.type:null}(u);if(f){var t,r;null===(t=globalThis._googlesitekit)||void 0===t||null===(r=t.gtagEvent)||void 0===r||r.call(t,"contact_link_click",s({link_type:f},p(u)))}else{const e=function(e,t){if("http:"!==t.protocol&&"https:"!==t.protocol||t.hostname===globalThis.location.hostname)return null;const r=new Set((e.getAttribute("rel")||"").toLowerCase().split(/[\s,]+/).filter(Boolean));return c.filter(e=>r.has(e)).join(" ")||null}(l,u);var n,o;e&&(null===(n=globalThis._googlesitekit)||void 0===n||null===(o=n.gtagEvent)||void 0===o||o.call(n,"outbound_link_click",s({link_rel:e,link_url:u.href,link_domain:u.hostname},p(u))))}}catch(e){console.error("Site Kit: failed to track this link click.",e)}})}catch(e){console.error("Site Kit: failed to initialize link click tracking.",e)}})();