aptechka 0.90.8 → 0.90.10
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/lib/{Animation-D1hABQm1.cjs → Animation-CS32dwF1.cjs} +1 -1
- package/lib/{Animation-rSS-Nd6w.js → Animation-DwOegoQA.js} +2 -1
- package/lib/{Damped-CskjPD1V.cjs → Damped-B_mVO810.cjs} +1 -1
- package/lib/{Damped-7F7Szrx5.js → Damped-m3PWu4LD.js} +1 -1
- package/lib/{DragControls-0Ia-FRQl.cjs → DragControls-Cwnszjzf.cjs} +1 -1
- package/lib/{DragControls-lvk3C5V0.js → DragControls-QzcTE5Pt.js} +1 -1
- package/lib/{Tweened--KJh27xY.cjs → Tweened-BZoUkI7O.cjs} +1 -1
- package/lib/{Tweened-n81fEVM5.js → Tweened-DuJCwQl7.js} +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.d.ts +1 -0
- package/lib/iframe/index.js +5 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +3 -3
- package/lib/{scroll-BAlaPfiQ.cjs → scroll-BWDLSP3i.cjs} +1 -1
- package/lib/{scroll-BoOEbQx5.js → scroll-C27tnW2f.js} +1 -1
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +32 -18
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const order_index=require("./order/index.cjs"),Store=require("./Store-B96mD8mD.cjs"),ticker_index=require("./index-BoGx2BWX.cjs"),math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs");var _maxFPS,_order,_culling,_delay,_delayTimeoutId,_isRunning,_direction,_target,_min,_max,_from,_tmpSetValue,_Animation_instances,setTarget_fn,_animationFrameListener,clearDelayTimeout_fn;const _Animation=class _Animation extends Store.Store{constructor(initial,options){super(initial||0,options);__privateAdd(this,_Animation_instances);__privateAdd(this,_maxFPS);__privateAdd(this,_order,order_index.TICK_ORDER.ANIMATION);__privateAdd(this,_culling);__privateAdd(this,_delay,0);__privateAdd(this,_delayTimeoutId,null);__privateAdd(this,_isRunning,new Store.Store(!1));__privateAdd(this,_direction,0);__privateAdd(this,_target,0);__privateAdd(this,_min,-1/0);__privateAdd(this,_max,1/0);__privateAdd(this,_from,0);__privateAdd(this,_tmpSetValue,null);__privateAdd(this,_animationFrameListener,__name(e=>{this.handleAnimationFrame(e)},"#animationFrameListener"));__privateSet(this,_target,this.current)}get direction(){return __privateGet(this,_direction)}get target(){return __privateGet(this,_target)}get min(){return __privateGet(this,_min)}set min(value){__privateSet(this,_min,value),this.set(__privateGet(this,_target),{equalize:!0})}get max(){return __privateGet(this,_max)}set max(value){__privateSet(this,_max,value),this.set(__privateGet(this,_target),{equalize:!0})}get from(){return __privateGet(this,_from)}get isRunning(){return __privateGet(this,_isRunning)}get delta(){return Math.abs(__privateGet(this,_target)-__privateGet(this,_from))}get deltaProgress(){return this.delta?number.preciseNumber(Math.abs(this.current-__privateGet(this,_from))/this.delta,6):0}get distance(){return Math.abs(__privateGet(this,_max)-__privateGet(this,_min))}get distanceProgress(){return this.distance?number.preciseNumber(Math.abs(this.current-__privateGet(this,_min))/this.distance,6):0}set(value,options){(__privateGet(this,_target)!==value||options!=null&&options.restart)&&(__privateSet(this,_tmpSetValue,value),this.updateOptions(options),__privateSet(this,_tmpSetValue,null),__privateGet(this,_target)!==this.current&&this.start())}shift(value,options){this.set(__privateGet(this,_target)+value,options)}reset(){super.reset(),__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.set(this.initial,{equalize:!0})}close(){super.close(),__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){__privateGet(this,_isRunning).current||(__privateGet(this,_isRunning).current=!0,ticker_index.ticker.subscribe(__privateGet(this,_animationFrameListener),{maxFPS:__privateGet(this,_maxFPS),order:__privateGet(this,_order),culling:__privateGet(this,_culling)}))}unlistenAnimationFrame(){__privateGet(this,_isRunning).current&&(__privateGet(this,_isRunning).current=!1,ticker_index.ticker.unsubscribe(__privateGet(this,_animationFrameListener)))}updateOptions(options){__privateSet(this,_maxFPS,polyfills.nullishCoalescing(options==null?void 0:options.maxFPS,__privateGet(this,_maxFPS))),__privateSet(this,_order,polyfills.nullishCoalescing(options==null?void 0:options.order,__privateGet(this,_order))),__privateSet(this,_culling,polyfills.nullishCoalescing(options==null?void 0:options.culling,__privateGet(this,_culling))),__privateSet(this,_min,polyfills.nullishCoalescing(options==null?void 0:options.min,__privateGet(this,_min))),__privateSet(this,_max,polyfills.nullishCoalescing(options==null?void 0:options.max,__privateGet(this,_max))),__privateSet(this,_delay,polyfills.nullishCoalescing(options==null?void 0:options.delay,__privateGet(this,_delay))),__privateMethod(this,_Animation_instances,setTarget_fn).call(this,typeof __privateGet(this,_tmpSetValue)=="number"?__privateGet(this,_tmpSetValue):__privateGet(this,_target)),options!=null&&options.equalize&&!(options!=null&&options.restart)&&(__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.unlistenAnimationFrame(),this.current=__privateSet(this,_from,__privateGet(this,_target))),options!=null&&options.restart&&(__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.unlistenAnimationFrame(),this.current=__privateSet(this,_from,this.initial),options!=null&&options.equalize&&(this.current=__privateSet(this,_from,__privateGet(this,_target)))),typeof(options==null?void 0:options.current)=="number"&&__privateSet(this,_from,this.current=options.current)}start(){__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),__privateGet(this,_delay)>0?__privateSet(this,_delayTimeoutId,window.setTimeout(()=>{__privateSet(this,_delayTimeoutId,null),this.listenAnimationFrame()},__privateGet(this,_delay))):this.listenAnimationFrame()}};_maxFPS=new WeakMap,_order=new WeakMap,_culling=new WeakMap,_delay=new WeakMap,_delayTimeoutId=new WeakMap,_isRunning=new WeakMap,_direction=new WeakMap,_target=new WeakMap,_min=new WeakMap,_max=new WeakMap,_from=new WeakMap,_tmpSetValue=new WeakMap,_Animation_instances=new WeakSet,setTarget_fn=__name(function(value){
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const order_index=require("./order/index.cjs"),Store=require("./Store-B96mD8mD.cjs"),ticker_index=require("./index-BoGx2BWX.cjs"),math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs");var _maxFPS,_order,_culling,_delay,_delayTimeoutId,_isRunning,_direction,_target,_min,_max,_from,_tmpSetValue,_Animation_instances,setTarget_fn,_animationFrameListener,clearDelayTimeout_fn;const _Animation=class _Animation extends Store.Store{constructor(initial,options){super(initial||0,options);__privateAdd(this,_Animation_instances);__privateAdd(this,_maxFPS);__privateAdd(this,_order,order_index.TICK_ORDER.ANIMATION);__privateAdd(this,_culling);__privateAdd(this,_delay,0);__privateAdd(this,_delayTimeoutId,null);__privateAdd(this,_isRunning,new Store.Store(!1));__privateAdd(this,_direction,0);__privateAdd(this,_target,0);__privateAdd(this,_min,-1/0);__privateAdd(this,_max,1/0);__privateAdd(this,_from,0);__privateAdd(this,_tmpSetValue,null);__privateAdd(this,_animationFrameListener,__name(e=>{this.handleAnimationFrame(e)},"#animationFrameListener"));__privateSet(this,_target,this.current)}get direction(){return __privateGet(this,_direction)}get target(){return __privateGet(this,_target)}get min(){return __privateGet(this,_min)}set min(value){__privateSet(this,_min,value),this.set(__privateGet(this,_target),{equalize:!0})}get max(){return __privateGet(this,_max)}set max(value){__privateSet(this,_max,value),this.set(__privateGet(this,_target),{equalize:!0})}get from(){return __privateGet(this,_from)}get isRunning(){return __privateGet(this,_isRunning)}get delta(){return Math.abs(__privateGet(this,_target)-__privateGet(this,_from))}get deltaProgress(){return this.delta?number.preciseNumber(Math.abs(this.current-__privateGet(this,_from))/this.delta,6):0}get distance(){return Math.abs(__privateGet(this,_max)-__privateGet(this,_min))}get distanceProgress(){return this.distance?number.preciseNumber(Math.abs(this.current-__privateGet(this,_min))/this.distance,6):0}set(value,options){(__privateGet(this,_target)!==value||options!=null&&options.restart)&&(__privateSet(this,_tmpSetValue,value),this.updateOptions(options),__privateSet(this,_tmpSetValue,null),__privateGet(this,_target)!==this.current&&this.start())}shift(value,options){this.set(__privateGet(this,_target)+value,options)}reset(){super.reset(),__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.set(this.initial,{equalize:!0})}close(){super.close(),__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){__privateGet(this,_isRunning).current||(__privateGet(this,_isRunning).current=!0,ticker_index.ticker.subscribe(__privateGet(this,_animationFrameListener),{maxFPS:__privateGet(this,_maxFPS),order:__privateGet(this,_order),culling:__privateGet(this,_culling)}))}unlistenAnimationFrame(){__privateGet(this,_isRunning).current&&(__privateGet(this,_isRunning).current=!1,ticker_index.ticker.unsubscribe(__privateGet(this,_animationFrameListener)))}updateOptions(options){__privateSet(this,_maxFPS,polyfills.nullishCoalescing(options==null?void 0:options.maxFPS,__privateGet(this,_maxFPS))),__privateSet(this,_order,polyfills.nullishCoalescing(options==null?void 0:options.order,__privateGet(this,_order))),__privateSet(this,_culling,polyfills.nullishCoalescing(options==null?void 0:options.culling,__privateGet(this,_culling))),__privateSet(this,_min,polyfills.nullishCoalescing(options==null?void 0:options.min,__privateGet(this,_min))),__privateSet(this,_max,polyfills.nullishCoalescing(options==null?void 0:options.max,__privateGet(this,_max))),__privateSet(this,_delay,polyfills.nullishCoalescing(options==null?void 0:options.delay,__privateGet(this,_delay))),__privateMethod(this,_Animation_instances,setTarget_fn).call(this,typeof __privateGet(this,_tmpSetValue)=="number"?__privateGet(this,_tmpSetValue):__privateGet(this,_target)),options!=null&&options.equalize&&!(options!=null&&options.restart)&&(__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.unlistenAnimationFrame(),this.current=__privateSet(this,_from,__privateGet(this,_target))),options!=null&&options.restart&&(__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),this.unlistenAnimationFrame(),this.current=__privateSet(this,_from,this.initial),options!=null&&options.equalize&&(this.current=__privateSet(this,_from,__privateGet(this,_target)))),typeof(options==null?void 0:options.current)=="number"&&__privateSet(this,_from,this.current=options.current)}start(){__privateMethod(this,_Animation_instances,clearDelayTimeout_fn).call(this),__privateGet(this,_delay)>0?__privateSet(this,_delayTimeoutId,window.setTimeout(()=>{__privateSet(this,_delayTimeoutId,null),this.listenAnimationFrame()},__privateGet(this,_delay))):this.listenAnimationFrame()}};_maxFPS=new WeakMap,_order=new WeakMap,_culling=new WeakMap,_delay=new WeakMap,_delayTimeoutId=new WeakMap,_isRunning=new WeakMap,_direction=new WeakMap,_target=new WeakMap,_min=new WeakMap,_max=new WeakMap,_from=new WeakMap,_tmpSetValue=new WeakMap,_Animation_instances=new WeakSet,setTarget_fn=__name(function(value){const direction=Math.sign(value-__privateGet(this,_target));__privateSet(this,_target,math.clamp(value,__privateGet(this,_min),__privateGet(this,_max))),__privateSet(this,_direction,direction),__privateSet(this,_from,this.current)},"#setTarget"),_animationFrameListener=new WeakMap,clearDelayTimeout_fn=__name(function(){__privateGet(this,_delayTimeoutId)!==null&&(window.clearTimeout(__privateGet(this,_delayTimeoutId)),__privateSet(this,_delayTimeoutId,null))},"#clearDelayTimeout"),__name(_Animation,"Animation");let Animation=_Animation;exports.Animation=Animation;
|
|
@@ -105,7 +105,8 @@ const _Animation = class _Animation extends Store {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
_maxFPS = new WeakMap(), _order = new WeakMap(), _culling = new WeakMap(), _delay = new WeakMap(), _delayTimeoutId = new WeakMap(), _isRunning = new WeakMap(), _direction = new WeakMap(), _target = new WeakMap(), _min = new WeakMap(), _max = new WeakMap(), _from = new WeakMap(), _tmpSetValue = new WeakMap(), _Animation_instances = new WeakSet(), setTarget_fn = /* @__PURE__ */ __name(function(value) {
|
|
108
|
-
|
|
108
|
+
const direction = Math.sign(value - __privateGet(this, _target));
|
|
109
|
+
__privateSet(this, _target, clamp(value, __privateGet(this, _min), __privateGet(this, _max))), __privateSet(this, _direction, direction), __privateSet(this, _from, this.current);
|
|
109
110
|
}, "#setTarget"), _animationFrameListener = new WeakMap(), clearDelayTimeout_fn = /* @__PURE__ */ __name(function() {
|
|
110
111
|
__privateGet(this, _delayTimeoutId) !== null && (window.clearTimeout(__privateGet(this, _delayTimeoutId)), __privateSet(this, _delayTimeoutId, null));
|
|
111
112
|
}, "#clearDelayTimeout"), __name(_Animation, "Animation");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-CS32dwF1.cjs");require("construct-style-sheets-polyfill");require("./index-BoGx2BWX.cjs");var _velocity,_speed;const _Damped=class _Damped extends Animation.Animation{constructor(initial,options){super(initial,options);__privateAdd(this,_velocity);__privateAdd(this,_speed);this.damping=20,this.stiffness=0,this.mass=0,__privateSet(this,_velocity,0),__privateSet(this,_speed,0),this.updateOptions(__spreadProps(__spreadValues({},options),{equalize:!0}))}get velocity(){return __privateGet(this,_velocity)}get speed(){return __privateGet(this,_speed)}updateOptions(options){this.damping=polyfills.nullishCoalescing(options==null?void 0:options.damping,this.damping),this.mass=polyfills.nullishCoalescing(options==null?void 0:options.mass,this.mass),this.stiffness=polyfills.nullishCoalescing(options==null?void 0:options.stiffness,this.stiffness),super.updateOptions(options)}handleAnimationFrame(e){number.preciseNumber(this.current,6)===number.preciseNumber(this.target,6)&&(this.unlistenAnimationFrame(),this.current=this.target);const current=this.current,delta=Math.abs(current-this.target);__privateSet(this,_speed,delta/e.timeBetweenFrames);const dt=e.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const acceleration=(this.target-this.current)*this.stiffness-__privateGet(this,_velocity)*this.damping;__privateSet(this,_velocity,__privateGet(this,_velocity)+acceleration/this.mass*dt),this.current+=__privateGet(this,_velocity)*dt}else this.current=math.damp(this.current,this.target,this.damping,dt)}};_velocity=new WeakMap,_speed=new WeakMap,__name(_Damped,"Damped");let Damped=_Damped;exports.Damped=Damped;
|
|
@@ -18,7 +18,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
18
18
|
import { d as damp } from "./math-r8V23YFe.js";
|
|
19
19
|
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
20
20
|
import { n as nullishCoalescing } from "./polyfills-CG1XJNia.js";
|
|
21
|
-
import { A as Animation } from "./Animation-
|
|
21
|
+
import { A as Animation } from "./Animation-DwOegoQA.js";
|
|
22
22
|
import "construct-style-sheets-polyfill";
|
|
23
23
|
import "./index-DAG0CtYo.js";
|
|
24
24
|
var _velocity, _speed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-B96mD8mD.cjs"),dom=require("./dom-B40i6NXw.cjs"),ticker_index=require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const Tweened=require("./Tweened--KJh27xY.cjs"),gestures=require("./gestures-DtYbQr49.cjs"),number=require("./number-Bu4sGvW7.cjs"),order_index=require("./order/index.cjs"),notifier_index=require("./notifier/index.cjs");var _changeEvent;const _Controls=class _Controls{constructor(){__privateAdd(this,_changeEvent,new notifier_index.Notifier)}get changeEvent(){return __privateGet(this,_changeEvent)}};_changeEvent=new WeakMap,__name(_Controls,"Controls");let Controls=_Controls;var _element,_dimensionElement,_dimension,_keydownListener;const _KeyboardControls=class _KeyboardControls extends Controls{constructor(options){super();__privateAdd(this,_element,null);__privateAdd(this,_dimensionElement,null);__privateAdd(this,_dimension,"offsetHeight");__privateAdd(this,_keydownListener,__name(e=>{const dir=e.shiftKey?-1:1;let value;e.code==="Space"?value=dir*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.4:e.code==="ArrowLeft"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowRight"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="PageUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="PageDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="Home"?value=0:e.code==="End"&&(value=__privateGet(this,_dimension)==="offsetWidth"?__privateGet(this,_dimensionElement).scrollWidth:__privateGet(this,_dimensionElement).scrollHeight),value&&(e.stopPropagation(),this.changeEvent.notify("keyboard",value,e))},"#keydownListener"));Store.isBrowser&&(__privateSet(this,_element,options!=null&&options.element&&dom.getElement(options.element)||window),__privateSet(this,_dimensionElement,__privateGet(this,_element)instanceof HTMLElement?__privateGet(this,_element):document.documentElement),this.dimension=options==null?void 0:options.dimension)}set dimension(value){__privateSet(this,_dimension,value==="width"?"offsetWidth":"offsetHeight")}connect(){Store.isBrowser&&__privateGet(this,_element).addEventListener("keydown",__privateGet(this,_keydownListener))}disconnect(){Store.isBrowser&&__privateGet(this,_element).removeEventListener("keydown",__privateGet(this,_keydownListener))}};_element=new WeakMap,_dimensionElement=new WeakMap,_dimension=new WeakMap,_keydownListener=new WeakMap,__name(_KeyboardControls,"KeyboardControls");let KeyboardControls=_KeyboardControls;var _speed,_interval,_options,_intervalId,_paused,_pauseTimeoutId,_connected,_isIntersecting,_AutoplayControls_instances,setup_fn,clear_fn,startInterval_fn,_animationFrameCallback,_intervalCallback,_documentVisibilityChangeListener,_intersectionListener;const _AutoplayControls=class _AutoplayControls extends Controls{constructor(options){super();__privateAdd(this,_AutoplayControls_instances);__privateAdd(this,_speed);__privateAdd(this,_interval);__privateAdd(this,_options);__privateAdd(this,_intervalId);__privateAdd(this,_paused);__privateAdd(this,_pauseTimeoutId);__privateAdd(this,_connected);__privateAdd(this,_isIntersecting);__privateAdd(this,_animationFrameCallback);__privateAdd(this,_intervalCallback);__privateAdd(this,_documentVisibilityChangeListener);__privateAdd(this,_intersectionListener);this.direction=1,__privateSet(this,_paused,new Tweened.Tweened(0,{easing:Tweened.easeInQuad})),__privateSet(this,_connected,!1),__privateSet(this,_isIntersecting,!1),__privateSet(this,_animationFrameCallback,e=>{__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",e.timeBetweenFrames*__privateGet(this,_speed)*this.direction*(1-__privateGet(this,_paused).current),e)}),__privateSet(this,_intervalCallback,()=>{__privateGet(this,_isIntersecting)&&__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",Math.sign(__privateGet(this,_speed))*this.direction*(1-__privateGet(this,_paused).current),null)}),__privateSet(this,_documentVisibilityChangeListener,()=>{__privateGet(this,_interval)&&(document.hidden?__privateGet(this,_paused).set(1,{equalize:!0}):__privateGet(this,_paused).set(0,{equalize:!0}))}),__privateSet(this,_intersectionListener,e=>{__privateSet(this,_isIntersecting,e.isIntersecting),__privateGet(this,_isIntersecting)?__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):clearInterval(__privateGet(this,_intervalId))}),__privateSet(this,_speed,(options==null?void 0:options.speed)||1),__privateSet(this,_interval,(options==null?void 0:options.interval)||!1),__privateSet(this,_options,options)}set interval(value){__privateSet(this,_interval,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}set speed(value){__privateSet(this,_speed,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}connect(){__privateGet(this,_connected)||(__privateSet(this,_connected,!0),__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this))}disconnect(){__privateGet(this,_connected)&&(__privateSet(this,_connected,!1),__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this))}pauseAndContinue(duration,instant){__privateGet(this,_connected)&&duration&&(clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).set(1,{duration:Math.min(duration,1e3),equalize:instant}),__privateSet(this,_pauseTimeoutId,setTimeout(()=>{__privateGet(this,_paused).set(0,{duration:Math.min(duration,5e3),equalize:instant})},duration)))}};_speed=new WeakMap,_interval=new WeakMap,_options=new WeakMap,_intervalId=new WeakMap,_paused=new WeakMap,_pauseTimeoutId=new WeakMap,_connected=new WeakMap,_isIntersecting=new WeakMap,_AutoplayControls_instances=new WeakSet,setup_fn=__name(function(){var _a,_b;__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this),__privateGet(this,_interval)?(_a=__privateGet(this,_options))!=null&&_a.culling?ticker_index.intersector.subscribe((_b=__privateGet(this,_options))==null?void 0:_b.culling,__privateGet(this,_intersectionListener)):__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):ticker_index.ticker.subscribe(__privateGet(this,_animationFrameCallback),__privateGet(this,_options)),document.addEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#setup"),clear_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),ticker_index.ticker.unsubscribe(__privateGet(this,_animationFrameCallback)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).close(),document.removeEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#clear"),startInterval_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),__privateSet(this,_intervalId,setInterval(__privateGet(this,_intervalCallback),Math.abs(__privateGet(this,_speed))))},"#startInterval"),_animationFrameCallback=new WeakMap,_intervalCallback=new WeakMap,_documentVisibilityChangeListener=new WeakMap,_intersectionListener=new WeakMap,__name(_AutoplayControls,"AutoplayControls");let AutoplayControls=_AutoplayControls;var _element2,_timeoutId,_prevEventDate,_wheelListener;const _WheelControls=class _WheelControls extends Controls{constructor(options){super();__privateAdd(this,_element2,null);__privateAdd(this,_timeoutId);__privateAdd(this,_prevEventDate);__privateAdd(this,_wheelListener,__name(event=>{let delta=0;const absY=Math.abs(event.deltaY),absX=Math.abs(event.deltaX);if(!(this.axis==="x"&&absY>absX||this.axis==="y"&&absX>absY)&&(event.preventDefault(),!(this.debounce&&this.axis==="x"&&absX<5||this.debounce&&this.axis==="y"&&absY<5)))if(delta=(this.axis==="max"?absX>absY?event.deltaX:event.deltaY:this.axis==="x"?event.deltaX:event.deltaY)*this.speed,event.stopPropagation(),this.debounce){const now=Date.now();if(now-__privateGet(this,_prevEventDate)>40&&(delta=100*Math.sign(delta)),__privateSet(this,_prevEventDate,now),Math.abs(delta)<100||__privateGet(this,_timeoutId))return;this.changeEvent.notify("wheel",delta,event),__privateSet(this,_timeoutId,setTimeout(()=>{__privateSet(this,_timeoutId,void 0)},80))}else this.changeEvent.notify("wheel",delta,event)},"#wheelListener"));this.axis=(options==null?void 0:options.axis)||"y",this.speed=(options==null?void 0:options.speed)||1,this.debounce=(options==null?void 0:options.debounce)||!1,__privateSet(this,_prevEventDate,Date.now()),Store.isBrowser&&__privateSet(this,_element2,options!=null&&options.element&&dom.getElement(options.element)||window)}connect(){Store.isBrowser&&__privateGet(this,_element2).addEventListener("wheel",__privateGet(this,_wheelListener),{passive:!1})}disconnect(){Store.isBrowser&&(__privateGet(this,_element2).removeEventListener("wheel",__privateGet(this,_wheelListener)),clearTimeout(__privateGet(this,_timeoutId)))}};_element2=new WeakMap,_timeoutId=new WeakMap,_prevEventDate=new WeakMap,_wheelListener=new WeakMap,__name(_WheelControls,"WheelControls");let WheelControls=_WheelControls;var _currentElement,_rootElement,_element3,_delta,_linkElements,_dragDelta,_linkClickListener,_pointerdownListener,_tickListener;const _DragControls=class _DragControls extends Controls{constructor(options){super();__privateAdd(this,_rootElement);__privateAdd(this,_element3);__privateAdd(this,_delta);__privateAdd(this,_linkElements);__privateAdd(this,_dragDelta);__privateAdd(this,_linkClickListener);__privateAdd(this,_pointerdownListener);__privateAdd(this,_tickListener);this.inertion=1,__privateSet(this,_rootElement,null),__privateSet(this,_element3,null),__privateSet(this,_delta,0),__privateSet(this,_linkElements,[]),__privateSet(this,_dragDelta,0),__privateSet(this,_linkClickListener,e=>{Math.abs(__privateGet(this,_dragDelta))>2&&e.preventDefault()}),__privateSet(this,_pointerdownListener,grabEvent=>{if(__privateSet(this,_dragDelta,0),__privateSet(this,_delta,0),grabEvent.button!==0||grabEvent.composedPath().find(p=>p instanceof HTMLElement&&p.hasAttribute("drag-dead-zone")))return;this.swipe||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener));let prev=grabEvent,okToNotify=!1;document.documentElement.classList.add("grabbing");let dx=0,dy=0,ddx=0,ddy=0;gestures.setupDrag(moveEvent=>{__privateGet(_DragControls,_currentElement)&&__privateGet(_DragControls,_currentElement)!==__privateGet(this,_element3)||(dx=prev.x-moveEvent.x,dy=prev.y-moveEvent.y,ddx=moveEvent.x-grabEvent.x,ddy=moveEvent.y-grabEvent.y,this.axis==="x"?(__privateSet(this,_dragDelta,ddx),__privateSet(this,_delta,dx)):(__privateSet(this,_dragDelta,ddy),__privateSet(this,_delta,dy)),prev=moveEvent,okToNotify=this.axis==="x"&&Math.abs(ddx)>Math.abs(ddy)||this.axis==="y"&&Math.abs(ddy)>Math.abs(ddx),okToNotify&&(document.documentElement.classList.add("dragging"),document.documentElement.classList.add("click-disabled"),__privateSet(_DragControls,_currentElement,__privateGet(this,_element3)),this.changeEvent.notify("drag",__privateGet(this,_delta),moveEvent)))},e=>{__privateSet(_DragControls,_currentElement,null),okToNotify&&(!this.swipe&&this.inertion?(__privateSet(this,_delta,__privateGet(this,_delta)*this.inertion),ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",__privateGet(this,_delta),e)),setTimeout(()=>{document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging"),document.documentElement.classList.remove("click-disabled")})})}),__privateSet(this,_tickListener,()=>{Math.floor(Math.abs(__privateGet(this,_delta)))||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateSet(this,_delta,__privateGet(this,_delta)*.95),__privateSet(this,_delta,number.preciseNumber(__privateGet(this,_delta),3)),this.changeEvent.notify("drag",__privateGet(this,_delta),null)}),this.axis=(options==null?void 0:options.axis)||"y",this.swipe=(options==null?void 0:options.swipe)||!1,Store.isBrowser&&(__privateSet(this,_element3,options!=null&&options.element&&dom.getElement(options.element)||document.documentElement),__privateSet(this,_rootElement,(options==null?void 0:options.rootElement)||__privateGet(this,_element3)))}connect(){Store.isBrowser&&(__privateSet(this,_linkElements,[...__privateGet(this,_rootElement).querySelectorAll("a")]),__privateGet(this,_linkElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).addEventListener("pointerdown",__privateGet(this,_pointerdownListener)))}disconnect(){Store.isBrowser&&(__privateGet(this,_linkElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).removeEventListener("pointerdown",__privateGet(this,_pointerdownListener)),ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)))}};_currentElement=new WeakMap,_rootElement=new WeakMap,_element3=new WeakMap,_delta=new WeakMap,_linkElements=new WeakMap,_dragDelta=new WeakMap,_linkClickListener=new WeakMap,_pointerdownListener=new WeakMap,_tickListener=new WeakMap,__name(_DragControls,"DragControls"),__privateAdd(_DragControls,_currentElement,null);let DragControls=_DragControls;exports.AutoplayControls=AutoplayControls;exports.Controls=Controls;exports.DragControls=DragControls;exports.KeyboardControls=KeyboardControls;exports.WheelControls=WheelControls;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-B96mD8mD.cjs"),dom=require("./dom-B40i6NXw.cjs"),ticker_index=require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const Tweened=require("./Tweened-BZoUkI7O.cjs"),gestures=require("./gestures-DtYbQr49.cjs"),number=require("./number-Bu4sGvW7.cjs"),order_index=require("./order/index.cjs"),notifier_index=require("./notifier/index.cjs");var _changeEvent;const _Controls=class _Controls{constructor(){__privateAdd(this,_changeEvent,new notifier_index.Notifier)}get changeEvent(){return __privateGet(this,_changeEvent)}};_changeEvent=new WeakMap,__name(_Controls,"Controls");let Controls=_Controls;var _element,_dimensionElement,_dimension,_keydownListener;const _KeyboardControls=class _KeyboardControls extends Controls{constructor(options){super();__privateAdd(this,_element,null);__privateAdd(this,_dimensionElement,null);__privateAdd(this,_dimension,"offsetHeight");__privateAdd(this,_keydownListener,__name(e=>{const dir=e.shiftKey?-1:1;let value;e.code==="Space"?value=dir*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.4:e.code==="ArrowLeft"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowRight"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="ArrowDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]*.2:e.code==="PageUp"?value=-1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="PageDown"?value=1*__privateGet(this,_dimensionElement)[__privateGet(this,_dimension)]:e.code==="Home"?value=0:e.code==="End"&&(value=__privateGet(this,_dimension)==="offsetWidth"?__privateGet(this,_dimensionElement).scrollWidth:__privateGet(this,_dimensionElement).scrollHeight),value&&(e.stopPropagation(),this.changeEvent.notify("keyboard",value,e))},"#keydownListener"));Store.isBrowser&&(__privateSet(this,_element,options!=null&&options.element&&dom.getElement(options.element)||window),__privateSet(this,_dimensionElement,__privateGet(this,_element)instanceof HTMLElement?__privateGet(this,_element):document.documentElement),this.dimension=options==null?void 0:options.dimension)}set dimension(value){__privateSet(this,_dimension,value==="width"?"offsetWidth":"offsetHeight")}connect(){Store.isBrowser&&__privateGet(this,_element).addEventListener("keydown",__privateGet(this,_keydownListener))}disconnect(){Store.isBrowser&&__privateGet(this,_element).removeEventListener("keydown",__privateGet(this,_keydownListener))}};_element=new WeakMap,_dimensionElement=new WeakMap,_dimension=new WeakMap,_keydownListener=new WeakMap,__name(_KeyboardControls,"KeyboardControls");let KeyboardControls=_KeyboardControls;var _speed,_interval,_options,_intervalId,_paused,_pauseTimeoutId,_connected,_isIntersecting,_AutoplayControls_instances,setup_fn,clear_fn,startInterval_fn,_animationFrameCallback,_intervalCallback,_documentVisibilityChangeListener,_intersectionListener;const _AutoplayControls=class _AutoplayControls extends Controls{constructor(options){super();__privateAdd(this,_AutoplayControls_instances);__privateAdd(this,_speed);__privateAdd(this,_interval);__privateAdd(this,_options);__privateAdd(this,_intervalId);__privateAdd(this,_paused);__privateAdd(this,_pauseTimeoutId);__privateAdd(this,_connected);__privateAdd(this,_isIntersecting);__privateAdd(this,_animationFrameCallback);__privateAdd(this,_intervalCallback);__privateAdd(this,_documentVisibilityChangeListener);__privateAdd(this,_intersectionListener);this.direction=1,__privateSet(this,_paused,new Tweened.Tweened(0,{easing:Tweened.easeInQuad})),__privateSet(this,_connected,!1),__privateSet(this,_isIntersecting,!1),__privateSet(this,_animationFrameCallback,e=>{__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",e.timeBetweenFrames*__privateGet(this,_speed)*this.direction*(1-__privateGet(this,_paused).current),e)}),__privateSet(this,_intervalCallback,()=>{__privateGet(this,_isIntersecting)&&__privateGet(this,_paused).current!==1&&this.changeEvent.notify("autoplay",Math.sign(__privateGet(this,_speed))*this.direction*(1-__privateGet(this,_paused).current),null)}),__privateSet(this,_documentVisibilityChangeListener,()=>{__privateGet(this,_interval)&&(document.hidden?__privateGet(this,_paused).set(1,{equalize:!0}):__privateGet(this,_paused).set(0,{equalize:!0}))}),__privateSet(this,_intersectionListener,e=>{__privateSet(this,_isIntersecting,e.isIntersecting),__privateGet(this,_isIntersecting)?__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):clearInterval(__privateGet(this,_intervalId))}),__privateSet(this,_speed,(options==null?void 0:options.speed)||1),__privateSet(this,_interval,(options==null?void 0:options.interval)||!1),__privateSet(this,_options,options)}set interval(value){__privateSet(this,_interval,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}set speed(value){__privateSet(this,_speed,value),__privateGet(this,_connected)&&__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this)}connect(){__privateGet(this,_connected)||(__privateSet(this,_connected,!0),__privateMethod(this,_AutoplayControls_instances,setup_fn).call(this))}disconnect(){__privateGet(this,_connected)&&(__privateSet(this,_connected,!1),__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this))}pauseAndContinue(duration,instant){__privateGet(this,_connected)&&duration&&(clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).set(1,{duration:Math.min(duration,1e3),equalize:instant}),__privateSet(this,_pauseTimeoutId,setTimeout(()=>{__privateGet(this,_paused).set(0,{duration:Math.min(duration,5e3),equalize:instant})},duration)))}};_speed=new WeakMap,_interval=new WeakMap,_options=new WeakMap,_intervalId=new WeakMap,_paused=new WeakMap,_pauseTimeoutId=new WeakMap,_connected=new WeakMap,_isIntersecting=new WeakMap,_AutoplayControls_instances=new WeakSet,setup_fn=__name(function(){var _a,_b;__privateMethod(this,_AutoplayControls_instances,clear_fn).call(this),__privateGet(this,_interval)?(_a=__privateGet(this,_options))!=null&&_a.culling?ticker_index.intersector.subscribe((_b=__privateGet(this,_options))==null?void 0:_b.culling,__privateGet(this,_intersectionListener)):__privateMethod(this,_AutoplayControls_instances,startInterval_fn).call(this):ticker_index.ticker.subscribe(__privateGet(this,_animationFrameCallback),__privateGet(this,_options)),document.addEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#setup"),clear_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),ticker_index.ticker.unsubscribe(__privateGet(this,_animationFrameCallback)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),clearTimeout(__privateGet(this,_pauseTimeoutId)),__privateGet(this,_paused).close(),document.removeEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))},"#clear"),startInterval_fn=__name(function(){clearInterval(__privateGet(this,_intervalId)),__privateSet(this,_intervalId,setInterval(__privateGet(this,_intervalCallback),Math.abs(__privateGet(this,_speed))))},"#startInterval"),_animationFrameCallback=new WeakMap,_intervalCallback=new WeakMap,_documentVisibilityChangeListener=new WeakMap,_intersectionListener=new WeakMap,__name(_AutoplayControls,"AutoplayControls");let AutoplayControls=_AutoplayControls;var _element2,_timeoutId,_prevEventDate,_wheelListener;const _WheelControls=class _WheelControls extends Controls{constructor(options){super();__privateAdd(this,_element2,null);__privateAdd(this,_timeoutId);__privateAdd(this,_prevEventDate);__privateAdd(this,_wheelListener,__name(event=>{let delta=0;const absY=Math.abs(event.deltaY),absX=Math.abs(event.deltaX);if(!(this.axis==="x"&&absY>absX||this.axis==="y"&&absX>absY)&&(event.preventDefault(),!(this.debounce&&this.axis==="x"&&absX<5||this.debounce&&this.axis==="y"&&absY<5)))if(delta=(this.axis==="max"?absX>absY?event.deltaX:event.deltaY:this.axis==="x"?event.deltaX:event.deltaY)*this.speed,event.stopPropagation(),this.debounce){const now=Date.now();if(now-__privateGet(this,_prevEventDate)>40&&(delta=100*Math.sign(delta)),__privateSet(this,_prevEventDate,now),Math.abs(delta)<100||__privateGet(this,_timeoutId))return;this.changeEvent.notify("wheel",delta,event),__privateSet(this,_timeoutId,setTimeout(()=>{__privateSet(this,_timeoutId,void 0)},80))}else this.changeEvent.notify("wheel",delta,event)},"#wheelListener"));this.axis=(options==null?void 0:options.axis)||"y",this.speed=(options==null?void 0:options.speed)||1,this.debounce=(options==null?void 0:options.debounce)||!1,__privateSet(this,_prevEventDate,Date.now()),Store.isBrowser&&__privateSet(this,_element2,options!=null&&options.element&&dom.getElement(options.element)||window)}connect(){Store.isBrowser&&__privateGet(this,_element2).addEventListener("wheel",__privateGet(this,_wheelListener),{passive:!1})}disconnect(){Store.isBrowser&&(__privateGet(this,_element2).removeEventListener("wheel",__privateGet(this,_wheelListener)),clearTimeout(__privateGet(this,_timeoutId)))}};_element2=new WeakMap,_timeoutId=new WeakMap,_prevEventDate=new WeakMap,_wheelListener=new WeakMap,__name(_WheelControls,"WheelControls");let WheelControls=_WheelControls;var _currentElement,_rootElement,_element3,_delta,_linkElements,_dragDelta,_linkClickListener,_pointerdownListener,_tickListener;const _DragControls=class _DragControls extends Controls{constructor(options){super();__privateAdd(this,_rootElement);__privateAdd(this,_element3);__privateAdd(this,_delta);__privateAdd(this,_linkElements);__privateAdd(this,_dragDelta);__privateAdd(this,_linkClickListener);__privateAdd(this,_pointerdownListener);__privateAdd(this,_tickListener);this.inertion=1,__privateSet(this,_rootElement,null),__privateSet(this,_element3,null),__privateSet(this,_delta,0),__privateSet(this,_linkElements,[]),__privateSet(this,_dragDelta,0),__privateSet(this,_linkClickListener,e=>{Math.abs(__privateGet(this,_dragDelta))>2&&e.preventDefault()}),__privateSet(this,_pointerdownListener,grabEvent=>{if(__privateSet(this,_dragDelta,0),__privateSet(this,_delta,0),grabEvent.button!==0||grabEvent.composedPath().find(p=>p instanceof HTMLElement&&p.hasAttribute("drag-dead-zone")))return;this.swipe||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener));let prev=grabEvent,okToNotify=!1;document.documentElement.classList.add("grabbing");let dx=0,dy=0,ddx=0,ddy=0;gestures.setupDrag(moveEvent=>{__privateGet(_DragControls,_currentElement)&&__privateGet(_DragControls,_currentElement)!==__privateGet(this,_element3)||(dx=prev.x-moveEvent.x,dy=prev.y-moveEvent.y,ddx=moveEvent.x-grabEvent.x,ddy=moveEvent.y-grabEvent.y,this.axis==="x"?(__privateSet(this,_dragDelta,ddx),__privateSet(this,_delta,dx)):(__privateSet(this,_dragDelta,ddy),__privateSet(this,_delta,dy)),prev=moveEvent,okToNotify=this.axis==="x"&&Math.abs(ddx)>Math.abs(ddy)||this.axis==="y"&&Math.abs(ddy)>Math.abs(ddx),okToNotify&&(document.documentElement.classList.add("dragging"),document.documentElement.classList.add("click-disabled"),__privateSet(_DragControls,_currentElement,__privateGet(this,_element3)),this.changeEvent.notify("drag",__privateGet(this,_delta),moveEvent)))},e=>{__privateSet(_DragControls,_currentElement,null),okToNotify&&(!this.swipe&&this.inertion?(__privateSet(this,_delta,__privateGet(this,_delta)*this.inertion),ticker_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",__privateGet(this,_delta),e)),setTimeout(()=>{document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging"),document.documentElement.classList.remove("click-disabled")})})}),__privateSet(this,_tickListener,()=>{Math.floor(Math.abs(__privateGet(this,_delta)))||ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)),__privateSet(this,_delta,__privateGet(this,_delta)*.95),__privateSet(this,_delta,number.preciseNumber(__privateGet(this,_delta),3)),this.changeEvent.notify("drag",__privateGet(this,_delta),null)}),this.axis=(options==null?void 0:options.axis)||"y",this.swipe=(options==null?void 0:options.swipe)||!1,Store.isBrowser&&(__privateSet(this,_element3,options!=null&&options.element&&dom.getElement(options.element)||document.documentElement),__privateSet(this,_rootElement,(options==null?void 0:options.rootElement)||__privateGet(this,_element3)))}connect(){Store.isBrowser&&(__privateSet(this,_linkElements,[...__privateGet(this,_rootElement).querySelectorAll("a")]),__privateGet(this,_linkElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).addEventListener("pointerdown",__privateGet(this,_pointerdownListener)))}disconnect(){Store.isBrowser&&(__privateGet(this,_linkElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_linkClickListener))}),__privateGet(this,_element3).removeEventListener("pointerdown",__privateGet(this,_pointerdownListener)),ticker_index.ticker.unsubscribe(__privateGet(this,_tickListener)))}};_currentElement=new WeakMap,_rootElement=new WeakMap,_element3=new WeakMap,_delta=new WeakMap,_linkElements=new WeakMap,_dragDelta=new WeakMap,_linkClickListener=new WeakMap,_pointerdownListener=new WeakMap,_tickListener=new WeakMap,__name(_DragControls,"DragControls"),__privateAdd(_DragControls,_currentElement,null);let DragControls=_DragControls;exports.AutoplayControls=AutoplayControls;exports.Controls=Controls;exports.DragControls=DragControls;exports.KeyboardControls=KeyboardControls;exports.WheelControls=WheelControls;
|
|
@@ -9,7 +9,7 @@ import { i as isBrowser } from "./Store-CAGUSjFX.js";
|
|
|
9
9
|
import { g as getElement } from "./dom-D8D-_9ty.js";
|
|
10
10
|
import { i as intersector, t as ticker } from "./index-DAG0CtYo.js";
|
|
11
11
|
import "construct-style-sheets-polyfill";
|
|
12
|
-
import { T as Tweened, e as easeInQuad } from "./Tweened-
|
|
12
|
+
import { T as Tweened, e as easeInQuad } from "./Tweened-DuJCwQl7.js";
|
|
13
13
|
import { s as setupDrag } from "./gestures-DmKKNnh4.js";
|
|
14
14
|
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
15
15
|
import { TICK_ORDER } from "./order/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-CS32dwF1.cjs"),linear=__name(t=>t,"linear"),easeInQuad=__name(t=>t*t,"easeInQuad"),easeOutQuad=__name(t=>t*(2-t),"easeOutQuad"),easeInOutQuad=__name(t=>t<.5?2*t*t:-1+(4-2*t)*t,"easeInOutQuad"),easeInCubic=__name(t=>t*t*t,"easeInCubic"),easeOutCubic=__name(t=>--t*t*t+1,"easeOutCubic"),easeInOutCubic=__name(t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,"easeInOutCubic"),easeInQuart=__name(t=>t*t*t*t,"easeInQuart"),easeOutQuart=__name(t=>1- --t*t*t*t,"easeOutQuart"),easeInOutQuart=__name(t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,"easeInOutQuart"),easeInQuint=__name(t=>t*t*t*t*t,"easeInQuint"),easeOutQuint=__name(t=>1+--t*t*t*t*t,"easeOutQuint"),easeInOutQuint=__name(t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t,"easeInOutQuint"),easeInExpo=__name(t=>t===0?0:2**(10*(t-1)),"easeInExpo"),easeOutExpo=__name(t=>t===1?1:1-2**(-10*t),"easeOutExpo"),easeInOutExpo=__name(t=>t===0||t===1?t:t<.5?.5*2**(10*2*(t-.5)):.5*(2-Math.abs(2**(-10*2*(t-.5)))),"easeInOutExpo"),easings={linear,easeInQuad,easeOutQuad,easeInOutQuad,easeInCubic,easeOutCubic,easeInOutCubic,easeInQuart,easeOutQuart,easeInOutQuart,easeInQuint,easeOutQuint,easeInOutQuint,easeInExpo,easeOutExpo,easeInOutExpo};var _easing,_duration;const _Tweened=class _Tweened extends Animation.Animation{constructor(initial,options){super(initial||0,options);__privateAdd(this,_easing,linear);__privateAdd(this,_duration,1e3);this.updateOptions(__spreadProps(__spreadValues({},options),{equalize:!0}))}updateOptions(options){super.updateOptions(options),__privateSet(this,_easing,typeof(options==null?void 0:options.easing)=="function"?options.easing:typeof(options==null?void 0:options.easing)=="string"?easings[options.easing]||easings.linear:__privateGet(this,_easing)),__privateSet(this,_duration,(options==null?void 0:options.duration)===!1?0:polyfills.nullishCoalescing(options==null?void 0:options.duration,__privateGet(this,_duration)))}handleAnimationFrame(e){const t=e.timeElapsedSinceSubscription/1e3/(__privateGet(this,_duration)/1e3)||0,et=__privateGet(this,_easing).call(this,math.clamp(t,0,1));this.current=number.preciseNumber(this.from+(this.target-this.from)*et,6),t>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),super.start()}};_easing=new WeakMap,_duration=new WeakMap,__name(_Tweened,"Tweened");let Tweened=_Tweened;exports.Tweened=Tweened;exports.easeInCubic=easeInCubic;exports.easeInExpo=easeInExpo;exports.easeInOutCubic=easeInOutCubic;exports.easeInOutExpo=easeInOutExpo;exports.easeInOutQuad=easeInOutQuad;exports.easeInOutQuart=easeInOutQuart;exports.easeInOutQuint=easeInOutQuint;exports.easeInQuad=easeInQuad;exports.easeInQuart=easeInQuart;exports.easeInQuint=easeInQuint;exports.easeOutCubic=easeOutCubic;exports.easeOutExpo=easeOutExpo;exports.easeOutQuad=easeOutQuad;exports.easeOutQuart=easeOutQuart;exports.easeOutQuint=easeOutQuint;exports.easings=easings;exports.linear=linear;
|
|
@@ -18,7 +18,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
18
18
|
import { c as clamp } from "./math-r8V23YFe.js";
|
|
19
19
|
import { p as preciseNumber } from "./number-DiVt2xnh.js";
|
|
20
20
|
import { n as nullishCoalescing } from "./polyfills-CG1XJNia.js";
|
|
21
|
-
import { A as Animation } from "./Animation-
|
|
21
|
+
import { A as Animation } from "./Animation-DwOegoQA.js";
|
|
22
22
|
const linear = /* @__PURE__ */ __name((t) => t, "linear"), easeInQuad = /* @__PURE__ */ __name((t) => t * t, "easeInQuad"), easeOutQuad = /* @__PURE__ */ __name((t) => t * (2 - t), "easeOutQuad"), easeInOutQuad = /* @__PURE__ */ __name((t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t, "easeInOutQuad"), easeInCubic = /* @__PURE__ */ __name((t) => t * t * t, "easeInCubic"), easeOutCubic = /* @__PURE__ */ __name((t) => --t * t * t + 1, "easeOutCubic"), easeInOutCubic = /* @__PURE__ */ __name((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1, "easeInOutCubic"), easeInQuart = /* @__PURE__ */ __name((t) => t * t * t * t, "easeInQuart"), easeOutQuart = /* @__PURE__ */ __name((t) => 1 - --t * t * t * t, "easeOutQuart"), easeInOutQuart = /* @__PURE__ */ __name((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t, "easeInOutQuart"), easeInQuint = /* @__PURE__ */ __name((t) => t * t * t * t * t, "easeInQuint"), easeOutQuint = /* @__PURE__ */ __name((t) => 1 + --t * t * t * t * t, "easeOutQuint"), easeInOutQuint = /* @__PURE__ */ __name((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t, "easeInOutQuint"), easeInExpo = /* @__PURE__ */ __name((t) => t === 0 ? 0 : 2 ** (10 * (t - 1)), "easeInExpo"), easeOutExpo = /* @__PURE__ */ __name((t) => t === 1 ? 1 : 1 - 2 ** (-10 * t), "easeOutExpo"), easeInOutExpo = /* @__PURE__ */ __name((t) => t === 0 || t === 1 ? t : t < 0.5 ? 0.5 * 2 ** (10 * 2 * (t - 0.5)) : 0.5 * (2 - Math.abs(2 ** (-10 * 2 * (t - 0.5)))), "easeInOutExpo"), easings = {
|
|
23
23
|
linear,
|
|
24
24
|
easeInQuad,
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-CS32dwF1.cjs"),Damped=require("../Damped-B_mVO810.cjs"),Tweened=require("../Tweened-BZoUkI7O.cjs");exports.Animation=Animation.Animation;exports.Damped=Damped.Damped;exports.Tweened=Tweened.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A } from "../Animation-
|
|
2
|
-
import { D } from "../Damped-
|
|
3
|
-
import { T } from "../Tweened-
|
|
1
|
+
import { A } from "../Animation-DwOegoQA.js";
|
|
2
|
+
import { D } from "../Damped-m3PWu4LD.js";
|
|
3
|
+
import { T } from "../Tweened-DuJCwQl7.js";
|
|
4
4
|
export {
|
|
5
5
|
A as Animation,
|
|
6
6
|
D as Damped,
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const DragControls=require("../DragControls-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const DragControls=require("../DragControls-Cwnszjzf.cjs");exports.AutoplayControls=DragControls.AutoplayControls;exports.Controls=DragControls.Controls;exports.DragControls=DragControls.DragControls;exports.KeyboardControls=DragControls.KeyboardControls;exports.WheelControls=DragControls.WheelControls;
|
package/lib/controls/index.js
CHANGED
package/lib/iframe/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const SourceElement=require("../SourceElement--dyBZ6T5.cjs");require("../window-resizer/index.cjs");const Store=require("../Store-B96mD8mD.cjs");require("../index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");var _iframeElement,_iframeLoadListener,_iframeErrorListener;const _IFrameElement=class _IFrameElement extends SourceElement.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});__privateAdd(this,_iframeElement,null);__privateAdd(this,_iframeLoadListener,__name(()=>{var _a,_b;(_b=(_a=this.consumerElement).onload)==null||_b.call(_a,new Event("load"))},"#iframeLoadListener"));__privateAdd(this,_iframeErrorListener,__name(()=>{var _a,_b;(_b=(_a=this.consumerElement).onload)==null||_b.call(_a,new Event("error"))},"#iframeErrorListener"))}createConsumer(){return document.createElement("div")}consumeSource(code){__privateGet(this,_iframeElement)&&(__privateGet(this,_iframeElement).onload=null,__privateGet(this,_iframeElement).onerror=null),this.consumerElement.innerHTML=(code==null?void 0:code.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",__privateSet(this,_iframeElement,this.consumerElement.querySelector("iframe")),__privateGet(this,_iframeElement)&&(__privateGet(this,_iframeElement).onload=__privateGet(this,_iframeLoadListener),__privateGet(this,_iframeElement).onerror=__privateGet(this,_iframeErrorListener))}};_iframeElement=new WeakMap,_iframeLoadListener=new WeakMap,_iframeErrorListener=new WeakMap,__name(_IFrameElement,"IFrameElement");let IFrameElement=_IFrameElement;Store.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",IFrameElement);exports.IFrameElement=IFrameElement;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const SourceElement=require("../SourceElement--dyBZ6T5.cjs");require("../window-resizer/index.cjs");const Store=require("../Store-B96mD8mD.cjs");require("../index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");var _iframeElement,_iframeLoadListener,_iframeErrorListener;const _IFrameElement=class _IFrameElement extends SourceElement.SourceElement{constructor(){super({sourceSetOptions:{mediaBuckets:!1}});__privateAdd(this,_iframeElement,null);__privateAdd(this,_iframeLoadListener,__name(()=>{var _a,_b;(_b=(_a=this.consumerElement).onload)==null||_b.call(_a,new Event("load"))},"#iframeLoadListener"));__privateAdd(this,_iframeErrorListener,__name(()=>{var _a,_b;(_b=(_a=this.consumerElement).onload)==null||_b.call(_a,new Event("error"))},"#iframeErrorListener"))}get iframeElement(){return __privateGet(this,_iframeElement)}createConsumer(){return document.createElement("div")}consumeSource(code){var _a;__privateGet(this,_iframeElement)&&(__privateGet(this,_iframeElement).onload=null,__privateGet(this,_iframeElement).onerror=null),this.consumerElement.innerHTML=(code==null?void 0:code.replace(/\\u003C/g,"<").replace(/\\u003E/g,">").replace(/\\"/g,'"'))||"",__privateSet(this,_iframeElement,this.consumerElement.querySelector("iframe")),(_a=__privateGet(this,_iframeElement))==null||_a.setAttribute("scrolling","none"),__privateGet(this,_iframeElement)&&(__privateGet(this,_iframeElement).onload=__privateGet(this,_iframeLoadListener),__privateGet(this,_iframeElement).onerror=__privateGet(this,_iframeErrorListener))}};_iframeElement=new WeakMap,_iframeLoadListener=new WeakMap,_iframeErrorListener=new WeakMap,__name(_IFrameElement,"IFrameElement");let IFrameElement=_IFrameElement;Store.isBrowser&&!customElements.get("e-iframe")&&customElements.define("e-iframe",IFrameElement);exports.IFrameElement=IFrameElement;
|
package/lib/iframe/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { SourceElement } from '../source';
|
|
|
2
2
|
export declare class IFrameElement extends SourceElement<HTMLElement> {
|
|
3
3
|
#private;
|
|
4
4
|
constructor();
|
|
5
|
+
get iframeElement(): HTMLIFrameElement | null;
|
|
5
6
|
protected createConsumer(): HTMLDivElement;
|
|
6
7
|
protected consumeSource(code: string | null): void;
|
|
7
8
|
}
|
package/lib/iframe/index.js
CHANGED
|
@@ -28,11 +28,15 @@ const _IFrameElement = class _IFrameElement extends SourceElement {
|
|
|
28
28
|
(_b = (_a = this.consumerElement).onload) == null || _b.call(_a, new Event("error"));
|
|
29
29
|
}, "#iframeErrorListener"));
|
|
30
30
|
}
|
|
31
|
+
get iframeElement() {
|
|
32
|
+
return __privateGet(this, _iframeElement);
|
|
33
|
+
}
|
|
31
34
|
createConsumer() {
|
|
32
35
|
return document.createElement("div");
|
|
33
36
|
}
|
|
34
37
|
consumeSource(code) {
|
|
35
|
-
|
|
38
|
+
var _a;
|
|
39
|
+
__privateGet(this, _iframeElement) && (__privateGet(this, _iframeElement).onload = null, __privateGet(this, _iframeElement).onerror = null), this.consumerElement.innerHTML = (code == null ? void 0 : code.replace(/\\u003C/g, "<").replace(/\\u003E/g, ">").replace(/\\"/g, '"')) || "", __privateSet(this, _iframeElement, this.consumerElement.querySelector("iframe")), (_a = __privateGet(this, _iframeElement)) == null || _a.setAttribute("scrolling", "none"), __privateGet(this, _iframeElement) && (__privateGet(this, _iframeElement).onload = __privateGet(this, _iframeLoadListener), __privateGet(this, _iframeElement).onerror = __privateGet(this, _iframeErrorListener));
|
|
36
40
|
}
|
|
37
41
|
};
|
|
38
42
|
_iframeElement = new WeakMap(), _iframeLoadListener = new WeakMap(), _iframeErrorListener = new WeakMap(), __name(_IFrameElement, "IFrameElement");
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __knownSymbol=(name,symbol)=>(symbol=Symbol[name])?symbol:Symbol.for("Symbol."+name),__typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});var __forAwait=(obj,it,method)=>(it=obj[__knownSymbol("asyncIterator")])?it.call(obj):(obj=obj[__knownSymbol("iterator")](),it={},method=(key,fn)=>(fn=obj[key])&&(it[key]=arg=>new Promise((yes,no,done)=>(arg=fn.call(obj,arg),done=arg.done,Promise.resolve(arg.value).then(value=>yes({value,done}),no)))),method("next"),method("return"),it);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),events=require("../events-UlGk63iC.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-BAlaPfiQ.cjs");require("construct-style-sheets-polyfill");require("../index-BoGx2BWX.cjs");const url=require("../url-D0rESDQq.cjs"),cssValueParser_index=require("../css-value-parser/index.cjs"),historyManager=require("../historyManager-C8A99Bvq.cjs"),_MorphAnnouncer=class _MorphAnnouncer extends HTMLElement{connectedCallback(){const attrs={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[key,value]of Object.entries(attrs))this.setAttribute(key,value)}};__name(_MorphAnnouncer,"MorphAnnouncer");let MorphAnnouncer=_MorphAnnouncer;Store.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",MorphAnnouncer);var _morph,_element,_MorphLink_instances,path_get,click_fn,_clickListener,_pointerListener;const _MorphLink=class _MorphLink{constructor(element,morph){__privateAdd(this,_MorphLink_instances);__privateAdd(this,_morph);__privateAdd(this,_element);__privateAdd(this,_clickListener,__name(e=>{e.preventDefault(),__privateMethod(this,_MorphLink_instances,click_fn).call(this)},"#clickListener"));__privateAdd(this,_pointerListener,__name(()=>{const revalidate=__privateGet(this,_element).hasAttribute("data-revalidate");__privateGet(this,_morph).prefetch(__privateGet(this,_MorphLink_instances,path_get),revalidate),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener))},"#pointerListener"));__privateSet(this,_morph,morph),__privateSet(this,_element,element),__privateGet(this,_element).addEventListener("click",__privateGet(this,_clickListener)),this.checkCurrent(location.href.replace(location.origin,"")),__privateGet(this,_element).hasAttribute("data-prefetch")&&__privateGet(this,_element).addEventListener("pointerenter",__privateGet(this,_pointerListener))}get element(){return __privateGet(this,_element)}checkCurrent(path){var _a,_b;const locationUrl=__privateGet(this,_morph).normalizePath(path),linkUrl=__privateGet(this,_morph).normalizePath(__privateGet(this,_MorphLink_instances,path_get));__privateGet(this,_element).hasAttribute("data-include")&&locationUrl.pathname.includes(linkUrl.pathname)?__privateGet(this,_element).classList.add("current"):linkUrl.pathname===locationUrl.pathname?__privateGet(this,_element).classList.add("current"):(_a=__privateGet(this,_element).getAttribute("data-associated-paths"))!=null&&_a.split(",").find(path2=>locationUrl.pathname.includes(path2))?__privateGet(this,_element).classList.add("current"):__privateGet(this,_element).classList.remove("current"),locationUrl.path===linkUrl.path?__privateGet(this,_element).classList.add("exact"):__privateGet(this,_element).classList.remove("exact");const[pathWithoutParams,pathParamsStr]=(_b=__privateGet(this,_MorphLink_instances,path_get).split("#")[0])==null?void 0:_b.split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search);let matchCounter=0;for(const[key]of locationParams)pathParams.has(key)&&locationParams.get(key)===pathParams.get(key)&&matchCounter++;matchCounter?(__privateGet(this,_element).classList.toggle("all-params-matched",locationParams.size===matchCounter),__privateGet(this,_element).classList.toggle("some-params-matched",locationParams.size!==matchCounter)):!locationParams.size&&__privateGet(this,_element).hasAttribute("data-match-no-params")?__privateGet(this,_element).classList.add("all-params-matched"):(__privateGet(this,_element).classList.remove("all-params-matched"),__privateGet(this,_element).classList.remove("some-params-matched"));for(const key in __privateGet(this,_element).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("match-param-")){const name=kebabKey.split("match-param-")[1],value=__privateGet(this,_element).dataset[key],className=`param-${name}-matched`;locationParams.has(name)&&locationParams.get(name)===value||!locationParams.has(name)&&(value===""||value==="*"||value==="all"||value==="any"||value==="vse")?__privateGet(this,_element).classList.add(className):__privateGet(this,_element).classList.remove(className)}}}destroy(){__privateGet(this,_element).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener)),__privateGet(this,_element).classList.remove("current","exact")}};_morph=new WeakMap,_element=new WeakMap,_MorphLink_instances=new WeakSet,path_get=__name(function(){const url2=new URL(__privateGet(this,_element).href);return __privateGet(this,_morph).normalizePath(url2.pathname+url2.search+url2.hash).path},"#path"),click_fn=__name(function(){var _a;if(document.documentElement.classList.contains("click-disabled"))return;if(__privateGet(this,_element).hasAttribute("data-back")&&__privateGet(this,_morph).previousURL)history.back();else{const historyAction=__privateGet(this,_element).getAttribute("data-history-action")||"push",centerScroll=__privateGet(this,_element).hasAttribute("data-center-scroll"),offsetScrollRawValue=getComputedStyle(__privateGet(this,_element)).getPropertyValue("--offset-scroll").trim(),offsetScroll=offsetScrollRawValue?cssValueParser_index.cssValueParser.parse(offsetScrollRawValue):void 0,scrollDuration=parseFloat(__privateGet(this,_element).getAttribute("data-scroll-duration")||"0")||void 0,scrollEasing=__privateGet(this,_element).getAttribute("data-scroll-easing")||void 0,revalidate=__privateGet(this,_element).hasAttribute("data-revalidate")||__privateGet(this,_element).hasAttribute("data-pagination-more-link")||__privateGet(this,_element).hasAttribute("data-pagination-set-link")||__privateGet(this,_element).hasAttribute("data-pagination-next-link")||__privateGet(this,_element).hasAttribute("data-pagination-prev-link"),keepSearchParameters=__privateGet(this,_element).hasAttribute("data-keep-search-parameters"),keepScrollPosition=__privateGet(this,_element).hasAttribute("data-keep-scroll-position")||__privateGet(this,_element).hasAttribute("data-pagination-more-link"),scrollBehaviour=__privateGet(this,_element).getAttribute("data-scroll-behaviour"),submorph=(_a=__privateGet(this,_element).getAttribute("data-submorph")||__privateGet(this,_element).getAttribute("data-submorph-append"))==null?void 0:_a.split(",").map(v=>v.trim()),clearState=__privateGet(this,_element).hasAttribute("data-clear-state");let path=__privateGet(this,_MorphLink_instances,path_get);if(__privateGet(this,_element).hasAttribute("data-toggle-params")){const[pathWithoutParams,pathParamsStr]=__privateGet(this,_MorphLink_instances,path_get).split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search),resultParams=new URLSearchParams;for(const[key]of pathParams)(!locationParams.has(key)||locationParams.has(key)&&locationParams.get(key)!==pathParams.get(key))&&resultParams.append(key,pathParams.get(key));if(__privateGet(this,_element).hasAttribute("data-merge-params"))for(const[key]of locationParams)pathParams.has(key)||resultParams.append(key,locationParams.get(key));path=`${pathWithoutParams}?${resultParams.toString()}`}__privateGet(this,_morph).navigate(path,{historyAction,centerScroll,offsetScroll,revalidate,keepSearchParameters,submorph,clearState,keepScrollPosition,scrollBehaviour,scrollDuration,scrollEasing,submorphAppend:__privateGet(this,_element).hasAttribute("data-submorph-append"),mergeParams:__privateGet(this,_element).hasAttribute("data-merge-params")&&!__privateGet(this,_element).hasAttribute("data-toggle-params"),detail:__privateGet(this,_element).getAttribute("data-detail"),removeParams:__privateGet(this,_element).getAttribute("data-remove-params")||void 0,scrollTo:__privateGet(this,_element).getAttribute("data-scroll-to")||void 0})}},"#click"),_clickListener=new WeakMap,_pointerListener=new WeakMap,__name(_MorphLink,"MorphLink");let MorphLink=_MorphLink;var _element2,_params,_MorphParamsDependent_instances,update_fn,_urlChangeListener;const _MorphParamsDependent=class _MorphParamsDependent{constructor(element){__privateAdd(this,_MorphParamsDependent_instances);__privateAdd(this,_element2);__privateAdd(this,_params,[]);__privateAdd(this,_urlChangeListener,__name(()=>{__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)},"#urlChangeListener"));__privateSet(this,_element2,element);for(const key in __privateGet(this,_element2).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("param-")){const name=kebabKey.split("param-")[1],value=__privateGet(this,_element2).dataset[key];__privateGet(this,_params).push({name,value})}}document.addEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener)),__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener))}};_element2=new WeakMap,_params=new WeakMap,_MorphParamsDependent_instances=new WeakSet,update_fn=__name(function(){const locationParams=new URLSearchParams(location.search);let matched=!!__privateGet(this,_params).find(param=>locationParams.has(param.name)&&(locationParams.get(param.name)===param.value||param.value==="*"||param.value==="all"||param.value==="any"||param.value==="vse"||locationParams.get(param.name)==="*"||locationParams.get(param.name)==="all"||locationParams.get(param.name)==="any"||locationParams.get(param.name)==="vse"));!matched&&__privateGet(this,_element2).hasAttribute("data-match-no-params")&&(matched=!__privateGet(this,_params).filter(param=>locationParams.has(param.name)).length);const hideClass=__privateGet(this,_element2).getAttribute("data-hide-class");matched?hideClass?__privateGet(this,_element2).classList.remove(hideClass):__privateGet(this,_element2).style.display="":hideClass?__privateGet(this,_element2).classList.add(hideClass):__privateGet(this,_element2).style.display="none",requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("resize"))})},"#update"),_urlChangeListener=new WeakMap,__name(_MorphParamsDependent,"MorphParamsDependent");let MorphParamsDependent=_MorphParamsDependent;const domParser=new DOMParser;var _morph2,_pathname,_scrollState,_initialDocument,_modifiedDocument,_currentDocument,_savedState,_abortController,_fetching,_headers,_needRavalidation;const _MorphRoute=class _MorphRoute{constructor(morph,pathname){__privateAdd(this,_morph2);__privateAdd(this,_pathname);__privateAdd(this,_scrollState,{x:0,y:0});__privateAdd(this,_initialDocument,null);__privateAdd(this,_modifiedDocument,null);__privateAdd(this,_currentDocument,null);__privateAdd(this,_savedState,null);__privateAdd(this,_abortController,null);__privateAdd(this,_fetching,null);__privateAdd(this,_headers);__privateAdd(this,_needRavalidation,!1);__privateSet(this,_morph2,morph),__privateSet(this,_pathname,pathname)}get pathname(){return __privateGet(this,_pathname)}get scrollState(){return __privateGet(this,_scrollState)}get document(){return __privateGet(this,_currentDocument)}needRavalidation(){__privateSet(this,_needRavalidation,!0)}setHeaders(headers){__privateSet(this,_headers,headers)}setInitialDocument(document2){__privateSet(this,_initialDocument,document2.cloneNode(!0))}abort(){var _a;return(_a=__privateGet(this,_abortController))==null?void 0:_a.abort(`[${__privateGet(this,_pathname)}] page loading cancelled`)}fetch(path,currentPath,revalidate){return __async(this,null,function*(){var _a;if(!revalidate&&!__privateGet(this,_needRavalidation)){const shouldUseCache=((_a=__privateGet(this,_initialDocument))==null?void 0:_a.documentElement.getAttribute("data-cache"))&¤tPath!==path,isPopstateNavigation=__privateGet(this,_initialDocument)&&__privateGet(this,_morph2).isPopstateNavigation;if(__privateGet(this,_fetching)||shouldUseCache||isPopstateNavigation)return __privateGet(this,_fetching)}return __privateSet(this,_fetching,new Promise(res=>__async(this,null,function*(){try{__privateSet(this,_abortController,new AbortController);const text=yield(yield fetch(path,{signal:__privateGet(this,_abortController).signal,headers:__spreadValues({"X-MORPH":"true","X-MORPH-REVALIDATE":revalidate?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(currentPath),"X-MORPH-NEW-PATH":encodeURIComponent(path)},__privateGet(this,_headers))})).text(),document2=domParser.parseFromString(text,"text/html");this.setInitialDocument(document2),__privateSet(this,_needRavalidation,!1)}catch(e){console.warn(e)}finally{__privateSet(this,_abortController,null),__privateSet(this,_fetching,null),res()}}))),__privateGet(this,_fetching)})}cloneDocument(){__privateSet(this,_currentDocument,(__privateGet(this,_modifiedDocument)||__privateGet(this,_initialDocument)).cloneNode(!0))}get title(){let title="";if(__privateGet(this,_currentDocument).title)title=__privateGet(this,_currentDocument).title;else{const h1=__privateGet(this,_currentDocument).querySelector("h1");title=(h1==null?void 0:h1.innerText)||(h1==null?void 0:h1.textContent)||__privateGet(this,_pathname)}return title}clearScrollState(){__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0}clearDocumentState(){__privateSet(this,_modifiedDocument,null)}saveScrollState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-scroll-restoration")?(__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0):(__privateGet(this,_scrollState).x=__privateGet(this,_morph2).scrollValue.left,__privateGet(this,_scrollState).y=__privateGet(this,_morph2).scrollValue.top)}restoreScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:__privateGet(this,_scrollState).y,left:__privateGet(this,_scrollState).x,behavior:"instant"})}saveDocumentState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-page-restoration")?__privateSet(this,_modifiedDocument,null):__privateSet(this,_modifiedDocument,document.cloneNode(!0))}renewScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(state){__privateSet(this,_savedState,state)}clearState(){const state=__privateGet(this,_savedState);return __privateSet(this,_savedState,null),state}};_morph2=new WeakMap,_pathname=new WeakMap,_scrollState=new WeakMap,_initialDocument=new WeakMap,_modifiedDocument=new WeakMap,_currentDocument=new WeakMap,_savedState=new WeakMap,_abortController=new WeakMap,_fetching=new WeakMap,_headers=new WeakMap,_needRavalidation=new WeakMap,__name(_MorphRoute,"MorphRoute");let MorphRoute=_MorphRoute;var _options,_morphElements,_links,_candidateURL,_currentURL,_previousURL,_promises,_isPopstateNavigation,_currentScrollElement,_isWindowScroll,_routes,_paramDependent,_announcer,_currentScrollX,_currentScrollY,_lastSubmorph,_lastRevalidate,_lastKeepScrollPosition,_checkLink,_Morph_instances,getRoute_fn,getMorphElements_fn,isElementEmitsLoadEvent_fn,updateCurrentScrollElement_fn,tryScrollToElement_fn,_popStateListener,_scrollListener;const _Morph=class _Morph{constructor(parameters){__privateAdd(this,_Morph_instances);__privateAdd(this,_options,null);__privateAdd(this,_morphElements,null);__privateAdd(this,_links,[]);__privateAdd(this,_candidateURL);__privateAdd(this,_currentURL,null);__privateAdd(this,_previousURL);__privateAdd(this,_promises,[]);__privateAdd(this,_isPopstateNavigation,!1);__privateAdd(this,_currentScrollElement,null);__privateAdd(this,_isWindowScroll,!1);__privateAdd(this,_routes,new Map);__privateAdd(this,_paramDependent,[]);__privateAdd(this,_announcer,null);__privateAdd(this,_currentScrollX,0);__privateAdd(this,_currentScrollY,0);__privateAdd(this,_lastSubmorph);__privateAdd(this,_lastRevalidate);__privateAdd(this,_lastKeepScrollPosition);__privateAdd(this,_checkLink,__name(element=>{var _a,_b;return(((_a=element.getAttribute("href"))==null?void 0:_a.startsWith("/"))||((_b=element.getAttribute("href"))==null?void 0:_b.startsWith("?")))&&!element.hasAttribute("download")&&!element.hasAttribute("data-morph-skip")&&!element.closest("[data-morph-skip]")&&element.getAttribute("target")!=="_blank"},"#checkLink"));__privateAdd(this,_popStateListener,__name(event=>__async(this,null,function*(){var _a,_b,_c,_d;(_b=(_a=event.state)==null?void 0:_a.data)!=null&&_b.popover||(_d=(_c=event.previousState)==null?void 0:_c.data)!=null&&_d.popover||(__privateSet(this,_isPopstateNavigation,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:__privateGet(this,_lastRevalidate)?void 0:__privateGet(this,_lastSubmorph),revalidate:__privateGet(this,_lastRevalidate),keepScrollPosition:__privateGet(this,_lastKeepScrollPosition)}),__privateSet(this,_isPopstateNavigation,!1))}),"#popStateListener"));__privateAdd(this,_scrollListener,__name(()=>{const{left,top}=this.scrollValue,directionY=top-__privateGet(this,_currentScrollY),directionX=left-__privateGet(this,_currentScrollX);__privateSet(this,_currentScrollY,top),__privateSet(this,_currentScrollX,left),document.documentElement.classList.toggle("scroll-y",top>0),document.documentElement.classList.toggle("scroll-x",left>0),document.documentElement.classList.toggle("scroll-y-forward",directionY>0),document.documentElement.classList.toggle("scroll-y-backward",directionY<0),document.documentElement.classList.toggle("scroll-x-forward",directionX>0),document.documentElement.classList.toggle("scroll-x-backward",directionX<0),events.dispatchEvent(document,"morphScroll",{detail:{left,top}})},"#scrollListener"));if(Store.isBrowser&&!_Morph.instance){_Morph.instance=this,__privateSet(this,_options,{base:url.normalizeBase(parameters==null?void 0:parameters.base),waitForHeadToLoad:(parameters==null?void 0:parameters.waitForHeadToLoad)!==!1,trailingSlash:(parameters==null?void 0:parameters.trailingSlash)||!1,scrollSelector:parameters==null?void 0:parameters.scrollSelector,morphInsideScrollContainer:(parameters==null?void 0:parameters.morphInsideScrollContainer)||!1}),__privateSet(this,_morphElements,__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,document.body));const normalizedURL=this.normalizePath(location.pathname+location.search+location.hash);__privateSet(this,_currentURL,normalizedURL);const initialRoute=new MorphRoute(this,__privateGet(this,_currentURL).pathname);initialRoute.setInitialDocument(document),__privateGet(this,_routes).set(__privateGet(this,_currentURL).pathname,initialRoute),document.documentElement.setAttribute("data-current-pathname",__privateGet(this,_currentURL).pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),this.findLinks(),this.findParamsDependent(),historyManager.historyManager.addPopStateHandler(__privateGet(this,_popStateListener)),historyManager.historyManager.__change({action:"replace",pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),__privateSet(this,_announcer,new MorphAnnouncer),__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,document)}}get currentURL(){return __privateGet(this,_currentURL)}get previousURL(){return __privateGet(this,_previousURL)}get links(){return __privateGet(this,_links)}get scrollElement(){return __privateGet(this,_currentScrollElement)}get isPopstateNavigation(){return __privateGet(this,_isPopstateNavigation)}get scrollValue(){let top=0,left=0;return __privateGet(this,_isWindowScroll)?(top=window.scrollY,left=window.scrollX):(top=__privateGet(this,_currentScrollElement).scrollTop,left=__privateGet(this,_currentScrollElement).scrollLeft),{top,left}}get isNavigating(){return!!__privateGet(this,_promises).length}saveState(state){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);route&&route.saveState(state)}getState(){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);return route==null?void 0:route.clearState()}normalizePath(path,options){return url.splitPath(path,{base:__privateGet(this,_options).base,trailingSlash:__privateGet(this,_options).trailingSlash,mergeParams:options!=null&&options.mergeParams?location.search:"",removeParams:options==null?void 0:options.removeParams})}prefetch(path,revalidate){return __async(this,null,function*(){var _a;if(__privateGet(this,_promises).length)return;path=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path;const route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,path);route==null||route.fetch(path,__privateGet(this,_currentURL).path,revalidate)})}excludeHeadChild(child){return!1}needRavalidation(path){const normalizedURL=this.normalizePath(path),route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.path);route==null||route.needRavalidation()}navigate(_0){return __async(this,arguments,function*(path,{historyAction="push",centerScroll,offsetScroll,scrollDuration,scrollEasing,scrollBehaviour,revalidate,keepSearchParameters,submorph,submorphAppend,clearState,keepScrollPosition,mergeParams,removeParams,detail,scrollTo}={}){var _a,_b,_c,_d;if(__privateGet(this,_promises).length)return;__privateSet(this,_lastSubmorph,submorph),__privateSet(this,_lastRevalidate,revalidate),__privateSet(this,_lastKeepScrollPosition,keepScrollPosition);const modifiedPath=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path,normalizedURL=this.normalizePath(modifiedPath,{mergeParams,removeParams});if(!revalidate&&(((_b=__privateGet(this,_candidateURL))==null?void 0:_b.pathname)===normalizedURL.pathname||__privateGet(this,_currentURL).pathname===normalizedURL.pathname)){keepScrollPosition||__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo||normalizedURL.hash||0,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:"smooth"}),events.dispatchEvent(document,"morphSamePath",{detail:{detail}}),((_c=__privateGet(this,_currentURL))==null?void 0:_c.parameters)!==normalizedURL.parameters&&(__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL),historyManager.historyManager.__change({action:((_d=__privateGet(this,_currentURL))==null?void 0:_d.hash)!==normalizedURL.hash?"replace":historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),events.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:__privateGet(this,_currentURL),previousURL:__privateGet(this,_previousURL),detail}})),__privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});return}else __privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});__privateSet(this,_candidateURL,normalizedURL);try{let preprocessedSuccesfully=!0;if(this.preprocessor)try{yield new Promise((resolve,reject)=>{var _a2;(_a2=this.preprocessor)==null||_a2.call(this,{url:normalizedURL,resolve,reject,submorph,detail})})}catch(e){e?console.error(e):console.log("Route change canceled"),preprocessedSuccesfully=!1}if(!preprocessedSuccesfully||__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}const navigationEntry={url:normalizedURL,submorph,detail};submorph?submorphAppend||submorph.forEach(sel=>{document.querySelectorAll(sel).forEach(el=>{el.classList.add("out"),el.setAttribute("data-morph-out","")})}):__privateGet(this,_morphElements).forEach(el=>{var _a2,_b2;(_a2=el.firstElementChild)==null||_a2.classList.add("out"),(_b2=el.firstElementChild)==null||_b2.setAttribute("data-morph-out","")}),events.dispatchEvent(document,"morphNavigation",{detail:navigationEntry});const currentRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,__privateGet(this,_currentURL).pathname),nextRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.pathname);if(__privateGet(this,_routes).forEach(el=>{el.pathname!==normalizedURL.pathname&&el.abort()}),yield nextRoute==null?void 0:nextRoute.fetch(modifiedPath,__privateGet(this,_currentURL).path,revalidate),__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}currentRoute.clearState(),currentRoute.saveScrollState(),currentRoute.saveDocumentState(),(!__privateGet(this,_isPopstateNavigation)||revalidate)&&(nextRoute.clearScrollState(),nextRoute.clearDocumentState()),clearState&&nextRoute.clearState(),nextRoute.cloneDocument(),__privateGet(this,_announcer).textContent=nextRoute.title,document.body.appendChild(__privateGet(this,_announcer));const documentFetchedEntry=__spreadProps(__spreadValues({},navigationEntry),{document:nextRoute.document});submorphAppend||documentFetchedEntry.document.querySelectorAll("[data-morph-out]").forEach(el=>{el.classList.remove("out")}),events.dispatchEvent(document,"morphStart",{detail:documentFetchedEntry});const currentHeadChildren=Array.from(document.head.children),newHeadChildren=Array.from(nextRoute.document.head.children),identicalHeadChildren=dom.intersectElements(currentHeadChildren,newHeadChildren),removeHeadChildren=dom.excludeElements(currentHeadChildren,identicalHeadChildren),addHeadChildren=dom.excludeElements(newHeadChildren,identicalHeadChildren).filter(child=>!this.excludeHeadChild(child));addHeadChildren.forEach((child,index)=>{child.tagName==="SCRIPT"&&(addHeadChildren[index]=dom.createScriptElement(child))}),addHeadChildren.forEach(child=>{document.head.appendChild(child)});const elementsWithLoad=addHeadChildren.filter(child=>{if(child.hasAttribute("data-no-waiting"))return!1;if(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child))return!0});__privateGet(this,_options).waitForHeadToLoad&&elementsWithLoad.length&&(yield new Promise(res=>__async(this,null,function*(){let counter=0;try{for(var iter=__forAwait(elementsWithLoad),more,temp,error;more=!(temp=yield iter.next()).done;more=!1){const element=temp.value;element.onload=()=>{counter++,counter===elementsWithLoad.length&&res()}}}catch(temp){error=[temp]}finally{try{more&&(temp=iter.return)&&(yield temp.call(iter))}finally{if(error)throw error[0]}}}))),yield promises.wait(10);const oldElementsWithLoadEvent=[];submorphAppend||removeHeadChildren.forEach(child=>{child.hasAttribute("data-permanent")||(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child)?oldElementsWithLoadEvent.push(child):child.remove())});const newMorphElements=__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,nextRoute.document.body);!__privateGet(this,_options).morphInsideScrollContainer&&!submorph&&__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,nextRoute.document),document.documentElement.setAttribute("data-current-pathname",normalizedURL.pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),historyManager.historyManager.__change({action:historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters||(keepSearchParameters?location.search:""),hash:normalizedURL.hash}),__privateGet(this,_announcer).remove(),__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL);const morphedElements=[];__privateGet(this,_morphElements).forEach((morphElement,i)=>{const newMorphElement=newMorphElements[i],duration=getComputedStyle(morphElement).getPropertyValue("--morph-duration");let newMorphElementChildNodes=[],currentMorphElementChildNodes=[];submorph?(submorph.forEach(selector=>{const curSubMorphElement=morphElement.querySelector(selector),newSubMorphElement=newMorphElement.querySelector(selector);curSubMorphElement&&newSubMorphElement&&(currentMorphElementChildNodes.push(curSubMorphElement),newMorphElementChildNodes.push(newSubMorphElement))}),currentMorphElementChildNodes.forEach(el=>{el.parentElement&&morphedElements.push(el.parentElement)})):(newMorphElementChildNodes.push(...newMorphElement.childNodes),currentMorphElementChildNodes.push(...morphElement.childNodes),morphedElements.push(morphElement));const transfer=[];submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(this.destroyOldLinks(element),element.classList.add("old"),element.querySelectorAll("[data-morph-transfer]").forEach(el=>{const selector=el.getAttribute("data-morph-transfer");transfer.push({element:el,selector})}))}),newMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(transfer.forEach(item=>{const nestlement=element.querySelector(item.selector);nestlement&&nestlement.replaceWith(nextRoute.document.importNode(item.element,!0))}),this.findNewLinks(element),element.classList.add("new"))}),submorph?submorphAppend?newMorphElementChildNodes.forEach((el,i2)=>{currentMorphElementChildNodes[i2]instanceof HTMLElement&¤tMorphElementChildNodes[i2].append(...el.childNodes)}):newMorphElementChildNodes.forEach((el,i2)=>{var _a2;(_a2=currentMorphElementChildNodes[i2].parentElement)==null||_a2.insertBefore(el,currentMorphElementChildNodes[i2])}):morphElement.prepend(...newMorphElementChildNodes),setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&element.classList.add("old-idle")}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.setProperty("--new-content-height",element.offsetHeight+"px"),element.classList.add("new-idle"))})},0);const detail2=__spreadProps(__spreadValues({},documentFetchedEntry),{morphElement});events.dispatchEvent(document,"morphNewChildrenAdded",{detail:detail2});const promise=new Promise(res=>{setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(el=>{el.remove()}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.removeProperty("--new-content-height"),element.classList.remove("new-idle","new"))}),submorphAppend||events.dispatchEvent(document,"morphOldChildrenRemoved",{detail:detail2}),res()},(parseFloat(duration)||0)*1e3+10)});__privateGet(this,_promises).push(promise)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-nextRoute.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),events.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:nextRoute.scrollState}),scrollTo?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):normalizedURL.hash?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,normalizedURL.hash,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):__privateGet(this,_isPopstateNavigation)?nextRoute.restoreScrollPosition():keepScrollPosition||nextRoute.renewScrollPosition(),yield Promise.all(__privateGet(this,_promises)),submorphAppend||oldElementsWithLoadEvent.forEach(child=>child.remove()),__privateSet(this,_promises,[]),morphedElements.forEach(el=>{el.querySelectorAll("script").forEach(element=>{element.replaceWith(dom.createScriptElement(element))})}),__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)}),this.findParamsDependent(),events.dispatchEvent(document,"morphComplete",{detail:documentFetchedEntry}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(e){console.error(e)}__privateSet(this,_candidateURL,void 0)})}addLink(element){__privateGet(this,_links).push(new MorphLink(element,this))}addLinks(elements){elements.forEach(element=>{this.addLink(element)})}removeLink(element){__privateSet(this,_links,__privateGet(this,_links).filter(link=>link.element===element?(link.destroy(),!1):!0))}destroyOldLinks(morphElement){__privateSet(this,_links,__privateGet(this,_links).filter(link=>morphElement.contains(link.element)?(link.destroy(),!1):!0))}findNewLinks(morphElement){const linkElements=[...morphElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).push(...linkElements.map(element=>new MorphLink(element,this)))}findLinks(){const linkElements=[...document.documentElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).forEach(link=>link.destroy()),__privateSet(this,_links,linkElements.map(element=>new MorphLink(element,this)))}findParamsDependent(){const elements=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];__privateGet(this,_paramDependent).forEach(link=>link.destroy()),__privateSet(this,_paramDependent,elements.map(element=>new MorphParamsDependent(element)))}};_options=new WeakMap,_morphElements=new WeakMap,_links=new WeakMap,_candidateURL=new WeakMap,_currentURL=new WeakMap,_previousURL=new WeakMap,_promises=new WeakMap,_isPopstateNavigation=new WeakMap,_currentScrollElement=new WeakMap,_isWindowScroll=new WeakMap,_routes=new WeakMap,_paramDependent=new WeakMap,_announcer=new WeakMap,_currentScrollX=new WeakMap,_currentScrollY=new WeakMap,_lastSubmorph=new WeakMap,_lastRevalidate=new WeakMap,_lastKeepScrollPosition=new WeakMap,_checkLink=new WeakMap,_Morph_instances=new WeakSet,getRoute_fn=__name(function(path){const normalizedURL=this.normalizePath(path);let route=__privateGet(this,_routes).get(normalizedURL.pathname);return route||(route=new MorphRoute(this,normalizedURL.pathname),__privateGet(this,_routes).set(normalizedURL.pathname,route)),route},"#getRoute"),getMorphElements_fn=__name(function(el){const morphElements=[...el.querySelectorAll("[data-morph]")];return morphElements.length?morphElements:[el]},"#getMorphElements"),isElementEmitsLoadEvent_fn=__name(function(element){return element.tagName==="SCRIPT"||element.tagName==="STYLE"||element.tagName==="LINK"&&element.getAttribute("rel")==="stylesheet"},"#isElementEmitsLoadEvent"),updateCurrentScrollElement_fn=__name(function(document2){var _a,_b;(_a=__privateGet(this,_currentScrollElement))==null||_a.removeEventListener("scroll",__privateGet(this,_scrollListener)),__privateSet(this,_currentScrollY,0),__privateSet(this,_currentScrollX,0),__privateSet(this,_currentScrollElement,__privateGet(this,_options).scrollSelector&&document2.querySelector(__privateGet(this,_options).scrollSelector)||window),__privateSet(this,_isWindowScroll,__privateGet(this,_currentScrollElement)===window),(_b=__privateGet(this,_currentScrollElement))==null||_b.addEventListener("scroll",__privateGet(this,_scrollListener)),__privateGet(this,_scrollListener).call(this)},"#updateCurrentScrollElement"),tryScrollToElement_fn=__name(function(id,options){const value=typeof id=="string"?document.querySelector(id):id;(typeof value=="number"||value)&&scroll.scrollToElement(value,__spreadValues({scrollElement:__privateGet(this,_currentScrollElement)},options))},"#tryScrollToElement"),_popStateListener=new WeakMap,_scrollListener=new WeakMap,__name(_Morph,"Morph"),_Morph.instance=null;let Morph=_Morph;exports.Morph=Morph;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __knownSymbol=(name,symbol)=>(symbol=Symbol[name])?symbol:Symbol.for("Symbol."+name),__typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});var __forAwait=(obj,it,method)=>(it=obj[__knownSymbol("asyncIterator")])?it.call(obj):(obj=obj[__knownSymbol("iterator")](),it={},method=(key,fn)=>(fn=obj[key])&&(it[key]=arg=>new Promise((yes,no,done)=>(arg=fn.call(obj,arg),done=arg.done,Promise.resolve(arg.value).then(value=>yes({value,done}),no)))),method("next"),method("return"),it);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-B96mD8mD.cjs"),dom=require("../dom-B40i6NXw.cjs"),events=require("../events-UlGk63iC.cjs"),promises=require("../promises-nDm8_iG6.cjs"),scroll=require("../scroll-BWDLSP3i.cjs");require("construct-style-sheets-polyfill");require("../index-BoGx2BWX.cjs");const url=require("../url-D0rESDQq.cjs"),cssValueParser_index=require("../css-value-parser/index.cjs"),historyManager=require("../historyManager-C8A99Bvq.cjs"),_MorphAnnouncer=class _MorphAnnouncer extends HTMLElement{connectedCallback(){const attrs={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[key,value]of Object.entries(attrs))this.setAttribute(key,value)}};__name(_MorphAnnouncer,"MorphAnnouncer");let MorphAnnouncer=_MorphAnnouncer;Store.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",MorphAnnouncer);var _morph,_element,_MorphLink_instances,path_get,click_fn,_clickListener,_pointerListener;const _MorphLink=class _MorphLink{constructor(element,morph){__privateAdd(this,_MorphLink_instances);__privateAdd(this,_morph);__privateAdd(this,_element);__privateAdd(this,_clickListener,__name(e=>{e.preventDefault(),__privateMethod(this,_MorphLink_instances,click_fn).call(this)},"#clickListener"));__privateAdd(this,_pointerListener,__name(()=>{const revalidate=__privateGet(this,_element).hasAttribute("data-revalidate");__privateGet(this,_morph).prefetch(__privateGet(this,_MorphLink_instances,path_get),revalidate),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener))},"#pointerListener"));__privateSet(this,_morph,morph),__privateSet(this,_element,element),__privateGet(this,_element).addEventListener("click",__privateGet(this,_clickListener)),this.checkCurrent(location.href.replace(location.origin,"")),__privateGet(this,_element).hasAttribute("data-prefetch")&&__privateGet(this,_element).addEventListener("pointerenter",__privateGet(this,_pointerListener))}get element(){return __privateGet(this,_element)}checkCurrent(path){var _a,_b;const locationUrl=__privateGet(this,_morph).normalizePath(path),linkUrl=__privateGet(this,_morph).normalizePath(__privateGet(this,_MorphLink_instances,path_get));__privateGet(this,_element).hasAttribute("data-include")&&locationUrl.pathname.includes(linkUrl.pathname)?__privateGet(this,_element).classList.add("current"):linkUrl.pathname===locationUrl.pathname?__privateGet(this,_element).classList.add("current"):(_a=__privateGet(this,_element).getAttribute("data-associated-paths"))!=null&&_a.split(",").find(path2=>locationUrl.pathname.includes(path2))?__privateGet(this,_element).classList.add("current"):__privateGet(this,_element).classList.remove("current"),locationUrl.path===linkUrl.path?__privateGet(this,_element).classList.add("exact"):__privateGet(this,_element).classList.remove("exact");const[pathWithoutParams,pathParamsStr]=(_b=__privateGet(this,_MorphLink_instances,path_get).split("#")[0])==null?void 0:_b.split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search);let matchCounter=0;for(const[key]of locationParams)pathParams.has(key)&&locationParams.get(key)===pathParams.get(key)&&matchCounter++;matchCounter?(__privateGet(this,_element).classList.toggle("all-params-matched",locationParams.size===matchCounter),__privateGet(this,_element).classList.toggle("some-params-matched",locationParams.size!==matchCounter)):!locationParams.size&&__privateGet(this,_element).hasAttribute("data-match-no-params")?__privateGet(this,_element).classList.add("all-params-matched"):(__privateGet(this,_element).classList.remove("all-params-matched"),__privateGet(this,_element).classList.remove("some-params-matched"));for(const key in __privateGet(this,_element).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("match-param-")){const name=kebabKey.split("match-param-")[1],value=__privateGet(this,_element).dataset[key],className=`param-${name}-matched`;locationParams.has(name)&&locationParams.get(name)===value||!locationParams.has(name)&&(value===""||value==="*"||value==="all"||value==="any"||value==="vse")?__privateGet(this,_element).classList.add(className):__privateGet(this,_element).classList.remove(className)}}}destroy(){__privateGet(this,_element).removeEventListener("click",__privateGet(this,_clickListener)),__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerListener)),__privateGet(this,_element).classList.remove("current","exact")}};_morph=new WeakMap,_element=new WeakMap,_MorphLink_instances=new WeakSet,path_get=__name(function(){const url2=new URL(__privateGet(this,_element).href);return __privateGet(this,_morph).normalizePath(url2.pathname+url2.search+url2.hash).path},"#path"),click_fn=__name(function(){var _a;if(document.documentElement.classList.contains("click-disabled"))return;if(__privateGet(this,_element).hasAttribute("data-back")&&__privateGet(this,_morph).previousURL)history.back();else{const historyAction=__privateGet(this,_element).getAttribute("data-history-action")||"push",centerScroll=__privateGet(this,_element).hasAttribute("data-center-scroll"),offsetScrollRawValue=getComputedStyle(__privateGet(this,_element)).getPropertyValue("--offset-scroll").trim(),offsetScroll=offsetScrollRawValue?cssValueParser_index.cssValueParser.parse(offsetScrollRawValue):void 0,scrollDuration=parseFloat(__privateGet(this,_element).getAttribute("data-scroll-duration")||"0")||void 0,scrollEasing=__privateGet(this,_element).getAttribute("data-scroll-easing")||void 0,revalidate=__privateGet(this,_element).hasAttribute("data-revalidate")||__privateGet(this,_element).hasAttribute("data-pagination-more-link")||__privateGet(this,_element).hasAttribute("data-pagination-set-link")||__privateGet(this,_element).hasAttribute("data-pagination-next-link")||__privateGet(this,_element).hasAttribute("data-pagination-prev-link"),keepSearchParameters=__privateGet(this,_element).hasAttribute("data-keep-search-parameters"),keepScrollPosition=__privateGet(this,_element).hasAttribute("data-keep-scroll-position")||__privateGet(this,_element).hasAttribute("data-pagination-more-link"),scrollBehaviour=__privateGet(this,_element).getAttribute("data-scroll-behaviour"),submorph=(_a=__privateGet(this,_element).getAttribute("data-submorph")||__privateGet(this,_element).getAttribute("data-submorph-append"))==null?void 0:_a.split(",").map(v=>v.trim()),clearState=__privateGet(this,_element).hasAttribute("data-clear-state");let path=__privateGet(this,_MorphLink_instances,path_get);if(__privateGet(this,_element).hasAttribute("data-toggle-params")){const[pathWithoutParams,pathParamsStr]=__privateGet(this,_MorphLink_instances,path_get).split("?"),pathParams=new URLSearchParams(pathParamsStr),locationParams=new URLSearchParams(location.search),resultParams=new URLSearchParams;for(const[key]of pathParams)(!locationParams.has(key)||locationParams.has(key)&&locationParams.get(key)!==pathParams.get(key))&&resultParams.append(key,pathParams.get(key));if(__privateGet(this,_element).hasAttribute("data-merge-params"))for(const[key]of locationParams)pathParams.has(key)||resultParams.append(key,locationParams.get(key));path=`${pathWithoutParams}?${resultParams.toString()}`}__privateGet(this,_morph).navigate(path,{historyAction,centerScroll,offsetScroll,revalidate,keepSearchParameters,submorph,clearState,keepScrollPosition,scrollBehaviour,scrollDuration,scrollEasing,submorphAppend:__privateGet(this,_element).hasAttribute("data-submorph-append"),mergeParams:__privateGet(this,_element).hasAttribute("data-merge-params")&&!__privateGet(this,_element).hasAttribute("data-toggle-params"),detail:__privateGet(this,_element).getAttribute("data-detail"),removeParams:__privateGet(this,_element).getAttribute("data-remove-params")||void 0,scrollTo:__privateGet(this,_element).getAttribute("data-scroll-to")||void 0})}},"#click"),_clickListener=new WeakMap,_pointerListener=new WeakMap,__name(_MorphLink,"MorphLink");let MorphLink=_MorphLink;var _element2,_params,_MorphParamsDependent_instances,update_fn,_urlChangeListener;const _MorphParamsDependent=class _MorphParamsDependent{constructor(element){__privateAdd(this,_MorphParamsDependent_instances);__privateAdd(this,_element2);__privateAdd(this,_params,[]);__privateAdd(this,_urlChangeListener,__name(()=>{__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)},"#urlChangeListener"));__privateSet(this,_element2,element);for(const key in __privateGet(this,_element2).dataset){const kebabKey=Store.camelToKebab(key);if(kebabKey.startsWith("param-")){const name=kebabKey.split("param-")[1],value=__privateGet(this,_element2).dataset[key];__privateGet(this,_params).push({name,value})}}document.addEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener)),__privateMethod(this,_MorphParamsDependent_instances,update_fn).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",__privateGet(this,_urlChangeListener))}};_element2=new WeakMap,_params=new WeakMap,_MorphParamsDependent_instances=new WeakSet,update_fn=__name(function(){const locationParams=new URLSearchParams(location.search);let matched=!!__privateGet(this,_params).find(param=>locationParams.has(param.name)&&(locationParams.get(param.name)===param.value||param.value==="*"||param.value==="all"||param.value==="any"||param.value==="vse"||locationParams.get(param.name)==="*"||locationParams.get(param.name)==="all"||locationParams.get(param.name)==="any"||locationParams.get(param.name)==="vse"));!matched&&__privateGet(this,_element2).hasAttribute("data-match-no-params")&&(matched=!__privateGet(this,_params).filter(param=>locationParams.has(param.name)).length);const hideClass=__privateGet(this,_element2).getAttribute("data-hide-class");matched?hideClass?__privateGet(this,_element2).classList.remove(hideClass):__privateGet(this,_element2).style.display="":hideClass?__privateGet(this,_element2).classList.add(hideClass):__privateGet(this,_element2).style.display="none",requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("resize"))})},"#update"),_urlChangeListener=new WeakMap,__name(_MorphParamsDependent,"MorphParamsDependent");let MorphParamsDependent=_MorphParamsDependent;const domParser=new DOMParser;var _morph2,_pathname,_scrollState,_initialDocument,_modifiedDocument,_currentDocument,_savedState,_abortController,_fetching,_headers,_needRavalidation;const _MorphRoute=class _MorphRoute{constructor(morph,pathname){__privateAdd(this,_morph2);__privateAdd(this,_pathname);__privateAdd(this,_scrollState,{x:0,y:0});__privateAdd(this,_initialDocument,null);__privateAdd(this,_modifiedDocument,null);__privateAdd(this,_currentDocument,null);__privateAdd(this,_savedState,null);__privateAdd(this,_abortController,null);__privateAdd(this,_fetching,null);__privateAdd(this,_headers);__privateAdd(this,_needRavalidation,!1);__privateSet(this,_morph2,morph),__privateSet(this,_pathname,pathname)}get pathname(){return __privateGet(this,_pathname)}get scrollState(){return __privateGet(this,_scrollState)}get document(){return __privateGet(this,_currentDocument)}needRavalidation(){__privateSet(this,_needRavalidation,!0)}setHeaders(headers){__privateSet(this,_headers,headers)}setInitialDocument(document2){__privateSet(this,_initialDocument,document2.cloneNode(!0))}abort(){var _a;return(_a=__privateGet(this,_abortController))==null?void 0:_a.abort(`[${__privateGet(this,_pathname)}] page loading cancelled`)}fetch(path,currentPath,revalidate){return __async(this,null,function*(){var _a;if(!revalidate&&!__privateGet(this,_needRavalidation)){const shouldUseCache=((_a=__privateGet(this,_initialDocument))==null?void 0:_a.documentElement.getAttribute("data-cache"))&¤tPath!==path,isPopstateNavigation=__privateGet(this,_initialDocument)&&__privateGet(this,_morph2).isPopstateNavigation;if(__privateGet(this,_fetching)||shouldUseCache||isPopstateNavigation)return __privateGet(this,_fetching)}return __privateSet(this,_fetching,new Promise(res=>__async(this,null,function*(){try{__privateSet(this,_abortController,new AbortController);const text=yield(yield fetch(path,{signal:__privateGet(this,_abortController).signal,headers:__spreadValues({"X-MORPH":"true","X-MORPH-REVALIDATE":revalidate?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(currentPath),"X-MORPH-NEW-PATH":encodeURIComponent(path)},__privateGet(this,_headers))})).text(),document2=domParser.parseFromString(text,"text/html");this.setInitialDocument(document2),__privateSet(this,_needRavalidation,!1)}catch(e){console.warn(e)}finally{__privateSet(this,_abortController,null),__privateSet(this,_fetching,null),res()}}))),__privateGet(this,_fetching)})}cloneDocument(){__privateSet(this,_currentDocument,(__privateGet(this,_modifiedDocument)||__privateGet(this,_initialDocument)).cloneNode(!0))}get title(){let title="";if(__privateGet(this,_currentDocument).title)title=__privateGet(this,_currentDocument).title;else{const h1=__privateGet(this,_currentDocument).querySelector("h1");title=(h1==null?void 0:h1.innerText)||(h1==null?void 0:h1.textContent)||__privateGet(this,_pathname)}return title}clearScrollState(){__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0}clearDocumentState(){__privateSet(this,_modifiedDocument,null)}saveScrollState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-scroll-restoration")?(__privateGet(this,_scrollState).x=0,__privateGet(this,_scrollState).y=0):(__privateGet(this,_scrollState).x=__privateGet(this,_morph2).scrollValue.left,__privateGet(this,_scrollState).y=__privateGet(this,_morph2).scrollValue.top)}restoreScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:__privateGet(this,_scrollState).y,left:__privateGet(this,_scrollState).x,behavior:"instant"})}saveDocumentState(){__privateGet(this,_initialDocument).documentElement.hasAttribute("data-no-page-restoration")?__privateSet(this,_modifiedDocument,null):__privateSet(this,_modifiedDocument,document.cloneNode(!0))}renewScrollPosition(){__privateGet(this,_morph2).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(state){__privateSet(this,_savedState,state)}clearState(){const state=__privateGet(this,_savedState);return __privateSet(this,_savedState,null),state}};_morph2=new WeakMap,_pathname=new WeakMap,_scrollState=new WeakMap,_initialDocument=new WeakMap,_modifiedDocument=new WeakMap,_currentDocument=new WeakMap,_savedState=new WeakMap,_abortController=new WeakMap,_fetching=new WeakMap,_headers=new WeakMap,_needRavalidation=new WeakMap,__name(_MorphRoute,"MorphRoute");let MorphRoute=_MorphRoute;var _options,_morphElements,_links,_candidateURL,_currentURL,_previousURL,_promises,_isPopstateNavigation,_currentScrollElement,_isWindowScroll,_routes,_paramDependent,_announcer,_currentScrollX,_currentScrollY,_lastSubmorph,_lastRevalidate,_lastKeepScrollPosition,_checkLink,_Morph_instances,getRoute_fn,getMorphElements_fn,isElementEmitsLoadEvent_fn,updateCurrentScrollElement_fn,tryScrollToElement_fn,_popStateListener,_scrollListener;const _Morph=class _Morph{constructor(parameters){__privateAdd(this,_Morph_instances);__privateAdd(this,_options,null);__privateAdd(this,_morphElements,null);__privateAdd(this,_links,[]);__privateAdd(this,_candidateURL);__privateAdd(this,_currentURL,null);__privateAdd(this,_previousURL);__privateAdd(this,_promises,[]);__privateAdd(this,_isPopstateNavigation,!1);__privateAdd(this,_currentScrollElement,null);__privateAdd(this,_isWindowScroll,!1);__privateAdd(this,_routes,new Map);__privateAdd(this,_paramDependent,[]);__privateAdd(this,_announcer,null);__privateAdd(this,_currentScrollX,0);__privateAdd(this,_currentScrollY,0);__privateAdd(this,_lastSubmorph);__privateAdd(this,_lastRevalidate);__privateAdd(this,_lastKeepScrollPosition);__privateAdd(this,_checkLink,__name(element=>{var _a,_b;return(((_a=element.getAttribute("href"))==null?void 0:_a.startsWith("/"))||((_b=element.getAttribute("href"))==null?void 0:_b.startsWith("?")))&&!element.hasAttribute("download")&&!element.hasAttribute("data-morph-skip")&&!element.closest("[data-morph-skip]")&&element.getAttribute("target")!=="_blank"},"#checkLink"));__privateAdd(this,_popStateListener,__name(event=>__async(this,null,function*(){var _a,_b,_c,_d;(_b=(_a=event.state)==null?void 0:_a.data)!=null&&_b.popover||(_d=(_c=event.previousState)==null?void 0:_c.data)!=null&&_d.popover||(__privateSet(this,_isPopstateNavigation,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:__privateGet(this,_lastRevalidate)?void 0:__privateGet(this,_lastSubmorph),revalidate:__privateGet(this,_lastRevalidate),keepScrollPosition:__privateGet(this,_lastKeepScrollPosition)}),__privateSet(this,_isPopstateNavigation,!1))}),"#popStateListener"));__privateAdd(this,_scrollListener,__name(()=>{const{left,top}=this.scrollValue,directionY=top-__privateGet(this,_currentScrollY),directionX=left-__privateGet(this,_currentScrollX);__privateSet(this,_currentScrollY,top),__privateSet(this,_currentScrollX,left),document.documentElement.classList.toggle("scroll-y",top>0),document.documentElement.classList.toggle("scroll-x",left>0),document.documentElement.classList.toggle("scroll-y-forward",directionY>0),document.documentElement.classList.toggle("scroll-y-backward",directionY<0),document.documentElement.classList.toggle("scroll-x-forward",directionX>0),document.documentElement.classList.toggle("scroll-x-backward",directionX<0),events.dispatchEvent(document,"morphScroll",{detail:{left,top}})},"#scrollListener"));if(Store.isBrowser&&!_Morph.instance){_Morph.instance=this,__privateSet(this,_options,{base:url.normalizeBase(parameters==null?void 0:parameters.base),waitForHeadToLoad:(parameters==null?void 0:parameters.waitForHeadToLoad)!==!1,trailingSlash:(parameters==null?void 0:parameters.trailingSlash)||!1,scrollSelector:parameters==null?void 0:parameters.scrollSelector,morphInsideScrollContainer:(parameters==null?void 0:parameters.morphInsideScrollContainer)||!1}),__privateSet(this,_morphElements,__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,document.body));const normalizedURL=this.normalizePath(location.pathname+location.search+location.hash);__privateSet(this,_currentURL,normalizedURL);const initialRoute=new MorphRoute(this,__privateGet(this,_currentURL).pathname);initialRoute.setInitialDocument(document),__privateGet(this,_routes).set(__privateGet(this,_currentURL).pathname,initialRoute),document.documentElement.setAttribute("data-current-pathname",__privateGet(this,_currentURL).pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),this.findLinks(),this.findParamsDependent(),historyManager.historyManager.addPopStateHandler(__privateGet(this,_popStateListener)),historyManager.historyManager.__change({action:"replace",pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),__privateSet(this,_announcer,new MorphAnnouncer),__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,document)}}get currentURL(){return __privateGet(this,_currentURL)}get previousURL(){return __privateGet(this,_previousURL)}get links(){return __privateGet(this,_links)}get scrollElement(){return __privateGet(this,_currentScrollElement)}get isPopstateNavigation(){return __privateGet(this,_isPopstateNavigation)}get scrollValue(){let top=0,left=0;return __privateGet(this,_isWindowScroll)?(top=window.scrollY,left=window.scrollX):(top=__privateGet(this,_currentScrollElement).scrollTop,left=__privateGet(this,_currentScrollElement).scrollLeft),{top,left}}get isNavigating(){return!!__privateGet(this,_promises).length}saveState(state){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);route&&route.saveState(state)}getState(){const route=__privateGet(this,_routes).get(__privateGet(this,_currentURL).path);return route==null?void 0:route.clearState()}normalizePath(path,options){return url.splitPath(path,{base:__privateGet(this,_options).base,trailingSlash:__privateGet(this,_options).trailingSlash,mergeParams:options!=null&&options.mergeParams?location.search:"",removeParams:options==null?void 0:options.removeParams})}prefetch(path,revalidate){return __async(this,null,function*(){var _a;if(__privateGet(this,_promises).length)return;path=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path;const route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,path);route==null||route.fetch(path,__privateGet(this,_currentURL).path,revalidate)})}excludeHeadChild(child){return!1}needRavalidation(path){const normalizedURL=this.normalizePath(path),route=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.path);route==null||route.needRavalidation()}navigate(_0){return __async(this,arguments,function*(path,{historyAction="push",centerScroll,offsetScroll,scrollDuration,scrollEasing,scrollBehaviour,revalidate,keepSearchParameters,submorph,submorphAppend,clearState,keepScrollPosition,mergeParams,removeParams,detail,scrollTo}={}){var _a,_b,_c,_d;if(__privateGet(this,_promises).length)return;__privateSet(this,_lastSubmorph,submorph),__privateSet(this,_lastRevalidate,revalidate),__privateSet(this,_lastKeepScrollPosition,keepScrollPosition);const modifiedPath=((_a=this.pathnameModifier)==null?void 0:_a.call(this,path))||path,normalizedURL=this.normalizePath(modifiedPath,{mergeParams,removeParams});if(!revalidate&&(((_b=__privateGet(this,_candidateURL))==null?void 0:_b.pathname)===normalizedURL.pathname||__privateGet(this,_currentURL).pathname===normalizedURL.pathname)){keepScrollPosition||__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo||normalizedURL.hash||0,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:"smooth"}),events.dispatchEvent(document,"morphSamePath",{detail:{detail}}),((_c=__privateGet(this,_currentURL))==null?void 0:_c.parameters)!==normalizedURL.parameters&&(__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL),historyManager.historyManager.__change({action:((_d=__privateGet(this,_currentURL))==null?void 0:_d.hash)!==normalizedURL.hash?"replace":historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters,hash:normalizedURL.hash}),events.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:__privateGet(this,_currentURL),previousURL:__privateGet(this,_previousURL),detail}})),__privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});return}else __privateGet(this,_links).forEach(link=>{link.checkCurrent(normalizedURL.path)});__privateSet(this,_candidateURL,normalizedURL);try{let preprocessedSuccesfully=!0;if(this.preprocessor)try{yield new Promise((resolve,reject)=>{var _a2;(_a2=this.preprocessor)==null||_a2.call(this,{url:normalizedURL,resolve,reject,submorph,detail})})}catch(e){e?console.error(e):console.log("Route change canceled"),preprocessedSuccesfully=!1}if(!preprocessedSuccesfully||__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}const navigationEntry={url:normalizedURL,submorph,detail};submorph?submorphAppend||submorph.forEach(sel=>{document.querySelectorAll(sel).forEach(el=>{el.classList.add("out"),el.setAttribute("data-morph-out","")})}):__privateGet(this,_morphElements).forEach(el=>{var _a2,_b2;(_a2=el.firstElementChild)==null||_a2.classList.add("out"),(_b2=el.firstElementChild)==null||_b2.setAttribute("data-morph-out","")}),events.dispatchEvent(document,"morphNavigation",{detail:navigationEntry});const currentRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,__privateGet(this,_currentURL).pathname),nextRoute=__privateMethod(this,_Morph_instances,getRoute_fn).call(this,normalizedURL.pathname);if(__privateGet(this,_routes).forEach(el=>{el.pathname!==normalizedURL.pathname&&el.abort()}),yield nextRoute==null?void 0:nextRoute.fetch(modifiedPath,__privateGet(this,_currentURL).path,revalidate),__privateGet(this,_candidateURL).pathname!==normalizedURL.pathname){__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)});return}currentRoute.clearState(),currentRoute.saveScrollState(),currentRoute.saveDocumentState(),(!__privateGet(this,_isPopstateNavigation)||revalidate)&&(nextRoute.clearScrollState(),nextRoute.clearDocumentState()),clearState&&nextRoute.clearState(),nextRoute.cloneDocument(),__privateGet(this,_announcer).textContent=nextRoute.title,document.body.appendChild(__privateGet(this,_announcer));const documentFetchedEntry=__spreadProps(__spreadValues({},navigationEntry),{document:nextRoute.document});submorphAppend||documentFetchedEntry.document.querySelectorAll("[data-morph-out]").forEach(el=>{el.classList.remove("out")}),events.dispatchEvent(document,"morphStart",{detail:documentFetchedEntry});const currentHeadChildren=Array.from(document.head.children),newHeadChildren=Array.from(nextRoute.document.head.children),identicalHeadChildren=dom.intersectElements(currentHeadChildren,newHeadChildren),removeHeadChildren=dom.excludeElements(currentHeadChildren,identicalHeadChildren),addHeadChildren=dom.excludeElements(newHeadChildren,identicalHeadChildren).filter(child=>!this.excludeHeadChild(child));addHeadChildren.forEach((child,index)=>{child.tagName==="SCRIPT"&&(addHeadChildren[index]=dom.createScriptElement(child))}),addHeadChildren.forEach(child=>{document.head.appendChild(child)});const elementsWithLoad=addHeadChildren.filter(child=>{if(child.hasAttribute("data-no-waiting"))return!1;if(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child))return!0});__privateGet(this,_options).waitForHeadToLoad&&elementsWithLoad.length&&(yield new Promise(res=>__async(this,null,function*(){let counter=0;try{for(var iter=__forAwait(elementsWithLoad),more,temp,error;more=!(temp=yield iter.next()).done;more=!1){const element=temp.value;element.onload=()=>{counter++,counter===elementsWithLoad.length&&res()}}}catch(temp){error=[temp]}finally{try{more&&(temp=iter.return)&&(yield temp.call(iter))}finally{if(error)throw error[0]}}}))),yield promises.wait(10);const oldElementsWithLoadEvent=[];submorphAppend||removeHeadChildren.forEach(child=>{child.hasAttribute("data-permanent")||(__privateMethod(this,_Morph_instances,isElementEmitsLoadEvent_fn).call(this,child)?oldElementsWithLoadEvent.push(child):child.remove())});const newMorphElements=__privateMethod(this,_Morph_instances,getMorphElements_fn).call(this,nextRoute.document.body);!__privateGet(this,_options).morphInsideScrollContainer&&!submorph&&__privateMethod(this,_Morph_instances,updateCurrentScrollElement_fn).call(this,nextRoute.document),document.documentElement.setAttribute("data-current-pathname",normalizedURL.pathname),document.documentElement.setAttribute("data-current-leaf",normalizedURL.leaf),historyManager.historyManager.__change({action:historyAction,pathname:normalizedURL.pathname,searchParameters:normalizedURL.parameters||(keepSearchParameters?location.search:""),hash:normalizedURL.hash}),__privateGet(this,_announcer).remove(),__privateSet(this,_previousURL,__privateGet(this,_currentURL)),__privateSet(this,_currentURL,normalizedURL);const morphedElements=[];__privateGet(this,_morphElements).forEach((morphElement,i)=>{const newMorphElement=newMorphElements[i],duration=getComputedStyle(morphElement).getPropertyValue("--morph-duration");let newMorphElementChildNodes=[],currentMorphElementChildNodes=[];submorph?(submorph.forEach(selector=>{const curSubMorphElement=morphElement.querySelector(selector),newSubMorphElement=newMorphElement.querySelector(selector);curSubMorphElement&&newSubMorphElement&&(currentMorphElementChildNodes.push(curSubMorphElement),newMorphElementChildNodes.push(newSubMorphElement))}),currentMorphElementChildNodes.forEach(el=>{el.parentElement&&morphedElements.push(el.parentElement)})):(newMorphElementChildNodes.push(...newMorphElement.childNodes),currentMorphElementChildNodes.push(...morphElement.childNodes),morphedElements.push(morphElement));const transfer=[];submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(this.destroyOldLinks(element),element.classList.add("old"),element.querySelectorAll("[data-morph-transfer]").forEach(el=>{const selector=el.getAttribute("data-morph-transfer");transfer.push({element:el,selector})}))}),newMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&(transfer.forEach(item=>{const nestlement=element.querySelector(item.selector);nestlement&&nestlement.replaceWith(nextRoute.document.importNode(item.element,!0))}),this.findNewLinks(element),element.classList.add("new"))}),submorph?submorphAppend?newMorphElementChildNodes.forEach((el,i2)=>{currentMorphElementChildNodes[i2]instanceof HTMLElement&¤tMorphElementChildNodes[i2].append(...el.childNodes)}):newMorphElementChildNodes.forEach((el,i2)=>{var _a2;(_a2=currentMorphElementChildNodes[i2].parentElement)==null||_a2.insertBefore(el,currentMorphElementChildNodes[i2])}):morphElement.prepend(...newMorphElementChildNodes),setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(element=>{element instanceof HTMLElement&&element.classList.add("old-idle")}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.setProperty("--new-content-height",element.offsetHeight+"px"),element.classList.add("new-idle"))})},0);const detail2=__spreadProps(__spreadValues({},documentFetchedEntry),{morphElement});events.dispatchEvent(document,"morphNewChildrenAdded",{detail:detail2});const promise=new Promise(res=>{setTimeout(()=>{submorphAppend||currentMorphElementChildNodes.forEach(el=>{el.remove()}),newMorphElementChildNodes.forEach(element=>{var _a2;element instanceof HTMLElement&&((_a2=element.parentElement)==null||_a2.style.removeProperty("--new-content-height"),element.classList.remove("new-idle","new"))}),submorphAppend||events.dispatchEvent(document,"morphOldChildrenRemoved",{detail:detail2}),res()},(parseFloat(duration)||0)*1e3+10)});__privateGet(this,_promises).push(promise)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-nextRoute.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),events.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:nextRoute.scrollState}),scrollTo?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,scrollTo,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):normalizedURL.hash?(nextRoute.clearScrollState(),__privateMethod(this,_Morph_instances,tryScrollToElement_fn).call(this,normalizedURL.hash,{center:centerScroll,offset:offsetScroll,duration:scrollDuration,easing:scrollEasing,behavior:scrollBehaviour})):__privateGet(this,_isPopstateNavigation)?nextRoute.restoreScrollPosition():keepScrollPosition||nextRoute.renewScrollPosition(),yield Promise.all(__privateGet(this,_promises)),submorphAppend||oldElementsWithLoadEvent.forEach(child=>child.remove()),__privateSet(this,_promises,[]),morphedElements.forEach(el=>{el.querySelectorAll("script").forEach(element=>{element.replaceWith(dom.createScriptElement(element))})}),__privateGet(this,_links).forEach(link=>{link.checkCurrent(__privateGet(this,_currentURL).path)}),this.findParamsDependent(),events.dispatchEvent(document,"morphComplete",{detail:documentFetchedEntry}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(e){console.error(e)}__privateSet(this,_candidateURL,void 0)})}addLink(element){__privateGet(this,_links).push(new MorphLink(element,this))}addLinks(elements){elements.forEach(element=>{this.addLink(element)})}removeLink(element){__privateSet(this,_links,__privateGet(this,_links).filter(link=>link.element===element?(link.destroy(),!1):!0))}destroyOldLinks(morphElement){__privateSet(this,_links,__privateGet(this,_links).filter(link=>morphElement.contains(link.element)?(link.destroy(),!1):!0))}findNewLinks(morphElement){const linkElements=[...morphElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).push(...linkElements.map(element=>new MorphLink(element,this)))}findLinks(){const linkElements=[...document.documentElement.querySelectorAll("a")].filter(__privateGet(this,_checkLink));__privateGet(this,_links).forEach(link=>link.destroy()),__privateSet(this,_links,linkElements.map(element=>new MorphLink(element,this)))}findParamsDependent(){const elements=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];__privateGet(this,_paramDependent).forEach(link=>link.destroy()),__privateSet(this,_paramDependent,elements.map(element=>new MorphParamsDependent(element)))}};_options=new WeakMap,_morphElements=new WeakMap,_links=new WeakMap,_candidateURL=new WeakMap,_currentURL=new WeakMap,_previousURL=new WeakMap,_promises=new WeakMap,_isPopstateNavigation=new WeakMap,_currentScrollElement=new WeakMap,_isWindowScroll=new WeakMap,_routes=new WeakMap,_paramDependent=new WeakMap,_announcer=new WeakMap,_currentScrollX=new WeakMap,_currentScrollY=new WeakMap,_lastSubmorph=new WeakMap,_lastRevalidate=new WeakMap,_lastKeepScrollPosition=new WeakMap,_checkLink=new WeakMap,_Morph_instances=new WeakSet,getRoute_fn=__name(function(path){const normalizedURL=this.normalizePath(path);let route=__privateGet(this,_routes).get(normalizedURL.pathname);return route||(route=new MorphRoute(this,normalizedURL.pathname),__privateGet(this,_routes).set(normalizedURL.pathname,route)),route},"#getRoute"),getMorphElements_fn=__name(function(el){const morphElements=[...el.querySelectorAll("[data-morph]")];return morphElements.length?morphElements:[el]},"#getMorphElements"),isElementEmitsLoadEvent_fn=__name(function(element){return element.tagName==="SCRIPT"||element.tagName==="STYLE"||element.tagName==="LINK"&&element.getAttribute("rel")==="stylesheet"},"#isElementEmitsLoadEvent"),updateCurrentScrollElement_fn=__name(function(document2){var _a,_b;(_a=__privateGet(this,_currentScrollElement))==null||_a.removeEventListener("scroll",__privateGet(this,_scrollListener)),__privateSet(this,_currentScrollY,0),__privateSet(this,_currentScrollX,0),__privateSet(this,_currentScrollElement,__privateGet(this,_options).scrollSelector&&document2.querySelector(__privateGet(this,_options).scrollSelector)||window),__privateSet(this,_isWindowScroll,__privateGet(this,_currentScrollElement)===window),(_b=__privateGet(this,_currentScrollElement))==null||_b.addEventListener("scroll",__privateGet(this,_scrollListener)),__privateGet(this,_scrollListener).call(this)},"#updateCurrentScrollElement"),tryScrollToElement_fn=__name(function(id,options){const value=typeof id=="string"?document.querySelector(id):id;(typeof value=="number"||value)&&scroll.scrollToElement(value,__spreadValues({scrollElement:__privateGet(this,_currentScrollElement)},options))},"#tryScrollToElement"),_popStateListener=new WeakMap,_scrollListener=new WeakMap,__name(_Morph,"Morph"),_Morph.instance=null;let Morph=_Morph;exports.Morph=Morph;
|
package/lib/morph/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import { i as isBrowser, c as camelToKebab } from "../Store-CAGUSjFX.js";
|
|
|
36
36
|
import { i as intersectElements, e as excludeElements, c as createScriptElement } from "../dom-D8D-_9ty.js";
|
|
37
37
|
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
38
38
|
import { w as wait } from "../promises-BsIKOEDq.js";
|
|
39
|
-
import { s as scrollToElement } from "../scroll-
|
|
39
|
+
import { s as scrollToElement } from "../scroll-C27tnW2f.js";
|
|
40
40
|
import "construct-style-sheets-polyfill";
|
|
41
41
|
import "../index-DAG0CtYo.js";
|
|
42
42
|
import { a as normalizeBase, c as splitPath } from "../url-DTxLpq5m.js";
|
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-B96mD8mD.cjs");require("../index-BoGx2BWX.cjs");const math=require("../math-C-knY2TL.cjs"),Damped=require("../Damped-
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-B96mD8mD.cjs");require("../index-BoGx2BWX.cjs");const math=require("../math-C-knY2TL.cjs"),Damped=require("../Damped-B_mVO810.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),coordinates=require("../coordinates-DQ9XV9M1.cjs"),dom=require("../dom-B40i6NXw.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs"),cssProperty_index=require("../css-property/index.cjs");var _element,_x,_y,_z,_cartesian,_normalize,_fullScreen,_width,_height,_entered,_pointerEnterListener,_pointerLeaveListener,_pointerMoveListener,_resizeListener,_Pointer_instances,getPointerCoords_fn;const _Pointer=class _Pointer{constructor(parameters){__privateAdd(this,_Pointer_instances);__privateAdd(this,_element);__privateAdd(this,_x);__privateAdd(this,_y);__privateAdd(this,_z);__privateAdd(this,_cartesian);__privateAdd(this,_normalize);__privateAdd(this,_fullScreen,!1);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_entered,!1);__privateAdd(this,_pointerEnterListener,__name(e=>{__privateSet(this,_entered,!0);const pointer=__privateMethod(this,_Pointer_instances,getPointerCoords_fn).call(this,e);__privateGet(this,_x).set(pointer.x,{equalize:!0}),__privateGet(this,_y).set(pointer.y,{equalize:!0}),__privateGet(this,_z).set(1)},"#pointerEnterListener"));__privateAdd(this,_pointerLeaveListener,__name(e=>{__privateSet(this,_entered,!1),__privateGet(this,_z).set(0)},"#pointerLeaveListener"));__privateAdd(this,_pointerMoveListener,__name(e=>{__privateGet(this,_entered)||__privateGet(this,_pointerEnterListener).call(this,e);const pointer=__privateMethod(this,_Pointer_instances,getPointerCoords_fn).call(this,e);__privateGet(this,_x).set(pointer.x),__privateGet(this,_y).set(pointer.y)},"#pointerMoveListener"));__privateAdd(this,_resizeListener,__name(()=>{__privateGet(this,_fullScreen)?(__privateSet(this,_width,document.documentElement.clientWidth),__privateSet(this,_height,innerHeight)):(__privateSet(this,_width,this.element.clientWidth),__privateSet(this,_height,this.element.clientHeight));let xmin=0,xmax=0,ymin=0,ymax=0;__privateGet(this,_cartesian)?__privateGet(this,_normalize)?(xmin=-1,xmax=1,ymin=-1,ymax=1):(xmin=__privateGet(this,_width)/2*-1,xmax=__privateGet(this,_width)/2*1,ymin=__privateGet(this,_height)/2*-1,ymax=__privateGet(this,_height)/2*1):__privateGet(this,_normalize)?(xmin=0,xmax=1,ymin=0,ymax=1):(xmin=0,xmax=__privateGet(this,_width),ymin=0,ymax=__privateGet(this,_height)),__privateGet(this,_x).min=xmin,__privateGet(this,_x).max=xmax,__privateGet(this,_y).min=ymin,__privateGet(this,_y).max=ymax},"#resizeListener"));__privateSet(this,_element,dom.getElement(parameters.element)),__privateSet(this,_x,new Damped.Damped(0,parameters.damped)),__privateSet(this,_y,new Damped.Damped(0,parameters.damped)),__privateSet(this,_z,new Damped.Damped(0,parameters.damped)),__privateSet(this,_cartesian,parameters.cartesian||!1),__privateSet(this,_normalize,parameters.normalize||!1),__privateSet(this,_fullScreen,parameters.fullScreen||!1)}get element(){return __privateGet(this,_element)}get x(){return __privateGet(this,_x)}get y(){return __privateGet(this,_y)}get z(){return __privateGet(this,_z)}get cartesian(){return __privateGet(this,_cartesian)}set cartesian(value){__privateSet(this,_cartesian,value),__privateGet(this,_resizeListener).call(this)}get normalize(){return __privateGet(this,_normalize)}set normalize(value){__privateSet(this,_normalize,value),__privateGet(this,_resizeListener).call(this)}connect(){__privateGet(this,_element).addEventListener("pointerenter",__privateGet(this,_pointerEnterListener)),__privateGet(this,_element).addEventListener("pointerleave",__privateGet(this,_pointerLeaveListener)),__privateGet(this,_element).addEventListener("pointermove",__privateGet(this,_pointerMoveListener)),elementResizer_index.elementResizer.subscribe(__privateGet(this,_element),__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener))}disconnect(){__privateGet(this,_element).removeEventListener("pointerenter",__privateGet(this,_pointerEnterListener)),__privateGet(this,_element).removeEventListener("pointerleave",__privateGet(this,_pointerLeaveListener)),__privateGet(this,_element).removeEventListener("pointermove",__privateGet(this,_pointerMoveListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),__privateGet(this,_x).reset(),__privateGet(this,_y).reset(),__privateGet(this,_z).reset()}};_element=new WeakMap,_x=new WeakMap,_y=new WeakMap,_z=new WeakMap,_cartesian=new WeakMap,_normalize=new WeakMap,_fullScreen=new WeakMap,_width=new WeakMap,_height=new WeakMap,_entered=new WeakMap,_pointerEnterListener=new WeakMap,_pointerLeaveListener=new WeakMap,_pointerMoveListener=new WeakMap,_resizeListener=new WeakMap,_Pointer_instances=new WeakSet,getPointerCoords_fn=__name(function(event){let pos=null;__privateGet(this,_fullScreen)?pos={x:event.clientX,y:event.clientY}:pos=coordinates.getPointerPosition(event,__privateGet(this,_element).getBoundingClientRect());const size={width:__privateGet(this,_width),height:__privateGet(this,_height)},pointer={x:pos.x,y:pos.y};if(__privateGet(this,_cartesian)){const res=coordinates.screenToCartesian(pointer,size);pointer.x=res.x,pointer.y=res.y}if(__privateGet(this,_normalize)){const res=coordinates.normalize(pointer,size);__privateGet(this,_cartesian)?(pointer.x=math.clamp(res.x*2,-1,1),pointer.y=math.clamp(res.y*2,-1,1)):(pointer.x=res.x,pointer.y=res.y)}return pointer},"#getPointerCoords"),__name(_Pointer,"Pointer");let Pointer=_Pointer;var _pointer,_dampingCSSProperty,_massCSSProperty,_stiffnessCSSProperty,_cartesianCSSProperty,_normalizeCSSProperty;const _PointerElement=class _PointerElement extends HTMLElement{constructor(){super();__privateAdd(this,_pointer);__privateAdd(this,_dampingCSSProperty,new cssProperty_index.CSSProperty(this,"--damping",20));__privateAdd(this,_massCSSProperty,new cssProperty_index.CSSProperty(this,"--mass",0));__privateAdd(this,_stiffnessCSSProperty,new cssProperty_index.CSSProperty(this,"--stiffness",0));__privateAdd(this,_cartesianCSSProperty,new cssProperty_index.CSSProperty(this,"--cartesian",!1));__privateAdd(this,_normalizeCSSProperty,new cssProperty_index.CSSProperty(this,"--normalize",!1));__privateSet(this,_pointer,new Pointer({element:this})),__privateGet(this,_dampingCSSProperty).subscribe(e=>{__privateGet(this,_pointer).x.damping=e.current,__privateGet(this,_pointer).y.damping=e.current,__privateGet(this,_pointer).z.damping=e.current}),__privateGet(this,_cartesianCSSProperty).subscribe(e=>{__privateGet(this,_pointer).cartesian=e.current}),__privateGet(this,_normalizeCSSProperty).subscribe(e=>{__privateGet(this,_pointer).normalize=e.current}),__privateGet(this,_massCSSProperty).subscribe(e=>{__privateGet(this,_pointer).x.mass=e.current,__privateGet(this,_pointer).y.mass=e.current,__privateGet(this,_pointer).z.mass=e.current}),__privateGet(this,_stiffnessCSSProperty).subscribe(e=>{__privateGet(this,_pointer).x.stiffness=e.current,__privateGet(this,_pointer).y.stiffness=e.current,__privateGet(this,_pointer).z.stiffness=e.current}),__privateGet(this,_pointer).x.subscribe(e=>{this.style.setProperty("--x",e.current.toString())}),__privateGet(this,_pointer).y.subscribe(e=>{this.style.setProperty("--y",e.current.toString())}),__privateGet(this,_pointer).z.subscribe(e=>{this.style.setProperty("--z",e.current.toString())})}get pointer(){return __privateGet(this,_pointer)}connectedCallback(){__privateGet(this,_pointer).connect(),__privateGet(this,_dampingCSSProperty).observe(),__privateGet(this,_massCSSProperty).observe(),__privateGet(this,_stiffnessCSSProperty).observe()}disconnectedCallback(){__privateGet(this,_pointer).disconnect(),__privateGet(this,_dampingCSSProperty).unobserve(),__privateGet(this,_massCSSProperty).unobserve(),__privateGet(this,_stiffnessCSSProperty).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}};_pointer=new WeakMap,_dampingCSSProperty=new WeakMap,_massCSSProperty=new WeakMap,_stiffnessCSSProperty=new WeakMap,_cartesianCSSProperty=new WeakMap,_normalizeCSSProperty=new WeakMap,__name(_PointerElement,"PointerElement");let PointerElement=_PointerElement;Store.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",PointerElement);exports.Pointer=Pointer;exports.PointerElement=PointerElement;
|
package/lib/pointer/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
8
8
|
import { i as isBrowser } from "../Store-CAGUSjFX.js";
|
|
9
9
|
import "../index-DAG0CtYo.js";
|
|
10
10
|
import { c as clamp } from "../math-r8V23YFe.js";
|
|
11
|
-
import { D as Damped } from "../Damped-
|
|
11
|
+
import { D as Damped } from "../Damped-m3PWu4LD.js";
|
|
12
12
|
import { elementResizer } from "../element-resizer/index.js";
|
|
13
13
|
import { g as getPointerPosition, s as screenToCartesian, n as normalize } from "../coordinates--JG1U6kQ.js";
|
|
14
14
|
import { g as getElement } from "../dom-D8D-_9ty.js";
|