PageSourceSearch

https://employmenthero.com/wp-content/plugins/employmentherocom202…/view.js?ver=cecdf1991adcd2338295

js employmenthero.com collected 2026-09-24 08:35:27 UTC 14,266 bytes, 1 lines download raw bytes

1import{getConfig as e,getContext as t,store as r}from"@wordpress/interactivity";const a="eh-learn-results",n=e=>{void 0!==window.dataLayer&&window.dataLayer.push(e)},o=`[data-wp-interactive="${a}"][data-learn-results-root]`,i=`${a}:load-more`,s=e=>{if(!e)return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value},l=e=>"video"===e||"webinar"===e,c=e=>l(e?.type)&&!!e?.showPlayBtn&&!!e?.wistiaVideoId;let d=0,u=null,m=null,p=[];const g=()=>{0!==p.length&&(p.forEach(e=>e.remove()),p=[])},h={video:"On Demand",webinar:"Upcoming Webinar",article:"Article",guide:"Guide","case-study":"Case Study",downloadable:"Resources"},y=(e,t)=>"news"===(t??"").toLowerCase()?"News":h[e]??"Article",w=e=>{if(!e)return"";const t="number"==typeof e?new Date(1e3*e):new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},f=e=>{if(!e)return"";const t="number"==typeof e?new Date(1e3*e):new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)},b=e=>{if(!e)return 0;const t="number"==typeof e||/^\d+$/.test(String(e))?new Date(1e3*Number(e)):new Date(e);return Number.isNaN(t.getTime())?0:Math.floor(t.getTime()/1e3)},_=(e,t)=>{const r=s(String(e||t||"")).trim().replace(/^[“”"]+|[“”"]+$/gu,"").trim();return r?`“${r}”`:""},v=(e="")=>{const t=String(e).toLowerCase().replace(/[&-]/g," ").replace(/\s+/g," ").trim();return"ai and automation"===t||"ai automation"===t},C=(e,t)=>{if(document.querySelector(`script[src="${e}"]`))return;const r=document.createElement("script");r.src=e,r.async=!0,t&&(r.type=t),document.head.appendChild(r)},L=e=>{(e=>{["controls-visible-on-load","controlsvisibleonload","play-bar","playbar","play-button","playbutton","small-play-button","smallplaybutton","volume-control","volumecontrol","settings-control","settingscontrol","fullscreen-button","fullscreenbutton","play-pause-notifier","playpausenotifier","big-play-button","bigplaybutton","copy-link-and-thumbnail"].forEach(t=>e.setAttribute(t,"false")),e.setAttribute("rounded-player","0"),e.controlsVisibleOnLoad=!1,e.playbar=!1,e.playButton=!1,e.smallPlayButton=!1,e.volumeControl=!1,e.settingsControl=!1,e.fullscreenButton=!1,e.playPauseNotifier=!1,e.bigPlayButton=!1,e.copyLinkAndThumbnail=!1,e.roundedPlayer=0})(e),(e=>{e.setAttribute("muted",""),e.setAttribute("volume","0"),e.muted=!0,e.volume=0,"function"==typeof e.mute&&e.mute()})(e),(e=>{const t=e.shadowRoot;if(!t||t.querySelector("style[data-eh-preview-links]"))return;const r=document.createElement("style");r.dataset.ehPreviewLinks="",r.textContent=".w-bottom-bar-right.w-css-reset { display: none !important; }",t.appendChild(r)})(e)},S=e=>{L(e),"true"!==e.dataset.ehPreviewConfigured&&(e.dataset.ehPreviewConfigured="true",e.addEventListener("api-ready",()=>L(e)),e.addEventListener("play",()=>L(e)))},k=e=>{const t=Number(e.dateTimestamp);if(Number.isFinite(t)&&t>0)return t;const r=Date.parse(e.dateIso||e.date||"");return Number.isNaN(r)?0:r/1e3},T=(e,t)=>
1{if(1===e.size)return e.keys().next().value;let r=null,a=1/0;for(const[n,o]of e)n!==t&&o[0].index<a&&(r=n,a=o[0].index);return r??e.keys().next().value},M=e=>{const t=e.map((e,t)=>({card:e,index:t,timestamp:k(e)})).sort((e,t)=>t.timestamp-e.timestamp||e.index-t.index),r=new Map;t.forEach((e,t)=>{const a=(n=e.card,String(n?.type||"article").trim().toLowerCase());var n;r.has(a)||r.set(a,[]),r.get(a).push({card:e.card,index:t})});const a=[];let n=null;for(;r.size;){const e=T(r,n),t=r.get(e);a.push(t.shift().card),0===t.length&&r.delete(e),n=e}return a},A=e=>"video"===e?.type||"webinar"===e?.type&&c(e)?2:1,x=e=>{const t=[...e],r=()=>t.length,a=[];let n=0,o=0;for(;o<r();){const e=A(t[o]);if(n+e<=4)a.push(t[o++]),n+=e,4===n&&(n=0);else{if(3===n){const e=Math.min(o+4,r()-1);for(let r=o+1;r<=e;r++)if(1===A(t[r])){a.push(t.splice(r,1)[0]);break}}n=0}}return a},D=e=>{const t=e.map(e=>String(e?.id??"")).sort().join(",");let r=5381;for(let e=0;e<t.length;e++)r=((r<<5)+r^t.charCodeAt(e))>>>0;return r||1},N=e=>((e=((e=(e^e<<13)>>>0)^e>>>17)>>>0)^e<<5)>>>0,$=(e,t)=>{const r=[...e];let a=t>>>0||1;for(let e=r.length-1;e>0;e--){a=N(a);const t=a%(e+1);[r[e],r[t]]=[r[t],r[e]]}return r},q=(e,t=!1)=>{switch(e){case"case-study":return{tagLabel:"Case Study",tagCls:"tag-light"};case"video":return{tagLabel:"Video",tagCls:"tag-sky"};case"webinar":return t?{tagLabel:"Upcoming Webinar",tagCls:"tag-green"}:{tagLabel:"On Demand",tagCls:"tag-sky"};default:return{tagLabel:"",tagCls:""}}},E=(e,t)=>{if("video"!==e||!t)return"";const r=String(t).match(/(\d+)/);return r?`${r[1]} min watch`:""},F=e=>{const t=String(e??"").replace(/<[^>]+>/g,"").trim().split(/\s+/).slice(0,12).join(" ");return t?`${s(t)}.`:""},R=e=>{const t=((e="")=>{const t=e.toLowerCase().trim();return t.includes("case")?"case-study":t.includes("on demand")||t.includes("video")?"video":t.includes("webinar")?"webinar":t.includes("guide")?"guide":["download","factsheet","template","checklist","polic","report"].some(e=>t.includes(e))?"downloadable":"article"})(e.search_post_type),r=(e=>e.homepage_thumbnail_url?e.homepage_thumbnail_url:e.post_thumbnail||e.images?.full?.url||e.images?.resources_tile_large?.url||e.images?.thumbnail?.url||"")(e),a=l(t),n="webinar"===t?(e=>{const t=e.event_start_datetime??"";if(!t)return"";const r="number"==typeof t?new Date(1e3*t):new Date(t);if(Number.isNaN(r.getTime()))return"";if(r>new Date)return`Upcoming — ${r.getUTCDate()} ${r.toLocaleDateString("en-US",{month:"short",timeZone:"UTC"})}`;let a="";const n=e.event_end_datetime??"";if(n){const e="number"==typeof n?new Date(1e3*n):new Date(n);if(!Number.isNaN(e.getTime())){const t=Math.round((e.getTime()-r.getTime())/6e4);t>0&&(a=` — ${t} min`)}}return"On demand"+a})(e):"",o="webinar"===t&&n.startsWith("Upcoming"),i=s(e.primary_topic??e.taxonomies?.learn_topic?.[0]??e.taxonomies?.topic?.[0]??"");return{id:String(e.objectID),type:t,permalink:String(e.permalink??""),title:s(String(e.post_title??"")),excerpt:F(e.post_excerpt),thumbUrl:r,duration:E(t,e.reading_time),format:y(t,e.search_post_type),...q(t,o),date:w(e.post_date),dateIso:f(e.post_date),dateTimestamp:b(e.post_date),topic:i,isAiTopic:v(i),authorRole:"case-study"===t?String(e._cs_card_job_title??""):"",csQuote:"case-study"===t?_(e._cs_card_quote,e.post_title):"",csAuthor:"case-study"===t?String(e._cs_card_author??""):"",logoUrl:"case-study"===t?String(e._cs_glance_logo_url??""):"",logoDarkMode:"case-study"===t?e._cs_logo_dark_mode??"invert":"",showPlayBtn:a&&!o,wistiaVideoId:String(e.wistia_video_id??e.wistia_media_id??"")}},{state:H}=r(a,{state:{loadMoreCount:0,get hasReachedLoadMoreCap(){return H.hasViewAll&&H.loadMoreCount>=3},get isLoadMoreHidden(){return!H.hasMore||H.hasReachedLoadMoreCap},get showingLabel(){return(e(a).showingLabelTemplate??"Showing %1$s of %2$s results").replace("%1$s",String(H.showingCount)).replace("%2$s",String(H.nbHits))},get showingCount(){return H.showFiltered?H.filteredCards.length:H.ssrCount+H.ssrExtra.length}},callbacks:{positionResultsMeta(){const e=document.querySelector(".lfp-results-meta"),t=document.querySelector("[data-learn-results-meta-slot]");e&&t&&!t.contains(e)&&t.appendChild(e)},isArticleCard(){const{card:e}=t();return r=e?.type,"article"===r||"guide"===r||"downloadable"===r;var r},isAvCard(){const{card:e}=t();return l(e?.type)},isCsCard(){const{card:e}=t();return r=e?.type,"case-study"===r;var r},cardClass(){const{card:e}=t(),r=e?.type??"article";return l(r)?`card card--${r}${"webinar"!==r||e?.showPlayBtn?"":" card--upcoming"}${"webinar"===r&&c(e)?" card--wide":""}`:`card card--${r}`},formatClass(){const{card:e}=t();return`card-format card-format--${e?.type??"article"}`},articleThumbClass(){const{card:e}=t();return"card-thumb card-thumb--article"+(e?.thumbUrl?"":" card-thumb--placeholder")}
1,cardThumbBackgroundImage(){const{card:e}=t();return r=e?.thumbUrl,r?`url(${JSON.stringify(String(r))})`:"";var r},articleCtaText(){const{card:e}=t();return"guide"===e?.type?"Read full guide":"Read full article"},avTagClass(){const{card:e}=t();return`card-tag ${e?.tagCls??""}`},csBannerClass(){const{card:e}=t();return"cs-banner"+(e?.thumbUrl?"":" cs-banner--placeholder")},csImgClass(){const{card:e}=t();return"cs-feature-img"+(e?.logoUrl?"":" ")},csLogoClass(){const{card:e}=t();return"no-invert"===e?.logoDarkMode?"no-invert-on-dark":"invert-on-dark"},initBlock(){const{actions:e}=r(a);e.showLoading(),e.hideLoading()},isDownloadableType(){const{card:e}=t();return"downloadable"===e?.type},isArticleType(){const{card:e}=t();return"article"===e?.type},isGuideType(){const{card:e}=t();return"guide"===e?.type},hasWistiaPreview(){const{card:e}=t();return c(e)},isSkeletonHidden:()=>!H.isLoading,isSsrGridHidden:()=>H.showFiltered||H.isLoading,isFilteredGridHidden:()=>!H.showFiltered||H.isLoading,isFilteredEmptyStateHidden:()=>H.filteredCards.length>0,isAiTopic(){const{card:e}=t();return!!e?.isAiTopic},hasTextTopic(){const{card:e}=t();return!!e?.topic&&!e?.isAiTopic}},actions:{reset(){g(),u&&(window.clearTimeout(u),u=null),d=0,m=null,H.filteredCards=[],H.ssrExtra=[],H.showFiltered=!1,H.isLoading=!1,H.isLoadingMore=!1,H.hasMore=H.initialHasMore,H.page=0,H.nbHits=H.initialNbHits,H.loadMoreCount=0},showLoading(){u&&(window.clearTimeout(u),u=null),d=Date.now(),H.isLoading=!0},hideLoading(){u&&(window.clearTimeout(u),u=null);const e=()=>{u=null,d=0,H.isLoading=!1,requestAnimationFrame(()=>{m&&((e=>{e?.length&&document.querySelectorAll(".loading-skeleton [data-skeleton-card]").forEach((t,r)=>{const a=e[r];t.hidden=!a,t.classList.toggle("card--wide",!!a&&c(a))})})(m),m=null);const e=H.showFiltered?document.querySelector(".cards-grid--filtered"):document.querySelector(".cards-grid--ssr");if(!e)return;const t=[...e.querySelectorAll(".card")],r=new Map;for(const e of t){const t=Math.round(e.getBoundingClientRect().top);r.has(t)||r.set(t,[]),r.get(t).push(e)}let a=0;for(const e of r.values()){for(const t of e)t.style.animationDelay=`${a}ms`,t.classList.add("card--cascade-in");a+=40}})},t=d?Date.now()-d:1501,r=Math.max(0,1501-t);r>0?u=window.setTimeout(e,r):e()},setResults(e,t={}){g();const{hasMore:n=!1,page:o=1,filtered:i=!0,nbHits:s}=t;void 0!==s&&(H.nbHits=s);const{actions:l}=r(a),c=e??[];m=c,H.isLoadingMore=!1,H.hasMore=n,H.page=o,i?(H.filteredCards=c,H.ssrExtra=[],H.showFiltered=!0):(H.ssrExtra=c,H.filteredCards=[],H.showFiltered=!1),l.hideLoading()},appendResult(e,t){const r=e??[],a=H.showFiltered;g();const n=document.querySelector(a?".cards-grid--filtered":".cards-grid--ssr"),o=n?n.getBoundingClientRect().bottom+window.scrollY:0;a?H.filteredCards=[...H.filteredCards,...r]:H.ssrExtra=[...H.ssrExtra,...r],H.page=H.page+1,H.hasMore=void 0!==t?t:H.hasMore,H.isLoadingMore=!1,r.length>0&&H.loadMoreCount++,r.length>0&&o>0&&requestAnimationFrame(()=>{const e=o-.15*window.innerHeight;e>window.scrollY&&window.scrollTo({top:e,behavior:"smooth"})})},trackViewAllClick(e){const t=r("eh-learn-filter");n({event:"learn_block_cta_click",cta_text:"View all resources",cta_destination:e.currentTarget?.href||"",content_section:t?.state?.activeTabLabel||""})},loadMore(){if(H.isLoadingMore||H.isLoadMoreHidden)return;const e=r("eh-learn-filter");n({event:"learn_block_cta_click",cta_text:"Load more",cta_destination:"",content_section:e?.state?.activeTabLabel||""});const t=document.querySelector(o),a=Number.parseInt(t?.dataset?.perPage??"",10)||0;a<=0||(H.isLoadingMore=!0,(e=>{const t=document.querySelector(H.showFiltered?".cards-grid--filtered":".cards-grid--ssr"),r=document.querySelectorAll(".loading-skeleton [data-skeleton-card]");if(!t||0===r.length)return;const a=document.createDocumentFragment();for(let t=0;t<e;t++){const e=r[t%r.length].cloneNode(!0);e.removeAttribute("hidden"),delete e.dataset.skeletonCard,e.setAttribute("aria-hidden","true"),p.push(e),a.appendChild(e)}t.appendChild(a)})(a),document.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:{page:H.page+1,perPage:a}})))},clearFilters(){const{actions:e}=r("eh-learn-filter");"function"==typeof e?.clearFilters&&e.clearFilters()},setAlgoliaResults(e,t={}){const{actions:n}=r(a),i=document.querySelector(o)?.dataset?.orderMode??"";let s=(e??[]).map(R);"interleave"===i||"interleave-only"===i?s=M(s):"interleave-pack"===i?s=x(M(s)):"random-dense"===i&&(s=$(s,D(s))),n.setResults(s,t)}
1,appendAlgoliaResults(e,t){const{actions:n}=r(a),i=document.querySelector(o)?.dataset?.orderMode??"";let s=(e??[]).map(R);"interleave"===i||"interleave-only"===i?s=M(s):"interleave-pack"===i?s=x(M(s)):"random-dense"===i&&(s=$(s,D(s))),n.appendResult(s,t)},hoverAvCard(e){if(!window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: 769px)").matches)return;const t=e.currentTarget,r=t?.querySelector?.("wistia-player");r&&(t.classList.remove("is-preview-ready"),(e=>{const t=e.getAttribute("media-id")||e.mediaId||e.mediaID;t&&(C("https://fast.wistia.com/player.js"),C(`https://fast.wistia.com/embed/${t}.js`,"module"))})(r),customElements.whenDefined("wistia-player").then(()=>{if(!t.matches(":hover"))return;S(r);const e=()=>{window.requestAnimationFrame(()=>{t.matches(":hover")&&t.classList.add("is-preview-ready")})};if(r.addEventListener("play",e,{once:!0}),"function"==typeof r.play){const t=r.play();t&&"function"==typeof t.catch&&t.then(()=>{S(r),e()}).catch(()=>{})}}))},unhoverAvCard(e){const t=e.currentTarget;t?.classList?.remove("is-preview-ready");const r=t?.querySelector?.("wistia-player");r&&customElements.whenDefined("wistia-player").then(()=>{"function"==typeof r.pause&&r.pause(),"function"==typeof r.time&&r.time(0)})},trackCardClick(e){const{card:o}=t();if(!o)return;const i=r("eh-learn-filter"),s=i?.state?.searchQuery||"",c=i?.state?.activeTabLabel||"",{state:d}=r(a),u=d.showFiltered?".cards-grid--filtered .card":".cards-grid--ssr .card",m=[...document.querySelectorAll(u)].indexOf(e.currentTarget)+1;if(l(o.type))return void n({event:"learn_block_video_click",video_id:o.wistiaVideoId,video_title:o.title,content_position:m,click_destination:o.permalink});const p=o.type;n({event:"learn_block_click",content_type:p,content_title:o.title,content_url:o.permalink,content_position:m,content_section:c}),s&&n({event:"learn_block_search_result_click",search_term:s,content_type:p,content_title:o.title,content_url:o.permalink,content_position:m})}}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.