PageSourceSearch

https://www.kingcenter.com/assets-hybrid-framework--modular-js/pro…/491066d89e/js/legends/dist/legends.umd.js

js kingcenter.com collected 2026-10-03 22:04:51 UTC 3,642 bytes, 1 lines download raw bytes

1(function(p,a){typeof exports=="object"&&typeof module<"u"?module.exports=a():typeof define=="function"&&define.amd?define(a):(p=typeof globalThis<"u"?globalThis:p||self,p.Legends=a())})(this,function(){"use strict";const p={edpSidebarButtonsWrapper:".event_detail .buttonWrapper",elpButtonsWrapper:".eventItem .buttons",elpEventWrapper:".entry",elpEventLinkWrapper:".title a",homepageButtonsWrapper:".home-slideshow .buttons",homepageSlideshowWrapper:".home-slideshow",homepageEventLinkWrapper:"h3 a"};class a{constructor(e={}){var t;this.bound=new WeakSet,console.log("initializing legends"),this.options={...p,...e.options},this.edpButtonClick(),this.elpButtonClick(),this.homepageButtonClick(this.options.homepageButtonsWrapper),(t=document.getElementById("loadMoreEvents"))==null||t.addEventListener("click",()=>{console.log("re-binding elp buttons after ajax load"),this.elpButtonClick()})}getEventDetailData(){const e=document.getElementById("legends-event-json"),t=e?JSON.parse(e.textContent??"{}"):{};return{EventName:t.EventName||"",EventDate:t.EventDate||"",ImageURL:t.ImageURL||"",EventID:t.EventID||"",URL:window.location.href}}isEventDetailPage(){return document.body.id==="events"&&document.body.classList.contains("detail")}getJsonEventData(e){console.log("Legends: looking up event by URI",e);const t=document.getElementById("legends-events-json");return t?JSON.parse(t.textContent??"[]").find(o=>o.EventUri===e)??null:null}elpButtonClick(e){console.log("Legends: binding ELP buttons",e||this.options.elpButtonsWrapper),this.bindCheckout({wrapper:e||this.options.elpButtonsWrapper,stripGraphics:!0,resolveData:t=>this.getJsonEventData(this.eventUriFromTitle(t,this.options.elpEventWrapper,this.options.elpEventLinkWrapper))})}homepageButtonClick(e){console.log("Legends: binding homepage buttons",e||this.options.homepageButtonsWrapper),this.bindCheckout({wrapper:e||this.options.homepageButtonsWrapper,stripGraphics:!0,resolveData:t=>this.getJsonEventData(this.eventUriFromTitle(t,this.options.homepageSlideshowWrapper,this.options.homepageEventLinkWrapper))})}edpButtonClick(){console.log("Legends: binding EDP buttons",this.options.edpSidebarButtonsWrapper),this.bindCheckout({wrapper:this.options.edpSidebarButtonsWrapper,stripGraphics:!1,resolveData:()=>this.getEventDetailData()})}bindCheckout(e){document.querySelectorAll(`${e.wrapper} a`).forEach(n=>{if(this.bound.has(n))return;this.bound.add(n);const o=s=>{var u;if(s.type==="keyup"){const r=s.key;if(r!=="Enter"&&r!==" "&&r!=="Spacebar")return}s.preventDefault();const i=this.getButtonType(n,e.stripGraphics),l=n.getAttribute("href")??"";console.log(`Legends: ${s.type} on "${i}" button`,{checkoutUrl:l,anchor:n});const d=e.resolveData(n);if(d?console.log("Legends: resolved event data",d):console.warn("Legends: could not resolve event data for button",n),d&&((u=window.klaviyo)!=null&&u.push)){const r={...d,CheckoutURL:l};window.klaviyo.push(["track",`Started ${i} Checkout`,r]),console.log(`Legends: tracked "Started ${i} Checkout"`,r)}console.log("Legends: opening checkout URL",l),window.open(l,"_blank")};n.addEventListener("click",o),n.addEventListener("keyup",o)})}getButtonType(e,t){if(e.classList.contains("tickets"))return"Standard";let n;if(t){const o=e.cloneNode(!0);o.querySelectorAll("svg, img").forEach(s=>s.remove()),n=o.textContent??""}else n=e.textContent??"";return n.trim().replace(/\b(get|buy|purchase)\b/gi,"").trim().replace(/\b\w/g,o=>o.toUpperCase())}eventUriFromTitle(e,t,n){var i;const o=e.closest(t);return(((i=o==null?void 0:o.querySelector(n))==null?void 0:i.getAttribute("href"))||"").split("/").filter(Boolean).pop()}}return a});

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.