@ssgoi/core 6.5.1 → 6.6.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.
package/dist/internal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Mt=Object.defineProperty;var xt=(t,s,e)=>s in t?Mt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var B=(t,s,e)=>xt(t,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("./multi-animation-uzEnQnrG.cjs");class Et extends Z.Animation{constructor(){super(...arguments);B(this,"child",null);B(this,"_state","idle");B(this,"_settled",!1);B(this,"listeners",new Set)}attach(e){const n=this.child;if(this.child=e,this._settled=!1,n){const c=n.getPose();n.complete(),e.matchInto(c)}e.playbackRate=this.playbackRate;const l=e.onComplete;e.onComplete=()=>{l==null||l(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const f=e.onUpdate;e.onUpdate=c=>{var y;f==null||f(c),(y=this.onUpdate)==null||y.call(this,c),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 n;return((n=this.child)==null?void 0:n.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 n;(n=this.child)==null||n.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 Lt=(t,s)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=s==null?void 0:s.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},ht=new Set(["auto","scroll","overlay"]),Ot=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s);if(ht.has(e.overflowY)||ht.has(e.overflowX))return s;s=s.parentElement}return document.documentElement},_t=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return s;s=s.parentElement}return document.body};function kt(t){const s=Object.keys(t);return Promise.all(s.map(e=>t[e])).then(e=>{const n={};return s.forEach((l,f)=>{n[l]=e[f]}),n})}function Dt(t){const s=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...s]}function X(t,s){if(s==="*")return!0;if(s.endsWith("/*")){const e=s.slice(0,-1);return t.startsWith(e)&&t.length>e.length}return t===s}function Ht(t,s,e){for(const n of e)if(X(t,n.from)&&X(s,n.to))return n.transition;for(const n of e)if((n.from==="*"||X(t,n.from))&&(n.to==="*"||X(s,n.to)))return n.transition;return null}const Nt=768,It=10,Wt=10;function Ft(t={}){const{preserveScroll:s=a=>a}=t,e=typeof s=="function"?s:()=>s;let n=null,l=!1,f=!1;const c=()=>{const a=(n==null?void 0:n.clientWidth)??0,u=a>0?a:typeof window<"u"?window.innerWidth:0;return u>0&&u<Nt},y=()=>(f||(l=c(),f=!0),l),b=a=>{var S;const u=e(y());if(u===!1)return{preserves:!1,shared:!1,storageKey:`path:${a}`};if(u===!0)return{preserves:!0,shared:!1,storageKey:`path:${a}`};const v=((S=u.exclude)==null?void 0:S.some(A=>X(a,A)))??!1,w=!v&&!!u.key;return{preserves:!v,shared:w,storageKey:w?`shared:${u.key}`:`path:${a}`}},O=a=>b(a).preserves;let _=null;const E=new Map;let x=null,k=!1,I=0;const W=()=>{n&&x&&!k&&E.set(b(x).storageKey,{x:n.scrollLeft,y:n.scrollTop})},T=a=>{if(!n)return;const u=b(a);if(u.preserves&&u.shared&&!E.has(u.storageKey))return;const v=u.preserves&&E.has(u.storageKey)?E.get(u.storageKey):{x:0,y:0};let w=0;const S=()=>{if(!n)return;n.scrollTo({top:v.y,left:v.x}),!(Math.abs(n.scrollTop-v.y)<1&&Math.abs(n.scrollLeft-v.x)<1)&&w<It&&(w++,requestAnimationFrame(S))};requestAnimationFrame(S)};return{initializeContext:(a,u)=>{k=!0;const v=++I;_=a,n||(n=Ot(a),l=c(),f=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{l=c()}).observe(n),(n===document.documentElement?window:n).addEventListener("scroll",W,{passive:!0})),x=u,T(u);let w=0;const S=()=>{v===I&&(w++,w>=Wt?k=!1:requestAnimationFrame(S))};requestAnimationFrame(S)},calculateScrollOffset:(a,u)=>{const v=a?b(a).storageKey:null,w=v&&E.has(v)?E.get(v):{x:0,y:0},S=u?b(u):null,A=S!=null&&S.preserves?S.storageKey:null,F=A&&E.has(A)?E.get(A):{x:0,y:0};return{x:-F.x+w.x,y:-F.y+w.y}},evictScrollPosition:a=>{E.delete(b(a).storageKey)},shouldPreserve:O,getScrollContainer:()=>n,getPositionedParentElement:()=>_?_t(_):document.body,getScrollPosition:a=>{const u=a?b(a).storageKey:null;return u&&E.has(u)?E.get(u):{x:0,y:0}}}}const yt=30,mt=8,pt=1.2,gt=30,Kt=600;function Bt(){let t=null,s=!1,e=!1,n=null,l=null,f=!1;const c=(d,g)=>{for(let m=0;m<d.length;m++){const p=d.item(m);if(p&&p.identifier===g)return p}return null},y=()=>{n!==null&&(clearTimeout(n),n=null)},b=()=>{l!==null&&(clearTimeout(l),l=null)},O=()=>{s=!0,e=!0,y(),b(),n=setTimeout(()=>{s=!1,e=!1,n=null},Kt)},_=d=>{if(d.touches.length!==1){t=null;return}const g=d.touches.item(0);if(!g){t=null;return}const m=window.innerWidth,p=g.clientX<=yt,R=g.clientX>=m-yt;if(!p&&!R){t=null;return}t={identifier:g.identifier,startX:g.clientX,startY:g.clientY,fromLeftEdge:p,moved:!1}},E=d=>{if(!t)return;if(d.touches.length!==1){t=null;return}const g=c(d.touches,t.identifier);if(!g){t=null;return}const m=g.clientX-t.startX,p=g.clientY-t.startY,R=Math.abs(m),a=Math.abs(p);if(a>mt&&a>R*pt){t=null;return}const u=t.fromLeftEdge?m>0:m<0;R>mt&&R>a*pt&&u&&(t.moved=!0)},x=d=>{if(!t)return;const g=c(d.changedTouches,t.identifier);if(!g){t=null;return}const m=g.clientX-t.startX,p=t.fromLeftEdge?m>0:m<0;if(t.moved&&p&&Math.abs(m)>=gt){O(),t=null;return}t.moved&&Math.abs(m)>=gt&&O(),t=null},k=()=>{t&&(t.moved&&O(),t=null)};return{initialize:()=>{if(typeof window>"u"||f)return;f=!0;const d={passive:!0,capture:!0};window.addEventListener("touchstart",_,d),window.addEventListener("touchmove",E,d),window.addEventListener("touchend",x,d),window.addEventListener("touchcancel",k,d)},destroy:()=>{if(typeof window>"u"||!f)return;f=!1;const d={capture:!0};window.removeEventListener("touchstart",_,d),window.removeEventListener("touchmove",E,d),window.removeEventListener("touchend",x,d),window.removeEventListener("touchcancel",k,d),y(),b(),t=null,s=!1,e=!1},isSwipeBack:()=>{const d=s||e;return d&&y(),d},onPageEnter:()=>{s=!1,y(),b(),l=setTimeout(()=>{e=!1,l=null},0)}}}function Xt(){let t=null;function s(){var n,l;t&&((n=t.outResolve)==null||n.call(t,null),(l=t.inResolve)==null||l.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){s();return}const n={from:t.from,to:t.to};t.outResolve(n),t.inResolve(n),t=null}}return{trigger(n,l){var c;l==="out"&&(t==null?void 0:t.to)===n&&!t.from&&((c=t.inResolve)==null||c.call(t,null),t={}),t&&(l==="out"&&t.from&&t.from!==n||l==="in"&&t.to&&t.to!==n)&&s(),t||(t={}),l==="out"?t.from=n:t.to=n},get(n){return new Promise(l=>{t||(t={}),n==="out"?t.outResolve=l:t.inResolve=l,e()})}}}const $=new Map;let Y=null,vt=!1;function St(t){if(t instanceof HTMLElement&&$.has(t)&&!t.isConnected){const s=$.get(t);$.delete(t),queueMicrotask(s)}for(const s of Array.from(t.childNodes))St(s)}function zt(){if(vt||typeof document>"u")return;vt=!0,Y=new MutationObserver(s=>{for(const e of s)for(const n of Array.from(e.removedNodes))St(n)});const t=()=>{Y==null||Y.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function $t(t,s){return zt(),$.set(t,s),()=>{$.delete(t)}}const it=new WeakMap;let G=null;const j="none !important";function z(t){const s=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${s} !important`:s}function qt(){return G||(G=new MutationObserver(t=>{for(const s of t){const e=s.target,n=it.get(e);if(!n)continue;const l=z(e);l!==n.accounted&&(n.accounted=l,l===j?(n.reactHidden=!0,n.onHide()):l!=="none"&&n.reactHidden&&(n.reactHidden=!1,n.onShow()))}}),G)}function Vt(t,s){const e=z(t),n={accounted:e,reactHidden:e===j,onHide:s.onHide,onShow:s.onShow};return it.set(t,n),qt().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return z(t)===j},setDisplay(l,f=!1){l===null?t.style.removeProperty("display"):t.style.setProperty("display",l,f?"important":""),n.accounted=z(t)},sync(){n.accounted=z(t),n.reactHidden=n.accounted===j},stop(){it.delete(t)}}}function Ut(t){return Array.isArray(t)}function wt(t){const s=[];for(const e of t)Ut(e)?s.push(...wt(e)):s.push(e);return s}function Yt(t,s={}){const{transitions:e=[],middleware:n=(o,i)=>({from:o,to:i}),preserveScroll:l=o=>o}=t,f=s.host??new Et,c=Xt(),y=Dt(wt(e)),b=Bt();b.initialize();const{initializeContext:O,calculateScrollOffset:_,evictScrollPosition:E,shouldPreserve:x,getScrollContainer:k,getPositionedParentElement:I,getScrollPosition:W}=Ft({preserveScroll:l});let T=null,P=null;const d=new WeakMap,g=o=>{d.set(o,{parent:o.parentElement,nextSibling:o.nextElementSibling})},m=o=>{const i=d.get(o);return i||{parent:o.parentElement,nextSibling:o.nextElementSibling}},p=new WeakMap,R=new WeakMap;let a=0;const u=o=>{const i=typeof getComputedStyle<"u"?getComputedStyle(o).display:"";return i&&i!=="none"?i:"block"},v=(o,i)=>{i.visibleDisplay=o.style.getPropertyValue("display"),i.computedDisplay=u(o)},w=(o,i)=>{if(R.get(o)!==i)return;R.delete(o);const r=p.get(o);r&&(r.savedCss!==null&&(o.style.cssText=r.savedCss,r.savedCss=null),r.intent==="hidden"?r.vis.setDisplay("none",!0):r.visibleDisplay?(r.vis.setDisplay(r.visibleDisplay,!1),v(o,r)):(r.vis.setDisplay(null),v(o,r)))},S=(o,i,r,h,L)=>{const M=h.element,D=L.element,H=(h.mode??"unmount")==="hidden",{parent:q,nextSibling:Q}=h.parent?{parent:h.parent,nextSibling:h.nextSibling}:m(M),V=_(i,r),tt={scrollOffset:V,from:{scroll:W(i)},to:{scroll:W(r)},get scrollingElement(){return k()||document.documentElement},get positionedParent(){return I()}};let C;if(H){C=M,C.style.top=`${-1*((V==null?void 0:V.y)??0)}px`;const N=p.get(D);N&&N.savedCss===null&&(N.savedCss=D.style.cssText)}else C=M.cloneNode(!0),C.setAttribute("data-ssgoi-clone",""),Lt(C,tt);x(i)||E(i);const U=H?++a:0;H&&(R.set(D,U),R.set(M,U));const ut=Promise.resolve(C),dt=Promise.resolve(D),ft=[],Pt={from:ut,to:dt,context:tt,createElement:((N,et="div")=>{const K=document.createElement(et);return K.setAttribute("data-ssgoi-id",N),ft.push(K),K})},Ct=Promise.resolve(o.prepare?o.prepare(Pt):{});kt({from:ut,to:dt,extras:Ct}).then(({from:N,to:et,extras:K})=>{!H&&q&&(Q&&q.contains(Q)?q.insertBefore(C,Q):q.appendChild(C));const nt=o.animation({from:N,to:et,context:tt,...K}),st=nt.onComplete;nt.onComplete=()=>{st==null||st(),H?(w(M,U),w(D,U)):C.parentElement&&C.parentElement.removeChild(C);for(const ot of ft)ot.parentElement&&ot.parentElement.removeChild(ot)},f.attach(nt)})},A=(o,i)=>{const r=b.isSwipeBack();c.trigger(o,i),c.get(i).then(h=>{if(i==="in"&&b.onPageEnter(),!h)return;if(r){i==="out"&&h.from&&!x(h.from)&&E(h.from),T=null,P=null;return}if(i!=="in")return;const{from:L,to:M}=n(h.from,h.to),D=Ht(L,M,y),J=T,H=P;T=null,P=null,!(!D||!J||!H)&&S(D,L,M,J,H)})},F=(o,i)=>{const r=p.get(o);if(!r)return;const h=r.intent==="hidden";if(r.intent="hidden",r.savedCss===null&&(r.savedCss=o.style.cssText),r.vis.setDisplay(r.computedDisplay||"block",!0),o.style.position="absolute",o.style.width="100%",o.style.left="0",h)return;const L=m(o);T={element:o,parent:L.parent,nextSibling:L.nextSibling,mode:"hidden"};const M=o.getAttribute("data-ssgoi-transition")??i;A(M,"out")},Rt=(o,i)=>{const r=p.get(o);if(!r||r.intent==="visible")return;r.intent="visible",v(o,r),r.savedCss!==null&&(o.style.cssText=r.savedCss,r.visibleDisplay?r.vis.setDisplay(r.visibleDisplay,!1):r.vis.setDisplay(null)),O(o,i),P={element:o,parent:o.parentElement,nextSibling:o.nextElementSibling};const h=o.getAttribute("data-ssgoi-transition")??i;A(h,"in")},At=(o,i)=>{const r=p.get(o);if(r&&(r.vis.stop(),p.delete(o),R.delete(o),r.intent==="hidden")){(T==null?void 0:T.element)===o&&(T=null),(P==null?void 0:P.element)===o&&(P=null);return}const h=m(o);T={element:o,parent:h.parent,nextSibling:h.nextSibling,mode:"unmount"};const L=o.getAttribute("data-ssgoi-transition")??i;A(L,"out")},lt=new WeakSet,ct=(o,i)=>{if(lt.has(i))return;lt.add(i),g(i);const r=Vt(i,{onHide:()=>F(i,o),onShow:()=>Rt(i,o)}),h={vis:r,savedCss:null,intent:r.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};p.set(i,h),r.isHidden||(v(i,h),O(i,o),P={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling},A(o,"in")),$t(i,()=>At(i,o))},at=new Map;return{register:ct,refFor:o=>{let i=at.get(o);return i||(i=r=>{r&&ct(o,r)},at.set(o,i)),i}}}const Tt="data-ssgoi-root",Gt=`[${Tt}]`,rt="data-ssgoi-transition",bt=`[${rt}]`,jt="[data-ssgoi-clone]";function Zt(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function Jt(t){return t.nodeType===Node.ELEMENT_NODE}function Qt(t){return t instanceof HTMLElement}function te(t,s){if(!Zt())return()=>{};t.setAttribute(Tt,"");const e=c=>c.closest(Gt)===t,n=c=>{if(!Qt(c)||!e(c)||c.closest(jt))return;const y=c.getAttribute(rt);y!==null&&s.register(y,c)},l=c=>{if(Jt(c)){c.matches(bt)&&n(c);for(const y of c.querySelectorAll(bt))n(y)}},f=new MutationObserver(c=>{for(const y of c){if(y.type==="attributes"){n(y.target);continue}for(const b of y.addedNodes)l(b)}});return f.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[rt]}),l(t),()=>f.disconnect()}exports.Animation=Z.Animation;exports.MultiAnimation=Z.MultiAnimation;exports.WebAnimation=Z.WebAnimation;exports.HostAnimation=Et;exports.createSggoiTransitionContext=Yt;exports.observeSsgoiTransitions=te;
1
+ "use strict";var Ot=Object.defineProperty;var _t=(t,s,e)=>s in t?Ot(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var F=(t,s,e)=>_t(t,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("./multi-animation-uzEnQnrG.cjs");class St extends J.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const n=this.child;if(this.child=e,this._settled=!1,n){const a=n.getPose();n.complete(),e.matchInto(a)}e.playbackRate=this.playbackRate;const l=e.onComplete;e.onComplete=()=>{l==null||l(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const p=e.onUpdate;e.onUpdate=a=>{var g;p==null||p(a),(g=this.onUpdate)==null||g.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 n;return((n=this.child)==null?void 0:n.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 n;(n=this.child)==null||n.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 kt=(t,s)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=s==null?void 0:s.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},yt=new Set(["auto","scroll","overlay"]),Dt=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s);if(yt.has(e.overflowY)||yt.has(e.overflowX))return s;s=s.parentElement}return document.documentElement},Nt=t=>{let s=t.parentElement;for(;s&&s!==document.body;){const e=window.getComputedStyle(s).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return s;s=s.parentElement}return document.body};function Ht(t){const s=Object.keys(t);return Promise.all(s.map(e=>t[e])).then(e=>{const n={};return s.forEach((l,p)=>{n[l]=e[p]}),n})}function It(t){const s=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...s]}function K(t,s){if(s==="*")return!0;if(s.endsWith("/*")){const e=s.slice(0,-1);return t.startsWith(e)&&t.length>e.length}return t===s}function Wt(t,s,e){for(const n of e)if(K(t,n.from)&&K(s,n.to))return n.transition;for(const n of e)if((n.from==="*"||K(t,n.from))&&(n.to==="*"||K(s,n.to)))return n.transition;return null}const Ft=768,Kt=10,Bt=10;function Xt(t={}){const{preserveScroll:s=u=>u}=t,e=typeof s=="function"?s:()=>s;let n=null,l=!1,p=!1;const a=()=>{const u=(n==null?void 0:n.clientWidth)??0,c=u>0?u:typeof window<"u"?window.innerWidth:0;return c>0&&c<Ft},g=()=>(p||(l=a(),p=!0),l),v=u=>{var E;const c=e(g());if(c===!1)return{preserves:!1,shared:!1,storageKey:`path:${u}`};if(c===!0)return{preserves:!0,shared:!1,storageKey:`path:${u}`};const m=((E=c.exclude)==null?void 0:E.some(T=>K(u,T)))??!1,w=!m&&!!c.key;return{preserves:!m,shared:w,storageKey:w?`shared:${c.key}`:`path:${u}`}},C=u=>v(u).preserves;let x=null;const b=new Map;let M=null,L=!1,H=0;const I=()=>{n&&M&&!L&&b.set(v(M).storageKey,{x:n.scrollLeft,y:n.scrollTop})},z=u=>{if(!n)return;const c=v(u);if(c.preserves&&c.shared&&!b.has(c.storageKey))return;const m=c.preserves&&b.has(c.storageKey)?b.get(c.storageKey):{x:0,y:0};let w=0;const E=()=>{if(!n)return;n.scrollTo({top:m.y,left:m.x}),!(Math.abs(n.scrollTop-m.y)<1&&Math.abs(n.scrollLeft-m.x)<1)&&w<Kt&&(w++,requestAnimationFrame(E))};requestAnimationFrame(E)};return{initializeContext:(u,c)=>{L=!0;const m=++H;x=u,n||(n=Dt(u),l=a(),p=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{l=a()}).observe(n),(n===document.documentElement?window:n).addEventListener("scroll",I,{passive:!0})),M=c,z(c);let w=0;const E=()=>{m===H&&(w++,w>=Bt?L=!1:requestAnimationFrame(E))};requestAnimationFrame(E)},calculateScrollOffset:(u,c)=>{const m=u?v(u).storageKey:null,w=m&&b.has(m)?b.get(m):{x:0,y:0},E=c?v(c):null,T=E!=null&&E.preserves?E.storageKey:null,N=T&&b.has(T)?b.get(T):{x:0,y:0};return{x:-N.x+w.x,y:-N.y+w.y}},evictScrollPosition:u=>{b.delete(v(u).storageKey)},shouldPreserve:C,getScrollContainer:()=>n,getPositionedParentElement:()=>x?Nt(x):document.body,getScrollPosition:u=>{const c=u?v(u).storageKey:null;return c&&b.has(c)?b.get(c):{x:0,y:0}},getIsMobile:g}}const pt=30,gt=8,mt=1.2,vt=30,zt=600;function $t(){let t=null,s=!1,e=!1,n=null,l=null,p=!1;const a=(d,f)=>{for(let h=0;h<d.length;h++){const S=d.item(h);if(S&&S.identifier===f)return S}return null},g=()=>{n!==null&&(clearTimeout(n),n=null)},v=()=>{l!==null&&(clearTimeout(l),l=null)},C=()=>{s=!0,e=!0,g(),v(),n=setTimeout(()=>{s=!1,e=!1,n=null},zt)},x=d=>{if(d.touches.length!==1){t=null;return}const f=d.touches.item(0);if(!f){t=null;return}const h=window.innerWidth,S=f.clientX<=pt,O=f.clientX>=h-pt;if(!S&&!O){t=null;return}t={identifier:f.identifier,startX:f.clientX,startY:f.clientY,fromLeftEdge:S,moved:!1}},b=d=>{if(!t)return;if(d.touches.length!==1){t=null;return}const f=a(d.touches,t.identifier);if(!f){t=null;return}const h=f.clientX-t.startX,S=f.clientY-t.startY,O=Math.abs(h),u=Math.abs(S);if(u>gt&&u>O*mt){t=null;return}const c=t.fromLeftEdge?h>0:h<0;O>gt&&O>u*mt&&c&&(t.moved=!0)},M=d=>{if(!t)return;const f=a(d.changedTouches,t.identifier);if(!f){t=null;return}const h=f.clientX-t.startX,S=t.fromLeftEdge?h>0:h<0;if(t.moved&&S&&Math.abs(h)>=vt){C(),t=null;return}t.moved&&Math.abs(h)>=vt&&C(),t=null},L=()=>{t&&(t.moved&&C(),t=null)};return{initialize:()=>{if(typeof window>"u"||p)return;p=!0;const d={passive:!0,capture:!0};window.addEventListener("touchstart",x,d),window.addEventListener("touchmove",b,d),window.addEventListener("touchend",M,d),window.addEventListener("touchcancel",L,d)},destroy:()=>{if(typeof window>"u"||!p)return;p=!1;const d={capture:!0};window.removeEventListener("touchstart",x,d),window.removeEventListener("touchmove",b,d),window.removeEventListener("touchend",M,d),window.removeEventListener("touchcancel",L,d),g(),v(),t=null,s=!1,e=!1},isSwipeBack:()=>{const d=s||e;return d&&g(),d},onPageEnter:()=>{s=!1,g(),v(),l=setTimeout(()=>{e=!1,l=null},0)}}}function qt(){let t=null;function s(){var n,l;t&&((n=t.outResolve)==null||n.call(t,null),(l=t.inResolve)==null||l.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){s();return}const n={from:t.from,to:t.to};t.outResolve(n),t.inResolve(n),t=null}}return{trigger(n,l){var a;l==="out"&&(t==null?void 0:t.to)===n&&!t.from&&((a=t.inResolve)==null||a.call(t,null),t={}),t&&(l==="out"&&t.from&&t.from!==n||l==="in"&&t.to&&t.to!==n)&&s(),t||(t={}),l==="out"?t.from=n:t.to=n},get(n){return new Promise(l=>{t||(t={}),n==="out"?t.outResolve=l:t.inResolve=l,e()})}}}const X=new Map;let G=null,bt=!1;function wt(t,s){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(s))}for(const e of Array.from(t.childNodes))wt(e,s)}function Vt(){if(bt||typeof document>"u")return;bt=!0,G=new MutationObserver(s=>{for(const e of s){const n={parent:e.target,nextSibling:e.nextSibling};for(const l of Array.from(e.removedNodes))wt(l,n)}});const t=()=>{G==null||G.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function Ut(t,s){return Vt(),X.set(t,s),()=>{X.delete(t)}}const rt=new WeakMap;let j=null;const Z="none !important";function B(t){const s=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${s} !important`:s}function Yt(){return j||(j=new MutationObserver(t=>{for(const s of t){const e=s.target,n=rt.get(e);if(!n)continue;const l=B(e);l!==n.accounted&&(n.accounted=l,l===Z?(n.reactHidden=!0,n.onHide()):l!=="none"&&n.reactHidden&&(n.reactHidden=!1,n.onShow()))}}),j)}function Gt(t,s){const e=B(t),n={accounted:e,reactHidden:e===Z,onHide:s.onHide,onShow:s.onShow};return rt.set(t,n),Yt().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return B(t)===Z},setDisplay(l,p=!1){l===null?t.style.removeProperty("display"):t.style.setProperty("display",l,p?"important":""),n.accounted=B(t)},sync(){n.accounted=B(t),n.reactHidden=n.accounted===Z},stop(){rt.delete(t)}}}function jt(t){return Array.isArray(t)}function Tt(t){const s=[];for(const e of t)jt(e)?s.push(...Tt(e)):s.push(e);return s}function Zt(t,s={}){const{transitions:e=[],middleware:n=(o,i)=>({from:o,to:i}),preserveScroll:l=o=>o}=t,p=s.host??new St,a=qt(),g=typeof e=="function"?e:()=>e,v=$t();v.initialize();const{initializeContext:C,calculateScrollOffset:x,evictScrollPosition:b,shouldPreserve:M,getScrollContainer:L,getPositionedParentElement:H,getScrollPosition:I,getIsMobile:z}=Xt({preserveScroll:l}),$=new Map,d=()=>{const o=z();let i=$.get(o);return i||(i=It(Tt(g({isMobile:o}))),$.set(o,i)),i};let f=null,h=null;const S=new WeakMap,O=o=>{S.set(o,{parent:o.parentNode,nextSibling:o.nextSibling})},u=o=>{const i=S.get(o);return i||{parent:o.parentNode,nextSibling:o.nextSibling}},c=new WeakMap,m=new WeakMap;let w=0;const E=o=>{const i=typeof getComputedStyle<"u"?getComputedStyle(o).display:"";return i&&i!=="none"?i:"block"},T=(o,i)=>{i.visibleDisplay=o.style.getPropertyValue("display"),i.computedDisplay=E(o)},N=(o,i)=>{if(m.get(o)!==i)return;m.delete(o);const r=c.get(o);r&&(r.savedCss!==null&&(o.style.cssText=r.savedCss,r.savedCss=null),r.intent==="hidden"?r.vis.setDisplay("none",!0):r.visibleDisplay?(r.vis.setDisplay(r.visibleDisplay,!1),T(o,r)):(r.vis.setDisplay(null),T(o,r)))},Rt=(o,i,r,y,P)=>{const R=y.element,_=P.element,k=(y.mode??"unmount")==="hidden",{parent:V,nextSibling:tt}=y.parent?{parent:y.parent,nextSibling:y.nextSibling}:u(R),U=x(i,r),et={scrollOffset:U,from:{scroll:I(i)},to:{scroll:I(r)},get scrollingElement(){return L()||document.documentElement},get positionedParent(){return H()}};let A;if(k){A=R,A.style.top=`${-1*((U==null?void 0:U.y)??0)}px`;const D=c.get(_);D&&D.savedCss===null&&(D.savedCss=_.style.cssText)}else A=R,kt(A,et);M(i)||b(i);const Y=k?++w:0;k&&(m.set(_,Y),m.set(R,Y));const dt=Promise.resolve(A),ft=Promise.resolve(_),ht=[],xt={from:dt,to:ft,context:et,createElement:((D,nt="div")=>{const W=document.createElement(nt);return W.setAttribute("data-ssgoi-id",D),ht.push(W),W})},Lt=Promise.resolve(o.prepare?o.prepare(xt):{});Ht({from:dt,to:ft,extras:Lt}).then(({from:D,to:nt,extras:W})=>{!k&&V&&(tt&&V.contains(tt)?V.insertBefore(A,tt):V.appendChild(A));const st=o.animation({from:D,to:nt,context:et,...W}),ot=st.onComplete;st.onComplete=()=>{ot==null||ot(),k?(N(R,Y),N(_,Y)):A.parentNode&&A.parentNode.removeChild(A);for(const it of ht)it.parentNode&&it.parentNode.removeChild(it)},p.attach(st)})},q=(o,i)=>{const r=v.isSwipeBack();a.trigger(o,i),a.get(i).then(y=>{if(i==="in"&&v.onPageEnter(),!y)return;if(r){i==="out"&&y.from&&!M(y.from)&&b(y.from),f=null,h=null;return}if(i!=="in")return;const{from:P,to:R}=n(y.from,y.to),_=Wt(P,R,d()),Q=f,k=h;f=null,h=null,!(!_||!Q||!k)&&Rt(_,P,R,Q,k)})},At=(o,i)=>{const r=c.get(o);if(!r)return;const y=r.intent==="hidden";if(r.intent="hidden",r.savedCss===null&&(r.savedCss=o.style.cssText),r.vis.setDisplay(r.computedDisplay||"block",!0),o.style.position="absolute",o.style.width="100%",o.style.left="0",y)return;const P=u(o);f={element:o,parent:P.parent,nextSibling:P.nextSibling,mode:"hidden"};const R=o.getAttribute("data-ssgoi-transition")??i;q(R,"out")},Mt=(o,i)=>{const r=c.get(o);if(!r||r.intent==="visible")return;r.intent="visible",T(o,r),r.savedCss!==null&&(o.style.cssText=r.savedCss,r.visibleDisplay?r.vis.setDisplay(r.visibleDisplay,!1):r.vis.setDisplay(null)),C(o,i),h={element:o,parent:o.parentElement,nextSibling:o.nextElementSibling};const y=o.getAttribute("data-ssgoi-transition")??i;q(y,"in")},Ct=(o,i,r)=>{const y=c.get(o);if(y&&(y.vis.stop(),c.delete(o),m.delete(o),y.intent==="hidden")){(f==null?void 0:f.element)===o&&(f=null),(h==null?void 0:h.element)===o&&(h=null);return}const P=r??u(o);f={element:o,parent:P.parent,nextSibling:P.nextSibling,mode:"unmount"};const R=o.getAttribute("data-ssgoi-transition")??i;q(R,"out")},ct=new WeakSet,at=(o,i)=>{if(ct.has(i))return;ct.add(i),O(i);const r=Gt(i,{onHide:()=>At(i,o),onShow:()=>Mt(i,o)}),y={vis:r,savedCss:null,intent:r.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};c.set(i,y),r.isHidden||(T(i,y),C(i,o),h={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling},q(o,"in")),Ut(i,P=>Ct(i,o,P))},ut=new Map;return{register:at,refFor:o=>{let i=ut.get(o);return i||(i=r=>{r&&at(o,r)},ut.set(o,i)),i}}}const Pt="data-ssgoi-root",Jt=`[${Pt}]`,lt="data-ssgoi-transition",Et=`[${lt}]`,Qt="[data-ssgoi-clone]";function te(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ee(t){return t.nodeType===Node.ELEMENT_NODE}function ne(t){return t instanceof HTMLElement}function se(t,s){if(!te())return()=>{};t.setAttribute(Pt,"");const e=a=>a.closest(Jt)===t,n=a=>{if(!ne(a)||!e(a)||a.closest(Qt))return;const g=a.getAttribute(lt);g!==null&&s.register(g,a)},l=a=>{if(ee(a)){a.matches(Et)&&n(a);for(const g of a.querySelectorAll(Et))n(g)}},p=new MutationObserver(a=>{for(const g of a){if(g.type==="attributes"){n(g.target);continue}for(const v of g.addedNodes)l(v)}});return p.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[lt]}),l(t),()=>p.disconnect()}exports.Animation=J.Animation;exports.MultiAnimation=J.MultiAnimation;exports.WebAnimation=J.WebAnimation;exports.HostAnimation=St;exports.createSggoiTransitionContext=Zt;exports.observeSsgoiTransitions=se;
package/dist/internal.js CHANGED
@@ -1,31 +1,31 @@
1
- var At = Object.defineProperty;
2
- var Ct = (t, s, e) => s in t ? At(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
- var B = (t, s, e) => Ct(t, typeof s != "symbol" ? s + "" : s, e);
4
- import { A as xt } from "./multi-animation-Ch5rI3rB.js";
5
- import { M as le, W as ce } from "./multi-animation-Ch5rI3rB.js";
6
- class Mt extends xt {
1
+ var Ct = Object.defineProperty;
2
+ var Lt = (t, s, e) => s in t ? Ct(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
+ var F = (t, s, e) => Lt(t, typeof s != "symbol" ? s + "" : s, e);
4
+ import { A as Ot } from "./multi-animation-Ch5rI3rB.js";
5
+ import { M as ue, W as de } from "./multi-animation-Ch5rI3rB.js";
6
+ class _t extends Ot {
7
7
  constructor() {
8
8
  super(...arguments);
9
- B(this, "child", null);
10
- B(this, "_state", "idle");
11
- B(this, "_settled", !1);
12
- B(this, "listeners", /* @__PURE__ */ new Set());
9
+ F(this, "child", null);
10
+ F(this, "_state", "idle");
11
+ F(this, "_settled", !1);
12
+ F(this, "listeners", /* @__PURE__ */ new Set());
13
13
  }
14
14
  attach(e) {
15
15
  const n = this.child;
16
16
  if (this.child = e, this._settled = !1, n) {
17
- const c = n.getPose();
18
- n.complete(), e.matchInto(c);
17
+ const a = n.getPose();
18
+ n.complete(), e.matchInto(a);
19
19
  }
20
20
  e.playbackRate = this.playbackRate;
21
21
  const l = e.onComplete;
22
22
  e.onComplete = () => {
23
23
  l == null || l(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
24
24
  };
25
- const d = e.onUpdate;
26
- e.onUpdate = (c) => {
27
- var y;
28
- d == null || d(c), (y = this.onUpdate) == null || y.call(this, c), this.notify();
25
+ const p = e.onUpdate;
26
+ e.onUpdate = (a) => {
27
+ var g;
28
+ p == null || p(a), (g = this.onUpdate) == null || g.call(this, a), this.notify();
29
29
  }, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
30
30
  }
31
31
  play() {
@@ -98,19 +98,19 @@ class Mt extends xt {
98
98
  for (const e of this.listeners) e();
99
99
  }
100
100
  }
101
- const Lt = (t, s) => {
101
+ const kt = (t, s) => {
102
102
  var e;
103
103
  t.style.position = "absolute", t.style.width = "100%", t.style.top = `${-1 * (((e = s == null ? void 0 : s.scrollOffset) == null ? void 0 : e.y) ?? 0)}px`, t.style.left = "0";
104
- }, dt = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Ot = (t) => {
104
+ }, ht = /* @__PURE__ */ new Set(["auto", "scroll", "overlay"]), Dt = (t) => {
105
105
  let s = t.parentElement;
106
106
  for (; s && s !== document.body; ) {
107
107
  const e = window.getComputedStyle(s);
108
- if (dt.has(e.overflowY) || dt.has(e.overflowX))
108
+ if (ht.has(e.overflowY) || ht.has(e.overflowX))
109
109
  return s;
110
110
  s = s.parentElement;
111
111
  }
112
112
  return document.documentElement;
113
- }, _t = (t) => {
113
+ }, Nt = (t) => {
114
114
  let s = t.parentElement;
115
115
  for (; s && s !== document.body; ) {
116
116
  const e = window.getComputedStyle(s).position;
@@ -120,16 +120,16 @@ const Lt = (t, s) => {
120
120
  }
121
121
  return document.body;
122
122
  };
123
- function kt(t) {
123
+ function Ht(t) {
124
124
  const s = Object.keys(t);
125
125
  return Promise.all(s.map((e) => t[e])).then((e) => {
126
126
  const n = {};
127
- return s.forEach((l, d) => {
128
- n[l] = e[d];
127
+ return s.forEach((l, p) => {
128
+ n[l] = e[p];
129
129
  }), n;
130
130
  });
131
131
  }
132
- function Dt(t) {
132
+ function It(t) {
133
133
  const s = t.filter((e) => e.symmetric).map((e) => ({
134
134
  from: e.to,
135
135
  to: e.from,
@@ -137,7 +137,7 @@ function Dt(t) {
137
137
  }));
138
138
  return [...t, ...s];
139
139
  }
140
- function X(t, s) {
140
+ function K(t, s) {
141
141
  if (s === "*")
142
142
  return !0;
143
143
  if (s.endsWith("/*")) {
@@ -146,187 +146,190 @@ function X(t, s) {
146
146
  }
147
147
  return t === s;
148
148
  }
149
- function Ht(t, s, e) {
149
+ function Wt(t, s, e) {
150
150
  for (const n of e)
151
- if (X(t, n.from) && X(s, n.to))
151
+ if (K(t, n.from) && K(s, n.to))
152
152
  return n.transition;
153
153
  for (const n of e)
154
- if ((n.from === "*" || X(t, n.from)) && (n.to === "*" || X(s, n.to)))
154
+ if ((n.from === "*" || K(t, n.from)) && (n.to === "*" || K(s, n.to)))
155
155
  return n.transition;
156
156
  return null;
157
157
  }
158
- const Nt = 768, It = 10, Wt = 10;
159
- function Ft(t = {}) {
160
- const { preserveScroll: s = (a) => a } = t, e = typeof s == "function" ? s : () => s;
161
- let n = null, l = !1, d = !1;
162
- const c = () => {
163
- const a = (n == null ? void 0 : n.clientWidth) ?? 0, u = a > 0 ? a : typeof window < "u" ? window.innerWidth : 0;
164
- return u > 0 && u < Nt;
165
- }, y = () => (d || (l = c(), d = !0), l), E = (a) => {
166
- var w;
167
- const u = e(y());
168
- if (u === !1)
169
- return { preserves: !1, shared: !1, storageKey: `path:${a}` };
170
- if (u === !0)
171
- return { preserves: !0, shared: !1, storageKey: `path:${a}` };
172
- const v = ((w = u.exclude) == null ? void 0 : w.some((P) => X(a, P))) ?? !1, S = !v && !!u.key;
158
+ const Ft = 768, Kt = 10, Bt = 10;
159
+ function Xt(t = {}) {
160
+ const { preserveScroll: s = (u) => u } = t, e = typeof s == "function" ? s : () => s;
161
+ let n = null, l = !1, p = !1;
162
+ const a = () => {
163
+ const u = (n == null ? void 0 : n.clientWidth) ?? 0, c = u > 0 ? u : typeof window < "u" ? window.innerWidth : 0;
164
+ return c > 0 && c < Ft;
165
+ }, g = () => (p || (l = a(), p = !0), l), v = (u) => {
166
+ var E;
167
+ const c = e(g());
168
+ if (c === !1)
169
+ return { preserves: !1, shared: !1, storageKey: `path:${u}` };
170
+ if (c === !0)
171
+ return { preserves: !0, shared: !1, storageKey: `path:${u}` };
172
+ const m = ((E = c.exclude) == null ? void 0 : E.some((T) => K(u, T))) ?? !1, S = !m && !!c.key;
173
173
  return {
174
- preserves: !v,
174
+ preserves: !m,
175
175
  shared: S,
176
- storageKey: S ? `shared:${u.key}` : `path:${a}`
176
+ storageKey: S ? `shared:${c.key}` : `path:${u}`
177
177
  };
178
- }, O = (a) => E(a).preserves;
179
- let _ = null;
178
+ }, A = (u) => v(u).preserves;
179
+ let C = null;
180
180
  const b = /* @__PURE__ */ new Map();
181
- let M = null, k = !1, I = 0;
182
- const W = () => {
183
- n && M && !k && b.set(E(M).storageKey, {
181
+ let x = null, L = !1, H = 0;
182
+ const I = () => {
183
+ n && x && !L && b.set(v(x).storageKey, {
184
184
  x: n.scrollLeft,
185
185
  y: n.scrollTop
186
186
  });
187
- }, T = (a) => {
187
+ }, z = (u) => {
188
188
  if (!n) return;
189
- const u = E(a);
190
- if (u.preserves && u.shared && !b.has(u.storageKey))
189
+ const c = v(u);
190
+ if (c.preserves && c.shared && !b.has(c.storageKey))
191
191
  return;
192
- const v = u.preserves && b.has(u.storageKey) ? b.get(u.storageKey) : { x: 0, y: 0 };
192
+ const m = c.preserves && b.has(c.storageKey) ? b.get(c.storageKey) : { x: 0, y: 0 };
193
193
  let S = 0;
194
- const w = () => {
194
+ const E = () => {
195
195
  if (!n) return;
196
196
  n.scrollTo({
197
- top: v.y,
198
- left: v.x
199
- }), !(Math.abs(n.scrollTop - v.y) < 1 && Math.abs(n.scrollLeft - v.x) < 1) && S < It && (S++, requestAnimationFrame(w));
197
+ top: m.y,
198
+ left: m.x
199
+ }), !(Math.abs(n.scrollTop - m.y) < 1 && Math.abs(n.scrollLeft - m.x) < 1) && S < Kt && (S++, requestAnimationFrame(E));
200
200
  };
201
- requestAnimationFrame(w);
201
+ requestAnimationFrame(E);
202
202
  };
203
203
  return {
204
- initializeContext: (a, u) => {
205
- k = !0;
206
- const v = ++I;
207
- _ = a, n || (n = Ot(a), l = c(), d = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
208
- l = c();
209
- }).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll", W, {
204
+ initializeContext: (u, c) => {
205
+ L = !0;
206
+ const m = ++H;
207
+ C = u, n || (n = Dt(u), l = a(), p = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
208
+ l = a();
209
+ }).observe(n), (n === document.documentElement ? window : n).addEventListener("scroll", I, {
210
210
  passive: !0
211
- })), M = u, T(u);
211
+ })), x = c, z(c);
212
212
  let S = 0;
213
- const w = () => {
214
- v === I && (S++, S >= Wt ? k = !1 : requestAnimationFrame(w));
213
+ const E = () => {
214
+ m === H && (S++, S >= Bt ? L = !1 : requestAnimationFrame(E));
215
215
  };
216
- requestAnimationFrame(w);
216
+ requestAnimationFrame(E);
217
217
  },
218
- calculateScrollOffset: (a, u) => {
219
- const v = a ? E(a).storageKey : null, S = v && b.has(v) ? b.get(v) : { x: 0, y: 0 }, w = u ? E(u) : null, P = w != null && w.preserves ? w.storageKey : null, F = P && b.has(P) ? b.get(P) : { x: 0, y: 0 };
218
+ calculateScrollOffset: (u, c) => {
219
+ const m = u ? v(u).storageKey : null, S = m && b.has(m) ? b.get(m) : { x: 0, y: 0 }, E = c ? v(c) : null, T = E != null && E.preserves ? E.storageKey : null, N = T && b.has(T) ? b.get(T) : { x: 0, y: 0 };
220
220
  return {
221
- x: -F.x + S.x,
222
- y: -F.y + S.y
221
+ x: -N.x + S.x,
222
+ y: -N.y + S.y
223
223
  };
224
224
  },
225
- evictScrollPosition: (a) => {
226
- b.delete(E(a).storageKey);
225
+ evictScrollPosition: (u) => {
226
+ b.delete(v(u).storageKey);
227
227
  },
228
- shouldPreserve: O,
228
+ shouldPreserve: A,
229
229
  getScrollContainer: () => n,
230
- getPositionedParentElement: () => _ ? _t(_) : document.body,
231
- getScrollPosition: (a) => {
232
- const u = a ? E(a).storageKey : null;
233
- return u && b.has(u) ? b.get(u) : { x: 0, y: 0 };
234
- }
230
+ getPositionedParentElement: () => C ? Nt(C) : document.body,
231
+ getScrollPosition: (u) => {
232
+ const c = u ? v(u).storageKey : null;
233
+ return c && b.has(c) ? b.get(c) : { x: 0, y: 0 };
234
+ },
235
+ // Same measurement that drives `preserveScroll`'s `isMobile`, exposed so a
236
+ // functional `transitions` config can branch on it too.
237
+ getIsMobile: g
235
238
  };
236
239
  }
237
- const ht = 30, yt = 8, pt = 1.2, mt = 30, Kt = 600;
238
- function Bt() {
239
- let t = null, s = !1, e = !1, n = null, l = null, d = !1;
240
- const c = (f, g) => {
241
- for (let p = 0; p < f.length; p++) {
242
- const m = f.item(p);
243
- if (m && m.identifier === g) return m;
240
+ const yt = 30, pt = 8, gt = 1.2, mt = 30, zt = 600;
241
+ function $t() {
242
+ let t = null, s = !1, e = !1, n = null, l = null, p = !1;
243
+ const a = (d, f) => {
244
+ for (let h = 0; h < d.length; h++) {
245
+ const w = d.item(h);
246
+ if (w && w.identifier === f) return w;
244
247
  }
245
248
  return null;
246
- }, y = () => {
249
+ }, g = () => {
247
250
  n !== null && (clearTimeout(n), n = null);
248
- }, E = () => {
251
+ }, v = () => {
249
252
  l !== null && (clearTimeout(l), l = null);
250
- }, O = () => {
251
- s = !0, e = !0, y(), E(), n = setTimeout(() => {
253
+ }, A = () => {
254
+ s = !0, e = !0, g(), v(), n = setTimeout(() => {
252
255
  s = !1, e = !1, n = null;
253
- }, Kt);
254
- }, _ = (f) => {
255
- if (f.touches.length !== 1) {
256
+ }, zt);
257
+ }, C = (d) => {
258
+ if (d.touches.length !== 1) {
256
259
  t = null;
257
260
  return;
258
261
  }
259
- const g = f.touches.item(0);
260
- if (!g) {
262
+ const f = d.touches.item(0);
263
+ if (!f) {
261
264
  t = null;
262
265
  return;
263
266
  }
264
- const p = window.innerWidth, m = g.clientX <= ht, R = g.clientX >= p - ht;
265
- if (!m && !R) {
267
+ const h = window.innerWidth, w = f.clientX <= yt, O = f.clientX >= h - yt;
268
+ if (!w && !O) {
266
269
  t = null;
267
270
  return;
268
271
  }
269
272
  t = {
270
- identifier: g.identifier,
271
- startX: g.clientX,
272
- startY: g.clientY,
273
- fromLeftEdge: m,
273
+ identifier: f.identifier,
274
+ startX: f.clientX,
275
+ startY: f.clientY,
276
+ fromLeftEdge: w,
274
277
  moved: !1
275
278
  };
276
- }, b = (f) => {
279
+ }, b = (d) => {
277
280
  if (!t) return;
278
- if (f.touches.length !== 1) {
281
+ if (d.touches.length !== 1) {
279
282
  t = null;
280
283
  return;
281
284
  }
282
- const g = c(f.touches, t.identifier);
283
- if (!g) {
285
+ const f = a(d.touches, t.identifier);
286
+ if (!f) {
284
287
  t = null;
285
288
  return;
286
289
  }
287
- const p = g.clientX - t.startX, m = g.clientY - t.startY, R = Math.abs(p), a = Math.abs(m);
288
- if (a > yt && a > R * pt) {
290
+ const h = f.clientX - t.startX, w = f.clientY - t.startY, O = Math.abs(h), u = Math.abs(w);
291
+ if (u > pt && u > O * gt) {
289
292
  t = null;
290
293
  return;
291
294
  }
292
- const u = t.fromLeftEdge ? p > 0 : p < 0;
293
- R > yt && R > a * pt && u && (t.moved = !0);
294
- }, M = (f) => {
295
+ const c = t.fromLeftEdge ? h > 0 : h < 0;
296
+ O > pt && O > u * gt && c && (t.moved = !0);
297
+ }, x = (d) => {
295
298
  if (!t) return;
296
- const g = c(f.changedTouches, t.identifier);
297
- if (!g) {
299
+ const f = a(d.changedTouches, t.identifier);
300
+ if (!f) {
298
301
  t = null;
299
302
  return;
300
303
  }
301
- const p = g.clientX - t.startX, m = t.fromLeftEdge ? p > 0 : p < 0;
302
- if (t.moved && m && Math.abs(p) >= mt) {
303
- O(), t = null;
304
+ const h = f.clientX - t.startX, w = t.fromLeftEdge ? h > 0 : h < 0;
305
+ if (t.moved && w && Math.abs(h) >= mt) {
306
+ A(), t = null;
304
307
  return;
305
308
  }
306
- t.moved && Math.abs(p) >= mt && O(), t = null;
307
- }, k = () => {
308
- t && (t.moved && O(), t = null);
309
+ t.moved && Math.abs(h) >= mt && A(), t = null;
310
+ }, L = () => {
311
+ t && (t.moved && A(), t = null);
309
312
  };
310
313
  return { initialize: () => {
311
- if (typeof window > "u" || d) return;
312
- d = !0;
313
- const f = { passive: !0, capture: !0 };
314
- window.addEventListener("touchstart", _, f), window.addEventListener("touchmove", b, f), window.addEventListener("touchend", M, f), window.addEventListener("touchcancel", k, f);
314
+ if (typeof window > "u" || p) return;
315
+ p = !0;
316
+ const d = { passive: !0, capture: !0 };
317
+ window.addEventListener("touchstart", C, d), window.addEventListener("touchmove", b, d), window.addEventListener("touchend", x, d), window.addEventListener("touchcancel", L, d);
315
318
  }, destroy: () => {
316
- if (typeof window > "u" || !d) return;
317
- d = !1;
318
- const f = { capture: !0 };
319
- window.removeEventListener("touchstart", _, f), window.removeEventListener("touchmove", b, f), window.removeEventListener("touchend", M, f), window.removeEventListener("touchcancel", k, f), y(), E(), t = null, s = !1, e = !1;
319
+ if (typeof window > "u" || !p) return;
320
+ p = !1;
321
+ const d = { capture: !0 };
322
+ window.removeEventListener("touchstart", C, d), window.removeEventListener("touchmove", b, d), window.removeEventListener("touchend", x, d), window.removeEventListener("touchcancel", L, d), g(), v(), t = null, s = !1, e = !1;
320
323
  }, isSwipeBack: () => {
321
- const f = s || e;
322
- return f && y(), f;
324
+ const d = s || e;
325
+ return d && g(), d;
323
326
  }, onPageEnter: () => {
324
- s = !1, y(), E(), l = setTimeout(() => {
327
+ s = !1, g(), v(), l = setTimeout(() => {
325
328
  e = !1, l = null;
326
329
  }, 0);
327
330
  } };
328
331
  }
329
- function Xt() {
332
+ function Vt() {
330
333
  let t = null;
331
334
  function s() {
332
335
  var n, l;
@@ -344,8 +347,8 @@ function Xt() {
344
347
  }
345
348
  return {
346
349
  trigger(n, l) {
347
- var c;
348
- l === "out" && (t == null ? void 0 : t.to) === n && !t.from && ((c = t.inResolve) == null || c.call(t, null), t = {}), t && (l === "out" && t.from && t.from !== n || l === "in" && t.to && t.to !== n) && s(), t || (t = {}), l === "out" ? t.from = n : t.to = n;
350
+ var a;
351
+ l === "out" && (t == null ? void 0 : t.to) === n && !t.from && ((a = t.inResolve) == null || a.call(t, null), t = {}), t && (l === "out" && t.from && t.from !== n || l === "in" && t.to && t.to !== n) && s(), t || (t = {}), l === "out" ? t.from = n : t.to = n;
349
352
  },
350
353
  get(n) {
351
354
  return new Promise((l) => {
@@ -354,312 +357,322 @@ function Xt() {
354
357
  }
355
358
  };
356
359
  }
357
- const $ = /* @__PURE__ */ new Map();
358
- let Y = null, gt = !1;
359
- function Et(t) {
360
- if (t instanceof HTMLElement && $.has(t) && !t.isConnected) {
361
- const s = $.get(t);
362
- $.delete(t), queueMicrotask(s);
360
+ const X = /* @__PURE__ */ new Map();
361
+ let G = null, vt = !1;
362
+ function Et(t, s) {
363
+ if (t instanceof HTMLElement && X.has(t) && !t.isConnected) {
364
+ const e = X.get(t);
365
+ X.delete(t), queueMicrotask(() => e(s));
363
366
  }
364
- for (const s of Array.from(t.childNodes))
365
- Et(s);
367
+ for (const e of Array.from(t.childNodes))
368
+ Et(e, s);
366
369
  }
367
- function zt() {
368
- if (gt || typeof document > "u") return;
369
- gt = !0, Y = new MutationObserver((s) => {
370
- for (const e of s)
371
- for (const n of Array.from(e.removedNodes))
372
- Et(n);
370
+ function qt() {
371
+ if (vt || typeof document > "u") return;
372
+ vt = !0, G = new MutationObserver((s) => {
373
+ for (const e of s) {
374
+ const n = {
375
+ parent: e.target,
376
+ nextSibling: e.nextSibling
377
+ };
378
+ for (const l of Array.from(e.removedNodes))
379
+ Et(l, n);
380
+ }
373
381
  });
374
382
  const t = () => {
375
- Y == null || Y.observe(document.body, { childList: !0, subtree: !0 });
383
+ G == null || G.observe(document.body, { childList: !0, subtree: !0 });
376
384
  };
377
385
  document.body ? t() : document.addEventListener("DOMContentLoaded", t, { once: !0 });
378
386
  }
379
- function $t(t, s) {
380
- return zt(), $.set(t, s), () => {
381
- $.delete(t);
387
+ function Ut(t, s) {
388
+ return qt(), X.set(t, s), () => {
389
+ X.delete(t);
382
390
  };
383
391
  }
384
- const ot = /* @__PURE__ */ new WeakMap();
385
- let G = null;
386
- const Z = "none !important";
387
- function z(t) {
392
+ const it = /* @__PURE__ */ new WeakMap();
393
+ let Z = null;
394
+ const j = "none !important";
395
+ function B(t) {
388
396
  const s = t.style.getPropertyValue("display");
389
397
  return t.style.getPropertyPriority("display") ? `${s} !important` : s;
390
398
  }
391
- function Vt() {
392
- return G || (G = new MutationObserver((t) => {
399
+ function Yt() {
400
+ return Z || (Z = new MutationObserver((t) => {
393
401
  for (const s of t) {
394
- const e = s.target, n = ot.get(e);
402
+ const e = s.target, n = it.get(e);
395
403
  if (!n) continue;
396
- const l = z(e);
397
- l !== n.accounted && (n.accounted = l, l === Z ? (n.reactHidden = !0, n.onHide()) : l !== "none" && n.reactHidden && (n.reactHidden = !1, n.onShow()));
404
+ const l = B(e);
405
+ l !== n.accounted && (n.accounted = l, l === j ? (n.reactHidden = !0, n.onHide()) : l !== "none" && n.reactHidden && (n.reactHidden = !1, n.onShow()));
398
406
  }
399
- }), G);
407
+ }), Z);
400
408
  }
401
- function qt(t, s) {
402
- const e = z(t), n = {
409
+ function Gt(t, s) {
410
+ const e = B(t), n = {
403
411
  accounted: e,
404
- reactHidden: e === Z,
412
+ reactHidden: e === j,
405
413
  onHide: s.onHide,
406
414
  onShow: s.onShow
407
415
  };
408
- return ot.set(t, n), Vt().observe(t, {
416
+ return it.set(t, n), Yt().observe(t, {
409
417
  attributes: !0,
410
418
  attributeFilter: ["style"]
411
419
  }), {
412
420
  get isHidden() {
413
- return z(t) === Z;
421
+ return B(t) === j;
414
422
  },
415
- setDisplay(l, d = !1) {
423
+ setDisplay(l, p = !1) {
416
424
  l === null ? t.style.removeProperty("display") : t.style.setProperty(
417
425
  "display",
418
426
  l,
419
- d ? "important" : ""
420
- ), n.accounted = z(t);
427
+ p ? "important" : ""
428
+ ), n.accounted = B(t);
421
429
  },
422
430
  sync() {
423
- n.accounted = z(t), n.reactHidden = n.accounted === Z;
431
+ n.accounted = B(t), n.reactHidden = n.accounted === j;
424
432
  },
425
433
  stop() {
426
- ot.delete(t);
434
+ it.delete(t);
427
435
  }
428
436
  };
429
437
  }
430
- function Ut(t) {
438
+ function Zt(t) {
431
439
  return Array.isArray(t);
432
440
  }
433
- function bt(t) {
441
+ function wt(t) {
434
442
  const s = [];
435
443
  for (const e of t)
436
- Ut(e) ? s.push(...bt(e)) : s.push(e);
444
+ Zt(e) ? s.push(...wt(e)) : s.push(e);
437
445
  return s;
438
446
  }
439
- function se(t, s = {}) {
447
+ function re(t, s = {}) {
440
448
  const {
441
449
  transitions: e = [],
442
450
  middleware: n = (o, i) => ({ from: o, to: i }),
443
451
  preserveScroll: l = (o) => o
444
- } = t, d = s.host ?? new Mt(), c = Xt(), y = Dt(
445
- bt(e)
446
- ), E = Bt();
447
- E.initialize();
452
+ } = t, p = s.host ?? new _t(), a = Vt(), g = typeof e == "function" ? e : () => e, v = $t();
453
+ v.initialize();
448
454
  const {
449
- initializeContext: O,
450
- calculateScrollOffset: _,
455
+ initializeContext: A,
456
+ calculateScrollOffset: C,
451
457
  evictScrollPosition: b,
452
- shouldPreserve: M,
453
- getScrollContainer: k,
454
- getPositionedParentElement: I,
455
- getScrollPosition: W
456
- } = Ft({ preserveScroll: l });
457
- let T = null, A = null;
458
- const f = /* @__PURE__ */ new WeakMap(), g = (o) => {
459
- f.set(o, {
460
- parent: o.parentElement,
461
- nextSibling: o.nextElementSibling
458
+ shouldPreserve: x,
459
+ getScrollContainer: L,
460
+ getPositionedParentElement: H,
461
+ getScrollPosition: I,
462
+ getIsMobile: z
463
+ } = Xt({ preserveScroll: l }), $ = /* @__PURE__ */ new Map(), d = () => {
464
+ const o = z();
465
+ let i = $.get(o);
466
+ return i || (i = It(
467
+ wt(g({ isMobile: o }))
468
+ ), $.set(o, i)), i;
469
+ };
470
+ let f = null, h = null;
471
+ const w = /* @__PURE__ */ new WeakMap(), O = (o) => {
472
+ w.set(o, {
473
+ parent: o.parentNode,
474
+ nextSibling: o.nextSibling
462
475
  });
463
- }, p = (o) => {
464
- const i = f.get(o);
476
+ }, u = (o) => {
477
+ const i = w.get(o);
465
478
  return i || {
466
- parent: o.parentElement,
467
- nextSibling: o.nextElementSibling
479
+ parent: o.parentNode,
480
+ nextSibling: o.nextSibling
468
481
  };
469
- }, m = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap();
470
- let a = 0;
471
- const u = (o) => {
482
+ }, c = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap();
483
+ let S = 0;
484
+ const E = (o) => {
472
485
  const i = typeof getComputedStyle < "u" ? getComputedStyle(o).display : "";
473
486
  return i && i !== "none" ? i : "block";
474
- }, v = (o, i) => {
475
- i.visibleDisplay = o.style.getPropertyValue("display"), i.computedDisplay = u(o);
476
- }, S = (o, i) => {
477
- if (R.get(o) !== i) return;
478
- R.delete(o);
479
- const r = m.get(o);
480
- r && (r.savedCss !== null && (o.style.cssText = r.savedCss, r.savedCss = null), r.intent === "hidden" ? r.vis.setDisplay("none", !0) : r.visibleDisplay ? (r.vis.setDisplay(r.visibleDisplay, !1), v(o, r)) : (r.vis.setDisplay(null), v(o, r)));
481
- }, w = (o, i, r, h, L) => {
482
- const x = h.element, D = L.element, H = (h.mode ?? "unmount") === "hidden", { parent: V, nextSibling: J } = h.parent ? { parent: h.parent, nextSibling: h.nextSibling } : p(x), q = _(i, r), Q = {
483
- scrollOffset: q,
484
- from: { scroll: W(i) },
485
- to: { scroll: W(r) },
487
+ }, T = (o, i) => {
488
+ i.visibleDisplay = o.style.getPropertyValue("display"), i.computedDisplay = E(o);
489
+ }, N = (o, i) => {
490
+ if (m.get(o) !== i) return;
491
+ m.delete(o);
492
+ const r = c.get(o);
493
+ r && (r.savedCss !== null && (o.style.cssText = r.savedCss, r.savedCss = null), r.intent === "hidden" ? r.vis.setDisplay("none", !0) : r.visibleDisplay ? (r.vis.setDisplay(r.visibleDisplay, !1), T(o, r)) : (r.vis.setDisplay(null), T(o, r)));
494
+ }, Tt = (o, i, r, y, R) => {
495
+ const P = y.element, _ = R.element, k = (y.mode ?? "unmount") === "hidden", { parent: q, nextSibling: Q } = y.parent ? { parent: y.parent, nextSibling: y.nextSibling } : u(P), U = C(i, r), tt = {
496
+ scrollOffset: U,
497
+ from: { scroll: I(i) },
498
+ to: { scroll: I(r) },
486
499
  get scrollingElement() {
487
- return k() || document.documentElement;
500
+ return L() || document.documentElement;
488
501
  },
489
502
  get positionedParent() {
490
- return I();
503
+ return H();
491
504
  }
492
505
  };
493
- let C;
494
- if (H) {
495
- C = x, C.style.top = `${-1 * ((q == null ? void 0 : q.y) ?? 0)}px`;
496
- const N = m.get(D);
497
- N && N.savedCss === null && (N.savedCss = D.style.cssText);
506
+ let M;
507
+ if (k) {
508
+ M = P, M.style.top = `${-1 * ((U == null ? void 0 : U.y) ?? 0)}px`;
509
+ const D = c.get(_);
510
+ D && D.savedCss === null && (D.savedCss = _.style.cssText);
498
511
  } else
499
- C = x.cloneNode(!0), C.setAttribute("data-ssgoi-clone", ""), Lt(C, Q);
500
- M(i) || b(i);
501
- const U = H ? ++a : 0;
502
- H && (R.set(D, U), R.set(x, U));
503
- const at = Promise.resolve(C), ut = Promise.resolve(D), ft = [], Rt = {
504
- from: at,
505
- to: ut,
506
- context: Q,
507
- createElement: ((N, tt = "div") => {
508
- const K = document.createElement(tt);
509
- return K.setAttribute("data-ssgoi-id", N), ft.push(K), K;
512
+ M = P, kt(M, tt);
513
+ x(i) || b(i);
514
+ const Y = k ? ++S : 0;
515
+ k && (m.set(_, Y), m.set(P, Y));
516
+ const ut = Promise.resolve(M), dt = Promise.resolve(_), ft = [], xt = {
517
+ from: ut,
518
+ to: dt,
519
+ context: tt,
520
+ createElement: ((D, et = "div") => {
521
+ const W = document.createElement(et);
522
+ return W.setAttribute("data-ssgoi-id", D), ft.push(W), W;
510
523
  })
511
- }, Pt = Promise.resolve(
512
- o.prepare ? o.prepare(Rt) : {}
524
+ }, At = Promise.resolve(
525
+ o.prepare ? o.prepare(xt) : {}
513
526
  );
514
- kt({
515
- from: at,
516
- to: ut,
517
- extras: Pt
518
- }).then(({ from: N, to: tt, extras: K }) => {
519
- !H && V && (J && V.contains(J) ? V.insertBefore(C, J) : V.appendChild(C));
520
- const et = o.animation({
521
- from: N,
522
- to: tt,
523
- context: Q,
524
- ...K
525
- }), nt = et.onComplete;
526
- et.onComplete = () => {
527
- nt == null || nt(), H ? (S(x, U), S(D, U)) : C.parentElement && C.parentElement.removeChild(C);
528
- for (const st of ft)
529
- st.parentElement && st.parentElement.removeChild(st);
530
- }, d.attach(et);
527
+ Ht({
528
+ from: ut,
529
+ to: dt,
530
+ extras: At
531
+ }).then(({ from: D, to: et, extras: W }) => {
532
+ !k && q && (Q && q.contains(Q) ? q.insertBefore(M, Q) : q.appendChild(M));
533
+ const nt = o.animation({
534
+ from: D,
535
+ to: et,
536
+ context: tt,
537
+ ...W
538
+ }), st = nt.onComplete;
539
+ nt.onComplete = () => {
540
+ st == null || st(), k ? (N(P, Y), N(_, Y)) : M.parentNode && M.parentNode.removeChild(M);
541
+ for (const ot of ft)
542
+ ot.parentNode && ot.parentNode.removeChild(ot);
543
+ }, p.attach(nt);
531
544
  });
532
- }, P = (o, i) => {
533
- const r = E.isSwipeBack();
534
- c.trigger(o, i), c.get(i).then((h) => {
535
- if (i === "in" && E.onPageEnter(), !h) return;
545
+ }, V = (o, i) => {
546
+ const r = v.isSwipeBack();
547
+ a.trigger(o, i), a.get(i).then((y) => {
548
+ if (i === "in" && v.onPageEnter(), !y) return;
536
549
  if (r) {
537
- i === "out" && h.from && !M(h.from) && b(h.from), T = null, A = null;
550
+ i === "out" && y.from && !x(y.from) && b(y.from), f = null, h = null;
538
551
  return;
539
552
  }
540
553
  if (i !== "in") return;
541
- const { from: L, to: x } = n(
542
- h.from,
543
- h.to
544
- ), D = Ht(
545
- L,
546
- x,
547
- y
548
- ), j = T, H = A;
549
- T = null, A = null, !(!D || !j || !H) && w(D, L, x, j, H);
554
+ const { from: R, to: P } = n(
555
+ y.from,
556
+ y.to
557
+ ), _ = Wt(
558
+ R,
559
+ P,
560
+ d()
561
+ ), J = f, k = h;
562
+ f = null, h = null, !(!_ || !J || !k) && Tt(_, R, P, J, k);
550
563
  });
551
- }, F = (o, i) => {
552
- const r = m.get(o);
564
+ }, Rt = (o, i) => {
565
+ const r = c.get(o);
553
566
  if (!r) return;
554
- const h = r.intent === "hidden";
555
- if (r.intent = "hidden", r.savedCss === null && (r.savedCss = o.style.cssText), r.vis.setDisplay(r.computedDisplay || "block", !0), o.style.position = "absolute", o.style.width = "100%", o.style.left = "0", h) return;
556
- const L = p(o);
557
- T = {
567
+ const y = r.intent === "hidden";
568
+ if (r.intent = "hidden", r.savedCss === null && (r.savedCss = o.style.cssText), r.vis.setDisplay(r.computedDisplay || "block", !0), o.style.position = "absolute", o.style.width = "100%", o.style.left = "0", y) return;
569
+ const R = u(o);
570
+ f = {
558
571
  element: o,
559
- parent: L.parent,
560
- nextSibling: L.nextSibling,
572
+ parent: R.parent,
573
+ nextSibling: R.nextSibling,
561
574
  mode: "hidden"
562
575
  };
563
- const x = o.getAttribute("data-ssgoi-transition") ?? i;
564
- P(x, "out");
565
- }, St = (o, i) => {
566
- const r = m.get(o);
576
+ const P = o.getAttribute("data-ssgoi-transition") ?? i;
577
+ V(P, "out");
578
+ }, Pt = (o, i) => {
579
+ const r = c.get(o);
567
580
  if (!r || r.intent === "visible") return;
568
- r.intent = "visible", v(o, r), r.savedCss !== null && (o.style.cssText = r.savedCss, r.visibleDisplay ? r.vis.setDisplay(r.visibleDisplay, !1) : r.vis.setDisplay(null)), O(o, i), A = {
581
+ r.intent = "visible", T(o, r), r.savedCss !== null && (o.style.cssText = r.savedCss, r.visibleDisplay ? r.vis.setDisplay(r.visibleDisplay, !1) : r.vis.setDisplay(null)), A(o, i), h = {
569
582
  element: o,
570
583
  parent: o.parentElement,
571
584
  nextSibling: o.nextElementSibling
572
585
  };
573
- const h = o.getAttribute("data-ssgoi-transition") ?? i;
574
- P(h, "in");
575
- }, Tt = (o, i) => {
576
- const r = m.get(o);
577
- if (r && (r.vis.stop(), m.delete(o), R.delete(o), r.intent === "hidden")) {
578
- (T == null ? void 0 : T.element) === o && (T = null), (A == null ? void 0 : A.element) === o && (A = null);
586
+ const y = o.getAttribute("data-ssgoi-transition") ?? i;
587
+ V(y, "in");
588
+ }, Mt = (o, i, r) => {
589
+ const y = c.get(o);
590
+ if (y && (y.vis.stop(), c.delete(o), m.delete(o), y.intent === "hidden")) {
591
+ (f == null ? void 0 : f.element) === o && (f = null), (h == null ? void 0 : h.element) === o && (h = null);
579
592
  return;
580
593
  }
581
- const h = p(o);
582
- T = {
594
+ const R = r ?? u(o);
595
+ f = {
583
596
  element: o,
584
- parent: h.parent,
585
- nextSibling: h.nextSibling,
597
+ parent: R.parent,
598
+ nextSibling: R.nextSibling,
586
599
  mode: "unmount"
587
600
  };
588
- const L = o.getAttribute("data-ssgoi-transition") ?? i;
589
- P(L, "out");
590
- }, rt = /* @__PURE__ */ new WeakSet(), lt = (o, i) => {
591
- if (rt.has(i)) return;
592
- rt.add(i), g(i);
593
- const r = qt(i, {
594
- onHide: () => F(i, o),
595
- onShow: () => St(i, o)
596
- }), h = {
601
+ const P = o.getAttribute("data-ssgoi-transition") ?? i;
602
+ V(P, "out");
603
+ }, lt = /* @__PURE__ */ new WeakSet(), ct = (o, i) => {
604
+ if (lt.has(i)) return;
605
+ lt.add(i), O(i);
606
+ const r = Gt(i, {
607
+ onHide: () => Rt(i, o),
608
+ onShow: () => Pt(i, o)
609
+ }), y = {
597
610
  vis: r,
598
611
  savedCss: null,
599
612
  intent: r.isHidden ? "hidden" : "visible",
600
613
  visibleDisplay: "",
601
614
  computedDisplay: "block"
602
615
  };
603
- m.set(i, h), r.isHidden || (v(i, h), O(i, o), A = {
616
+ c.set(i, y), r.isHidden || (T(i, y), A(i, o), h = {
604
617
  element: i,
605
618
  parent: i.parentElement,
606
619
  nextSibling: i.nextElementSibling
607
- }, P(o, "in")), $t(i, () => Tt(i, o));
608
- }, ct = /* @__PURE__ */ new Map();
609
- return { register: lt, refFor: (o) => {
610
- let i = ct.get(o);
620
+ }, V(o, "in")), Ut(i, (R) => Mt(i, o, R));
621
+ }, at = /* @__PURE__ */ new Map();
622
+ return { register: ct, refFor: (o) => {
623
+ let i = at.get(o);
611
624
  return i || (i = (r) => {
612
- r && lt(o, r);
613
- }, ct.set(o, i)), i;
625
+ r && ct(o, r);
626
+ }, at.set(o, i)), i;
614
627
  } };
615
628
  }
616
- const wt = "data-ssgoi-root", Yt = `[${wt}]`, it = "data-ssgoi-transition", vt = `[${it}]`, Gt = "[data-ssgoi-clone]";
617
- function Zt() {
629
+ const St = "data-ssgoi-root", jt = `[${St}]`, rt = "data-ssgoi-transition", bt = `[${rt}]`, Jt = "[data-ssgoi-clone]";
630
+ function Qt() {
618
631
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
619
632
  }
620
- function jt(t) {
633
+ function te(t) {
621
634
  return t.nodeType === Node.ELEMENT_NODE;
622
635
  }
623
- function Jt(t) {
636
+ function ee(t) {
624
637
  return t instanceof HTMLElement;
625
638
  }
626
- function oe(t, s) {
627
- if (!Zt()) return () => {
639
+ function le(t, s) {
640
+ if (!Qt()) return () => {
628
641
  };
629
- t.setAttribute(wt, "");
630
- const e = (c) => c.closest(Yt) === t, n = (c) => {
631
- if (!Jt(c) || !e(c) || c.closest(Gt))
642
+ t.setAttribute(St, "");
643
+ const e = (a) => a.closest(jt) === t, n = (a) => {
644
+ if (!ee(a) || !e(a) || a.closest(Jt))
632
645
  return;
633
- const y = c.getAttribute(it);
634
- y !== null && s.register(y, c);
635
- }, l = (c) => {
636
- if (jt(c)) {
637
- c.matches(vt) && n(c);
638
- for (const y of c.querySelectorAll(vt))
639
- n(y);
646
+ const g = a.getAttribute(rt);
647
+ g !== null && s.register(g, a);
648
+ }, l = (a) => {
649
+ if (te(a)) {
650
+ a.matches(bt) && n(a);
651
+ for (const g of a.querySelectorAll(bt))
652
+ n(g);
640
653
  }
641
- }, d = new MutationObserver((c) => {
642
- for (const y of c) {
643
- if (y.type === "attributes") {
644
- n(y.target);
654
+ }, p = new MutationObserver((a) => {
655
+ for (const g of a) {
656
+ if (g.type === "attributes") {
657
+ n(g.target);
645
658
  continue;
646
659
  }
647
- for (const E of y.addedNodes)
648
- l(E);
660
+ for (const v of g.addedNodes)
661
+ l(v);
649
662
  }
650
663
  });
651
- return d.observe(t, {
664
+ return p.observe(t, {
652
665
  childList: !0,
653
666
  subtree: !0,
654
667
  attributes: !0,
655
- attributeFilter: [it]
656
- }), l(t), () => d.disconnect();
668
+ attributeFilter: [rt]
669
+ }), l(t), () => p.disconnect();
657
670
  }
658
671
  export {
659
- xt as Animation,
660
- Mt as HostAnimation,
661
- le as MultiAnimation,
662
- ce as WebAnimation,
663
- se as createSggoiTransitionContext,
664
- oe as observeSsgoiTransitions
672
+ Ot as Animation,
673
+ _t as HostAnimation,
674
+ ue as MultiAnimation,
675
+ de as WebAnimation,
676
+ re as createSggoiTransitionContext,
677
+ le as observeSsgoiTransitions
665
678
  };
@@ -20,5 +20,6 @@ export declare function createContextManager(options?: ContextManagerOptions): {
20
20
  x: number;
21
21
  y: number;
22
22
  };
23
+ getIsMobile: () => boolean;
23
24
  };
24
25
  //# sourceMappingURL=create-context-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,QAAQ,CAAC;AAgBrE,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;iCAqIlC,WAAW,QAAQ,MAAM;mCAwDpD,MAAM,OACR,MAAM,KACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;gCAuBQ,MAAM;2BAxJX,MAAM,KAAG,OAAO;;;+BAmKZ,MAAM,KAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;EAgBpE"}
1
+ {"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,QAAQ,CAAC;AAgBrE,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;iCAqIlC,WAAW,QAAQ,MAAM;mCAwDpD,MAAM,OACR,MAAM,KACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;gCAuBQ,MAAM;2BAxJX,MAAM,KAAG,OAAO;;;+BAmKZ,MAAM,KAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;uBAjMxC,OAAO;EAoNnC"}
@@ -5,10 +5,10 @@ import { HostAnimation } from '../animation/host-animation';
5
5
  *
6
6
  * Pure promise plumbing: the framework adapter calls `in(element)` on mount
7
7
  * and `out(element)` on unmount; the dispatcher pairs them by path via
8
- * NavigationDetector, then `.then`-chains the prepare result, the cloned
9
- * `from` element, and the `to` element. `animation()` runs once the chain
10
- * resolves — never via blocking `await` — so a follow-up navigation can
11
- * start its own pair while a prior one is still building.
8
+ * NavigationDetector, then `.then`-chains the prepare result, the `from`
9
+ * element, and the `to` element. `animation()` runs once the chain resolves —
10
+ * never via blocking `await` — so a follow-up navigation can start its own pair
11
+ * while a prior one is still building.
12
12
  */
13
13
  export interface CreateSsgoiTransitionContextOptions {
14
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAMb,MAAM,QAAQ,CAAC;AAShB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AA8C5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,CA0ed"}
1
+ {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAOb,MAAM,QAAQ,CAAC;AAShB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AA8C5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,CAwgBd"}
@@ -10,7 +10,11 @@
10
10
  * - parent re-mounts that detach the watched node also fire
11
11
  * - lower memory / browser overhead than dozens of observers
12
12
  */
13
- type UnmountCallback = () => void;
13
+ export type UnmountAnchor = {
14
+ parent: Node;
15
+ nextSibling: Node | null;
16
+ };
17
+ type UnmountCallback = (anchor?: UnmountAnchor) => void;
14
18
  /** Register `cb` to fire when `element` is removed from the DOM. */
15
19
  export declare function watchUnmount(element: HTMLElement, cb: UnmountCallback): () => void;
16
20
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"unmount-observer.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/unmount-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAmDlC,oEAAoE;AACpE,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,eAAe,GAClB,MAAM,IAAI,CAMZ"}
1
+ {"version":3,"file":"unmount-observer.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/unmount-observer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC;IACb,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,KAAK,eAAe,GAAG,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;AAuDxD,oEAAoE;AACpE,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,eAAe,GAClB,MAAM,IAAI,CAMZ"}
@@ -142,8 +142,27 @@ export type PreserveScrollValue = boolean | {
142
142
  };
143
143
  export type PreserveScrollFn = (isMobile: boolean) => PreserveScrollValue;
144
144
  export type PreserveScrollOption = PreserveScrollValue | PreserveScrollFn;
145
+ /**
146
+ * Argument handed to a functional `transitions` config. Destructured at the
147
+ * call site (`({ isMobile }) => …`) so the boolean's meaning is self-documenting
148
+ * — and so the object can grow more fields later without breaking signatures.
149
+ */
150
+ export type TransitionsResolverArgs = {
151
+ isMobile: boolean;
152
+ };
153
+ /**
154
+ * Functional form of `transitions`: receives device context and returns the
155
+ * path-transition list. Lets a config branch on viewport (e.g. drawer on
156
+ * mobile, fade on desktop) without an outer wrapper.
157
+ */
158
+ export type SsgoiTransitionsFn = (args: TransitionsResolverArgs) => readonly SsgoiPathTransitionInput[];
159
+ /**
160
+ * `transitions` accepts either the plain list (existing form) or a function of
161
+ * device context. Both normalize to the functional form internally.
162
+ */
163
+ export type SsgoiTransitionsOption = readonly SsgoiPathTransitionInput[] | SsgoiTransitionsFn;
145
164
  export type SsgoiConfig = {
146
- transitions?: readonly SsgoiPathTransitionInput[];
165
+ transitions?: SsgoiTransitionsOption;
147
166
  middleware?: (from: string, to: string) => {
148
167
  from: string;
149
168
  to: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAM1D,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;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AI,CAAC;CACjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "6.5.1",
3
+ "version": "6.6.1",
4
4
  "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",
@@ -32,6 +32,18 @@
32
32
  "!dist/**/*.test.*",
33
33
  "!dist/**/*.spec.*"
34
34
  ],
35
+ "scripts": {
36
+ "dev": "vite",
37
+ "watch": "vite build --watch",
38
+ "build": "tsc && vite build",
39
+ "preview": "vite preview",
40
+ "prepare": "pnpm run build",
41
+ "lint": "eslint .",
42
+ "test": "vitest",
43
+ "test:ui": "vitest --ui",
44
+ "test:run": "vitest run",
45
+ "test:coverage": "vitest run --coverage"
46
+ },
35
47
  "keywords": [
36
48
  "page-transition",
37
49
  "page-transitions",
@@ -76,16 +88,5 @@
76
88
  "vite": "^6.0.7",
77
89
  "vite-plugin-dts": "^4.5.0",
78
90
  "vitest": "^3.2.4"
79
- },
80
- "scripts": {
81
- "dev": "vite",
82
- "watch": "vite build --watch",
83
- "build": "tsc && vite build",
84
- "preview": "vite preview",
85
- "lint": "eslint .",
86
- "test": "vitest",
87
- "test:ui": "vitest --ui",
88
- "test:run": "vitest run",
89
- "test:coverage": "vitest run --coverage"
90
91
  }
91
- }
92
+ }