@ssgoi/core 7.0.0 → 7.0.1-beta.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/internal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Ft=Object.defineProperty;var Bt=(t,n,e)=>n in t?Ft(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var Z=(t,n,e)=>Bt(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("./multi-animation-6124HEke.cjs");class _t extends st.Animation{constructor(){super(...arguments);Z(this,"child",null);Z(this,"_state","idle");Z(this,"_settled",!1);Z(this,"listeners",new Set)}attach(e){const o=this.child;if(this.child=e,this._settled=!1,o){const a=o.getPose();o.complete(),e.matchInto(a)}e.playbackRate=this.playbackRate;const r=e.onComplete;e.onComplete=()=>{r==null||r(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const i=e.onUpdate;e.onUpdate=a=>{var u;i==null||i(a),(u=this.onUpdate)==null||u.call(this,a),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var o;(o=this.child)==null||o.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const zt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},wt=new Set(["auto","scroll","overlay"]),Xt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(wt.has(e.overflowY)||wt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},Gt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ut(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const o={};return n.forEach((r,i)=>{o[r]=e[i]}),o})}const qt=768,Kt=10,Vt=10;function $t(t={}){const{resolvePath:n=g=>g}=t;let e=null,o=!1,r=!1;const i=()=>{const g=(e==null?void 0:e.clientWidth)??0,S=g>0?g:typeof window<"u"?window.innerWidth:0;return S>0&&S<qt},a=()=>(r||(o=i(),r=!0),o),u=g=>`path:${n(g)}`;let f=null;const l=new Map;let p=null,h=!1,y=0,E=0,w=0;const A=()=>{e&&p&&!h&&l.set(u(p),{x:e.scrollLeft,y:e.scrollTop})},_=(g,S,C)=>{if(!e)return;const O=++E,I=u(g),P=S&&l.has(I)?l.get(I):{x:0,y:0};let D=0;const G=()=>{if(!e||C!==y||O!==E)return;S||l.set(I,P),e.scrollTo({top:P.y,left:P.x}),!(Math.abs(e.scrollTop-P.y)<1&&Math.abs(e.scrollLeft-P.x)<1)&&D<Kt&&(D++,requestAnimationFrame(G))};requestAnimationFrame(G)};return{initializeContext:(g,S,C)=>{h=!0;const O=p===S?y:++y;f=g,e||(e=Xt(g),o=i(),r=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{o=i()}).observe(e),(e===document.documentElement?window:e).addEventListener("scroll",A,{passive:!0})),p=S;const I=u(S),P=l.get(I),D=$=>{O===y&&(w=O,$&&P&&l.set(I,P),_(S,$,O))};C!==void 0?D(C):requestAnimationFrame(()=>{w!==O&&O===y&&D(!1)});let G=0;const B=()=>{O===y&&(G++,G>=Vt?h=!1:requestAnimationFrame(B))};return requestAnimationFrame(B),D},calculateScrollOffset:(g,S,C=!1)=>{const O=g?u(g):null,I=O&&l.has(O)?l.get(O):{x:0,y:0},P=S&&C?u(S):null,D=P&&l.has(P)?l.get(P):{x:0,y:0};return{x:-D.x+I.x,y:-D.y+I.y}},evictScrollPosition:g=>{l.delete(u(g))},getScrollContainer:()=>e,getPositionedParentElement:()=>f?Gt(f):document.body,getScrollPosition:(g,S=!0)=>{if(!S)return{x:0,y:0};const C=g?u(g):null;return C&&l.has(C)?l.get(C):{x:0,y:0}},getIsMobile:a}}const Tt=30,Pt=8,At=1.2,Ct=30,Yt=600;function Zt(){let t=null,n=!1,e=!1,o=null,r=null,i=!1;const a=(v,b)=>{for(let T=0;T<v.length;T++){const R=v.item(T);if(R&&R.identifier===b)return R}return null},u=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{r!==null&&(clearTimeout(r),r=null)},l=()=>{n=!0,e=!0,u(),f(),o=setTimeout(()=>{n=!1,e=!1,o=null},Yt)},p=v=>{if(v.touches.length!==1){t=null;return}const b=v.touches.item(0);if(!b){t=null;return}const T=window.innerWidth,R=b.clientX<=Tt,F=b.clientX>=T-Tt;if(!R&&!F){t=null;return}t={identifier:b.identifier,startX:b.clientX,startY:b.clientY,fromLeftEdge:R,moved:!1}},h=v=>{if(!t)return;if(v.touches.length!==1){t=null;return}const b=a(v.touches,t.identifier);if(!b){t=null;return}const T=b.clientX-t.startX,R=b.clientY-t.startY,F=Math.abs(T),g=Math.abs(R);if(g>Pt&&g>F*At){t=null;return}const S=t.fromLeftEdge?T>0:T<0;F>Pt&&F>g*At&&S&&(t.moved=!0)},y=v=>{if(!t)return;const b=a(v.changedTouches,t.identifier);if(!b){t=null;return}const T=b.clientX-t.startX,R=t.fromLeftEdge?T>0:T<0;if(t.moved&&R&&Math.abs(T)>=Ct){l(),t=null;return}t.moved&&Math.abs(T)>=Ct&&l(),t=null},E=()=>{t&&(t.moved&&l(),t=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const v={passive:!0,capture:!0};window.addEventListener("touchstart",p,v),window.addEventListener("touchmove",h,v),window.addEventListener("touchend",y,v),window.addEventListener("touchcancel",E,v)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const v={capture:!0};window.removeEventListener("touchstart",p,v),window.removeEventListener("touchmove",h,v),window.removeEventListener("touchend",y,v),window.removeEventListener("touchcancel",E,v),u(),f(),t=null,n=!1,e=!1},isSwipeBack:()=>{const v=n||e;return v&&u(),v},onPageEnter:()=>{n=!1,u(),f(),r=setTimeout(()=>{e=!1,r=null},0)}}}const jt=1e6,xt=100,Qt=10,Jt=1;function te(t){const n=t.trim(),e=n.indexOf("#"),o=n.indexOf("?"),r=[e,o].filter(i=>i>=0).reduce((i,a)=>Math.min(i,a),n.length);return n.slice(0,r)}function Q(t){const n=te(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return Q(new URL(n).pathname)}catch{}const o=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(o.length>1?o.replace(/\/+$/g,""):o)||"/"}function ee(t){const n=t.trim();return n==="*"?"/**":Q(n)}function ft(t){return t==="/"?[]:t.slice(1).split("/")}function ne(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function ie(t,n){const e=Q(t),o=ee(n);if(e===o)return{matched:!0,specificity:jt+ft(o).length*xt,pattern:n};const r=ft(e),i=ft(o);let a=0;for(let u=0;u<i.length;u++){const f=i[u],l=r[u],p=u===i.length-1;if(f==="**")return{matched:p&&r.length>=u,specificity:a,pattern:n};if(l===void 0||f===void 0)return{matched:!1,specificity:0,pattern:n};if(f==="*"){a+=Jt;continue}if(ne(f)){a+=Qt;continue}if(f!==l)return{matched:!1,specificity:0,pattern:n};a+=xt}return{matched:r.length===i.length,specificity:a,pattern:n}}function H(t,n){const e=typeof n=="string"?[n]:n;let o=null;for(const r of e){const i=ie(t,r);i.matched&&(!o||i.specificity>o.specificity)&&(o=i)}return o}const Mt={from:!0,to:!1},oe={from:!0,to:!0};function se(t,n){return n?t.priority!==n.priority?t.priority>n.priority:t.specificity!==n.specificity?t.specificity>n.specificity:t.ruleIndex<n.ruleIndex:!0}function pt(t,n){return n==="forward"?{from:t.from,to:t.to}:{from:t.to,to:t.from}}function re(t,n,e,o){let r=null;return e.forEach((i,a)=>{const u=i.priority??0;let f=null;if(i.on!==void 0){const l=i.except!==void 0&&H(t,i.except)!==null,p=i.except!==void 0&&H(n,i.except)!==null,h=l?null:H(t,i.on),y=p?null:H(n,i.on);if(h||y){const E=!h&&y?"forward":h&&!y?"backward":o,w=!h&&y?"on-enter":h&&!y?"on-leave":"on-history",A=i.preserveScroll??Mt;f={transition:i.transition,direction:E,ruleIndex:a,priority:u,specificity:Math.max((h==null?void 0:h.specificity)??0,(y==null?void 0:y.specificity)??0),reason:w,preserveScroll:w==="on-history"?{from:A.to,to:A.to}:pt(A,E)}}}else if(i.ordered!==void 0){let l=-1,p=-1,h=-1,y=-1;if(i.ordered.forEach((E,w)=>{const A=H(t,E);A&&A.specificity>h&&(l=w,h=A.specificity);const _=H(n,E);_&&_.specificity>y&&(p=w,y=_.specificity)}),l>=0&&p>=0&&l!==p){const E=l<p?"forward":"backward";f={transition:i.transition,direction:E,ruleIndex:a,priority:u,specificity:h+y,reason:"ordered",preserveScroll:pt(i.preserveScroll??oe,E)}}}else{const l=H(t,i.from),p=H(n,i.to),h=i.bidirectional===!1?null:H(t,i.to),y=i.bidirectional===!1?null:H(n,i.from),E=l&&p,w=h&&y;if(E||w){const A=E?l.specificity+p.specificity:-1,_=w?h.specificity+y.specificity:-1,X=E&&w&&A===_?o:A>=_?"forward":"backward";f={transition:i.transition,direction:X,ruleIndex:a,priority:u,specificity:Math.max(A,_),reason:"pair",preserveScroll:pt(i.preserveScroll??Mt,X)}}}f&&se(f,r)&&(r=f)}),r}function ce(){const t=[];let n=!1;const e=()=>{n=!0};return typeof window<"u"&&window.addEventListener("popstate",e),{resolve(o,r){const i=Q(o),a=Q(r);if(t.length===0)t.push(i);else if(t[t.length-1]!==i){const l=t.lastIndexOf(i);l>=0?t.splice(l+1):t.push(i)}const u=t[t.length-2],f=n||u===a?"backward":"forward";if(n=!1,f==="backward"){const l=t.lastIndexOf(a);l>=0?t.splice(l+1):t.push(a)}else t[t.length-1]!==a&&t.push(a);return f},dispose(){typeof window<"u"&&window.removeEventListener("popstate",e)}}}function le(t={}){let n=null,e=null;function o(){var i,a;n&&((i=n.out)==null||i.resolve(null),(a=n.in)==null||a.resolve(null),n=null)}function r(){if(n!=null&&n.out&&n.in){if(n.out.path===n.in.path){o();return}const i={from:n.out.path,to:n.in.path,out:n.out.payload,in:n.in.payload};e=i,n.out.resolve(i),n.in.resolve(i),n=null}}return{arrive(i,a,u){return new Promise(f=>{var y,E;const l=e===null?null:a==="out"?{path:e.from,payload:e.out}:{path:e.to,payload:e.in};if((l==null?void 0:l.path)===i){f(null);return}a==="out"&&((y=n==null?void 0:n.in)==null?void 0:y.path)===i&&!n.out&&(n.in.resolve(null),n.in=void 0);const p=n==null?void 0:n[a];p&&p.path!==i&&o(),n||(n={});const h=n[a];if(h){if(((E=t.keepCurrent)==null?void 0:E.call(t,{type:a,path:i,current:h.payload,next:u}))??!1){f(null);return}h.resolve(null)}n[a]={path:i,payload:u,resolve:f},r()})},cancel(i){(n!=null&&n.out&&i(n.out.payload)||n!=null&&n.in&&i(n.in.payload))&&o(),(e&&i(e.out)||e&&i(e.in))&&(e=null)}}}const ae={},V=new Map;let et=null,Lt=!1;function Dt(t,n,e){t instanceof HTMLElement&&V.has(t)&&!t.isConnected&&e.set(t,{entry:V.get(t),anchor:n});for(const o of Array.from(t.childNodes))Dt(o,n,e)}function ue(t){const n=new Set(Array.from(t.values(),({entry:e})=>e));for(const[e,{entry:o,anchor:r}]of t){V.delete(e);let i=o.parent,a=!1;for(;i;){if(i.group===o.group&&n.has(i)){a=!0;break}i=i.parent}queueMicrotask(()=>o.callback(r,{emit:!a}))}}function de(){if(Lt||typeof document>"u")return;Lt=!0,et=new MutationObserver(n=>{const e=new Map;for(const o of n){const r={parent:o.target,nextSibling:o.nextSibling};for(const i of Array.from(o.removedNodes))Dt(i,r,e)}ue(e)});const t=()=>{et==null||et.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function fe(t,n,e=ae){de();let o=t.parentElement,r=null;for(;o;){const i=V.get(o);if((i==null?void 0:i.group)===e){r=i;break}o=o.parentElement}return V.set(t,{element:t,callback:n,group:e,parent:r}),()=>{V.delete(t)}}const ht=new WeakMap;let nt=null;const it="none !important";function j(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function pe(){return nt||(nt=new MutationObserver(t=>{for(const n of t){const e=n.target,o=ht.get(e);if(!o)continue;const r=j(e);r!==o.accounted&&(o.accounted=r,r===it?(o.reactHidden=!0,o.onHide()):r!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),nt)}function he(t,n){const e=j(t),o={accounted:e,reactHidden:e===it,onHide:n.onHide,onShow:n.onShow};return ht.set(t,o),pe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return j(t)===it},setDisplay(r,i=!1){r===null?t.style.removeProperty("display"):t.style.setProperty("display",r,i?"important":""),o.accounted=j(t)},sync(){o.accounted=j(t),o.reactHidden=o.accounted===it},stop(){ht.delete(t)}}}function ye(t,n={}){const{transitions:e=[],middleware:o=(s,c)=>({from:s,to:c})}=t,r=n.host??new _t,i={},a=le({keepCurrent:({current:s,next:c})=>s.element.contains(c.element)}),u=ce(),f=typeof e=="function"?e:()=>e,l=Zt();l.initialize();const p=new Map,h=s=>{let c=p.get(s);return c===void 0&&(c=o(s,s).from,p.set(s,c)),c},{initializeContext:y,calculateScrollOffset:E,evictScrollPosition:w,getScrollContainer:A,getPositionedParentElement:_,getScrollPosition:X,getIsMobile:v}=$t({resolvePath:h}),b=new Map,T=()=>{const s=v();let c=b.get(s);return c||(c=f({isMobile:s}),b.set(s,c)),c},R=new WeakMap,F=s=>{R.set(s,{parent:s.parentNode,nextSibling:s.nextSibling})},g=s=>{const c=R.get(s);return c||{parent:s.parentNode,nextSibling:s.nextSibling}},S=new WeakMap,C=new WeakMap;let O=0;const I=s=>{const c=typeof getComputedStyle<"u"?getComputedStyle(s).display:"";return c&&c!=="none"?c:"block"},P=(s,c)=>{c.visibleDisplay=s.style.getPropertyValue("display"),c.computedDisplay=I(s)},D=(s,c)=>{if(C.get(s)!==c)return;C.delete(s);const d=S.get(s);d&&(d.savedCss!==null&&(s.style.cssText=d.savedCss,d.savedCss=null),d.intent==="hidden"?d.vis.setDisplay("none",!0):d.visibleDisplay?(d.vis.setDisplay(d.visibleDisplay,!1),P(s,d)):(d.vis.setDisplay(null),P(s,d)))},G=(s,c,d,M,m,L,x)=>{const W=m.element,k=L.element,z=(m.mode??"unmount")==="hidden",{parent:U,nextSibling:K}=m.parent?{parent:m.parent,nextSibling:m.nextSibling}:g(W),J=E(d,M,x.to),ct={direction:c,scrollOffset:J,from:{scroll:X(d)},to:{scroll:X(M,x.to)},get scrollingElement(){return A()||document.documentElement},get positionedParent(){return _()}};let N;if(z){N=W,N.style.top=`${-1*((J==null?void 0:J.y)??0)}px`;const q=S.get(k);q&&q.savedCss===null&&(q.savedCss=k.style.cssText)}else N=W,zt(N,ct);x.from||w(d);const tt=z?++O:0;z&&(C.set(k,tt),C.set(W,tt));const St=Promise.resolve(N),Et=Promise.resolve(k),bt=[],Ht={from:St,to:Et,context:ct,createElement:((q,lt="div")=>{const Y=document.createElement(lt);return Y.setAttribute("data-ssgoi-id",q),bt.push(Y),Y})},Wt=Promise.resolve(s.prepare?s.prepare(Ht):{});Ut({from:St,to:Et,extras:Wt}).then(({from:q,to:lt,extras:Y})=>{!z&&U&&(K&&U.contains(K)?U.insertBefore(N,K):U.appendChild(N));const at=s.animation({from:q,to:lt,context:ct,...Y}),ut=at.onComplete;at.onComplete=()=>{ut==null||ut(),z?(D(W,tt),D(k,tt)):N.parentNode&&N.parentNode.removeChild(N);for(const dt of bt)dt.parentNode&&dt.parentNode.removeChild(dt)},r.attach(at)})},B=(s,c,d)=>{const M=l.isSwipeBack();a.arrive(s,c,d).then(m=>{var rt,z,U,K;if(c==="in"&&l.onPageEnter(),!m||c!=="in")return;const{from:L,to:x}=o(m.from,m.to),W=u.resolve(L,x),k=re(L,x,T(),W);if(!k){(z=(rt=m.in).applyScrollPolicy)==null||z.call(rt,!1),w(m.from);return}if((K=(U=m.in).applyScrollPolicy)==null||K.call(U,k.preserveScroll.to),M){k.preserveScroll.from||w(m.from);return}G(k.transition,k.direction,m.from,m.to,m.out,m.in,k.preserveScroll)})},$=(s,c)=>{const d=S.get(s);if(!d)return;const M=d.intent==="hidden";if(d.intent="hidden",d.savedCss===null&&(d.savedCss=s.style.cssText),d.vis.setDisplay(d.computedDisplay||"block",!0),s.style.position="absolute",s.style.width="100%",s.style.left="0",M)return;const m=g(s),L={element:s,parent:m.parent,nextSibling:m.nextSibling,mode:"hidden"},x=s.getAttribute("data-ssgoi-transition")??c;B(x,"out",L)},yt=(s,c)=>{const d=S.get(s);if(!d||d.intent==="visible")return;d.intent="visible",P(s,d),d.savedCss!==null&&(s.style.cssText=d.savedCss,d.visibleDisplay?d.vis.setDisplay(d.visibleDisplay,!1):d.vis.setDisplay(null));const M=s.getAttribute("data-ssgoi-transition")??c,m=y(s,M),L={element:s,parent:s.parentElement,nextSibling:s.nextElementSibling,applyScrollPolicy:m};B(M,"in",L)},Nt=(s,c,d,M=!0)=>{const m=S.get(s);if(m&&(m.vis.stop(),S.delete(s),C.delete(s),m.intent==="hidden")){a.cancel(k=>k.element===s);return}if(!M)return;const L=d??g(s),x={element:s,parent:L.parent,nextSibling:L.nextSibling,mode:"unmount"},W=s.getAttribute("data-ssgoi-transition")??c;B(W,"out",x)},mt=new WeakSet,gt=(s,c,{enter:d=!0}={})=>{if(mt.has(c))return;mt.add(c),F(c);const M=he(c,{onHide:()=>$(c,s),onShow:()=>yt(c,s)}),m={vis:M,savedCss:null,intent:M.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};if(S.set(c,m),!M.isHidden&&(P(c,m),d)){const L=y(c,s),x={element:c,parent:c.parentElement,nextSibling:c.nextElementSibling,applyScrollPolicy:L};B(s,"in",x)}fe(c,(L,x)=>Nt(c,s,L,(x==null?void 0:x.emit)??!0),i)},vt=new Map;return{register:gt,refFor:s=>{let c=vt.get(s);return c||(c=d=>{d&&gt(s,d)},vt.set(s,c)),c}}}const It="data-ssgoi-root",me=`[${It}]`,ot="data-ssgoi-transition",Rt=`[${ot}]`,ge="[data-ssgoi-clone]";function ve(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function Se(t){return t.nodeType===Node.ELEMENT_NODE}function Ee(t){return t instanceof HTMLElement}function Ot(t){let n=0,e=t.parentElement;for(;e;)n++,e=e.parentElement;return n}function kt(t,n,e=t){const o=Array.from(t).sort((r,i)=>Ot(r)-Ot(i));for(const r of o){const i=r.getAttribute(ot);if(i===null)continue;let a=r.parentElement,u=!1;for(;a;){if(e.has(a)){u=!0;break}a=a.parentElement}n.register(i,r,{enter:!u})}}function be(t,n){if(!ve())return()=>{};t.setAttribute(It,"");const e=u=>u.closest(me)===t,o=u=>!Ee(u)||!e(u)||u.closest(ge)||u.getAttribute(ot)===null?null:u,r=(u,f)=>{if(Se(u)){if(u.matches(Rt)){const l=o(u);l&&f.add(l)}for(const l of u.querySelectorAll(Rt)){const p=o(l);p&&f.add(p)}}},i=new MutationObserver(u=>{const f=new Set,l=new Set;for(const p of u){if(p.type==="attributes"){const h=o(p.target);h&&f.add(h);continue}for(const h of p.addedNodes)r(h,l)}for(const p of l)f.add(p);kt(f,n,l)});i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ot]});const a=new Set;return r(t,a),kt(a,n),()=>i.disconnect()}exports.Animation=st.Animation;exports.MultiAnimation=st.MultiAnimation;exports.WebAnimation=st.WebAnimation;exports.HostAnimation=_t;exports.createSggoiTransitionContext=ye;exports.observeSsgoiTransitions=be;
1
+ "use strict";var Bt=Object.defineProperty;var zt=(t,n,e)=>n in t?Bt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var Z=(t,n,e)=>zt(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("./multi-animation-6124HEke.cjs");class _t extends st.Animation{constructor(){super(...arguments);Z(this,"child",null);Z(this,"_state","idle");Z(this,"_settled",!1);Z(this,"listeners",new Set)}attach(e){const o=this.child;if(this.child=e,this._settled=!1,o){const u=o.getPose();o.complete(),e.matchInto(u)}e.playbackRate=this.playbackRate;const c=e.onComplete;e.onComplete=()=>{c==null||c(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const i=e.onUpdate;e.onUpdate=u=>{var f;i==null||i(u),(f=this.onUpdate)==null||f.call(this,u),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var o;(o=this.child)==null||o.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Xt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},wt=new Set(["auto","scroll","overlay"]),Gt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(wt.has(e.overflowY)||wt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},qt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ut(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const o={};return n.forEach((c,i)=>{o[c]=e[i]}),o})}const Kt=768,Vt=10,$t=10;function Yt(t={}){const{resolvePath:n=g=>g}=t;let e=null,o=!1,c=!1;const i=()=>{const g=(e==null?void 0:e.clientWidth)??0,v=g>0?g:typeof window<"u"?window.innerWidth:0;return v>0&&v<Kt},u=()=>(c||(o=i(),c=!0),o),f=g=>`path:${n(g)}`;let h=null;const a=new Map;let p=null,y=!1,m=0,b=0,P=0;const M=()=>{e&&p&&!y&&a.set(f(p),{x:e.scrollLeft,y:e.scrollTop})},D=(g,v,O)=>{if(!e)return;const R=++b,I=f(g),x=v&&a.has(I)?a.get(I):{x:0,y:0};let _=0;const W=()=>{if(!e||O!==m||R!==b)return;v||a.set(I,x),e.scrollTo({top:x.y,left:x.x}),!(Math.abs(e.scrollTop-x.y)<1&&Math.abs(e.scrollLeft-x.x)<1)&&_<Vt&&(_++,requestAnimationFrame(W))};requestAnimationFrame(W)};return{initializeContext:(g,v,O)=>{y=!0;const R=p===v?m:++m;h=g,e||(e=Gt(g),o=i(),c=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{o=i()}).observe(e),(e===document.documentElement?window:e).addEventListener("scroll",M,{passive:!0})),p=v;const I=f(v),x=a.get(I),_=z=>{R===m&&(P=R,z&&x&&a.set(I,x),D(v,z,R))};O!==void 0?_(O):requestAnimationFrame(()=>{P!==R&&R===m&&_(!1)});let W=0;const $=()=>{R===m&&(W++,W>=$t?y=!1:requestAnimationFrame($))};return requestAnimationFrame($),_},calculateScrollOffset:(g,v,O=!1)=>{const R=g?f(g):null,I=R&&a.has(R)?a.get(R):{x:0,y:0},x=v&&O?f(v):null,_=x&&a.has(x)?a.get(x):{x:0,y:0};return{x:-_.x+I.x,y:-_.y+I.y}},evictScrollPosition:g=>{a.delete(f(g))},getScrollContainer:()=>e,getPositionedParentElement:()=>h?qt(h):document.body,getScrollPosition:(g,v=!0)=>{if(!v)return{x:0,y:0};const O=g?f(g):null;return O&&a.has(O)?a.get(O):{x:0,y:0}},getIsMobile:u}}const Tt=30,Pt=8,At=1.2,Ct=30,Zt=600;function jt(){let t=null,n=!1,e=!1,o=null,c=null,i=!1;const u=(S,w)=>{for(let C=0;C<S.length;C++){const L=S.item(C);if(L&&L.identifier===w)return L}return null},f=()=>{o!==null&&(clearTimeout(o),o=null)},h=()=>{c!==null&&(clearTimeout(c),c=null)},a=()=>{n=!0,e=!0,f(),h(),o=setTimeout(()=>{n=!1,e=!1,o=null},Zt)},p=S=>{if(S.touches.length!==1){t=null;return}const w=S.touches.item(0);if(!w){t=null;return}const C=window.innerWidth,L=w.clientX<=Tt,B=w.clientX>=C-Tt;if(!L&&!B){t=null;return}t={identifier:w.identifier,startX:w.clientX,startY:w.clientY,fromLeftEdge:L,moved:!1}},y=S=>{if(!t)return;if(S.touches.length!==1){t=null;return}const w=u(S.touches,t.identifier);if(!w){t=null;return}const C=w.clientX-t.startX,L=w.clientY-t.startY,B=Math.abs(C),g=Math.abs(L);if(g>Pt&&g>B*At){t=null;return}const v=t.fromLeftEdge?C>0:C<0;B>Pt&&B>g*At&&v&&(t.moved=!0)},m=S=>{if(!t)return;const w=u(S.changedTouches,t.identifier);if(!w){t=null;return}const C=w.clientX-t.startX,L=t.fromLeftEdge?C>0:C<0;if(t.moved&&L&&Math.abs(C)>=Ct){a(),t=null;return}t.moved&&Math.abs(C)>=Ct&&a(),t=null},b=()=>{t&&(t.moved&&a(),t=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const S={passive:!0,capture:!0};window.addEventListener("touchstart",p,S),window.addEventListener("touchmove",y,S),window.addEventListener("touchend",m,S),window.addEventListener("touchcancel",b,S)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const S={capture:!0};window.removeEventListener("touchstart",p,S),window.removeEventListener("touchmove",y,S),window.removeEventListener("touchend",m,S),window.removeEventListener("touchcancel",b,S),f(),h(),t=null,n=!1,e=!1},isSwipeBack:()=>{const S=n||e;return S&&f(),S},onPageEnter:()=>{n=!1,f(),h(),c=setTimeout(()=>{e=!1,c=null},0)}}}const Qt=1e6,Ot=100,Jt=10,te=1;function ee(t){const n=t.trim(),e=n.indexOf("#"),o=n.indexOf("?"),c=[e,o].filter(i=>i>=0).reduce((i,u)=>Math.min(i,u),n.length);return n.slice(0,c)}function Q(t){const n=ee(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return Q(new URL(n).pathname)}catch{}const o=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(o.length>1?o.replace(/\/+$/g,""):o)||"/"}function ne(t){const n=t.trim();return n==="*"?"/**":Q(n)}function dt(t){return t==="/"?[]:t.slice(1).split("/")}function ie(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function oe(t,n){const e=Q(t),o=ne(n);if(e===o)return{matched:!0,specificity:Qt+dt(o).length*Ot,pattern:n};const c=dt(e),i=dt(o);let u=0;for(let f=0;f<i.length;f++){const h=i[f],a=c[f],p=f===i.length-1;if(h==="**")return{matched:p&&c.length>=f,specificity:u,pattern:n};if(a===void 0||h===void 0)return{matched:!1,specificity:0,pattern:n};if(h==="*"){u+=te;continue}if(ie(h)){u+=Jt;continue}if(h!==a)return{matched:!1,specificity:0,pattern:n};u+=Ot}return{matched:c.length===i.length,specificity:u,pattern:n}}function H(t,n){const e=typeof n=="string"?[n]:n;let o=null;for(const c of e){const i=oe(t,c);i.matched&&(!o||i.specificity>o.specificity)&&(o=i)}return o}const xt={from:!0,to:!1},se={from:!0,to:!0};function re(t,n){return n?t.priority!==n.priority?t.priority>n.priority:t.specificity!==n.specificity?t.specificity>n.specificity:t.ruleIndex<n.ruleIndex:!0}function ht(t,n){return n==="forward"?{from:t.from,to:t.to}:{from:t.to,to:t.from}}function ce(t,n,e,o){let c=null;return e.forEach((i,u)=>{const f=i.priority??0;let h=null;if(i.on!==void 0){const a=i.except!==void 0&&H(t,i.except)!==null,p=i.except!==void 0&&H(n,i.except)!==null,y=a?null:H(t,i.on),m=p?null:H(n,i.on);if(y||m){const b=!y&&m?"forward":y&&!m?"backward":o,P=!y&&m?"on-enter":y&&!m?"on-leave":"on-history",M=i.preserveScroll??xt;h={transition:i.transition,direction:b,ruleIndex:u,priority:f,specificity:Math.max((y==null?void 0:y.specificity)??0,(m==null?void 0:m.specificity)??0),reason:P,preserveScroll:P==="on-history"?{from:M.to,to:M.to}:ht(M,b)}}}else if(i.ordered!==void 0){let a=-1,p=-1,y=-1,m=-1;if(i.ordered.forEach((b,P)=>{const M=H(t,b);M&&M.specificity>y&&(a=P,y=M.specificity);const D=H(n,b);D&&D.specificity>m&&(p=P,m=D.specificity)}),a>=0&&p>=0&&a!==p){const b=a<p?"forward":"backward";h={transition:i.transition,direction:b,ruleIndex:u,priority:f,specificity:y+m,reason:"ordered",preserveScroll:ht(i.preserveScroll??se,b)}}}else{const a=H(t,i.from),p=H(n,i.to),y=i.bidirectional===!1?null:H(t,i.to),m=i.bidirectional===!1?null:H(n,i.from),b=a&&p,P=y&&m;if(b||P){const M=b?a.specificity+p.specificity:-1,D=P?y.specificity+m.specificity:-1,G=b&&P&&M===D?o:M>=D?"forward":"backward";h={transition:i.transition,direction:G,ruleIndex:u,priority:f,specificity:Math.max(M,D),reason:"pair",preserveScroll:ht(i.preserveScroll??xt,G)}}}h&&re(h,c)&&(c=h)}),c}function le(){const t=[];let n=!1;const e=()=>{n=!0};return typeof window<"u"&&window.addEventListener("popstate",e),{resolve(o,c){const i=Q(o),u=Q(c);if(t.length===0)t.push(i);else if(t[t.length-1]!==i){const a=t.lastIndexOf(i);a>=0?t.splice(a+1):t.push(i)}const f=t[t.length-2],h=n||f===u?"backward":"forward";if(n=!1,h==="backward"){const a=t.lastIndexOf(u);a>=0?t.splice(a+1):t.push(u)}else t[t.length-1]!==u&&t.push(u);return h},dispose(){typeof window<"u"&&window.removeEventListener("popstate",e)}}}function ae(t={}){let n=null,e=null;function o(){var i,u;n&&((i=n.out)==null||i.resolve(null),(u=n.in)==null||u.resolve(null),n=null)}function c(){if(n!=null&&n.out&&n.in){if(n.out.path===n.in.path){o();return}const i={from:n.out.path,to:n.in.path,out:n.out.payload,in:n.in.payload};e=i,n.out.resolve(i),n.in.resolve(i),n=null}}return{arrive(i,u,f){return new Promise(h=>{var m,b;const a=e===null?null:u==="out"?{path:e.from,payload:e.out}:{path:e.to,payload:e.in};if((a==null?void 0:a.path)===i){h(null);return}u==="out"&&((m=n==null?void 0:n.in)==null?void 0:m.path)===i&&!n.out&&(n.in.resolve(null),n.in=void 0);const p=n==null?void 0:n[u];p&&p.path!==i&&o(),n||(n={});const y=n[u];if(y){if(((b=t.keepCurrent)==null?void 0:b.call(t,{type:u,path:i,current:y.payload,next:f}))??!1){h(null);return}y.resolve(null)}n[u]={path:i,payload:f,resolve:h},c()})},cancel(i){(n!=null&&n.out&&i(n.out.payload)||n!=null&&n.in&&i(n.in.payload))&&o(),(e&&i(e.out)||e&&i(e.in))&&(e=null)}}}const ue={},V=new Map;let et=null,Mt=!1;function Dt(t,n,e){t instanceof HTMLElement&&V.has(t)&&!t.isConnected&&e.set(t,{entry:V.get(t),anchor:n});for(const o of Array.from(t.childNodes))Dt(o,n,e)}function fe(t){const n=new Set(Array.from(t.values(),({entry:e})=>e));for(const[e,{entry:o,anchor:c}]of t){V.delete(e);let i=o.parent,u=!1;for(;i;){if(i.group===o.group&&n.has(i)){u=!0;break}i=i.parent}queueMicrotask(()=>o.callback(c,{emit:!u}))}}function de(){if(Mt||typeof document>"u")return;Mt=!0,et=new MutationObserver(n=>{const e=new Map;for(const o of n){const c={parent:o.target,nextSibling:o.nextSibling};for(const i of Array.from(o.removedNodes))Dt(i,c,e)}fe(e)});const t=()=>{et==null||et.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function he(t,n,e=ue){de();let o=t.parentElement,c=null;for(;o;){const i=V.get(o);if((i==null?void 0:i.group)===e){c=i;break}o=o.parentElement}return V.set(t,{element:t,callback:n,group:e,parent:c}),()=>{V.delete(t)}}const pt=new WeakMap;let nt=null;const it="none !important";function j(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function pe(){return nt||(nt=new MutationObserver(t=>{for(const n of t){const e=n.target,o=pt.get(e);if(!o)continue;const c=j(e);c!==o.accounted&&(o.accounted=c,c===it?(o.reactHidden=!0,o.onHide()):c!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),nt)}function ye(t,n){const e=j(t),o={accounted:e,reactHidden:e===it,onHide:n.onHide,onShow:n.onShow};return pt.set(t,o),pe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return j(t)===it},setDisplay(c,i=!1){c===null?t.style.removeProperty("display"):t.style.setProperty("display",c,i?"important":""),o.accounted=j(t)},sync(){o.accounted=j(t),o.reactHidden=o.accounted===it},stop(){pt.delete(t)}}}function me(t,n={}){const{transitions:e=[],middleware:o=(s,r)=>({from:s,to:r})}=t,c=n.host??new _t,i={},u=ae({keepCurrent:({current:s,next:r})=>s.element.contains(r.element)}),f=le(),h=typeof e=="function"?e:()=>e,a=jt();a.initialize();const p=new Map,y=s=>{let r=p.get(s);return r===void 0&&(r=o(s,s).from,p.set(s,r)),r},{initializeContext:m,calculateScrollOffset:b,evictScrollPosition:P,getScrollContainer:M,getPositionedParentElement:D,getScrollPosition:G,getIsMobile:S}=Yt({resolvePath:y}),w=new Map,C=()=>{const s=S();let r=w.get(s);return r||(r=h({isMobile:s}),w.set(s,r)),r},L=new WeakMap,B=s=>{L.set(s,{parent:s.parentNode,nextSibling:s.nextSibling})},g=s=>{const r=L.get(s);return r||{parent:s.parentNode,nextSibling:s.nextSibling}},v=new WeakMap,O=new WeakMap;let R=0;const I=s=>{const r=typeof getComputedStyle<"u"?getComputedStyle(s).display:"";return r&&r!=="none"?r:"block"},x=(s,r)=>{r.visibleDisplay=s.style.getPropertyValue("display"),r.computedDisplay=I(s)},_=(s,r)=>{if(O.get(s)!==r)return;O.delete(s);const l=v.get(s);l&&(l.savedCss!==null&&(s.style.cssText=l.savedCss,l.savedCss=null),l.intent==="hidden"?l.vis.setDisplay("none",!0):l.visibleDisplay?(l.vis.setDisplay(l.visibleDisplay,!1),x(s,l)):(l.vis.setDisplay(null),x(s,l)))},W=(s,r)=>{if(s.mode!=="hidden")return;const l=Array.from(new Set([s.element,r==null?void 0:r.element].filter(Boolean))),A=++R;for(const d of l)O.set(d,A);c.complete();for(const d of l)_(d,A)},$=(s,r,l,A,d,E,T)=>{const F=d.element,k=E.element,X=(d.mode??"unmount")==="hidden",{parent:q,nextSibling:K}=d.parent?{parent:d.parent,nextSibling:d.nextSibling}:g(F),J=b(l,A,T.to),ct={direction:r,scrollOffset:J,from:{scroll:G(l)},to:{scroll:G(A,T.to)},get scrollingElement(){return M()||document.documentElement},get positionedParent(){return D()}};let N;if(X){N=F,N.style.top=`${-1*((J==null?void 0:J.y)??0)}px`;const U=v.get(k);U&&U.savedCss===null&&(U.savedCss=k.style.cssText)}else N=F,Xt(N,ct);T.from||P(l);const tt=X?++R:0;X&&(O.set(k,tt),O.set(F,tt));const St=Promise.resolve(N),Et=Promise.resolve(k),bt=[],Wt={from:St,to:Et,context:ct,createElement:((U,lt="div")=>{const Y=document.createElement(lt);return Y.setAttribute("data-ssgoi-id",U),bt.push(Y),Y})},Ft=Promise.resolve(s.prepare?s.prepare(Wt):{});Ut({from:St,to:Et,extras:Ft}).then(({from:U,to:lt,extras:Y})=>{!X&&q&&(K&&q.contains(K)?q.insertBefore(N,K):q.appendChild(N));const at=s.animation({from:U,to:lt,context:ct,...Y}),ut=at.onComplete;at.onComplete=()=>{ut==null||ut(),X?(_(F,tt),_(k,tt)):N.parentNode&&N.parentNode.removeChild(N);for(const ft of bt)ft.parentNode&&ft.parentNode.removeChild(ft)},c.attach(at)})},z=(s,r,l)=>{const A=a.isSwipeBack();u.arrive(s,r,l).then(d=>{var rt,X,q,K;if(r==="in"&&a.onPageEnter(),!d){r==="out"&&W(l);return}if(r!=="in")return;const{from:E,to:T}=o(d.from,d.to),F=f.resolve(E,T),k=ce(E,T,C(),F);if(!k){(X=(rt=d.in).applyScrollPolicy)==null||X.call(rt,!1),P(d.from),W(d.out,d.in);return}if((K=(q=d.in).applyScrollPolicy)==null||K.call(q,k.preserveScroll.to),A){k.preserveScroll.from||P(d.from),W(d.out,d.in);return}$(k.transition,k.direction,d.from,d.to,d.out,d.in,k.preserveScroll)})},yt=(s,r)=>{const l=v.get(s);if(!l)return;const A=l.intent==="hidden";if(l.intent="hidden",l.savedCss===null&&(l.savedCss=s.style.cssText),l.vis.setDisplay(l.computedDisplay||"block",!0),s.style.position="absolute",s.style.width="100%",s.style.left="0",A)return;const d=g(s),E={element:s,parent:d.parent,nextSibling:d.nextSibling,mode:"hidden"},T=l.pendingOutPath??l.currentPath??r;l.pendingOutPath=null,z(T,"out",E)},Nt=(s,r)=>{const l=v.get(s);if(!l||l.intent==="visible")return;l.intent="visible",l.currentPath=s.getAttribute("data-ssgoi-transition")??l.currentPath??r,l.pendingOutPath=null,l.pathRevision++,x(s,l),l.savedCss!==null&&(s.style.cssText=l.savedCss,l.visibleDisplay?l.vis.setDisplay(l.visibleDisplay,!1):l.vis.setDisplay(null));const A=l.currentPath,d=m(s,A),E={element:s,parent:s.parentElement,nextSibling:s.nextElementSibling,applyScrollPolicy:d};z(A,"in",E)},Ht=(s,r,l,A=!0)=>{const d=v.get(s),E=(d==null?void 0:d.pendingOutPath)??(d==null?void 0:d.currentPath)??r;if(d&&(d.vis.stop(),v.delete(s),O.delete(s),d.intent==="hidden")){u.cancel(k=>k.element===s);return}if(!A)return;const T=l??g(s),F={element:s,parent:T.parent,nextSibling:T.nextSibling,mode:"unmount"};z(E,"out",F)},mt=new WeakSet,gt=(s,r,{enter:l=!0}={})=>{if(mt.has(r)){const E=v.get(r);if(E&&E.currentPath!==s){E.intent==="visible"&&E.pendingOutPath===null&&(E.pendingOutPath=E.currentPath),E.currentPath=s;const T=++E.pathRevision;queueMicrotask(()=>{E.pathRevision===T&&(E.pendingOutPath=null)})}return}mt.add(r),B(r);const A=ye(r,{onHide:()=>yt(r,s),onShow:()=>Nt(r,s)}),d={vis:A,savedCss:null,intent:A.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block",currentPath:s,pendingOutPath:null,pathRevision:0};if(v.set(r,d),!A.isHidden&&(x(r,d),l)){const E=m(r,s),T={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling,applyScrollPolicy:E};z(s,"in",T)}he(r,(E,T)=>Ht(r,s,E,(T==null?void 0:T.emit)??!0),i)},vt=new Map;return{register:gt,refFor:s=>{let r=vt.get(s);return r||(r=l=>{l&&gt(s,l)},vt.set(s,r)),r}}}const It="data-ssgoi-root",ge=`[${It}]`,ot="data-ssgoi-transition",Rt=`[${ot}]`,ve="[data-ssgoi-clone]";function Se(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function Ee(t){return t.nodeType===Node.ELEMENT_NODE}function be(t){return t instanceof HTMLElement}function Lt(t){let n=0,e=t.parentElement;for(;e;)n++,e=e.parentElement;return n}function kt(t,n,e=t){const o=Array.from(t).sort((c,i)=>Lt(c)-Lt(i));for(const c of o){const i=c.getAttribute(ot);if(i===null)continue;let u=c.parentElement,f=!1;for(;u;){if(e.has(u)){f=!0;break}u=u.parentElement}n.register(i,c,{enter:!f})}}function we(t,n){if(!Se())return()=>{};t.setAttribute(It,"");const e=f=>f.closest(ge)===t,o=f=>!be(f)||!e(f)||f.closest(ve)||f.getAttribute(ot)===null?null:f,c=(f,h)=>{if(Ee(f)){if(f.matches(Rt)){const a=o(f);a&&h.add(a)}for(const a of f.querySelectorAll(Rt)){const p=o(a);p&&h.add(p)}}},i=new MutationObserver(f=>{const h=new Set,a=new Set;for(const p of f){if(p.type==="attributes"){const y=o(p.target);y&&h.add(y);continue}for(const y of p.addedNodes)c(y,a)}for(const p of a)h.add(p);kt(h,n,a)});i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ot]});const u=new Set;return c(t,u),kt(u,n),()=>i.disconnect()}exports.Animation=st.Animation;exports.MultiAnimation=st.MultiAnimation;exports.WebAnimation=st.WebAnimation;exports.HostAnimation=_t;exports.createSggoiTransitionContext=me;exports.observeSsgoiTransitions=we;