@ssgoi/core 6.7.0-beta.1 → 7.0.0-beta.1

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.
Files changed (100) hide show
  1. package/README.md +80 -230
  2. package/dist/animation/animation.d.ts +2 -2
  3. package/dist/animation/frame-scheduler.d.ts +36 -0
  4. package/dist/animation/frame-scheduler.d.ts.map +1 -0
  5. package/dist/animation/multi-animation.d.ts +3 -2
  6. package/dist/animation/multi-animation.d.ts.map +1 -1
  7. package/dist/animation/web-animation.d.ts +16 -4
  8. package/dist/animation/web-animation.d.ts.map +1 -1
  9. package/dist/index.cjs +15 -15
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1282 -1125
  13. package/dist/internal.cjs +1 -1
  14. package/dist/internal.d.ts +1 -1
  15. package/dist/internal.d.ts.map +1 -1
  16. package/dist/internal.js +692 -521
  17. package/dist/multi-animation-6124HEke.cjs +1 -0
  18. package/dist/multi-animation-ZFZBDBGr.js +439 -0
  19. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
  20. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts +24 -9
  21. package/dist/ssgoi-transition/navigation-detector-strategy.d.ts.map +1 -1
  22. package/dist/ssgoi-transition/navigation-direction.d.ts +13 -0
  23. package/dist/ssgoi-transition/navigation-direction.d.ts.map +1 -0
  24. package/dist/ssgoi-transition/observe-ssgoi-transitions.d.ts +1 -0
  25. package/dist/ssgoi-transition/observe-ssgoi-transitions.d.ts.map +1 -1
  26. package/dist/ssgoi-transition/path-pattern.d.ts +15 -0
  27. package/dist/ssgoi-transition/path-pattern.d.ts.map +1 -0
  28. package/dist/ssgoi-transition/resolve-transition-rule.d.ts +16 -0
  29. package/dist/ssgoi-transition/resolve-transition-rule.d.ts.map +1 -0
  30. package/dist/ssgoi-transition/unmount-observer.d.ts +11 -2
  31. package/dist/ssgoi-transition/unmount-observer.d.ts.map +1 -1
  32. package/dist/transitions/axis/index.d.ts +5 -7
  33. package/dist/transitions/axis/index.d.ts.map +1 -1
  34. package/dist/transitions/axis/types.d.ts +0 -1
  35. package/dist/transitions/axis/types.d.ts.map +1 -1
  36. package/dist/transitions/blind/index.d.ts +2 -3
  37. package/dist/transitions/blind/index.d.ts.map +1 -1
  38. package/dist/transitions/drill/index.d.ts +6 -7
  39. package/dist/transitions/drill/index.d.ts.map +1 -1
  40. package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -1
  41. package/dist/transitions/drill/provider/parallax.d.ts.map +1 -1
  42. package/dist/transitions/drill/transition.d.ts.map +1 -1
  43. package/dist/transitions/drill/types.d.ts +0 -1
  44. package/dist/transitions/drill/types.d.ts.map +1 -1
  45. package/dist/transitions/fade/index.d.ts +3 -5
  46. package/dist/transitions/fade/index.d.ts.map +1 -1
  47. package/dist/transitions/film/index.d.ts +3 -5
  48. package/dist/transitions/film/index.d.ts.map +1 -1
  49. package/dist/transitions/hero/fit.d.ts +5 -0
  50. package/dist/transitions/hero/fit.d.ts.map +1 -0
  51. package/dist/transitions/hero/index.d.ts +3 -5
  52. package/dist/transitions/hero/index.d.ts.map +1 -1
  53. package/dist/transitions/hero/transition.d.ts +12 -1
  54. package/dist/transitions/hero/transition.d.ts.map +1 -1
  55. package/dist/transitions/hero/types.d.ts +2 -1
  56. package/dist/transitions/hero/types.d.ts.map +1 -1
  57. package/dist/transitions/jaemin/index.d.ts +3 -5
  58. package/dist/transitions/jaemin/index.d.ts.map +1 -1
  59. package/dist/transitions/media-geometry.d.ts +55 -0
  60. package/dist/transitions/media-geometry.d.ts.map +1 -0
  61. package/dist/transitions/rotate/index.d.ts +3 -5
  62. package/dist/transitions/rotate/index.d.ts.map +1 -1
  63. package/dist/transitions/scroll/index.d.ts +4 -5
  64. package/dist/transitions/scroll/index.d.ts.map +1 -1
  65. package/dist/transitions/scroll/transition.d.ts +1 -1
  66. package/dist/transitions/scroll/transition.d.ts.map +1 -1
  67. package/dist/transitions/sheet/index.d.ts +6 -7
  68. package/dist/transitions/sheet/index.d.ts.map +1 -1
  69. package/dist/transitions/sheet/provider/static.d.ts.map +1 -1
  70. package/dist/transitions/sheet/transition.d.ts.map +1 -1
  71. package/dist/transitions/sheet/types.d.ts +0 -1
  72. package/dist/transitions/sheet/types.d.ts.map +1 -1
  73. package/dist/transitions/slide/index.d.ts +3 -5
  74. package/dist/transitions/slide/index.d.ts.map +1 -1
  75. package/dist/transitions/slide/transition.d.ts +0 -1
  76. package/dist/transitions/slide/transition.d.ts.map +1 -1
  77. package/dist/transitions/strip/index.d.ts +3 -5
  78. package/dist/transitions/strip/index.d.ts.map +1 -1
  79. package/dist/transitions/utils.d.ts +3 -21
  80. package/dist/transitions/utils.d.ts.map +1 -1
  81. package/dist/transitions/zoom/index.d.ts +3 -4
  82. package/dist/transitions/zoom/index.d.ts.map +1 -1
  83. package/dist/transitions/zoom/provider/blur.d.ts.map +1 -1
  84. package/dist/transitions/zoom/transition.d.ts +6 -1
  85. package/dist/transitions/zoom/transition.d.ts.map +1 -1
  86. package/dist/transitions/zoom/types.d.ts +5 -0
  87. package/dist/transitions/zoom/types.d.ts.map +1 -1
  88. package/dist/transitions/zoom/zoom-element.d.ts +2 -2
  89. package/dist/transitions/zoom/zoom-element.d.ts.map +1 -1
  90. package/dist/types/index.d.ts +66 -10
  91. package/dist/types/index.d.ts.map +1 -1
  92. package/dist/utils/wait-paint.d.ts +8 -7
  93. package/dist/utils/wait-paint.d.ts.map +1 -1
  94. package/package.json +13 -14
  95. package/dist/multi-animation-1FueEz2Q.js +0 -367
  96. package/dist/multi-animation-qtH1IKNG.cjs +0 -1
  97. package/dist/ssgoi-transition/find-matching-transition.d.ts +0 -30
  98. package/dist/ssgoi-transition/find-matching-transition.d.ts.map +0 -1
  99. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +0 -7
  100. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +0 -1
