@hifilabs/pixel 0.16.6 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +1 -1
- package/dist/browser.min.js +1 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
package/dist/browser.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ArtistPixel=(()=>{var qe=Object.defineProperty;var Ne=(_,k,v)=>k in _?qe(_,k,{enumerable:!0,configurable:!0,writable:!0,value:v}):_[k]=v;var J=(_,k,v)=>(Ne(_,typeof k!="symbol"?k+"":k,v),v);(function(){let _="0.
|
|
1
|
+
var ArtistPixel=(()=>{var qe=Object.defineProperty;var Ne=(_,k,v)=>k in _?qe(_,k,{enumerable:!0,configurable:!0,writable:!0,value:v}):_[k]=v;var J=(_,k,v)=>(Ne(_,typeof k!="symbol"?k+"":k,v),v);(function(){let _="0.17.0";function k(t){let e="desktop";/ipad|tablet|android(?!.*mobile)/i.test(t)?e="tablet":/mobile|iphone|android.*mobile|blackberry|iemobile/i.test(t)&&(e="mobile");let n="Unknown";/edg/i.test(t)?n="Edge":/opr|opera/i.test(t)?n="Opera":/firefox/i.test(t)?n="Firefox":/chrome/i.test(t)?n="Chrome":/safari/i.test(t)&&(n="Safari");let o="Unknown";return/iphone|ipad/i.test(t)?o="iOS":/android/i.test(t)?o="Android":/windows/i.test(t)?o="Windows":/mac os/i.test(t)?o="macOS":/linux/i.test(t)?o="Linux":/cros/i.test(t)&&(o="ChromeOS"),{device_type:e,browser:n,os:o}}let v=null;function Yt(){if(!v)try{v=k(navigator.userAgent)}catch{v={device_type:"desktop",browser:"Unknown",os:"Unknown"}}return v}let s=document.currentScript,O=s?.dataset.artistId,K=s?.dataset.projectId,X=K?Jt(K):void 0;function Jt(t){return!t||t.startsWith("release_")||t.startsWith("merch_")||t.startsWith("link_")||t.startsWith("custom_")?t:`custom_${t}`}let Q=s?.dataset.emulator==="true",yt=s?.dataset.debug==="true",Z=parseInt(s?.dataset.heartbeatInterval||"120000",10),bt=s?.dataset.heartbeat!=="false",vt=s?.dataset.source,_t=s?.dataset.endpoint,f=window.__artistPixelConfig||{},j=s?.dataset.metaPixelId||f.metaPixelId,L=s?.dataset.tiktokPixelId||f.tiktokPixelId,p=s?.dataset.googleAdsId||f.googleAdsId,kt=s?.dataset.googleAdsConversionLabel||f.googleAdsConversionLabel,U=s?.dataset.googleTagManagerId||f.googleTagManagerId,h=s?.dataset.googleAnalyticsId||f.googleAnalyticsId,m={pageview:(s?.dataset.forwardPageview??f.forwardPageview)!=="false",purchase:(s?.dataset.forwardPurchase??f.forwardPurchase)!=="false",addToCart:(s?.dataset.forwardAddToCart??f.forwardAddToCart)!=="false",lead:(s?.dataset.forwardLead??f.forwardLead)!=="false",viewContent:(s?.dataset.forwardViewContent??f.forwardViewContent)!=="false",initiateCheckout:(s?.dataset.forwardInitiateCheckout??f.forwardInitiateCheckout)!=="false",completeRegistration:(s?.dataset.forwardCompleteRegistration??f.forwardCompleteRegistration)!=="false",subscribe:(s?.dataset.forwardSubscribe??f.forwardSubscribe)!=="false",search:(s?.dataset.forwardSearch??f.forwardSearch)!=="false",contact:(s?.dataset.forwardContact??f.forwardContact)!=="false",custom:(s?.dataset.forwardCustom||f.forwardCustom||"").split(",").filter(Boolean)},F=!!(j||L||p||U||h),tt=s?.dataset.consentUi==="true",Kt=s?.dataset.consentStyle||"brutalist",Xt=s?.dataset.primaryColor,Qt=s?.dataset.bannerPosition||"bottom",It=s?.dataset.excludePages?.split(",").filter(Boolean)||[],xt=s?.dataset.trackFileDownloads==="true",Zt=s?.dataset.hashRouting==="true";function te(){if(vt)return vt;let t=typeof window.dataLayer<"u"&&Array.isArray(window.dataLayer),e=typeof window.gtag=="function";return t&&e?"gtm":"pixel"}let G="pixel";if(!O){S(" Error: data-artist-id attribute is required");return}let Ct="session_id",et="session_timestamp",St="attribution",y="fan_id_hash",nt="visitor_id",B="artistPixel_consent",ee=365*24*60*60*1e3,ne=30*24*60*60*1e3,ae=60*60*1e3,w="balance_";function oe(t){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");return new RegExp("^"+e+"$")}function ie(t){if(It.length===0)return!1;try{let e=new URL(t,window.location.origin).pathname;return It.some(n=>oe(n).test(e))}catch{return!1}}let re=[".pdf",".zip",".tar",".gz",".rar",".7z",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".mp3",".wav",".flac",".aac",".ogg",".mp4",".mov",".avi",".mkv",".webm",".exe",".dmg",".pkg",".deb",".rpm",".csv",".json",".xml",".txt"];function Pt(t){try{let e=new URL(t,window.location.origin).pathname.toLowerCase();return re.some(n=>e.endsWith(n))}catch{return!1}}function se(t,e){try{let o=new URL(t,window.location.origin).pathname.split("/").pop()||"unknown",c=o.includes(".")?o.split(".").pop():"unknown";a("File download tracked:",{url:t,fileName:o,fileExtension:c});let d=P({event_name:"custom",metadata:{event_type:"file_download",file_url:t,file_name:o,file_extension:c,link_text:e?.textContent?.trim().substring(0,100)||""}});E(d)}catch(n){S("Failed to track file download:",n)}}let ce="https://e.os.xyz",Et="https://us-central1-artist-os-distro.cloudfunctions.net/ingestEvents",de="https://us-central1-artist-os-distro.cloudfunctions.net/identityHashIdentity",A=_t||(Q?"http://localhost:5001/artist-os-distro/us-central1/ingestEvents":ce),q=null,b=null,g=null,l=null,R={},at={},I=[],ot=null,x="session",D=null,it=0,rt=0,M=0,N=!0,st=0,ct=!1,le=2*60*1e3,Tt=Date.now(),H=!1,ge=!yt,a=(...t)=>{yt&&console.log("[artistPixel]",...t)},S=(...t)=>{ge||console.error("[artistPixel]",...t)},dt={base:`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
4
4
|
position: fixed;
|