@trailguide/core 0.0.1 → 0.0.3

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.
@@ -1,12 +1,12 @@
1
- (function(w,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(w=typeof globalThis<"u"?globalThis:w||self,S(w.Trailguide={}))})(this,function(w){"use strict";var He=Object.defineProperty;var Ie=(w,S,T)=>S in w?He(w,S,{enumerable:!0,configurable:!0,writable:!0,value:T}):w[S]=T;var M=(w,S,T)=>Ie(w,typeof S!="symbol"?S+"":S,T);const S=Math.min,T=Math.max,it=Math.round,$=t=>({x:t,y:t}),It={left:"right",right:"left",bottom:"top",top:"bottom"},qt={start:"end",end:"start"};function ut(t,e,i){return T(t,S(e,i))}function J(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function Q(t){return t.split("-")[1]}function xt(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}const jt=new Set(["top","bottom"]);function W(t){return jt.has(q(t))?"y":"x"}function ht(t){return xt(W(t))}function Xt(t,e,i){i===void 0&&(i=!1);const n=Q(t),o=ht(t),s=dt(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ot(r)),[r,ot(r)]}function _t(t){const e=ot(t);return[pt(t),e,pt(e)]}function pt(t){return t.replace(/start|end/g,e=>qt[e])}const vt=["left","right"],bt=["right","left"],Yt=["top","bottom"],zt=["bottom","top"];function Kt(t,e,i){switch(t){case"top":case"bottom":return i?e?bt:vt:e?vt:bt;case"left":case"right":return e?Yt:zt;default:return[]}}function Gt(t,e,i,n){const o=Q(t);let s=Kt(q(t),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(pt)))),s}function ot(t){return t.replace(/left|right|bottom|top/g,e=>It[e])}function Jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function St(t){return typeof t!="number"?Jt(t):{top:t,right:t,bottom:t,left:t}}function st(t){const{x:e,y:i,width:n,height:o}=t;return{width:n,height:o,top:i,left:e,right:e+n,bottom:i+o,x:e,y:i}}function At(t,e,i){let{reference:n,floating:o}=t;const s=W(e),r=ht(e),l=dt(r),c=q(e),a=s==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[l]/2-o[l]/2;let f;switch(c){case"top":f={x:d,y:n.y-o.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(Q(e)){case"start":f[r]-=p*(i&&a?-1:1);break;case"end":f[r]+=p*(i&&a?-1:1);break}return f}async function Qt(t,e){var i;e===void 0&&(e={});const{x:n,y:o,platform:s,rects:r,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=J(e,t),h=St(f),m=l[p?u==="floating"?"reference":"floating":u],y=st(await s.getClippingRect({element:(i=await(s.isElement==null?void 0:s.isElement(m)))==null||i?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:d,strategy:c})),x=u==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),b=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},k=st(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:v,strategy:c}):x);return{top:(y.top-k.top+h.top)/b.y,bottom:(k.bottom-y.bottom+h.bottom)/b.y,left:(y.left-k.left+h.left)/b.x,right:(k.right-y.right+h.right)/b.x}}const Ut=async(t,e,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:u}=At(a,n,c),p=n,f={},h=0;for(let m=0;m<l.length;m++){var g;const{name:y,fn:x}=l[m],{x:v,y:b,data:k,reset:E}=await x({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:f,rects:a,platform:{...r,detectOverflow:(g=r.detectOverflow)!=null?g:Qt},elements:{reference:t,floating:e}});d=v??d,u=b??u,f={...f,[y]:{...f[y],...k}},E&&h<=50&&(h++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(a=E.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):E.rects),{x:d,y:u}=At(a,p,c)),m=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:f}},Zt=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:n,placement:o,rects:s,platform:r,elements:l,middlewareData:c}=e,{element:a,padding:d=0}=J(t,e)||{};if(a==null)return{};const u=St(d),p={x:i,y:n},f=ht(o),h=dt(f),g=await r.getDimensions(a),m=f==="y",y=m?"top":"left",x=m?"bottom":"right",v=m?"clientHeight":"clientWidth",b=s.reference[h]+s.reference[f]-p[f]-s.floating[h],k=p[f]-s.reference[f],E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a));let j=E?E[v]:0;(!j||!await(r.isElement==null?void 0:r.isElement(E)))&&(j=l.floating[v]||s.floating[h]);const tt=b/2-k/2,X=j/2-g[h]/2-1,V=S(u[y],X),et=S(u[x],X),_=V,nt=j-g[h]-et,C=j/2-g[h]/2+tt,Y=ut(_,C,nt),N=!c.arrow&&Q(o)!=null&&C!==Y&&s.reference[h]/2-(C<_?V:et)-g[h]/2<0,P=N?C<_?C-_:C-nt:0;return{[f]:p[f]+P,data:{[f]:Y,centerOffset:C-Y-P,...N&&{alignmentOffset:P}},reset:N}}}),te=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=J(t,e);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const y=q(o),x=W(l),v=q(l)===l,b=await(c.isRTL==null?void 0:c.isRTL(a.floating)),k=p||(v||!g?[ot(l)]:_t(l)),E=h!=="none";!p&&E&&k.push(...Gt(l,g,h,b));const j=[l,...k],tt=await c.detectOverflow(e,m),X=[];let V=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&X.push(tt[y]),u){const C=Xt(o,r,b);X.push(tt[C[0]],tt[C[1]])}if(V=[...V,{placement:o,overflows:X}],!X.every(C=>C<=0)){var et,_;const C=(((et=s.flip)==null?void 0:et.index)||0)+1,Y=j[C];if(Y&&(!(u==="alignment"?x!==W(Y):!1)||V.every(D=>W(D.placement)===x?D.overflows[0]>0:!0)))return{data:{index:C,overflows:V},reset:{placement:Y}};let N=(_=V.filter(P=>P.overflows[0]<=0).sort((P,D)=>P.overflows[1]-D.overflows[1])[0])==null?void 0:_.placement;if(!N)switch(f){case"bestFit":{var nt;const P=(nt=V.filter(D=>{if(E){const I=W(D.placement);return I===x||I==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(I=>I>0).reduce((I,We)=>I+We,0)]).sort((D,I)=>D[1]-I[1])[0])==null?void 0:nt[0];P&&(N=P);break}case"initialPlacement":N=l;break}if(o!==N)return{reset:{placement:N}}}return{}}}},ee=new Set(["left","top"]);async function ne(t,e){const{placement:i,platform:n,elements:o}=t,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=q(i),l=Q(i),c=W(i)==="y",a=ee.has(r)?-1:1,d=s&&c?-1:1,u=J(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof h=="number"&&(f=l==="end"?h*-1:h),c?{x:f*d,y:p*a}:{x:p*a,y:f*d}}const ie=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var i,n;const{x:o,y:s,placement:r,middlewareData:l}=e,c=await ne(e,t);return r===((i=l.offset)==null?void 0:i.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:r}}}}},oe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:n,placement:o,platform:s}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:c={fn:y=>{let{x,y:v}=y;return{x,y:v}}},...a}=J(t,e),d={x:i,y:n},u=await s.detectOverflow(e,a),p=W(q(o)),f=xt(p);let h=d[f],g=d[p];if(r){const y=f==="y"?"top":"left",x=f==="y"?"bottom":"right",v=h+u[y],b=h-u[x];h=ut(v,h,b)}if(l){const y=p==="y"?"top":"left",x=p==="y"?"bottom":"right",v=g+u[y],b=g-u[x];g=ut(v,g,b)}const m=c.fn({...e,[f]:h,[p]:g});return{...m,data:{x:m.x-i,y:m.y-n,enabled:{[f]:r,[p]:l}}}}}};function rt(){return typeof window<"u"}function z(t){return Ct(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function B(t){var e;return(e=(Ct(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ct(t){return rt()?t instanceof Node||t instanceof O(t).Node:!1}function L(t){return rt()?t instanceof Element||t instanceof O(t).Element:!1}function F(t){return rt()?t instanceof HTMLElement||t instanceof O(t).HTMLElement:!1}function Et(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof O(t).ShadowRoot}const se=new Set(["inline","contents"]);function U(t){const{overflow:e,overflowX:i,overflowY:n,display:o}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&!se.has(o)}const re=new Set(["table","td","th"]);function le(t){return re.has(z(t))}const ce=[":popover-open",":modal"];function lt(t){return ce.some(e=>{try{return t.matches(e)}catch{return!1}})}const ae=["transform","translate","scale","rotate","perspective"],fe=["transform","translate","scale","rotate","perspective","filter"],ue=["paint","layout","strict","content"];function gt(t){const e=mt(),i=L(t)?R(t):t;return ae.some(n=>i[n]?i[n]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!e&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!e&&(i.filter?i.filter!=="none":!1)||fe.some(n=>(i.willChange||"").includes(n))||ue.some(n=>(i.contain||"").includes(n))}function de(t){let e=H(t);for(;F(e)&&!K(e);){if(gt(e))return e;if(lt(e))return null;e=H(e)}return null}function mt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const he=new Set(["html","body","#document"]);function K(t){return he.has(z(t))}function R(t){return O(t).getComputedStyle(t)}function ct(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function H(t){if(z(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Et(t)&&t.host||B(t);return Et(e)?e.host:e}function Ot(t){const e=H(t);return K(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&U(e)?e:Ot(e)}function Tt(t,e,i){var n;e===void 0&&(e=[]);const o=Ot(t),s=o===((n=t.ownerDocument)==null?void 0:n.body),r=O(o);return s?(wt(r),e.concat(r,r.visualViewport||[],U(o)?o:[],[])):e.concat(o,Tt(o,[]))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Lt(t){const e=R(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=F(t),s=o?t.offsetWidth:i,r=o?t.offsetHeight:n,l=it(i)!==s||it(n)!==r;return l&&(i=s,n=r),{width:i,height:n,$:l}}function Rt(t){return L(t)?t:t.contextElement}function G(t){const e=Rt(t);if(!F(e))return $(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:s}=Lt(e);let r=(s?it(i.width):i.width)/n,l=(s?it(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const pe=$(0);function kt(t){const e=O(t);return!mt()||!e.visualViewport?pe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,i){return e===void 0&&(e=!1),!i||e&&i!==O(t)?!1:e}function Z(t,e,i,n){e===void 0&&(e=!1),i===void 0&&(i=!1);const o=t.getBoundingClientRect(),s=Rt(t);let r=$(1);e&&(n?L(n)&&(r=G(n)):r=G(t));const l=ge(s,i,n)?kt(s):$(0);let c=(o.left+l.x)/r.x,a=(o.top+l.y)/r.y,d=o.width/r.x,u=o.height/r.y;if(s){const p=O(s),f=n&&L(n)?O(n):n;let h=p,g=wt(h);for(;g&&n&&f!==h;){const m=G(g),y=g.getBoundingClientRect(),x=R(g),v=y.left+(g.clientLeft+parseFloat(x.paddingLeft))*m.x,b=y.top+(g.clientTop+parseFloat(x.paddingTop))*m.y;c*=m.x,a*=m.y,d*=m.x,u*=m.y,c+=v,a+=b,h=O(g),g=wt(h)}}return st({width:d,height:u,x:c,y:a})}function at(t,e){const i=ct(t).scrollLeft;return e?e.left+i:Z(B(t)).left+i}function Pt(t,e){const i=t.getBoundingClientRect(),n=i.left+e.scrollLeft-at(t,i),o=i.top+e.scrollTop;return{x:n,y:o}}function me(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const s=o==="fixed",r=B(n),l=e?lt(e.floating):!1;if(n===r||l&&s)return i;let c={scrollLeft:0,scrollTop:0},a=$(1);const d=$(0),u=F(n);if((u||!u&&!s)&&((z(n)!=="body"||U(r))&&(c=ct(n)),F(n))){const f=Z(n);a=G(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const p=r&&!u&&!s?Pt(r,c):$(0);return{width:i.width*a.x,height:i.height*a.y,x:i.x*a.x-c.scrollLeft*a.x+d.x+p.x,y:i.y*a.y-c.scrollTop*a.y+d.y+p.y}}function we(t){return Array.from(t.getClientRects())}function ye(t){const e=B(t),i=ct(t),n=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=T(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+at(t);const l=-i.scrollTop;return R(n).direction==="rtl"&&(r+=T(e.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}const Dt=25;function xe(t,e){const i=O(t),n=B(t),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,l=0,c=0;if(o){s=o.width,r=o.height;const d=mt();(!d||d&&e==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const a=at(n);if(a<=0){const d=n.ownerDocument,u=d.body,p=getComputedStyle(u),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(n.clientWidth-u.clientWidth-f);h<=Dt&&(s-=h)}else a<=Dt&&(s+=a);return{width:s,height:r,x:l,y:c}}const ve=new Set(["absolute","fixed"]);function be(t,e){const i=Z(t,!0,e==="fixed"),n=i.top+t.clientTop,o=i.left+t.clientLeft,s=F(t)?G(t):$(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,c=o*s.x,a=n*s.y;return{width:r,height:l,x:c,y:a}}function $t(t,e,i){let n;if(e==="viewport")n=xe(t,i);else if(e==="document")n=ye(B(t));else if(L(e))n=be(e,i);else{const o=kt(t);n={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return st(n)}function Ft(t,e){const i=H(t);return i===e||!L(i)||K(i)?!1:R(i).position==="fixed"||Ft(i,e)}function Se(t,e){const i=e.get(t);if(i)return i;let n=Tt(t,[]).filter(l=>L(l)&&z(l)!=="body"),o=null;const s=R(t).position==="fixed";let r=s?H(t):t;for(;L(r)&&!K(r);){const l=R(r),c=gt(r);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&ve.has(o.position)||U(r)&&!c&&Ft(t,r))?n=n.filter(d=>d!==r):o=l,r=H(r)}return e.set(t,n),n}function Ae(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const r=[...i==="clippingAncestors"?lt(e)?[]:Se(e,this._c):[].concat(i),n],l=r[0],c=r.reduce((a,d)=>{const u=$t(e,d,o);return a.top=T(u.top,a.top),a.right=S(u.right,a.right),a.bottom=S(u.bottom,a.bottom),a.left=T(u.left,a.left),a},$t(e,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ce(t){const{width:e,height:i}=Lt(t);return{width:e,height:i}}function Ee(t,e,i){const n=F(e),o=B(e),s=i==="fixed",r=Z(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=$(0);function a(){c.x=at(o)}if(n||!n&&!s)if((z(e)!=="body"||U(o))&&(l=ct(e)),n){const f=Z(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else o&&a();s&&!n&&o&&a();const d=o&&!n&&!s?Pt(o,l):$(0),u=r.left+l.scrollLeft-c.x-d.x,p=r.top+l.scrollTop-c.y-d.y;return{x:u,y:p,width:r.width,height:r.height}}function yt(t){return R(t).position==="static"}function Bt(t,e){if(!F(t)||R(t).position==="fixed")return null;if(e)return e(t);let i=t.offsetParent;return B(t)===i&&(i=i.ownerDocument.body),i}function Vt(t,e){const i=O(t);if(lt(t))return i;if(!F(t)){let o=H(t);for(;o&&!K(o);){if(L(o)&&!yt(o))return o;o=H(o)}return i}let n=Bt(t,e);for(;n&&le(n)&&yt(n);)n=Bt(n,e);return n&&K(n)&&yt(n)&&!gt(n)?i:n||de(t)||i}const Oe=async function(t){const e=this.getOffsetParent||Vt,i=this.getDimensions,n=await i(t.floating);return{reference:Ee(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Te(t){return R(t).direction==="rtl"}const Le={convertOffsetParentRelativeRectToViewportRelativeRect:me,getDocumentElement:B,getClippingRect:Ae,getOffsetParent:Vt,getElementRects:Oe,getClientRects:we,getDimensions:Ce,getScale:G,isElement:L,isRTL:Te},Re=ie,ke=oe,Pe=te,De=Zt,$e=(t,e,i)=>{const n=new Map,o={platform:Le,...i},s={...o.platform,_c:n};return Ut(t,e,{...o,platform:s})};function Nt(t){try{return document.querySelector(t)}catch{return console.warn(`[Trailguide] Invalid selector: ${t}`),null}}function Mt(t){const e=t.getBoundingClientRect(),i=window.getComputedStyle(t);return e.width>0&&e.height>0&&i.visibility!=="hidden"&&i.display!=="none"&&i.opacity!=="0"}function Wt(t){t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}function ft(t,e,i){const n=document.createElement(t);return e&&(n.className=e),i&&i.appendChild(n),n}class Ht{constructor(e={}){M(this,"trail",null);M(this,"currentStepIndex",0);M(this,"isActive",!1);M(this,"options",{});M(this,"overlay",null);M(this,"tooltip",null);M(this,"arrowEl",null);M(this,"cleanupFns",[]);this.options=e}start(e){this.trail=e,this.currentStepIndex=0,this.isActive=!0,this.createOverlay(),this.showStep(),this.bindKeyboard()}stop(){this.isActive=!1,this.cleanup()}next(){!this.trail||!this.isActive||(this.currentStepIndex<this.trail.steps.length-1?(this.currentStepIndex++,this.showStep()):this.complete())}prev(){!this.trail||!this.isActive||this.currentStepIndex>0&&(this.currentStepIndex--,this.showStep())}skip(){var e,i;this.isActive=!1,this.cleanup(),(i=(e=this.options).onSkip)==null||i.call(e)}goToStep(e){!this.trail||!this.isActive||e>=0&&e<this.trail.steps.length&&(this.currentStepIndex=e,this.showStep())}complete(){var e,i;this.isActive=!1,this.cleanup(),(i=(e=this.options).onComplete)==null||i.call(e)}createOverlay(){var i,n,o;this.overlay=ft("div","trailguide-overlay"),document.body.appendChild(this.overlay);const e=ft("div","trailguide-spotlight",this.overlay);e.innerHTML=`
1
+ (function(y,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(y=typeof globalThis<"u"?globalThis:y||self,A(y.Trailguide={}))})(this,function(y){"use strict";var Ge=Object.defineProperty;var Je=(y,A,O)=>A in y?Ge(y,A,{enumerable:!0,configurable:!0,writable:!0,value:O}):y[A]=O;var P=(y,A,O)=>Je(y,typeof A!="symbol"?A+"":A,O);const A=Math.min,O=Math.max,nt=Math.round,D=t=>({x:t,y:t}),Wt={left:"right",right:"left",bottom:"top",top:"bottom"},Ht={start:"end",end:"start"};function ut(t,e,n){return O(t,A(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function U(t){return t.split("-")[1]}function St(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}const jt=new Set(["top","bottom"]);function M(t){return jt.has(W(t))?"y":"x"}function ht(t){return St(M(t))}function zt(t,e,n){n===void 0&&(n=!1);const i=U(t),o=ht(t),s=dt(o);let r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ot(r)),[r,ot(r)]}function Xt(t){const e=ot(t);return[pt(t),e,pt(e)]}function pt(t){return t.replace(/start|end/g,e=>Ht[e])}const At=["left","right"],Ct=["right","left"],Yt=["top","bottom"],Kt=["bottom","top"];function Gt(t,e,n){switch(t){case"top":case"bottom":return n?e?Ct:At:e?At:Ct;case"left":case"right":return e?Yt:Kt;default:return[]}}function Jt(t,e,n,i){const o=U(t);let s=Gt(W(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(pt)))),s}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Wt[e])}function Ut(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tt(t){return typeof t!="number"?Ut(t):{top:t,right:t,bottom:t,left:t}}function st(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Et(t,e,n){let{reference:i,floating:o}=t;const s=M(e),r=ht(e),l=dt(r),c=W(e),a=s==="y",d=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;let u;switch(c){case"top":u={x:d,y:i.y-o.height};break;case"bottom":u={x:d,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:f};break;case"left":u={x:i.x-o.width,y:f};break;default:u={x:i.x,y:i.y}}switch(U(e)){case"start":u[r]-=h*(n&&a?-1:1);break;case"end":u[r]+=h*(n&&a?-1:1);break}return u}async function Qt(t,e){var n;e===void 0&&(e={});const{x:i,y:o,platform:s,rects:r,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:u=0}=J(e,t),p=Tt(u),m=l[h?f==="floating"?"reference":"floating":f],w=st(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:d,strategy:c})),b=f==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},R=st(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:v,strategy:c}):b);return{top:(w.top-R.top+p.top)/S.y,bottom:(R.bottom-w.bottom+p.bottom)/S.y,left:(w.left-R.left+p.left)/S.x,right:(R.right-w.right+p.right)/S.x}}const Zt=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:f}=Et(a,i,c),h=i,u={},p=0;for(let m=0;m<l.length;m++){var g;const{name:w,fn:b}=l[m],{x:v,y:S,data:R,reset:T}=await b({x:d,y:f,initialPlacement:i,placement:h,strategy:o,middlewareData:u,rects:a,platform:{...r,detectOverflow:(g=r.detectOverflow)!=null?g:Qt},elements:{reference:t,floating:e}});d=v??d,f=S??f,u={...u,[w]:{...u[w],...R}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(a=T.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):T.rects),{x:d,y:f}=Et(a,h,c)),m=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:u}},te=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:c}=e,{element:a,padding:d=0}=J(t,e)||{};if(a==null)return{};const f=Tt(d),h={x:n,y:i},u=ht(o),p=dt(u),g=await r.getDimensions(a),m=u==="y",w=m?"top":"left",b=m?"bottom":"right",v=m?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[u]-h[u]-s.floating[p],R=h[u]-s.reference[u],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a));let H=T?T[v]:0;(!H||!await(r.isElement==null?void 0:r.isElement(T)))&&(H=l.floating[v]||s.floating[p]);const tt=S/2-R/2,j=H/2-g[p]/2-1,_=A(f[w],j),et=A(f[b],j),z=_,it=H-g[p]-et,C=H/2-g[p]/2+tt,X=ut(z,C,it),q=!c.arrow&&U(o)!=null&&C!==X&&s.reference[p]/2-(C<z?_:et)-g[p]/2<0,$=q?C<z?C-z:C-it:0;return{[u]:h[u]+$,data:{[u]:X,centerOffset:C-X-$,...q&&{alignmentOffset:$}},reset:q}}}),ee=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=J(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=W(o),b=M(l),v=W(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(a.floating)),R=h||(v||!g?[ot(l)]:Xt(l)),T=p!=="none";!h&&T&&R.push(...Jt(l,g,p,S));const H=[l,...R],tt=await c.detectOverflow(e,m),j=[];let _=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&j.push(tt[w]),f){const C=zt(o,r,S);j.push(tt[C[0]],tt[C[1]])}if(_=[..._,{placement:o,overflows:j}],!j.every(C=>C<=0)){var et,z;const C=(((et=s.flip)==null?void 0:et.index)||0)+1,X=H[C];if(X&&(!(f==="alignment"?b!==M(X):!1)||_.every(I=>M(I.placement)===b?I.overflows[0]>0:!0)))return{data:{index:C,overflows:_},reset:{placement:X}};let q=(z=_.filter($=>$.overflows[0]<=0).sort(($,I)=>$.overflows[1]-I.overflows[1])[0])==null?void 0:z.placement;if(!q)switch(u){case"bestFit":{var it;const $=(it=_.filter(I=>{if(T){const N=M(I.placement);return N===b||N==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(N=>N>0).reduce((N,Ke)=>N+Ke,0)]).sort((I,N)=>I[1]-N[1])[0])==null?void 0:it[0];$&&(q=$);break}case"initialPlacement":q=l;break}if(o!==q)return{reset:{placement:q}}}return{}}}},ie=new Set(["left","top"]);async function ne(t,e){const{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=W(n),l=U(n),c=M(n)==="y",a=ie.has(r)?-1:1,d=s&&c?-1:1,f=J(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),c?{x:u*d,y:h*a}:{x:h*a,y:u*d}}const oe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:s,placement:r,middlewareData:l}=e,c=await ne(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:r}}}}},se=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o,platform:s}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x:b,y:v}=w;return{x:b,y:v}}},...a}=J(t,e),d={x:n,y:i},f=await s.detectOverflow(e,a),h=M(W(o)),u=St(h);let p=d[u],g=d[h];if(r){const w=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=p+f[w],S=p-f[b];p=ut(v,p,S)}if(l){const w=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=g+f[w],S=g-f[b];g=ut(v,g,S)}const m=c.fn({...e,[u]:p,[h]:g});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[u]:r,[h]:l}}}}}};function rt(){return typeof window<"u"}function Y(t){return Ot(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function B(t){var e;return(e=(Ot(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ot(t){return rt()?t instanceof Node||t instanceof E(t).Node:!1}function k(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function F(t){return rt()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function kt(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}const re=new Set(["inline","contents"]);function Q(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!re.has(o)}const le=new Set(["table","td","th"]);function ce(t){return le.has(Y(t))}const ae=[":popover-open",":modal"];function lt(t){return ae.some(e=>{try{return t.matches(e)}catch{return!1}})}const fe=["transform","translate","scale","rotate","perspective"],ue=["transform","translate","scale","rotate","perspective","filter"],de=["paint","layout","strict","content"];function gt(t){const e=mt(),n=k(t)?L(t):t;return fe.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||ue.some(i=>(n.willChange||"").includes(i))||de.some(i=>(n.contain||"").includes(i))}function he(t){let e=V(t);for(;F(e)&&!K(e);){if(gt(e))return e;if(lt(e))return null;e=V(e)}return null}function mt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pe=new Set(["html","body","#document"]);function K(t){return pe.has(Y(t))}function L(t){return E(t).getComputedStyle(t)}function ct(t){return k(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function V(t){if(Y(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||B(t);return kt(e)?e.host:e}function Lt(t){const e=V(t);return K(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&Q(e)?e:Lt(e)}function Rt(t,e,n){var i;e===void 0&&(e=[]);const o=Lt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=E(o);return s?(yt(r),e.concat(r,r.visualViewport||[],Q(o)?o:[],[])):e.concat(o,Rt(o,[]))}function yt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=L(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=F(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=nt(n)!==s||nt(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function It(t){return k(t)?t:t.contextElement}function G(t){const e=It(t);if(!F(e))return D(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:s}=$t(e);let r=(s?nt(n.width):n.width)/i,l=(s?nt(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const ge=D(0);function Pt(t){const e=E(t);return!mt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function me(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function Z(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=It(t);let r=D(1);e&&(i?k(i)&&(r=G(i)):r=G(t));const l=me(s,n,i)?Pt(s):D(0);let c=(o.left+l.x)/r.x,a=(o.top+l.y)/r.y,d=o.width/r.x,f=o.height/r.y;if(s){const h=E(s),u=i&&k(i)?E(i):i;let p=h,g=yt(p);for(;g&&i&&u!==p;){const m=G(g),w=g.getBoundingClientRect(),b=L(g),v=w.left+(g.clientLeft+parseFloat(b.paddingLeft))*m.x,S=w.top+(g.clientTop+parseFloat(b.paddingTop))*m.y;c*=m.x,a*=m.y,d*=m.x,f*=m.y,c+=v,a+=S,p=E(g),g=yt(p)}}return st({width:d,height:f,x:c,y:a})}function at(t,e){const n=ct(t).scrollLeft;return e?e.left+n:Z(B(t)).left+n}function Dt(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-at(t,n),o=n.top+e.scrollTop;return{x:i,y:o}}function ye(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const s=o==="fixed",r=B(i),l=e?lt(e.floating):!1;if(i===r||l&&s)return n;let c={scrollLeft:0,scrollTop:0},a=D(1);const d=D(0),f=F(i);if((f||!f&&!s)&&((Y(i)!=="body"||Q(r))&&(c=ct(i)),F(i))){const u=Z(i);a=G(i),d.x=u.x+i.clientLeft,d.y=u.y+i.clientTop}const h=r&&!f&&!s?Dt(r,c):D(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+d.x+h.x,y:n.y*a.y-c.scrollTop*a.y+d.y+h.y}}function we(t){return Array.from(t.getClientRects())}function xe(t){const e=B(t),n=ct(t),i=t.ownerDocument.body,o=O(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=O(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+at(t);const l=-n.scrollTop;return L(i).direction==="rtl"&&(r+=O(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}const Ft=25;function be(t,e){const n=E(t),i=B(t),o=n.visualViewport;let s=i.clientWidth,r=i.clientHeight,l=0,c=0;if(o){s=o.width,r=o.height;const d=mt();(!d||d&&e==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const a=at(i);if(a<=0){const d=i.ownerDocument,f=d.body,h=getComputedStyle(f),u=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(i.clientWidth-f.clientWidth-u);p<=Ft&&(s-=p)}else a<=Ft&&(s+=a);return{width:s,height:r,x:l,y:c}}const ve=new Set(["absolute","fixed"]);function Se(t,e){const n=Z(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=F(t)?G(t):D(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,c=o*s.x,a=i*s.y;return{width:r,height:l,x:c,y:a}}function Bt(t,e,n){let i;if(e==="viewport")i=be(t,n);else if(e==="document")i=xe(B(t));else if(k(e))i=Se(e,n);else{const o=Pt(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return st(i)}function _t(t,e){const n=V(t);return n===e||!k(n)||K(n)?!1:L(n).position==="fixed"||_t(n,e)}function Ae(t,e){const n=e.get(t);if(n)return n;let i=Rt(t,[]).filter(l=>k(l)&&Y(l)!=="body"),o=null;const s=L(t).position==="fixed";let r=s?V(t):t;for(;k(r)&&!K(r);){const l=L(r),c=gt(r);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&ve.has(o.position)||Q(r)&&!c&&_t(t,r))?i=i.filter(d=>d!==r):o=l,r=V(r)}return e.set(t,i),i}function Ce(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[...n==="clippingAncestors"?lt(e)?[]:Ae(e,this._c):[].concat(n),i],l=r[0],c=r.reduce((a,d)=>{const f=Bt(e,d,o);return a.top=O(f.top,a.top),a.right=A(f.right,a.right),a.bottom=A(f.bottom,a.bottom),a.left=O(f.left,a.left),a},Bt(e,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Te(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Ee(t,e,n){const i=F(e),o=B(e),s=n==="fixed",r=Z(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=D(0);function a(){c.x=at(o)}if(i||!i&&!s)if((Y(e)!=="body"||Q(o))&&(l=ct(e)),i){const u=Z(e,!0,s,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else o&&a();s&&!i&&o&&a();const d=o&&!i&&!s?Dt(o,l):D(0),f=r.left+l.scrollLeft-c.x-d.x,h=r.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:r.width,height:r.height}}function wt(t){return L(t).position==="static"}function qt(t,e){if(!F(t)||L(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return B(t)===n&&(n=n.ownerDocument.body),n}function Mt(t,e){const n=E(t);if(lt(t))return n;if(!F(t)){let o=V(t);for(;o&&!K(o);){if(k(o)&&!wt(o))return o;o=V(o)}return n}let i=qt(t,e);for(;i&&ce(i)&&wt(i);)i=qt(i,e);return i&&K(i)&&wt(i)&&!gt(i)?n:i||he(t)||n}const Oe=async function(t){const e=this.getOffsetParent||Mt,n=this.getDimensions,i=await n(t.floating);return{reference:Ee(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function ke(t){return L(t).direction==="rtl"}const Le={convertOffsetParentRelativeRectToViewportRelativeRect:ye,getDocumentElement:B,getClippingRect:Ce,getOffsetParent:Mt,getElementRects:Oe,getClientRects:we,getDimensions:Te,getScale:G,isElement:k,isRTL:ke},Re=oe,$e=se,Ie=ee,Pe=te,De=(t,e,n)=>{const i=new Map,o={platform:Le,...n},s={...o.platform,_c:i};return Zt(t,e,{...o,platform:s})};function xt(t){try{return document.querySelector(t)}catch{return console.warn(`[Trailguide] Invalid selector: ${t}`),null}}function bt(t){const e=t.getBoundingClientRect(),n=window.getComputedStyle(t);return e.width>0&&e.height>0&&n.visibility!=="hidden"&&n.display!=="none"&&n.opacity!=="0"}function Vt(t){t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}function Fe(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function ft(t,e,n){const i=document.createElement(t);return e&&(i.className=e),n&&n.appendChild(i),i}function Be(){return`${Date.now()}-${Math.random().toString(36).slice(2,11)}`}let vt=null;function _e(){return vt||(vt=Be()),vt}async function qe(t,e){if(!t.endpoint)return;const n={...e,user_id:t.userId,session_id:_e(),timestamp:new Date().toISOString()};try{const i=await fetch(t.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});t.debug&&(i.ok?console.log("[Trailguide Analytics]",n):console.error(`[Trailguide Analytics] Server error: ${i.status}`))}catch(i){t.debug&&console.error("[Trailguide Analytics] Failed:",i)}}class Nt{constructor(e={}){P(this,"trail",null);P(this,"currentStepIndex",0);P(this,"isActive",!1);P(this,"options",{});P(this,"overlay",null);P(this,"tooltip",null);P(this,"arrowEl",null);P(this,"cleanupFns",[]);P(this,"stepCleanupFns",[]);P(this,"instanceId",`trailguide-${Date.now()}-${Math.random().toString(36).slice(2,7)}`);this.options=e}start(e){this.trail=e,this.currentStepIndex=0,this.isActive=!0,this.createOverlay(),this.showStep(),this.bindKeyboard(),this.emitAnalytics("trail_started")}stop(){this.isActive=!1,this.cleanup()}next(){!this.trail||!this.isActive||(this.emitAnalytics("step_completed"),this.currentStepIndex<this.trail.steps.length-1?(this.currentStepIndex++,this.showStep()):this.complete())}prev(){!this.trail||!this.isActive||this.currentStepIndex>0&&(this.currentStepIndex--,this.showStep())}skip(){var e,n;this.emitAnalytics("trail_skipped"),this.isActive=!1,this.cleanup(),(n=(e=this.options).onSkip)==null||n.call(e)}goToStep(e){!this.trail||!this.isActive||e>=0&&e<this.trail.steps.length&&(this.currentStepIndex=e,this.showStep())}complete(){var e,n;this.emitAnalytics("trail_completed"),this.isActive=!1,this.cleanup(),(n=(e=this.options).onComplete)==null||n.call(e)}createOverlay(){var i,o,s;this.overlay=ft("div","trailguide-overlay"),document.body.appendChild(this.overlay);const e=ft("div","trailguide-spotlight",this.overlay),n=`${this.instanceId}-mask`;e.innerHTML=`
2
2
  <svg width="100%" height="100%">
3
3
  <defs>
4
- <mask id="trailguide-mask">
4
+ <mask id="${n}">
5
5
  <rect x="0" y="0" width="100%" height="100%" fill="white" />
6
6
  <rect class="trailguide-cutout" rx="4" fill="black" />
7
7
  </mask>
8
8
  </defs>
9
- <rect x="0" y="0" width="100%" height="100%" fill="rgba(0,0,0,0.5)" mask="url(#trailguide-mask)" />
9
+ <rect x="0" y="0" width="100%" height="100%" mask="url(#${n})" />
10
10
  </svg>
11
11
  `,ft("div","trailguide-highlight",this.overlay),this.tooltip=ft("div","trailguide-tooltip"),this.tooltip.innerHTML=`
12
12
  <div class="trailguide-tooltip-content">
@@ -24,4 +24,7 @@
24
24
  </div>
25
25
  <div class="trailguide-tooltip-arrow"></div>
26
26
  </div>
27
- `,document.body.appendChild(this.tooltip),this.arrowEl=this.tooltip.querySelector(".trailguide-tooltip-arrow"),(i=this.tooltip.querySelector(".trailguide-tooltip-close"))==null||i.addEventListener("click",()=>this.skip()),(n=this.tooltip.querySelector(".trailguide-btn-prev"))==null||n.addEventListener("click",()=>this.prev()),(o=this.tooltip.querySelector(".trailguide-btn-next"))==null||o.addEventListener("click",()=>this.next())}showStep(){if(!this.trail||!this.overlay||!this.tooltip)return;const e=this.trail.steps[this.currentStepIndex];if(!e)return;const i=Nt(e.target);if(!i||!Mt(i)){console.warn(`[Trailguide] Target not found or not visible: ${e.target}`);return}Wt(i),setTimeout(()=>{var n,o;this.updateSpotlight(i),this.updateTooltip(e,i),(o=(n=this.options).onStepChange)==null||o.call(n,e,this.currentStepIndex)},100)}updateSpotlight(e){if(!this.overlay)return;const i=e.getBoundingClientRect(),n=8,o=this.overlay.querySelector(".trailguide-cutout");o&&(o.setAttribute("x",String(i.left-n)),o.setAttribute("y",String(i.top-n)),o.setAttribute("width",String(i.width+n*2)),o.setAttribute("height",String(i.height+n*2)));const s=this.overlay.querySelector(".trailguide-highlight");s&&(s.style.top=`${i.top-n}px`,s.style.left=`${i.left-n}px`,s.style.width=`${i.width+n*2}px`,s.style.height=`${i.height+n*2}px`);const r=()=>{if(!this.isActive)return;const l=e.getBoundingClientRect();o&&(o.setAttribute("x",String(l.left-n)),o.setAttribute("y",String(l.top-n)),o.setAttribute("width",String(l.width+n*2)),o.setAttribute("height",String(l.height+n*2))),s&&(s.style.top=`${l.top-n}px`,s.style.left=`${l.left-n}px`,s.style.width=`${l.width+n*2}px`,s.style.height=`${l.height+n*2}px`)};window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),this.cleanupFns.push(()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)})}async updateTooltip(e,i){if(!this.tooltip||!this.trail||!this.arrowEl)return;const n=this.currentStepIndex===0,o=this.currentStepIndex===this.trail.steps.length-1,s=this.tooltip.querySelector(".trailguide-tooltip-title"),r=this.tooltip.querySelector(".trailguide-tooltip-body"),l=this.tooltip.querySelector(".trailguide-tooltip-progress"),c=this.tooltip.querySelector(".trailguide-btn-prev"),a=this.tooltip.querySelector(".trailguide-btn-next");s&&(s.textContent=e.title),r&&(r.textContent=e.content),l&&(l.textContent=`${this.currentStepIndex+1} of ${this.trail.steps.length}`),c&&(c.style.display=n?"none":"block"),a&&(a.textContent=o?"Finish":"Next");const{x:d,y:u,middlewareData:p}=await $e(i,this.tooltip,{placement:e.placement,middleware:[Re(12),Pe(),ke({padding:8}),De({element:this.arrowEl})]});if(this.tooltip.style.left=`${d}px`,this.tooltip.style.top=`${u}px`,p.arrow&&this.arrowEl){const{x:f,y:h}=p.arrow;this.arrowEl.style.left=f!=null?`${f}px`:"",this.arrowEl.style.top=h!=null?`${h}px`:""}}bindKeyboard(){const e=i=>{if(this.isActive)switch(i.key){case"ArrowRight":case"Enter":this.next();break;case"ArrowLeft":this.prev();break;case"Escape":this.skip();break}};window.addEventListener("keydown",e),this.cleanupFns.push(()=>window.removeEventListener("keydown",e))}cleanup(){var e,i;this.cleanupFns.forEach(n=>n()),this.cleanupFns=[],(e=this.overlay)==null||e.remove(),(i=this.tooltip)==null||i.remove(),this.overlay=null,this.tooltip=null}}let A=null;function Fe(t,e){return A&&A.stop(),A=new Ht(e),A.start(t),A}function Be(){A==null||A.stop()}function Ve(){A==null||A.next()}function Ne(){A==null||A.prev()}function Me(){A==null||A.skip()}w.Trailguide=Ht,w.findElement=Nt,w.isElementVisible=Mt,w.next=Ve,w.prev=Ne,w.scrollToElement=Wt,w.skip=Me,w.start=Fe,w.stop=Be,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
27
+ `,document.body.appendChild(this.tooltip),this.arrowEl=this.tooltip.querySelector(".trailguide-tooltip-arrow"),(i=this.tooltip.querySelector(".trailguide-tooltip-close"))==null||i.addEventListener("click",()=>this.skip()),(o=this.tooltip.querySelector(".trailguide-btn-prev"))==null||o.addEventListener("click",()=>this.prev()),(s=this.tooltip.querySelector(".trailguide-btn-next"))==null||s.addEventListener("click",()=>this.next())}showStep(){if(!this.trail||!this.overlay||!this.tooltip)return;this.stepCleanupFns.forEach(s=>s()),this.stepCleanupFns=[],this.tooltip.style.transform="";const e=this.overlay.querySelector(".trailguide-spotlight"),n=this.overlay.querySelector(".trailguide-highlight");e&&(e.style.display=""),n&&(n.style.display="");const i=this.trail.steps[this.currentStepIndex];if(!i)return;this.emitAnalytics("step_viewed");const o=xt(i.target);if(!o||!bt(o)){console.warn(`[Trailguide] Target not found or not visible: ${i.target}`),this.showErrorState(i);return}Vt(o),setTimeout(()=>{var s,r;this.updateSpotlight(o),this.updateTooltip(i,o),(r=(s=this.options).onStepChange)==null||r.call(s,i,this.currentStepIndex)},100)}showErrorState(e){var f,h;if(!this.tooltip||!this.trail)return;const n=(f=this.overlay)==null?void 0:f.querySelector(".trailguide-spotlight"),i=(h=this.overlay)==null?void 0:h.querySelector(".trailguide-highlight");n&&(n.style.display="none"),i&&(i.style.display="none");const o=this.tooltip.querySelector(".trailguide-tooltip-title"),s=this.tooltip.querySelector(".trailguide-tooltip-body"),r=this.tooltip.querySelector(".trailguide-tooltip-progress"),l=this.tooltip.querySelector(".trailguide-btn-prev"),c=this.tooltip.querySelector(".trailguide-btn-next"),a=this.currentStepIndex===0,d=this.currentStepIndex===this.trail.steps.length-1;o&&(o.textContent="Element Not Found"),s&&(s.innerHTML=`
28
+ <p style="color: #ef4444; margin: 0 0 8px 0;">Could not find: <code style="background: #fee2e2; padding: 2px 6px; border-radius: 4px; font-size: 12px;">${Fe(e.target)}</code></p>
29
+ <p style="margin: 0; font-size: 13px; color: #6b7280;">The target element doesn't exist on this page. Press <kbd style="background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 11px;">Esc</kbd> to close or skip to the next step.</p>
30
+ `),r&&(r.textContent=`${this.currentStepIndex+1} of ${this.trail.steps.length}`),l&&(l.style.display=a?"none":"block"),c&&(c.textContent=d?"Close":"Skip Step"),this.tooltip.style.left="50%",this.tooltip.style.top="50%",this.tooltip.style.transform="translate(-50%, -50%)"}updateSpotlight(e){if(!this.overlay)return;const n=e.getBoundingClientRect(),i=8,o=this.overlay.querySelector(".trailguide-cutout");o&&(o.setAttribute("x",String(n.left-i)),o.setAttribute("y",String(n.top-i)),o.setAttribute("width",String(n.width+i*2)),o.setAttribute("height",String(n.height+i*2)));const s=this.overlay.querySelector(".trailguide-highlight");s&&(s.style.top=`${n.top-i}px`,s.style.left=`${n.left-i}px`,s.style.width=`${n.width+i*2}px`,s.style.height=`${n.height+i*2}px`);const r=()=>{if(!this.isActive)return;const l=e.getBoundingClientRect();o&&(o.setAttribute("x",String(l.left-i)),o.setAttribute("y",String(l.top-i)),o.setAttribute("width",String(l.width+i*2)),o.setAttribute("height",String(l.height+i*2))),s&&(s.style.top=`${l.top-i}px`,s.style.left=`${l.left-i}px`,s.style.width=`${l.width+i*2}px`,s.style.height=`${l.height+i*2}px`)};window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),this.stepCleanupFns.push(()=>{window.removeEventListener("scroll",r,!0),window.removeEventListener("resize",r)})}async updateTooltip(e,n){if(!this.tooltip||!this.trail||!this.arrowEl)return;const i=this.currentStepIndex===0,o=this.currentStepIndex===this.trail.steps.length-1,s=this.tooltip.querySelector(".trailguide-tooltip-title"),r=this.tooltip.querySelector(".trailguide-tooltip-body"),l=this.tooltip.querySelector(".trailguide-tooltip-progress"),c=this.tooltip.querySelector(".trailguide-btn-prev"),a=this.tooltip.querySelector(".trailguide-btn-next");s&&(s.textContent=e.title),r&&(r.textContent=e.content),l&&(l.textContent=`${this.currentStepIndex+1} of ${this.trail.steps.length}`),c&&(c.style.display=i?"none":"block"),a&&(a.textContent=o?"Finish":"Next");const{x:d,y:f,placement:h,middlewareData:u}=await De(n,this.tooltip,{placement:e.placement,middleware:[Re(12),Ie(),$e({padding:8}),Pe({element:this.arrowEl})]});if(this.tooltip.style.left=`${d}px`,this.tooltip.style.top=`${f}px`,this.tooltip.dataset.placement=h,u.arrow&&this.arrowEl){const{x:p,y:g}=u.arrow;this.arrowEl.style.left=p!=null?`${p}px`:"",this.arrowEl.style.top=g!=null?`${g}px`:""}}bindKeyboard(){const e=n=>{if(this.isActive)switch(n.key){case"ArrowRight":case"Enter":this.next();break;case"ArrowLeft":this.prev();break;case"Escape":this.skip();break}};window.addEventListener("keydown",e),this.cleanupFns.push(()=>window.removeEventListener("keydown",e))}cleanup(){var e,n;this.stepCleanupFns.forEach(i=>i()),this.stepCleanupFns=[],this.cleanupFns.forEach(i=>i()),this.cleanupFns=[],(e=this.overlay)==null||e.remove(),(n=this.tooltip)==null||n.remove(),this.overlay=null,this.tooltip=null,this.arrowEl=null}emitAnalytics(e){if(!this.options.analytics||!this.trail)return;const n=this.trail.steps[this.currentStepIndex],i=this.options.analytics.trailId||this.trail.id;qe(this.options.analytics,{event_type:e,trail_id:i,step_id:n==null?void 0:n.id,step_index:this.currentStepIndex})}}let x=null;function Me(t,e){return x&&x.stop(),x=new Nt(e),x.start(t),x}function Ve(){x==null||x.stop(),x=null}function Ne(){x==null||x.next()}function We(){x==null||x.prev()}function He(){x==null||x.skip(),x=null}const je={bgBase:"#0f172a",bgCard:"#1e293b",bgGlass:"rgba(255,255,255,0.06)",bgInput:"rgba(255,255,255,0.03)",textPrimary:"#f8fafc",textSecondary:"#e2e8f0",textTertiary:"#cbd5e1",textMuted:"#94a3b8",textFaint:"#64748b",borderSubtle:"rgba(255,255,255,0.06)",borderPanel:"rgba(255,255,255,0.08)",borderControl:"rgba(255,255,255,0.1)",accent:"#1a91a2",accentBg:"rgba(26,145,162,0.15)",accentBorder:"rgba(26,145,162,0.3)",error:"#ef4444",errorBg:"rgba(239,68,68,0.1)",errorBorder:"rgba(239,68,68,0.3)",errorLight:"rgba(248,113,113,0.1)",errorText:"#fca5a5",success:"#10b981",successBg:"rgba(16,185,129,0.1)",successBorder:"rgba(16,185,129,0.3)",successText:"#6ee7b7",warningBg:"rgba(234,179,8,0.1)",disabled:"#9ca3af",disabledBg:"#4b5563",shadowLight:"0 4px 12px rgba(0,0,0,0.15)",shadowMedium:"0 4px 20px rgba(0,0,0,0.4)",shadowOverlay:"rgba(0,0,0,0.3)"};function ze(t){const e=[],n=[];return t.id||e.push({stepId:"",stepIndex:-1,type:"missing_required_field",message:'Trail is missing required "id" field'}),!t.steps||t.steps.length===0?(e.push({stepId:"",stepIndex:-1,type:"missing_required_field",message:"Trail has no steps"}),{valid:!1,errors:e,warnings:n}):(t.steps.forEach((i,o)=>{if(i.id||e.push({stepId:`step-${o}`,stepIndex:o,type:"missing_required_field",message:`Step ${o+1} is missing required "id" field`}),!i.target){e.push({stepId:i.id||`step-${o}`,stepIndex:o,type:"missing_required_field",message:`Step ${o+1} is missing required "target" field`});return}const s=xt(i.target);s?bt(s)||n.push({stepId:i.id,stepIndex:o,type:"hidden_target",message:`Step ${o+1} ("${i.title}"): Target element exists but is hidden`,selector:i.target}):e.push({stepId:i.id,stepIndex:o,type:"missing_target",message:`Step ${o+1} ("${i.title}"): Target element not found`,selector:i.target}),i.target&&Xe(i.target)&&n.push({stepId:i.id,stepIndex:o,type:"unstable_selector",message:`Step ${o+1}: Consider using data-trail-id for more stable targeting`,selector:i.target})}),{valid:e.length===0,errors:e,warnings:n})}function Xe(t){return t.startsWith("#")||t.includes("[data-")?!1:!!(t.includes(":nth-child")||t.includes(":nth-of-type")||/^\.[a-z]+-[a-z0-9]+$/i.test(t))}function Ye(t){if(t.valid&&t.warnings.length===0){console.log("%c✓ Trail validation passed","color: green; font-weight: bold");return}t.errors.length>0&&(console.group("%c✗ Trail validation errors","color: red; font-weight: bold"),t.errors.forEach(e=>{console.error(`Step ${e.stepIndex+1}: ${e.message}`),e.selector&&console.error(` Selector: ${e.selector}`)}),console.groupEnd()),t.warnings.length>0&&(console.group("%c⚠ Trail validation warnings","color: orange; font-weight: bold"),t.warnings.forEach(e=>{console.warn(`Step ${e.stepIndex+1}: ${e.message}`),e.selector&&console.warn(` Selector: ${e.selector}`)}),console.groupEnd())}y.Trailguide=Nt,y.findElement=xt,y.isElementVisible=bt,y.logValidationResults=Ye,y.next=Ne,y.prev=We,y.scrollToElement=Vt,y.skip=He,y.start=Me,y.stop=Ve,y.theme=je,y.validateTrail=ze,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
package/dist/types.d.ts CHANGED
@@ -1,14 +1,10 @@
1
1
  export type Placement = 'top' | 'bottom' | 'left' | 'right';
2
- export type StepAction = 'click' | 'input' | 'hover' | 'none';
3
- export type NextTrigger = 'click' | 'manual';
4
2
  export interface Step {
5
3
  id: string;
6
4
  target: string;
7
5
  placement: Placement;
8
6
  title: string;
9
7
  content: string;
10
- action?: StepAction;
11
- nextOn?: NextTrigger;
12
8
  }
13
9
  export interface Trail {
14
10
  id: string;
@@ -16,14 +12,16 @@ export interface Trail {
16
12
  version: string;
17
13
  steps: Step[];
18
14
  }
15
+ export interface AnalyticsConfig {
16
+ endpoint: string;
17
+ userId: string;
18
+ trailId?: string;
19
+ debug?: boolean;
20
+ }
19
21
  export interface TrailguideOptions {
20
22
  onComplete?: () => void;
21
23
  onSkip?: () => void;
22
24
  onStepChange?: (step: Step, index: number) => void;
23
- }
24
- export interface TrailguideState {
25
- trail: Trail | null;
26
- currentStepIndex: number;
27
- isActive: boolean;
25
+ analytics?: AnalyticsConfig;
28
26
  }
29
27
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B"}
@@ -0,0 +1,41 @@
1
+ import type { Trail } from './types';
2
+ export interface ValidationResult {
3
+ valid: boolean;
4
+ errors: ValidationError[];
5
+ warnings: ValidationWarning[];
6
+ }
7
+ export interface ValidationError {
8
+ stepId: string;
9
+ stepIndex: number;
10
+ type: 'missing_target' | 'missing_required_field';
11
+ message: string;
12
+ selector?: string;
13
+ }
14
+ export interface ValidationWarning {
15
+ stepId: string;
16
+ stepIndex: number;
17
+ type: 'hidden_target' | 'unstable_selector';
18
+ message: string;
19
+ selector?: string;
20
+ }
21
+ /**
22
+ * Validates a trail and checks if all target selectors exist in the DOM.
23
+ * Run this in development to catch broken selectors before they reach users.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { validateTrail } from '@trailguide/core';
28
+ *
29
+ * const result = validateTrail(myTrail);
30
+ * if (!result.valid) {
31
+ * console.error('Trail validation failed:', result.errors);
32
+ * }
33
+ * ```
34
+ */
35
+ export declare function validateTrail(trail: Trail): ValidationResult;
36
+ /**
37
+ * Logs validation results to the console with formatting.
38
+ * Useful for development debugging.
39
+ */
40
+ export declare function logValidationResults(result: ValidationResult): void;
41
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,gBAAgB,GAAG,wBAAwB,CAAC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,eAAe,GAAG,mBAAmB,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,gBAAgB,CAkF5D;AAkBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CA2BnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trailguide/core",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Framework-agnostic product tours. Tutorials as code for any web app.",
5
5
  "type": "module",
6
6
  "main": "./dist/trailguide.js",
@@ -17,11 +17,6 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
- "scripts": {
21
- "dev": "vite build --watch",
22
- "build": "vite build && tsc --emitDeclarationOnly",
23
- "typecheck": "tsc --noEmit"
24
- },
25
20
  "keywords": [
26
21
  "product-tour",
27
22
  "onboarding",
@@ -36,12 +31,12 @@
36
31
  "license": "MIT",
37
32
  "repository": {
38
33
  "type": "git",
39
- "url": "git+https://github.com/brandenlanghals/trailguide.git",
34
+ "url": "git+https://github.com/hellotrailguide/trailguide.git",
40
35
  "directory": "packages/core"
41
36
  },
42
- "homepage": "https://github.com/brandenlanghals/trailguide#readme",
37
+ "homepage": "https://github.com/hellotrailguide/trailguide#readme",
43
38
  "bugs": {
44
- "url": "https://github.com/brandenlanghals/trailguide/issues"
39
+ "url": "https://github.com/hellotrailguide/trailguide/issues"
45
40
  },
46
41
  "dependencies": {
47
42
  "@floating-ui/dom": "^1.6.0"
@@ -50,5 +45,10 @@
50
45
  "typescript": "^5.4.0",
51
46
  "vite": "^5.2.0",
52
47
  "vite-plugin-dts": "^3.8.0"
48
+ },
49
+ "scripts": {
50
+ "dev": "vite build --watch",
51
+ "build": "vite build && tsc --emitDeclarationOnly",
52
+ "typecheck": "tsc --noEmit"
53
53
  }
54
- }
54
+ }