package/dist/internal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var It=Object.defineProperty;var Ht=(t,n,e)=>n in t?It(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var F=(t,n,e)=>Ht(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./multi-animation-qtH1IKNG.cjs");class Mt extends Q.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const s=this.child;if(this.child=e,this._settled=!1,s){const l=s.getPose();s.complete(),e.matchInto(l)}e.playbackRate=this.playbackRate;const o=e.onComplete;e.onComplete=()=>{o==null||o(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const a=e.onUpdate;e.onUpdate=l=>{var u;a==null||a(l),(u=this.onUpdate)==null||u.call(this,l),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 s;return((s=this.child)==null?void 0:s.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 s;(s=this.child)==null||s.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 Wt=(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"},vt=new Set(["auto","scroll","overlay"]),zt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(vt.has(e.overflowY)||vt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},Bt=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 Ft(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const s={};return n.forEach((o,a)=>{s[o]=e[a]}),s})}function Kt(t){const n=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...n]}const Xt=1e6,bt=100,$t=10;function qt(t){const n=t.trim(),e=n.indexOf("#"),s=n.indexOf("?"),o=[e,s].filter(a=>a>=0).reduce((a,l)=>Math.min(a,l),n.length);return n.slice(0,o)}function ut(t){const n=qt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return ut(new URL(n).pathname)}catch{}const s=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(s.length>1?s.replace(/\/+$/g,""):s)||"/"}function Ut(t){const n=t.trim();return n==="*"?"*":ut(n)}function rt(t){return t==="/"?[]:t.slice(1).split("/")}function Vt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function ct(t,n){const e=ut(t),s=Ut(n);if(s==="*")return{matched:!0,specificity:0};if(e===s)return{matched:!0,specificity:Xt+rt(s).length*bt};const o=rt(e),a=rt(s);let l=0;for(let u=0;u<a.length;u++){const g=a[u],b=o[u],_=u===a.length-1;if(g===void 0)return{matched:!1,specificity:0};if((g==="*"||g==="**")&&_)return{matched:g==="**"?o.length>=u:o.length>u,specificity:l};if(b===void 0)return{matched:!1,specificity:0};if(g==="*"||Vt(g)){l+=$t;continue}if(g!==b)return{matched:!1,specificity:0};l+=bt}return{matched:o.length===a.length,specificity:l}}function Gt(t,n){return ct(t,n).matched}function Yt(t,n,e){let s;for(const o of e){const a=ct(t,o.from);if(!a.matched)continue;const l=ct(n,o.to);if(!l.matched)continue;const u=a.specificity+l.specificity;(!s||u>s.specificity)&&(s={transition:o.transition,specificity:u})}return(s==null?void 0:s.transition)??null}const Zt=768,jt=10,Qt=10;function Jt(t={}){const{preserveScroll:n=f=>f,resolvePath:e=f=>f}=t,s=typeof n=="function"?n:()=>n;let o=null,a=!1,l=!1;const u=()=>{const f=(o==null?void 0:o.clientWidth)??0,d=f>0?f:typeof window<"u"?window.innerWidth:0;return d>0&&d<Zt},g=()=>(l||(a=u(),l=!0),a),b=f=>{var R;const d=e(f),y=s(g());if(y===!1)return{preserves:!1,shared:!1,storageKey:`path:${d}`};if(y===!0)return{preserves:!0,shared:!1,storageKey:`path:${d}`};const E=((R=y.exclude)==null?void 0:R.some(C=>Gt(d,C)))??!1,P=!E&&!!y.key;return{preserves:!E,shared:P,storageKey:P?`shared:${y.key}`:`path:${d}`}},_=f=>b(f).preserves;let O=null;const T=new Map;let L=null,k=!1,W=0;const $=()=>{o&&L&&!k&&T.set(b(L).storageKey,{x:o.scrollLeft,y:o.scrollTop})},z=f=>{if(!o)return;const d=b(f);if(d.preserves&&d.shared&&!T.has(d.storageKey))return;const y=d.preserves&&T.has(d.storageKey)?T.get(d.storageKey):{x:0,y:0};let E=0;const P=()=>{if(!o)return;o.scrollTo({top:y.y,left:y.x}),!(Math.abs(o.scrollTop-y.y)<1&&Math.abs(o.scrollLeft-y.x)<1)&&E<jt&&(E++,requestAnimationFrame(P))};requestAnimationFrame(P)};return{initializeContext:(f,d)=>{k=!0;const y=++W;O=f,o||(o=zt(f),a=u(),l=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{a=u()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",$,{passive:!0})),L=d,z(d);let E=0;const P=()=>{y===W&&(E++,E>=Qt?k=!1:requestAnimationFrame(P))};requestAnimationFrame(P)},calculateScrollOffset:(f,d)=>{const y=f?b(f).storageKey:null,E=y&&T.has(y)?T.get(y):{x:0,y:0},P=d?b(d):null,R=P!=null&&P.preserves?P.storageKey:null,C=R&&T.has(R)?T.get(R):{x:0,y:0};return{x:-C.x+E.x,y:-C.y+E.y}},evictScrollPosition:f=>{T.delete(b(f).storageKey)},shouldPreserve:_,getScrollContainer:()=>o,getPositionedParentElement:()=>O?Bt(O):document.body,getScrollPosition:f=>{const d=f?b(f).storageKey:null;return d&&T.has(d)?T.get(d):{x:0,y:0}},getIsMobile:g}}const St=30,Et=8,Tt=1.2,wt=30,te=600;function ee(){let t=null,n=!1,e=!1,s=null,o=null,a=!1;const l=(h,v)=>{for(let S=0;S<h.length;S++){const m=h.item(S);if(m&&m.identifier===v)return m}return null},u=()=>{s!==null&&(clearTimeout(s),s=null)},g=()=>{o!==null&&(clearTimeout(o),o=null)},b=()=>{n=!0,e=!0,u(),g(),s=setTimeout(()=>{n=!1,e=!1,s=null},te)},_=h=>{if(h.touches.length!==1){t=null;return}const v=h.touches.item(0);if(!v){t=null;return}const S=window.innerWidth,m=v.clientX<=St,w=v.clientX>=S-St;if(!m&&!w){t=null;return}t={identifier:v.identifier,startX:v.clientX,startY:v.clientY,fromLeftEdge:m,moved:!1}},O=h=>{if(!t)return;if(h.touches.length!==1){t=null;return}const v=l(h.touches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=v.clientY-t.startY,w=Math.abs(S),I=Math.abs(m);if(I>Et&&I>w*Tt){t=null;return}const f=t.fromLeftEdge?S>0:S<0;w>Et&&w>I*Tt&&f&&(t.moved=!0)},T=h=>{if(!t)return;const v=l(h.changedTouches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=t.fromLeftEdge?S>0:S<0;if(t.moved&&m&&Math.abs(S)>=wt){b(),t=null;return}t.moved&&Math.abs(S)>=wt&&b(),t=null},L=()=>{t&&(t.moved&&b(),t=null)};return{initialize:()=>{if(typeof window>"u"||a)return;a=!0;const h={passive:!0,capture:!0};window.addEventListener("touchstart",_,h),window.addEventListener("touchmove",O,h),window.addEventListener("touchend",T,h),window.addEventListener("touchcancel",L,h)},destroy:()=>{if(typeof window>"u"||!a)return;a=!1;const h={capture:!0};window.removeEventListener("touchstart",_,h),window.removeEventListener("touchmove",O,h),window.removeEventListener("touchend",T,h),window.removeEventListener("touchcancel",L,h),u(),g(),t=null,n=!1,e=!1},isSwipeBack:()=>{const h=n||e;return h&&u(),h},onPageEnter:()=>{n=!1,u(),g(),o=setTimeout(()=>{e=!1,o=null},0)}}}function ne(){let t=null;function n(){var s,o;t&&((s=t.outResolve)==null||s.call(t,null),(o=t.inResolve)==null||o.call(t,null),t=null)}function e(){if(t!=null&&t.from&&(t!=null&&t.to)&&(t!=null&&t.outResolve)&&(t!=null&&t.inResolve)){if(t.from===t.to){n();return}const s={from:t.from,to:t.to};t.outResolve(s),t.inResolve(s),t=null}}return{trigger(s,o){var l;o==="out"&&(t==null?void 0:t.to)===s&&!t.from&&((l=t.inResolve)==null||l.call(t,null),t={}),t&&(o==="out"&&t.from&&t.from!==s||o==="in"&&t.to&&t.to!==s)&&n(),t||(t={}),o==="out"?t.from=s:t.to=s},get(s){return new Promise(o=>{t||(t={}),s==="out"?t.outResolve=o:t.inResolve=o,e()})}}}const X=new Map;let Y=null,Pt=!1;function Rt(t,n){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(n))}for(const e of Array.from(t.childNodes))Rt(e,n)}function se(){if(Pt||typeof document>"u")return;Pt=!0,Y=new MutationObserver(n=>{for(const e of n){const s={parent:e.target,nextSibling:e.nextSibling};for(const o of Array.from(e.removedNodes))Rt(o,s)}});const t=()=>{Y==null||Y.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function ie(t,n){return se(),X.set(t,n),()=>{X.delete(t)}}const lt=new WeakMap;let Z=null;const j="none !important";function K(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function oe(){return Z||(Z=new MutationObserver(t=>{for(const n of t){const e=n.target,s=lt.get(e);if(!s)continue;const o=K(e);o!==s.accounted&&(s.accounted=o,o===j?(s.reactHidden=!0,s.onHide()):o!=="none"&&s.reactHidden&&(s.reactHidden=!1,s.onShow()))}}),Z)}function re(t,n){const e=K(t),s={accounted:e,reactHidden:e===j,onHide:n.onHide,onShow:n.onShow};return lt.set(t,s),oe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return K(t)===j},setDisplay(o,a=!1){o===null?t.style.removeProperty("display"):t.style.setProperty("display",o,a?"important":""),s.accounted=K(t)},sync(){s.accounted=K(t),s.reactHidden=s.accounted===j},stop(){lt.delete(t)}}}function ce(t){return Array.isArray(t)}function Ct(t){const n=[];for(const e of t)ce(e)?n.push(...Ct(e)):n.push(e);return n}function le(t,n={}){const{transitions:e=[],middleware:s=(i,r)=>({from:i,to:r}),preserveScroll:o=i=>i}=t,a=n.host??new Mt,l=ne(),u=typeof e=="function"?e:()=>e,g=ee();g.initialize();const b=new Map,_=i=>{let r=b.get(i);return r===void 0&&(r=s(i,i).from,b.set(i,r)),r},{initializeContext:O,calculateScrollOffset:T,evictScrollPosition:L,shouldPreserve:k,getScrollContainer:W,getPositionedParentElement:$,getScrollPosition:z,getIsMobile:h}=Jt({preserveScroll:o,resolvePath:_}),v=new Map,S=()=>{const i=h();let r=v.get(i);return r||(r=Kt(Ct(u({isMobile:i}))),v.set(i,r)),r};let m=null,w=null;const I=new WeakMap,f=i=>{I.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},d=i=>{const r=I.get(i);return r||{parent:i.parentNode,nextSibling:i.nextSibling}},y=new WeakMap,E=new WeakMap;let P=0;const R=i=>{const r=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return r&&r!=="none"?r:"block"},C=(i,r)=>{r.visibleDisplay=i.style.getPropertyValue("display"),r.computedDisplay=R(i)},dt=(i,r)=>{if(E.get(i)!==r)return;E.delete(i);const c=y.get(i);c&&(c.savedCss!==null&&(i.style.cssText=c.savedCss,c.savedCss=null),c.intent==="hidden"?c.vis.setDisplay("none",!0):c.visibleDisplay?(c.vis.setDisplay(c.visibleDisplay,!1),C(i,c)):(c.vis.setDisplay(null),C(i,c)))},Ot=(i,r,c,p,A)=>{const M=p.element,D=A.element,N=(p.mode??"unmount")==="hidden",{parent:U,nextSibling:tt}=p.parent?{parent:p.parent,nextSibling:p.nextSibling}:d(M),V=T(r,c),et={scrollOffset:V,from:{scroll:z(r)},to:{scroll:z(c)},get scrollingElement(){return W()||document.documentElement},get positionedParent(){return $()}};let x;if(N){x=M,x.style.top=`${-1*((V==null?void 0:V.y)??0)}px`;const H=y.get(D);H&&H.savedCss===null&&(H.savedCss=D.style.cssText)}else x=M,Wt(x,et);k(r)||L(r);const G=N?++P:0;N&&(E.set(D,G),E.set(M,G));const yt=Promise.resolve(x),mt=Promise.resolve(D),gt=[],Nt={from:yt,to:mt,context:et,createElement:((H,nt="div")=>{const B=document.createElement(nt);return B.setAttribute("data-ssgoi-id",H),gt.push(B),B})},kt=Promise.resolve(i.prepare?i.prepare(Nt):{});Ft({from:yt,to:mt,extras:kt}).then(({from:H,to:nt,extras:B})=>{!N&&U&&(tt&&U.contains(tt)?U.insertBefore(x,tt):U.appendChild(x));const st=i.animation({from:H,to:nt,context:et,...B}),it=st.onComplete;st.onComplete=()=>{it==null||it(),N?(dt(M,G),dt(D,G)):x.parentNode&&x.parentNode.removeChild(x);for(const ot of gt)ot.parentNode&&ot.parentNode.removeChild(ot)},a.attach(st)})},q=(i,r)=>{const c=g.isSwipeBack();l.trigger(i,r),l.get(r).then(p=>{if(r==="in"&&g.onPageEnter(),!p)return;if(c){r==="out"&&p.from&&!k(p.from)&&L(p.from),m=null,w=null;return}if(r!=="in")return;const{from:A,to:M}=s(p.from,p.to),D=Yt(A,M,S()),J=m,N=w;m=null,w=null,!(!D||!J||!N)&&Ot(D,p.from,p.to,J,N)})},Lt=(i,r)=>{const c=y.get(i);if(!c)return;const p=c.intent==="hidden";if(c.intent="hidden",c.savedCss===null&&(c.savedCss=i.style.cssText),c.vis.setDisplay(c.computedDisplay||"block",!0),i.style.position="absolute",i.style.width="100%",i.style.left="0",p)return;const A=d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"hidden"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},_t=(i,r)=>{const c=y.get(i);if(!c||c.intent==="visible")return;c.intent="visible",C(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null)),O(i,r),w={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling};const p=i.getAttribute("data-ssgoi-transition")??r;q(p,"in")},Dt=(i,r,c)=>{const p=y.get(i);if(p&&(p.vis.stop(),y.delete(i),E.delete(i),p.intent==="hidden")){(m==null?void 0:m.element)===i&&(m=null),(w==null?void 0:w.element)===i&&(w=null);return}const A=c??d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"unmount"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},ft=new WeakSet,ht=(i,r)=>{if(ft.has(r))return;ft.add(r),f(r);const c=re(r,{onHide:()=>Lt(r,i),onShow:()=>_t(r,i)}),p={vis:c,savedCss:null,intent:c.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};y.set(r,p),c.isHidden||(C(r,p),O(r,i),w={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},q(i,"in")),ie(r,A=>Dt(r,i,A))},pt=new Map;return{register:ht,refFor:i=>{let r=pt.get(i);return r||(r=c=>{c&&ht(i,c)},pt.set(i,r)),r}}}const xt="data-ssgoi-root",ae=`[${xt}]`,at="data-ssgoi-transition",At=`[${at}]`,ue="[data-ssgoi-clone]";function de(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function fe(t){return t.nodeType===Node.ELEMENT_NODE}function he(t){return t instanceof HTMLElement}function pe(t,n){if(!de())return()=>{};t.setAttribute(xt,"");const e=l=>l.closest(ae)===t,s=l=>{if(!he(l)||!e(l)||l.closest(ue))return;const u=l.getAttribute(at);u!==null&&n.register(u,l)},o=l=>{if(fe(l)){l.matches(At)&&s(l);for(const u of l.querySelectorAll(At))s(u)}},a=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){s(u.target);continue}for(const g of u.addedNodes)o(g)}});return a.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[at]}),o(t),()=>a.disconnect()}exports.Animation=Q.Animation;exports.MultiAnimation=Q.MultiAnimation;exports.WebAnimation=Q.WebAnimation;exports.HostAnimation=Mt;exports.createSggoiTransitionContext=le;exports.observeSsgoiTransitions=pe;
1
+ "use strict";var Bt=Object.defineProperty;var Ft=(t,e,n)=>e in t?Bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var G=(t,e,n)=>Ft(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./multi-animation-6124HEke.cjs");class kt extends it.Animation{constructor(){super(...arguments);G(this,"child",null);G(this,"_state","idle");G(this,"_settled",!1);G(this,"listeners",new Set)}attach(n){const o=this.child;if(this.child=n,this._settled=!1,o){const a=o.getPose();o.complete(),n.matchInto(a)}n.playbackRate=this.playbackRate;const s=n.onComplete;n.onComplete=()=>{s==null||s(),this.child===n&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const i=n.onUpdate;n.onUpdate=a=>{var l;i==null||i(a),(l=this.onUpdate)==null||l.call(this,a),this.notify()},this._state==="paused"?n.pause():this._state==="reversing"?n.reverse():(this._state="playing",n.play()),this.notify()}play(){var n;this._state="playing",this._settled=!1,(n=this.child)==null||n.play(),this.notify()}reverse(){var n;this._state="reversing",this._settled=!1,(n=this.child)==null||n.reverse(),this.notify()}pause(){var n;this._state="paused",(n=this.child)==null||n.pause(),this.notify()}complete(){var n;(n=this.child)==null||n.complete(),this.notify()}get isAnimating(){var n;return((n=this.child)==null?void 0:n.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var n;return((n=this.child)==null?void 0:n.isReversing)??this._state==="reversing"}get progress(){var n;return((n=this.child)==null?void 0:n.progress)??0}findTimeForProgress(n){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(n))??null}get playbackRate(){return super.playbackRate}set playbackRate(n){super.playbackRate=n,this.child&&(this.child.playbackRate=n),this.notify()}getPose(){var n;return((n=this.child)==null?void 0:n.getPose())??[]}getTimeline(){var n;return((n=this.child)==null?void 0:n.getTimeline())??[]}matchInto(n){var o;(o=this.child)==null||o.matchInto(n)}get activeChild(){return this.child}subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}notify(){for(const n of this.listeners)n()}}const zt=(t,e)=>{var n;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((n=e==null?void 0:e.scrollOffset)==null?void 0:n.y)??0)}px`,t.style.left="0"},bt=new Set(["auto","scroll","overlay"]),Kt=t=>{let e=t.parentElement;for(;e&&e!==document.body;){const n=window.getComputedStyle(e);if(bt.has(n.overflowY)||bt.has(n.overflowX))return e;e=e.parentElement}return document.documentElement},Xt=t=>{let e=t.parentElement;for(;e&&e!==document.body;){const n=window.getComputedStyle(e).position;if(n==="relative"||n==="absolute"||n==="fixed"||n==="sticky")return e;e=e.parentElement}return document.body};function $t(t){const e=Object.keys(t);return Promise.all(e.map(n=>t[n])).then(n=>{const o={};return e.forEach((s,i)=>{o[s]=n[i]}),o})}const qt=1e6,Et=100,Gt=10,Ut=1;function Vt(t){const e=t.trim(),n=e.indexOf("#"),o=e.indexOf("?"),s=[n,o].filter(i=>i>=0).reduce((i,a)=>Math.min(i,a),e.length);return e.slice(0,s)}function V(t){const e=Vt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))return V(new URL(e).pathname)}catch{}const o=(e.startsWith("/")?e:`/${e}`).replace(/\/+/g,"/");return(o.length>1?o.replace(/\/+$/g,""):o)||"/"}function Yt(t){const e=t.trim();return e==="*"?"/**":V(e)}function ut(t){return t==="/"?[]:t.slice(1).split("/")}function Zt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function Ot(t,e){const n=V(t),o=Yt(e);if(n===o)return{matched:!0,specificity:qt+ut(o).length*Et,pattern:e};const s=ut(n),i=ut(o);let a=0;for(let l=0;l<i.length;l++){const f=i[l],u=s[l],y=l===i.length-1;if(f==="**")return{matched:y&&s.length>=l,specificity:a,pattern:e};if(u===void 0||f===void 0)return{matched:!1,specificity:0,pattern:e};if(f==="*"){a+=Ut;continue}if(Zt(f)){a+=Gt;continue}if(f!==u)return{matched:!1,specificity:0,pattern:e};a+=Et}return{matched:s.length===i.length,specificity:a,pattern:e}}function N(t,e){const n=typeof e=="string"?[e]:e;let o=null;for(const s of n){const i=Ot(t,s);i.matched&&(!o||i.specificity>o.specificity)&&(o=i)}return o}function jt(t,e){return Ot(t,e).matched}const Qt=768,Jt=10,te=10;function ee(t={}){const{preserveScroll:e=v=>v,resolvePath:n=v=>v}=t,o=typeof e=="function"?e:()=>e;let s=null,i=!1,a=!1;const l=()=>{const v=(s==null?void 0:s.clientWidth)??0,g=v>0?v:typeof window<"u"?window.innerWidth:0;return g>0&&g<Qt},f=()=>(a||(i=l(),a=!0),i),u=v=>{var _;const g=n(v),E=o(f());if(E===!1)return{preserves:!1,shared:!1,storageKey:`path:${g}`};if(E===!0)return{preserves:!0,shared:!1,storageKey:`path:${g}`};const P=((_=E.exclude)==null?void 0:_.some(D=>jt(g,D)))??!1,A=!P&&!!E.key;return{preserves:!P,shared:A,storageKey:A?`shared:${E.key}`:`path:${g}`}},y=v=>u(v).preserves;let h=null;const p=new Map;let w=null,O=!1,M=0;const R=()=>{s&&w&&!O&&p.set(u(w).storageKey,{x:s.scrollLeft,y:s.scrollTop})},K=v=>{if(!s)return;const g=u(v);if(g.preserves&&g.shared&&!p.has(g.storageKey))return;const E=g.preserves&&p.has(g.storageKey)?p.get(g.storageKey):{x:0,y:0};let P=0;const A=()=>{if(!s)return;s.scrollTo({top:E.y,left:E.x}),!(Math.abs(s.scrollTop-E.y)<1&&Math.abs(s.scrollLeft-E.x)<1)&&P<Jt&&(P++,requestAnimationFrame(A))};requestAnimationFrame(A)};return{initializeContext:(v,g)=>{O=!0;const E=++M;h=v,s||(s=Kt(v),i=l(),a=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{i=l()}).observe(s),(s===document.documentElement?window:s).addEventListener("scroll",R,{passive:!0})),w=g,K(g);let P=0;const A=()=>{E===M&&(P++,P>=te?O=!1:requestAnimationFrame(A))};requestAnimationFrame(A)},calculateScrollOffset:(v,g)=>{const E=v?u(v).storageKey:null,P=E&&p.has(E)?p.get(E):{x:0,y:0},A=g?u(g):null,_=A!=null&&A.preserves?A.storageKey:null,D=_&&p.has(_)?p.get(_):{x:0,y:0};return{x:-D.x+P.x,y:-D.y+P.y}},evictScrollPosition:v=>{p.delete(u(v).storageKey)},shouldPreserve:y,getScrollContainer:()=>s,getPositionedParentElement:()=>h?Xt(h):document.body,getScrollPosition:v=>{const g=v?u(v).storageKey:null;return g&&p.has(g)?p.get(g):{x:0,y:0}},getIsMobile:f}}const St=30,wt=8,Tt=1.2,Pt=30,ne=600;function ie(){let t=null,e=!1,n=!1,o=null,s=null,i=!1;const a=(b,S)=>{for(let T=0;T<b.length;T++){const k=b.item(T);if(k&&k.identifier===S)return k}return null},l=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{s!==null&&(clearTimeout(s),s=null)},u=()=>{e=!0,n=!0,l(),f(),o=setTimeout(()=>{e=!1,n=!1,o=null},ne)},y=b=>{if(b.touches.length!==1){t=null;return}const S=b.touches.item(0);if(!S){t=null;return}const T=window.innerWidth,k=S.clientX<=St,W=S.clientX>=T-St;if(!k&&!W){t=null;return}t={identifier:S.identifier,startX:S.clientX,startY:S.clientY,fromLeftEdge:k,moved:!1}},h=b=>{if(!t)return;if(b.touches.length!==1){t=null;return}const S=a(b.touches,t.identifier);if(!S){t=null;return}const T=S.clientX-t.startX,k=S.clientY-t.startY,W=Math.abs(T),F=Math.abs(k);if(F>wt&&F>W*Tt){t=null;return}const v=t.fromLeftEdge?T>0:T<0;W>wt&&W>F*Tt&&v&&(t.moved=!0)},p=b=>{if(!t)return;const S=a(b.changedTouches,t.identifier);if(!S){t=null;return}const T=S.clientX-t.startX,k=t.fromLeftEdge?T>0:T<0;if(t.moved&&k&&Math.abs(T)>=Pt){u(),t=null;return}t.moved&&Math.abs(T)>=Pt&&u(),t=null},w=()=>{t&&(t.moved&&u(),t=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const b={passive:!0,capture:!0};window.addEventListener("touchstart",y,b),window.addEventListener("touchmove",h,b),window.addEventListener("touchend",p,b),window.addEventListener("touchcancel",w,b)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const b={capture:!0};window.removeEventListener("touchstart",y,b),window.removeEventListener("touchmove",h,b),window.removeEventListener("touchend",p,b),window.removeEventListener("touchcancel",w,b),l(),f(),t=null,e=!1,n=!1},isSwipeBack:()=>{const b=e||n;return b&&l(),b},onPageEnter:()=>{e=!1,l(),f(),s=setTimeout(()=>{n=!1,s=null},0)}}}function se(t,e){return e?t.priority!==e.priority?t.priority>e.priority:t.specificity!==e.specificity?t.specificity>e.specificity:t.ruleIndex<e.ruleIndex:!0}function oe(t,e,n,o){let s=null;return n.forEach((i,a)=>{const l=i.priority??0;let f=null;if(i.on!==void 0){const u=i.except!==void 0&&N(t,i.except)!==null,y=i.except!==void 0&&N(e,i.except)!==null,h=u?null:N(t,i.on),p=y?null:N(e,i.on);if(h||p){const w=!h&&p?"forward":h&&!p?"backward":o;f={transition:i.transition,direction:w,ruleIndex:a,priority:l,specificity:Math.max((h==null?void 0:h.specificity)??0,(p==null?void 0:p.specificity)??0),reason:!h&&p?"on-enter":h&&!p?"on-leave":"on-history"}}}else if(i.ordered!==void 0){let u=-1,y=-1,h=-1,p=-1;i.ordered.forEach((w,O)=>{const M=N(t,w);M&&M.specificity>h&&(u=O,h=M.specificity);const R=N(e,w);R&&R.specificity>p&&(y=O,p=R.specificity)}),u>=0&&y>=0&&u!==y&&(f={transition:i.transition,direction:u<y?"forward":"backward",ruleIndex:a,priority:l,specificity:h+p,reason:"ordered"})}else{const u=N(t,i.from),y=N(e,i.to),h=i.bidirectional===!1?null:N(t,i.to),p=i.bidirectional===!1?null:N(e,i.from),w=u&&y,O=h&&p;if(w||O){const M=w?u.specificity+y.specificity:-1,R=O?h.specificity+p.specificity:-1,K=w&&O&&M===R?o:M>=R?"forward":"backward";f={transition:i.transition,direction:K,ruleIndex:a,priority:l,specificity:Math.max(M,R),reason:"pair"}}}f&&se(f,s)&&(s=f)}),s}function re(){const t=[];let e=!1;const n=()=>{e=!0};return typeof window<"u"&&window.addEventListener("popstate",n),{resolve(o,s){const i=V(o),a=V(s);if(t.length===0)t.push(i);else if(t[t.length-1]!==i){const u=t.lastIndexOf(i);u>=0?t.splice(u+1):t.push(i)}const l=t[t.length-2],f=e||l===a?"backward":"forward";if(e=!1,f==="backward"){const u=t.lastIndexOf(a);u>=0?t.splice(u+1):t.push(a)}else t[t.length-1]!==a&&t.push(a);return f},dispose(){typeof window<"u"&&window.removeEventListener("popstate",n)}}}function ce(t={}){let e=null;function n(){var s,i;e&&((s=e.out)==null||s.resolve(null),(i=e.in)==null||i.resolve(null),e=null)}function o(){if(e!=null&&e.out&&e.in){if(e.out.path===e.in.path){n();return}const s={from:e.out.path,to:e.in.path,out:e.out.payload,in:e.in.payload};e.out.resolve(s),e.in.resolve(s),e=null}}return{arrive(s,i,a){return new Promise(l=>{var y,h;i==="out"&&((y=e==null?void 0:e.in)==null?void 0:y.path)===s&&!e.out&&(e.in.resolve(null),e.in=void 0);const f=e==null?void 0:e[i];f&&f.path!==s&&n(),e||(e={});const u=e[i];if(u){if(((h=t.keepCurrent)==null?void 0:h.call(t,{type:i,path:s,current:u.payload,next:a}))??!1){l(null);return}u.resolve(null)}e[i]={path:s,payload:a,resolve:l},o()})},cancel(s){(e!=null&&e.out&&s(e.out.payload)||e!=null&&e.in&&s(e.in.payload))&&n()}}}const le={},$=new Map;let J=null,xt=!1;function Rt(t,e,n){t instanceof HTMLElement&&$.has(t)&&!t.isConnected&&n.set(t,{entry:$.get(t),anchor:e});for(const o of Array.from(t.childNodes))Rt(o,e,n)}function ae(t){const e=new Set(Array.from(t.values(),({entry:n})=>n));for(const[n,{entry:o,anchor:s}]of t){$.delete(n);let i=o.parent,a=!1;for(;i;){if(i.group===o.group&&e.has(i)){a=!0;break}i=i.parent}queueMicrotask(()=>o.callback(s,{emit:!a}))}}function ue(){if(xt||typeof document>"u")return;xt=!0,J=new MutationObserver(e=>{const n=new Map;for(const o of e){const s={parent:o.target,nextSibling:o.nextSibling};for(const i of Array.from(o.removedNodes))Rt(i,s,n)}ae(n)});const t=()=>{J==null||J.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function de(t,e,n=le){ue();let o=t.parentElement,s=null;for(;o;){const i=$.get(o);if((i==null?void 0:i.group)===n){s=i;break}o=o.parentElement}return $.set(t,{element:t,callback:e,group:n,parent:s}),()=>{$.delete(t)}}const dt=new WeakMap;let tt=null;const et="none !important";function U(t){const e=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${e} !important`:e}function fe(){return tt||(tt=new MutationObserver(t=>{for(const e of t){const n=e.target,o=dt.get(n);if(!o)continue;const s=U(n);s!==o.accounted&&(o.accounted=s,s===et?(o.reactHidden=!0,o.onHide()):s!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),tt)}function he(t,e){const n=U(t),o={accounted:n,reactHidden:n===et,onHide:e.onHide,onShow:e.onShow};return dt.set(t,o),fe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return U(t)===et},setDisplay(s,i=!1){s===null?t.style.removeProperty("display"):t.style.setProperty("display",s,i?"important":""),o.accounted=U(t)},sync(){o.accounted=U(t),o.reactHidden=o.accounted===et},stop(){dt.delete(t)}}}function pe(t,e={}){const{transitions:n=[],middleware:o=(r,c)=>({from:r,to:c}),preserveScroll:s=r=>r}=t,i=e.host??new kt,a={},l=ce({keepCurrent:({current:r,next:c})=>r.element.contains(c.element)}),f=re(),u=typeof n=="function"?n:()=>n,y=ie();y.initialize();const h=new Map,p=r=>{let c=h.get(r);return c===void 0&&(c=o(r,r).from,h.set(r,c)),c},{initializeContext:w,calculateScrollOffset:O,evictScrollPosition:M,shouldPreserve:R,getScrollContainer:K,getPositionedParentElement:b,getScrollPosition:S,getIsMobile:T}=ee({preserveScroll:s,resolvePath:p}),k=new Map,W=()=>{const r=T();let c=k.get(r);return c||(c=u({isMobile:r}),k.set(r,c)),c},F=new WeakMap,v=r=>{F.set(r,{parent:r.parentNode,nextSibling:r.nextSibling})},g=r=>{const c=F.get(r);return c||{parent:r.parentNode,nextSibling:r.nextSibling}},E=new WeakMap,P=new WeakMap;let A=0;const _=r=>{const c=typeof getComputedStyle<"u"?getComputedStyle(r).display:"";return c&&c!=="none"?c:"block"},D=(r,c)=>{c.visibleDisplay=r.style.getPropertyValue("display"),c.computedDisplay=_(r)},ft=(r,c)=>{if(P.get(r)!==c)return;P.delete(r);const d=E.get(r);d&&(d.savedCss!==null&&(r.style.cssText=d.savedCss,d.savedCss=null),d.intent==="hidden"?d.vis.setDisplay("none",!0):d.visibleDisplay?(d.vis.setDisplay(d.visibleDisplay,!1),D(r,d)):(d.vis.setDisplay(null),D(r,d)))},_t=(r,c,d,C,m,L)=>{const x=m.element,H=L.element,B=(m.mode??"unmount")==="hidden",{parent:Z,nextSibling:st}=m.parent?{parent:m.parent,nextSibling:m.nextSibling}:g(x),j=O(d,C),ot={direction:c,scrollOffset:j,from:{scroll:S(d)},to:{scroll:S(C)},get scrollingElement(){return K()||document.documentElement},get positionedParent(){return b()}};let I;if(B){I=x,I.style.top=`${-1*((j==null?void 0:j.y)??0)}px`;const z=E.get(H);z&&z.savedCss===null&&(z.savedCss=H.style.cssText)}else I=x,zt(I,ot);R(d)||M(d);const Q=B?++A:0;B&&(P.set(H,Q),P.set(x,Q));const mt=Promise.resolve(I),gt=Promise.resolve(H),vt=[],Ht={from:mt,to:gt,context:ot,createElement:((z,rt="div")=>{const q=document.createElement(rt);return q.setAttribute("data-ssgoi-id",z),vt.push(q),q})},Wt=Promise.resolve(r.prepare?r.prepare(Ht):{});$t({from:mt,to:gt,extras:Wt}).then(({from:z,to:rt,extras:q})=>{!B&&Z&&(st&&Z.contains(st)?Z.insertBefore(I,st):Z.appendChild(I));const ct=r.animation({from:z,to:rt,context:ot,...q}),lt=ct.onComplete;ct.onComplete=()=>{lt==null||lt(),B?(ft(x,Q),ft(H,Q)):I.parentNode&&I.parentNode.removeChild(I);for(const at of vt)at.parentNode&&at.parentNode.removeChild(at)},i.attach(ct)})},Y=(r,c,d)=>{const C=y.isSwipeBack();l.arrive(r,c,d).then(m=>{if(c==="in"&&y.onPageEnter(),!m)return;if(C&&c==="in"){const B=o(m.from,m.to);f.resolve(B.from,B.to)}if(C){c==="out"&&m.from&&!R(m.from)&&M(m.from);return}if(c!=="in")return;const{from:L,to:x}=o(m.from,m.to),H=f.resolve(L,x),X=oe(L,x,W(),H);X&&_t(X.transition,X.direction,m.from,m.to,m.out,m.in)})},Dt=(r,c)=>{const d=E.get(r);if(!d)return;const C=d.intent==="hidden";if(d.intent="hidden",d.savedCss===null&&(d.savedCss=r.style.cssText),d.vis.setDisplay(d.computedDisplay||"block",!0),r.style.position="absolute",r.style.width="100%",r.style.left="0",C)return;const m=g(r),L={element:r,parent:m.parent,nextSibling:m.nextSibling,mode:"hidden"},x=r.getAttribute("data-ssgoi-transition")??c;Y(x,"out",L)},It=(r,c)=>{const d=E.get(r);if(!d||d.intent==="visible")return;d.intent="visible",D(r,d),d.savedCss!==null&&(r.style.cssText=d.savedCss,d.visibleDisplay?d.vis.setDisplay(d.visibleDisplay,!1):d.vis.setDisplay(null)),w(r,c);const C={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},m=r.getAttribute("data-ssgoi-transition")??c;Y(m,"in",C)},Nt=(r,c,d,C=!0)=>{const m=E.get(r);if(m&&(m.vis.stop(),E.delete(r),P.delete(r),m.intent==="hidden")){l.cancel(X=>X.element===r);return}if(!C)return;const L=d??g(r),x={element:r,parent:L.parent,nextSibling:L.nextSibling,mode:"unmount"},H=r.getAttribute("data-ssgoi-transition")??c;Y(H,"out",x)},ht=new WeakSet,pt=(r,c,{enter:d=!0}={})=>{if(ht.has(c))return;ht.add(c),v(c);const C=he(c,{onHide:()=>Dt(c,r),onShow:()=>It(c,r)}),m={vis:C,savedCss:null,intent:C.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};if(E.set(c,m),!C.isHidden&&(D(c,m),d)){w(c,r);const L={element:c,parent:c.parentElement,nextSibling:c.nextElementSibling};Y(r,"in",L)}de(c,(L,x)=>Nt(c,r,L,(x==null?void 0:x.emit)??!0),a)},yt=new Map;return{register:pt,refFor:r=>{let c=yt.get(r);return c||(c=d=>{d&&pt(r,d)},yt.set(r,c)),c}}}const Lt="data-ssgoi-root",ye=`[${Lt}]`,nt="data-ssgoi-transition",At=`[${nt}]`,me="[data-ssgoi-clone]";function ge(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ve(t){return t.nodeType===Node.ELEMENT_NODE}function be(t){return t instanceof HTMLElement}function Ct(t){let e=0,n=t.parentElement;for(;n;)e++,n=n.parentElement;return e}function Mt(t,e,n=t){const o=Array.from(t).sort((s,i)=>Ct(s)-Ct(i));for(const s of o){const i=s.getAttribute(nt);if(i===null)continue;let a=s.parentElement,l=!1;for(;a;){if(n.has(a)){l=!0;break}a=a.parentElement}e.register(i,s,{enter:!l})}}function Ee(t,e){if(!ge())return()=>{};t.setAttribute(Lt,"");const n=l=>l.closest(ye)===t,o=l=>!be(l)||!n(l)||l.closest(me)||l.getAttribute(nt)===null?null:l,s=(l,f)=>{if(ve(l)){if(l.matches(At)){const u=o(l);u&&f.add(u)}for(const u of l.querySelectorAll(At)){const y=o(u);y&&f.add(y)}}},i=new MutationObserver(l=>{const f=new Set,u=new Set;for(const y of l){if(y.type==="attributes"){const h=o(y.target);h&&f.add(h);continue}for(const h of y.addedNodes)s(h,u)}for(const y of u)f.add(y);Mt(f,e,u)});i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[nt]});const a=new Set;return s(t,a),Mt(a,e),()=>i.disconnect()}exports.Animation=it.Animation;exports.MultiAnimation=it.MultiAnimation;exports.WebAnimation=it.WebAnimation;exports.HostAnimation=kt;exports.createSggoiTransitionContext=pe;exports.observeSsgoiTransitions=Ee;
@@ -1,5 +1,5 @@
1
1
  export { createSggoiTransitionContext } from './ssgoi-transition/create-ssgoi-transition-context';
2
2
  export { observeSsgoiTransitions } from './ssgoi-transition/observe-ssgoi-transitions';
3
3
  export { Animation, WebAnimation, MultiAnimation, HostAnimation, } from './animation';
4
- export type { SsgoiConfig, SsgoiContext, SsgoiPathTransition, SsgoiPathTransitionInput, TransitionConfig, PrepareArgs, AnimationFactoryArgs, CreateElement, SsgoiTransitionContext, Pose, Timeline, } from './types/index.ts';
4
+ export type { SsgoiConfig, SsgoiContext, SsgoiTransitionRule, SsgoiOnTransitionRule, SsgoiPairTransitionRule, SsgoiOrderedTransitionRule, PathPatterns, NavigationDirection, TransitionConfig, PrepareArgs, AnimationFactoryArgs, CreateElement, SsgoiTransitionContext, Pose, Timeline, } from './types/index.ts';
5
5
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/lib/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,IAAI,EACJ,QAAQ,GACT,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/lib/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,IAAI,EACJ,QAAQ,GACT,MAAM,QAAQ,CAAC"}