function C(){if(!(typeof window>"u"||window.__wdeftksaOutboundInit)){window.__wdeftksaOutboundInit=!0;try{const n="wdeftksa",o="referral",r="outbound",c="company_url",l=["wdeftksa.com","www.wdeftksa.com","online.wdeftksa.com","cdn.wdeftksa.com"],s=["jobs.sa","apps.apple.com","play.google.com","t.me","wa.me","googlesyndication.com","doubleclick.net","googleadservices.com","g.doubleclick.net"],h=t=>t==="http:"||t==="https:",p=(t,e)=>{const a=(e||"").toLowerCase();if(!a)return!1;for(const f of t){const m=(f||"").toLowerCase();if(m&&(a===m||a.endsWith(`.${m}`)))return!0}return!1},y=t=>p(l,t),L=t=>p(s,t),i=(()=>{try{const t=new URL(window.location.href);if(t.pathname.includes("/company/"))return`${t.origin}${t.pathname}`;const e=document.querySelector('a[href*="/company/"]');if(e&&e.href){const a=new URL(e.href,window.location.href);return`${a.origin}${a.pathname}`}}catch{}return null})(),g=t=>{try{return t.hasAttribute("data-no-utm")}catch{return!1}},k=t=>{try{return t?(t.getAttribute("rel")||"").toLowerCase().includes("sponsored")?!0:!!t.closest(".ad, .ads, .ad-auto, .wdeftksssacat, [data-ad], [data-adslot]"):!1}catch{return!1}},_=t=>{const e=new URL(t,window.location.href);return!h(e.protocol)||y(e.hostname)||L(e.hostname)?null:(e.searchParams.has("utm_source")||e.searchParams.set("utm_source",n),e.searchParams.has("utm_medium")||e.searchParams.set("utm_medium",o),e.searchParams.has("utm_campaign")||e.searchParams.set("utm_campaign",r),i&&!e.searchParams.has(c)&&e.searchParams.set(c,i),e.toString())},b=t=>t.defaultPrevented||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey,u=t=>t&&typeof t.closest=="function"?t.closest("a[href]"):null,A=t=>{try{window.dataLayer=window.dataLayer||[];const e=new URL(t);window.dataLayer.push({event:"click_outbound",link_url:t,link_host:e.hostname,page:window.location.href,company_url:typeof i=="string"?i:"",company_url_attached:!!i})}catch{}},d=(t,e)=>{if(!e||!e.href||g(e)||k(e))return;const a=_(e.href);if(!a)return;const f=(e.getAttribute("target")||"").toLowerCase();if(b(t)){e.href=a;return}t.preventDefault(),A(a),f==="_blank"?window.open(a,"_blank","noopener"):window.location.href=a},v=t=>{const e=u(t.target);e&&d(t,e)},E=t=>{if(t.button!==1)return;const e=u(t.target);e&&d(t,e)},M=t=>{if(t.key!=="Enter")return;const e=u(t.target);e&&d(t,e)};document.addEventListener("click",v,{capture:!0,passive:!1}),document.addEventListener("auxclick",E,{capture:!0,passive:!1}),document.addEventListener("keydown",M,{capture:!0,passive:!0})}catch{}}}function U(n){n.querySelectorAll("[data-apply-button]").forEach(r=>{r.addEventListener("click",()=>{r.classList.add("animate-press"),window.setTimeout(()=>r.classList.remove("animate-press"),150)})})}function S(n){n.querySelectorAll("[data-share-link]").forEach(r=>{r.addEventListener("click",()=>{r.classList.add("animate-press"),window.setTimeout(()=>r.classList.remove("animate-press"),150)})})}function T(n){const o=n.querySelector("#copy-link");if(!o)return;const r=o.innerHTML,c=()=>{o.innerHTML=r,o.classList.remove("bg-status-live/10","border-status-live","text-status-live")};o.addEventListener("click",()=>{const l=o.getAttribute("data-url")||window.location.href,s=()=>{o.innerHTML="تم النسخ!",o.classList.add("bg-status-live/10","border-status-live","text-status-live"),window.setTimeout(c,2e3)};navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(l).then(s).catch(()=>{window.alert("تم نسخ رابط الوظيفة إلى الحافظة"),s()}):(window.alert("تم نسخ رابط الوظيفة إلى الحافظة"),s())})}function w(){const n=document.querySelector("[data-job-details-mobile]");n&&(U(n),S(n),T(n))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w):w();C();w();