aptechka 0.86.1 → 0.87.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
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"});var _dummyElement,_CSSUnitParser_instances,createDummy_fn;const _CSSUnitParser=class _CSSUnitParser{constructor(){__privateAdd(this,_CSSUnitParser_instances);__privateAdd(this,_dummyElement,null)}parse(value){__privateMethod(this,_CSSUnitParser_instances,createDummy_fn).call(this),__privateGet(this,_dummyElement).style.left=value;const computedWidth=getComputedStyle(__privateGet(this,_dummyElement)).getPropertyValue("left");return parseFloat(computedWidth)}};_dummyElement=new WeakMap,_CSSUnitParser_instances=new WeakSet,createDummy_fn=__name(function(){__privateGet(this,_dummyElement)||(__privateSet(this,_dummyElement,document.createElement("div")),__privateGet(this,_dummyElement).style.cssText=`
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"});var _dummyElement,_CSSUnitParser_instances,createDummy_fn;const _CSSUnitParser=class _CSSUnitParser{constructor(){__privateAdd(this,_CSSUnitParser_instances);__privateAdd(this,_dummyElement,null)}parse(value){if(!value)return;__privateMethod(this,_CSSUnitParser_instances,createDummy_fn).call(this),__privateGet(this,_dummyElement).style.left=value;const computedWidth=getComputedStyle(__privateGet(this,_dummyElement)).getPropertyValue("left");return parseFloat(computedWidth)}};_dummyElement=new WeakMap,_CSSUnitParser_instances=new WeakSet,createDummy_fn=__name(function(){__privateGet(this,_dummyElement)||(__privateSet(this,_dummyElement,document.createElement("div")),__privateGet(this,_dummyElement).style.cssText=`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1,6 +1,6 @@
1
1
  declare class CSSUnitParser {
2
2
  #private;
3
- parse(value: string): number;
3
+ parse(value?: string): number | undefined;
4
4
  }
5
5
  export declare const cssUnitParser: CSSUnitParser;
6
6
  export {};
@@ -12,8 +12,12 @@ const _CSSUnitParser = class _CSSUnitParser {
12
12
  __privateAdd(this, _dummyElement, null);
13
13
  }
14
14
  parse(value) {
15
+ if (!value)
16
+ return;
15
17
  __privateMethod(this, _CSSUnitParser_instances, createDummy_fn).call(this), __privateGet(this, _dummyElement).style.left = value;
16
- const computedWidth = getComputedStyle(__privateGet(this, _dummyElement)).getPropertyValue("left");
18
+ const computedWidth = getComputedStyle(__privateGet(this, _dummyElement)).getPropertyValue(
19
+ "left"
20
+ );
17
21
  return parseFloat(computedWidth);
18
22
  }
19
23
  };
@@ -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 cssUnitParser_index=require("../css-unit-parser/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),ladder_index=require("../ladder/index.cjs"),notifier_index=require("../notifier/index.cjs"),order_index=require("../order/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),dom=require("../dom-B40i6NXw.cjs"),layout=require("../layout-CnGLl7oe.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs");function decomposeCSSMatrix(matrix){const scaleX=Math.sqrt(matrix.m11*matrix.m11+matrix.m12*matrix.m12+matrix.m13*matrix.m13),scaleY=Math.sqrt(matrix.m21*matrix.m21+matrix.m22*matrix.m22+matrix.m23*matrix.m23),scaleZ=Math.sqrt(matrix.m31*matrix.m31+matrix.m32*matrix.m32+matrix.m33*matrix.m33),rotationX=Math.atan2(matrix.m32,matrix.m33),rotationY=Math.atan2(-matrix.m31,Math.sqrt(matrix.m32*matrix.m32+matrix.m33*matrix.m33)),rotationZ=Math.atan2(matrix.m21,matrix.m11),translationX=matrix.m41,translationY=matrix.m42*-1,translationZ=matrix.m43;return{scaleX,scaleY,scaleZ,rotationX,rotationY,rotationZ,translationX,translationY,translationZ}}__name(decomposeCSSMatrix,"decomposeCSSMatrix");var _element,_containerElement,_scrollStepSetterCallbacks,_scrollAxis,_frontSide,_isCartesian,_isSizeStep,_isPositionStep,_isTransformStep,_isScrollStep,_width,_height,_depth,_top,_left,_front,_x,_y,_z,_CSSTranslation,_CSSRotation,_CSSScale,_rotation,_position,_scale,_scrollValue,_scrollEntries,_resizeNotifier,_LayoutBox_instances,recalculate_fn,composeSteps_fn,updateDimensions_fn,updateScrollPosition_fn,_resizeListener,_tickListener,_scrollEntriesListener;const _LayoutBox=class _LayoutBox{constructor(element,options){__privateAdd(this,_LayoutBox_instances);__privateAdd(this,_element,null);__privateAdd(this,_containerElement,null);__privateAdd(this,_scrollStepSetterCallbacks,[]);__privateAdd(this,_scrollAxis,"auto");__privateAdd(this,_frontSide,"top");__privateAdd(this,_isCartesian,!1);__privateAdd(this,_isSizeStep,!0);__privateAdd(this,_isPositionStep,!0);__privateAdd(this,_isTransformStep,!0);__privateAdd(this,_isScrollStep,!0);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_depth,0);__privateAdd(this,_top,0);__privateAdd(this,_left,0);__privateAdd(this,_front,0);__privateAdd(this,_x,0);__privateAdd(this,_y,0);__privateAdd(this,_z,0);__privateAdd(this,_CSSTranslation,{x:0,y:0,z:0});__privateAdd(this,_CSSRotation,{x:0,y:0,z:0});__privateAdd(this,_CSSScale,{x:1,y:1,z:1});__privateAdd(this,_rotation,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_position,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scale,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scrollValue,{x:0,y:0,z:0});__privateAdd(this,_scrollEntries,new Map);__privateAdd(this,_resizeNotifier,new notifier_index.Notifier);__privateAdd(this,_resizeListener,__name(()=>{intersector_index.isBrowser&&__privateMethod(this,_LayoutBox_instances,updateDimensions_fn).call(this)},"#resizeListener"));__privateAdd(this,_tickListener,__name(()=>{__privateMethod(this,_LayoutBox_instances,updateScrollPosition_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this)},"#tickListener"));__privateAdd(this,_scrollEntriesListener,__name(()=>{const allEntries=scrollEntries_index.scrollEntries.getAll(this.element);__privateGet(this,_scrollEntries).forEach((value,key)=>{allEntries.includes(key)||(this.deleteScrollStep(value),__privateGet(this,_scrollEntries).delete(key))}),allEntries.forEach(entry=>{if(!__privateGet(this,_scrollEntries).has(entry)){const callback=__name(()=>entry,"callback");__privateGet(this,_scrollEntries).set(entry,callback),this.setScrollStep(callback)}})},"#scrollEntriesListener"));intersector_index.isBrowser&&(__privateSet(this,_element,dom.getElement(element)||document.body),__privateSet(this,_containerElement,dom.getElement(options==null?void 0:options.containerElement)||document.body),__privateSet(this,_scrollAxis,(options==null?void 0:options.scrollAxis)||"auto"),__privateSet(this,_frontSide,(options==null?void 0:options.frontSide)||"top"),__privateSet(this,_isCartesian,(options==null?void 0:options.cartesian)||!1),__privateSet(this,_isSizeStep,(options==null?void 0:options.sizeStep)!==void 0?options.sizeStep:!0),__privateSet(this,_isPositionStep,(options==null?void 0:options.positionStep)!==void 0?options.positionStep:!0),__privateSet(this,_isTransformStep,(options==null?void 0:options.transformStep)!==void 0?options.transformStep:!0),__privateSet(this,_isScrollStep,(options==null?void 0:options.scrollStep)!==void 0?options.scrollStep:!0),__privateGet(this,_scale).setStep("_size","+",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_position","+",{x:0,y:0,z:0}),__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}),__privateGet(this,_isScrollStep)&&(scrollEntries_index.scrollEntries.notifier.subscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntriesListener).call(this),this.setScrollStep(()=>({axis:"y",value:layout.getStickyOffset(this.element,"top")*-1})),this.setScrollStep(()=>({axis:"x",value:layout.getStickyOffset(this.element,"left")*-1}))),elementResizer_index.elementResizer.subscribe(this.element,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.LAYOUT_BOX),intersector_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.LAYOUT_BOX,culling:options!=null&&options.culling?this.element:void 0}))}get element(){return __privateGet(this,_element)}get containerElement(){return __privateGet(this,_containerElement)}get position(){return __privateGet(this,_position).current}get rotation(){return __privateGet(this,_rotation).current}get scale(){return __privateGet(this,_scale).current}get scrollValue(){return __privateGet(this,_scrollValue)}get left(){return __privateGet(this,_left)}get top(){return __privateGet(this,_top)}get CSSTranslation(){return __privateGet(this,_CSSTranslation)}get CSSRotation(){return __privateGet(this,_CSSRotation)}get CSSScale(){return __privateGet(this,_CSSScale)}get front(){return __privateGet(this,_front)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get depth(){return __privateGet(this,_depth)}destroy(){intersector_index.ticker.unsubscribe(__privateGet(this,_tickListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),scrollEntries_index.scrollEntries.notifier.unsubscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntries).clear(),__privateGet(this,_position).close(),__privateGet(this,_rotation).close(),__privateGet(this,_scale).close()}bindObject(object){object.position&&__privateGet(this,_position).bind(object.position),object.rotation&&__privateGet(this,_rotation).bind(object.rotation),object.scale&&__privateGet(this,_scale).bind(object.scale)}unbindObject(object){object.position&&__privateGet(this,_position).unbind(object.position),object.rotation&&__privateGet(this,_rotation).unbind(object.rotation),object.scale&&__privateGet(this,_scale).unbind(object.scale)}setScrollStep(callback){return __privateGet(this,_scrollStepSetterCallbacks).includes(callback)||__privateGet(this,_scrollStepSetterCallbacks).push(callback),()=>this.deleteScrollStep(callback)}deleteScrollStep(callback){__privateSet(this,_scrollStepSetterCallbacks,__privateGet(this,_scrollStepSetterCallbacks).filter(s=>s!==callback))}setPositionStep(...args){__privateGet(this,_position).setStep(...args)}getPositionStep(...args){return __privateGet(this,_position).getStepValue(...args)}setRotationStep(...args){__privateGet(this,_rotation).setStep(...args)}getRotationStep(...args){return __privateGet(this,_rotation).getStepValue(...args)}getExcludedRotationSteps(...args){return __privateGet(this,_rotation).getExcludedStepsValue(...args)}getIncludedRotationSteps(...args){return __privateGet(this,_rotation).getIncludedStepsValue(...args)}setScaleStep(...args){__privateGet(this,_scale).setStep(...args)}getScaleStep(...args){return __privateGet(this,_scale).getStepValue(...args)}getExcludedScaleSteps(...args){return __privateGet(this,_scale).getExcludedStepsValue(...args)}getIncludedScaleSteps(...args){return __privateGet(this,_scale).getIncludedStepsValue(...args)}deletePositionStep(...args){__privateGet(this,_position).deleteStep(...args)}getExcludedPositionSteps(...args){return __privateGet(this,_position).getExcludedStepsValue(...args)}getIncludedPositionSteps(...args){return __privateGet(this,_position).getIncludedStepsValue(...args)}deleteRotationStep(...args){__privateGet(this,_rotation).deleteStep(...args)}deleteScaleStep(...args){__privateGet(this,_scale).deleteStep(...args)}onPosition(...args){return __privateGet(this,_position).subscribe(...args)}offPosition(...args){__privateGet(this,_position).unsubscribe(...args)}onScale(...args){return __privateGet(this,_scale).subscribe(...args)}offScale(...args){__privateGet(this,_scale).unsubscribe(...args)}onRotation(...args){return __privateGet(this,_rotation).subscribe(...args)}offRotation(...args){__privateGet(this,_rotation).unsubscribe(...args)}onResize(...args){return __privateGet(this,_resizeNotifier).subscribe(...args)}offResize(...args){return __privateGet(this,_resizeNotifier).unsubscribe(...args)}};_element=new WeakMap,_containerElement=new WeakMap,_scrollStepSetterCallbacks=new WeakMap,_scrollAxis=new WeakMap,_frontSide=new WeakMap,_isCartesian=new WeakMap,_isSizeStep=new WeakMap,_isPositionStep=new WeakMap,_isTransformStep=new WeakMap,_isScrollStep=new WeakMap,_width=new WeakMap,_height=new WeakMap,_depth=new WeakMap,_top=new WeakMap,_left=new WeakMap,_front=new WeakMap,_x=new WeakMap,_y=new WeakMap,_z=new WeakMap,_CSSTranslation=new WeakMap,_CSSRotation=new WeakMap,_CSSScale=new WeakMap,_rotation=new WeakMap,_position=new WeakMap,_scale=new WeakMap,_scrollValue=new WeakMap,_scrollEntries=new WeakMap,_resizeNotifier=new WeakMap,_LayoutBox_instances=new WeakSet,recalculate_fn=__name(function(){__privateGet(this,_scale).calculate(),__privateGet(this,_position).calculate(),__privateGet(this,_rotation).calculate()},"#recalculate"),composeSteps_fn=__name(function(){__privateGet(this,_scale).setStep("_size","+",{x:__privateGet(this,_isSizeStep)?__privateGet(this,_width):1,y:__privateGet(this,_isSizeStep)?__privateGet(this,_height):1,z:__privateGet(this,_isSizeStep)?__privateGet(this,_depth):1});const xPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_x):0,yPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_y):0,zPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_z):0;__privateGet(this,_position).setStep("_position","+",{x:xPosition,y:yPosition,z:zPosition}),__privateGet(this,_isTransformStep)?(__privateGet(this,_scale).setStep("_scale","*",{x:__privateGet(this,_CSSScale).x,y:__privateGet(this,_CSSScale).y,z:__privateGet(this,_CSSScale).z}),__privateGet(this,_position).setStep("_translation","+",{x:__privateGet(this,_CSSTranslation).x,y:__privateGet(this,_CSSTranslation).y,z:__privateGet(this,_CSSTranslation).z}),__privateGet(this,_rotation).setStep("_rotation","+",{x:__privateGet(this,_CSSRotation).x,y:__privateGet(this,_CSSRotation).y,z:__privateGet(this,_CSSRotation).z})):(__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}))},"#composeSteps"),updateDimensions_fn=__name(function(){const computed=getComputedStyle(__privateGet(this,_element));__privateSet(this,_width,Math.max(__privateGet(this,_element).clientWidth,1)),__privateSet(this,_height,Math.max(__privateGet(this,_element).clientHeight,1)),__privateSet(this,_depth,Math.max(cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--depth")||"0px"),1));const vl=layout.getCumulativeOffsetLeft(__privateGet(this,_containerElement)),vt=layout.getCumulativeOffsetTop(__privateGet(this,_containerElement)),vw=__privateGet(this,_containerElement).clientWidth,vh=__privateGet(this,_containerElement).clientHeight;if(__privateSet(this,_left,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl),__privateSet(this,_top,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt),__privateGet(this,_scrollAxis)==="z"){const nl=__privateGet(this,_left)/vw,nt=__privateGet(this,_top)/vh;__privateSet(this,_left,(nl-Math.floor(nl))*vw),__privateSet(this,_top,(nt-Math.floor(nt))*vh),__privateGet(this,_frontSide)==="left"?__privateSet(this,_front,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl-__privateGet(this,_left)):__privateSet(this,_front,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt-__privateGet(this,_top))}if(__privateSet(this,_left,__privateGet(this,_left)+__privateGet(this,_element).clientLeft),__privateSet(this,_top,__privateGet(this,_top)+__privateGet(this,_element).clientTop),__privateSet(this,_left,__privateGet(this,_left)+layout.getStickyOffset(this.element,"left")*-1),__privateSet(this,_top,__privateGet(this,_top)+layout.getStickyOffset(this.element,"top")*-1),__privateGet(this,_isCartesian)){const viewHalfWidth=Math.round(vw/2),viewHalfHeight=Math.round(vh/2),thisHalfWidth=__privateGet(this,_width)?Math.round(__privateGet(this,_width)/2):0,thisHalfHeight=__privateGet(this,_height)?Math.round(__privateGet(this,_height)/2):0,positionX=__privateGet(this,_left)-viewHalfWidth+thisHalfWidth,positionY=(__privateGet(this,_top)-viewHalfHeight+thisHalfHeight)*-1;__privateSet(this,_x,positionX),__privateSet(this,_y,positionY)}else __privateSet(this,_x,__privateGet(this,_left)),__privateSet(this,_y,__privateGet(this,_top));__privateSet(this,_z,__privateGet(this,_front)*-1);const cssMatrix=new WebKitCSSMatrix(computed.transform),decomposedMatrix=decomposeCSSMatrix(cssMatrix);__privateGet(this,_CSSTranslation).x=decomposedMatrix.translationX,__privateGet(this,_CSSTranslation).y=decomposedMatrix.translationY,__privateGet(this,_CSSTranslation).z=decomposedMatrix.translationZ,__privateGet(this,_CSSScale).x=decomposedMatrix.scaleX,__privateGet(this,_CSSScale).y=decomposedMatrix.scaleY,__privateGet(this,_CSSScale).z=decomposedMatrix.scaleZ,__privateGet(this,_CSSRotation).x=decomposedMatrix.rotationX,__privateGet(this,_CSSRotation).y=decomposedMatrix.rotationY,__privateGet(this,_CSSRotation).z=decomposedMatrix.rotationZ,__privateMethod(this,_LayoutBox_instances,composeSteps_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this),__privateGet(this,_resizeNotifier).notify()},"#updateDimensions"),updateScrollPosition_fn=__name(function(){__privateGet(this,_scrollValue).x=0,__privateGet(this,_scrollValue).y=0,__privateGet(this,_scrollValue).z=0;for(let index=0;index<__privateGet(this,_scrollStepSetterCallbacks).length;index++){const callbackReturn=__privateGet(this,_scrollStepSetterCallbacks)[index]();let axis=callbackReturn.axis;__privateGet(this,_scrollAxis)!=="auto"&&(axis=__privateGet(this,_scrollAxis));const value=callbackReturn.value*(axis==="x"?-1:__privateGet(this,_isCartesian)?1:-1);__privateGet(this,_scrollValue)[axis]+=value,__privateGet(this,_position).setStep(`_scroll_${index}`,"+",{[axis]:value})}},"#updateScrollPosition"),_resizeListener=new WeakMap,_tickListener=new WeakMap,_scrollEntriesListener=new WeakMap,__name(_LayoutBox,"LayoutBox");let LayoutBox=_LayoutBox;exports.LayoutBox=LayoutBox;exports.decomposeCSSMatrix=decomposeCSSMatrix;
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 cssUnitParser_index=require("../css-unit-parser/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),ladder_index=require("../ladder/index.cjs"),notifier_index=require("../notifier/index.cjs"),order_index=require("../order/index.cjs"),scrollEntries_index=require("../scroll-entries/index.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),dom=require("../dom-B40i6NXw.cjs"),layout=require("../layout-CnGLl7oe.cjs");require("construct-style-sheets-polyfill");const windowResizer_index=require("../window-resizer/index.cjs");function decomposeCSSMatrix(matrix){const scaleX=Math.sqrt(matrix.m11*matrix.m11+matrix.m12*matrix.m12+matrix.m13*matrix.m13),scaleY=Math.sqrt(matrix.m21*matrix.m21+matrix.m22*matrix.m22+matrix.m23*matrix.m23),scaleZ=Math.sqrt(matrix.m31*matrix.m31+matrix.m32*matrix.m32+matrix.m33*matrix.m33),rotationX=Math.atan2(matrix.m32,matrix.m33),rotationY=Math.atan2(-matrix.m31,Math.sqrt(matrix.m32*matrix.m32+matrix.m33*matrix.m33)),rotationZ=Math.atan2(matrix.m21,matrix.m11),translationX=matrix.m41,translationY=matrix.m42*-1,translationZ=matrix.m43;return{scaleX,scaleY,scaleZ,rotationX,rotationY,rotationZ,translationX,translationY,translationZ}}__name(decomposeCSSMatrix,"decomposeCSSMatrix");var _element,_containerElement,_scrollStepSetterCallbacks,_scrollAxis,_frontSide,_isCartesian,_isSizeStep,_isPositionStep,_isTransformStep,_isScrollStep,_width,_height,_depth,_top,_left,_front,_x,_y,_z,_CSSTranslation,_CSSRotation,_CSSScale,_rotation,_position,_scale,_scrollValue,_scrollEntries,_resizeNotifier,_LayoutBox_instances,recalculate_fn,composeSteps_fn,updateDimensions_fn,updateScrollPosition_fn,_resizeListener,_tickListener,_scrollEntriesListener;const _LayoutBox=class _LayoutBox{constructor(element,options){__privateAdd(this,_LayoutBox_instances);__privateAdd(this,_element,null);__privateAdd(this,_containerElement,null);__privateAdd(this,_scrollStepSetterCallbacks,[]);__privateAdd(this,_scrollAxis,"auto");__privateAdd(this,_frontSide,"top");__privateAdd(this,_isCartesian,!1);__privateAdd(this,_isSizeStep,!0);__privateAdd(this,_isPositionStep,!0);__privateAdd(this,_isTransformStep,!0);__privateAdd(this,_isScrollStep,!0);__privateAdd(this,_width,0);__privateAdd(this,_height,0);__privateAdd(this,_depth,0);__privateAdd(this,_top,0);__privateAdd(this,_left,0);__privateAdd(this,_front,0);__privateAdd(this,_x,0);__privateAdd(this,_y,0);__privateAdd(this,_z,0);__privateAdd(this,_CSSTranslation,{x:0,y:0,z:0});__privateAdd(this,_CSSRotation,{x:0,y:0,z:0});__privateAdd(this,_CSSScale,{x:1,y:1,z:1});__privateAdd(this,_rotation,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_position,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scale,new ladder_index.Ladder({x:0,y:0,z:0}));__privateAdd(this,_scrollValue,{x:0,y:0,z:0});__privateAdd(this,_scrollEntries,new Map);__privateAdd(this,_resizeNotifier,new notifier_index.Notifier);__privateAdd(this,_resizeListener,__name(()=>{intersector_index.isBrowser&&__privateMethod(this,_LayoutBox_instances,updateDimensions_fn).call(this)},"#resizeListener"));__privateAdd(this,_tickListener,__name(()=>{__privateMethod(this,_LayoutBox_instances,updateScrollPosition_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this)},"#tickListener"));__privateAdd(this,_scrollEntriesListener,__name(()=>{const allEntries=scrollEntries_index.scrollEntries.getAll(this.element);__privateGet(this,_scrollEntries).forEach((value,key)=>{allEntries.includes(key)||(this.deleteScrollStep(value),__privateGet(this,_scrollEntries).delete(key))}),allEntries.forEach(entry=>{if(!__privateGet(this,_scrollEntries).has(entry)){const callback=__name(()=>entry,"callback");__privateGet(this,_scrollEntries).set(entry,callback),this.setScrollStep(callback)}})},"#scrollEntriesListener"));intersector_index.isBrowser&&(__privateSet(this,_element,dom.getElement(element)||document.body),__privateSet(this,_containerElement,dom.getElement(options==null?void 0:options.containerElement)||document.body),__privateSet(this,_scrollAxis,(options==null?void 0:options.scrollAxis)||"auto"),__privateSet(this,_frontSide,(options==null?void 0:options.frontSide)||"top"),__privateSet(this,_isCartesian,(options==null?void 0:options.cartesian)||!1),__privateSet(this,_isSizeStep,(options==null?void 0:options.sizeStep)!==void 0?options.sizeStep:!0),__privateSet(this,_isPositionStep,(options==null?void 0:options.positionStep)!==void 0?options.positionStep:!0),__privateSet(this,_isTransformStep,(options==null?void 0:options.transformStep)!==void 0?options.transformStep:!0),__privateSet(this,_isScrollStep,(options==null?void 0:options.scrollStep)!==void 0?options.scrollStep:!0),__privateGet(this,_scale).setStep("_size","+",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_position","+",{x:0,y:0,z:0}),__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}),__privateGet(this,_isScrollStep)&&(scrollEntries_index.scrollEntries.notifier.subscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntriesListener).call(this),this.setScrollStep(()=>({axis:"y",value:layout.getStickyOffset(this.element,"top")*-1})),this.setScrollStep(()=>({axis:"x",value:layout.getStickyOffset(this.element,"left")*-1}))),elementResizer_index.elementResizer.subscribe(this.element,__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.LAYOUT_BOX),intersector_index.ticker.subscribe(__privateGet(this,_tickListener),{order:order_index.TICK_ORDER.LAYOUT_BOX,culling:options!=null&&options.culling?this.element:void 0}))}get element(){return __privateGet(this,_element)}get containerElement(){return __privateGet(this,_containerElement)}get position(){return __privateGet(this,_position).current}get rotation(){return __privateGet(this,_rotation).current}get scale(){return __privateGet(this,_scale).current}get scrollValue(){return __privateGet(this,_scrollValue)}get left(){return __privateGet(this,_left)}get top(){return __privateGet(this,_top)}get CSSTranslation(){return __privateGet(this,_CSSTranslation)}get CSSRotation(){return __privateGet(this,_CSSRotation)}get CSSScale(){return __privateGet(this,_CSSScale)}get front(){return __privateGet(this,_front)}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get depth(){return __privateGet(this,_depth)}destroy(){intersector_index.ticker.unsubscribe(__privateGet(this,_tickListener)),elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener)),windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener)),scrollEntries_index.scrollEntries.notifier.unsubscribe(__privateGet(this,_scrollEntriesListener)),__privateGet(this,_scrollEntries).clear(),__privateGet(this,_position).close(),__privateGet(this,_rotation).close(),__privateGet(this,_scale).close()}bindObject(object){object.position&&__privateGet(this,_position).bind(object.position),object.rotation&&__privateGet(this,_rotation).bind(object.rotation),object.scale&&__privateGet(this,_scale).bind(object.scale)}unbindObject(object){object.position&&__privateGet(this,_position).unbind(object.position),object.rotation&&__privateGet(this,_rotation).unbind(object.rotation),object.scale&&__privateGet(this,_scale).unbind(object.scale)}setScrollStep(callback){return __privateGet(this,_scrollStepSetterCallbacks).includes(callback)||__privateGet(this,_scrollStepSetterCallbacks).push(callback),()=>this.deleteScrollStep(callback)}deleteScrollStep(callback){__privateSet(this,_scrollStepSetterCallbacks,__privateGet(this,_scrollStepSetterCallbacks).filter(s=>s!==callback))}setPositionStep(...args){__privateGet(this,_position).setStep(...args)}getPositionStep(...args){return __privateGet(this,_position).getStepValue(...args)}setRotationStep(...args){__privateGet(this,_rotation).setStep(...args)}getRotationStep(...args){return __privateGet(this,_rotation).getStepValue(...args)}getExcludedRotationSteps(...args){return __privateGet(this,_rotation).getExcludedStepsValue(...args)}getIncludedRotationSteps(...args){return __privateGet(this,_rotation).getIncludedStepsValue(...args)}setScaleStep(...args){__privateGet(this,_scale).setStep(...args)}getScaleStep(...args){return __privateGet(this,_scale).getStepValue(...args)}getExcludedScaleSteps(...args){return __privateGet(this,_scale).getExcludedStepsValue(...args)}getIncludedScaleSteps(...args){return __privateGet(this,_scale).getIncludedStepsValue(...args)}deletePositionStep(...args){__privateGet(this,_position).deleteStep(...args)}getExcludedPositionSteps(...args){return __privateGet(this,_position).getExcludedStepsValue(...args)}getIncludedPositionSteps(...args){return __privateGet(this,_position).getIncludedStepsValue(...args)}deleteRotationStep(...args){__privateGet(this,_rotation).deleteStep(...args)}deleteScaleStep(...args){__privateGet(this,_scale).deleteStep(...args)}onPosition(...args){return __privateGet(this,_position).subscribe(...args)}offPosition(...args){__privateGet(this,_position).unsubscribe(...args)}onScale(...args){return __privateGet(this,_scale).subscribe(...args)}offScale(...args){__privateGet(this,_scale).unsubscribe(...args)}onRotation(...args){return __privateGet(this,_rotation).subscribe(...args)}offRotation(...args){__privateGet(this,_rotation).unsubscribe(...args)}onResize(...args){return __privateGet(this,_resizeNotifier).subscribe(...args)}offResize(...args){return __privateGet(this,_resizeNotifier).unsubscribe(...args)}};_element=new WeakMap,_containerElement=new WeakMap,_scrollStepSetterCallbacks=new WeakMap,_scrollAxis=new WeakMap,_frontSide=new WeakMap,_isCartesian=new WeakMap,_isSizeStep=new WeakMap,_isPositionStep=new WeakMap,_isTransformStep=new WeakMap,_isScrollStep=new WeakMap,_width=new WeakMap,_height=new WeakMap,_depth=new WeakMap,_top=new WeakMap,_left=new WeakMap,_front=new WeakMap,_x=new WeakMap,_y=new WeakMap,_z=new WeakMap,_CSSTranslation=new WeakMap,_CSSRotation=new WeakMap,_CSSScale=new WeakMap,_rotation=new WeakMap,_position=new WeakMap,_scale=new WeakMap,_scrollValue=new WeakMap,_scrollEntries=new WeakMap,_resizeNotifier=new WeakMap,_LayoutBox_instances=new WeakSet,recalculate_fn=__name(function(){__privateGet(this,_scale).calculate(),__privateGet(this,_position).calculate(),__privateGet(this,_rotation).calculate()},"#recalculate"),composeSteps_fn=__name(function(){__privateGet(this,_scale).setStep("_size","+",{x:__privateGet(this,_isSizeStep)?__privateGet(this,_width):1,y:__privateGet(this,_isSizeStep)?__privateGet(this,_height):1,z:__privateGet(this,_isSizeStep)?__privateGet(this,_depth):1});const xPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_x):0,yPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_y):0,zPosition=__privateGet(this,_isPositionStep)?__privateGet(this,_z):0;__privateGet(this,_position).setStep("_position","+",{x:xPosition,y:yPosition,z:zPosition}),__privateGet(this,_isTransformStep)?(__privateGet(this,_scale).setStep("_scale","*",{x:__privateGet(this,_CSSScale).x,y:__privateGet(this,_CSSScale).y,z:__privateGet(this,_CSSScale).z}),__privateGet(this,_position).setStep("_translation","+",{x:__privateGet(this,_CSSTranslation).x,y:__privateGet(this,_CSSTranslation).y,z:__privateGet(this,_CSSTranslation).z}),__privateGet(this,_rotation).setStep("_rotation","+",{x:__privateGet(this,_CSSRotation).x,y:__privateGet(this,_CSSRotation).y,z:__privateGet(this,_CSSRotation).z})):(__privateGet(this,_scale).setStep("_scale","*",{x:1,y:1,z:1}),__privateGet(this,_position).setStep("_translation","+",{x:0,y:0,z:0}),__privateGet(this,_rotation).setStep("_rotation","+",{x:0,y:0,z:0}))},"#composeSteps"),updateDimensions_fn=__name(function(){const computed=getComputedStyle(__privateGet(this,_element));__privateSet(this,_width,Math.max(__privateGet(this,_element).clientWidth,1)),__privateSet(this,_height,Math.max(__privateGet(this,_element).clientHeight,1)),__privateSet(this,_depth,Math.max(cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--depth")||"0px")||0,1));const vl=layout.getCumulativeOffsetLeft(__privateGet(this,_containerElement)),vt=layout.getCumulativeOffsetTop(__privateGet(this,_containerElement)),vw=__privateGet(this,_containerElement).clientWidth,vh=__privateGet(this,_containerElement).clientHeight;if(__privateSet(this,_left,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl),__privateSet(this,_top,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt),__privateGet(this,_scrollAxis)==="z"){const nl=__privateGet(this,_left)/vw,nt=__privateGet(this,_top)/vh;__privateSet(this,_left,(nl-Math.floor(nl))*vw),__privateSet(this,_top,(nt-Math.floor(nt))*vh),__privateGet(this,_frontSide)==="left"?__privateSet(this,_front,layout.getCumulativeOffsetLeft(__privateGet(this,_element))-vl-__privateGet(this,_left)):__privateSet(this,_front,layout.getCumulativeOffsetTop(__privateGet(this,_element))-vt-__privateGet(this,_top))}if(__privateSet(this,_left,__privateGet(this,_left)+__privateGet(this,_element).clientLeft),__privateSet(this,_top,__privateGet(this,_top)+__privateGet(this,_element).clientTop),__privateSet(this,_left,__privateGet(this,_left)+layout.getStickyOffset(this.element,"left")*-1),__privateSet(this,_top,__privateGet(this,_top)+layout.getStickyOffset(this.element,"top")*-1),__privateGet(this,_isCartesian)){const viewHalfWidth=Math.round(vw/2),viewHalfHeight=Math.round(vh/2),thisHalfWidth=__privateGet(this,_width)?Math.round(__privateGet(this,_width)/2):0,thisHalfHeight=__privateGet(this,_height)?Math.round(__privateGet(this,_height)/2):0,positionX=__privateGet(this,_left)-viewHalfWidth+thisHalfWidth,positionY=(__privateGet(this,_top)-viewHalfHeight+thisHalfHeight)*-1;__privateSet(this,_x,positionX),__privateSet(this,_y,positionY)}else __privateSet(this,_x,__privateGet(this,_left)),__privateSet(this,_y,__privateGet(this,_top));__privateSet(this,_z,__privateGet(this,_front)*-1);const cssMatrix=new WebKitCSSMatrix(computed.transform),decomposedMatrix=decomposeCSSMatrix(cssMatrix);__privateGet(this,_CSSTranslation).x=decomposedMatrix.translationX,__privateGet(this,_CSSTranslation).y=decomposedMatrix.translationY,__privateGet(this,_CSSTranslation).z=decomposedMatrix.translationZ,__privateGet(this,_CSSScale).x=decomposedMatrix.scaleX,__privateGet(this,_CSSScale).y=decomposedMatrix.scaleY,__privateGet(this,_CSSScale).z=decomposedMatrix.scaleZ,__privateGet(this,_CSSRotation).x=decomposedMatrix.rotationX,__privateGet(this,_CSSRotation).y=decomposedMatrix.rotationY,__privateGet(this,_CSSRotation).z=decomposedMatrix.rotationZ,__privateMethod(this,_LayoutBox_instances,composeSteps_fn).call(this),__privateMethod(this,_LayoutBox_instances,recalculate_fn).call(this),__privateGet(this,_resizeNotifier).notify()},"#updateDimensions"),updateScrollPosition_fn=__name(function(){__privateGet(this,_scrollValue).x=0,__privateGet(this,_scrollValue).y=0,__privateGet(this,_scrollValue).z=0;for(let index=0;index<__privateGet(this,_scrollStepSetterCallbacks).length;index++){const callbackReturn=__privateGet(this,_scrollStepSetterCallbacks)[index]();let axis=callbackReturn.axis;__privateGet(this,_scrollAxis)!=="auto"&&(axis=__privateGet(this,_scrollAxis));const value=callbackReturn.value*(axis==="x"?-1:__privateGet(this,_isCartesian)?1:-1);__privateGet(this,_scrollValue)[axis]+=value,__privateGet(this,_position).setStep(`_scroll_${index}`,"+",{[axis]:value})}},"#updateScrollPosition"),_resizeListener=new WeakMap,_tickListener=new WeakMap,_scrollEntriesListener=new WeakMap,__name(_LayoutBox,"LayoutBox");let LayoutBox=_LayoutBox;exports.LayoutBox=LayoutBox;exports.decomposeCSSMatrix=decomposeCSSMatrix;
@@ -293,7 +293,7 @@ _element = new WeakMap(), _containerElement = new WeakMap(), _scrollStepSetterCa
293
293
  }, "#composeSteps"), updateDimensions_fn = /* @__PURE__ */ __name(function() {
294
294
  const computed = getComputedStyle(__privateGet(this, _element));
295
295
  __privateSet(this, _width, Math.max(__privateGet(this, _element).clientWidth, 1)), __privateSet(this, _height, Math.max(__privateGet(this, _element).clientHeight, 1)), __privateSet(this, _depth, Math.max(
296
- cssUnitParser.parse(computed.getPropertyValue("--depth") || "0px"),
296
+ cssUnitParser.parse(computed.getPropertyValue("--depth") || "0px") || 0,
297
297
  1
298
298
  ));
299
299
  const vl = getCumulativeOffsetLeft(__privateGet(this, _containerElement)), vt = getCumulativeOffsetTop(__privateGet(this, _containerElement)), vw = __privateGet(this, _containerElement).clientWidth, vh = __privateGet(this, _containerElement).clientHeight;
@@ -0,0 +1,11 @@
1
+ export declare class NotchedElement extends HTMLElement {
2
+ #private;
3
+ constructor();
4
+ protected connectedCallback(): void;
5
+ protected disconnectedCallback(): void;
6
+ }
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'e-notched': NotchedElement;
10
+ }
11
+ }
@@ -0,0 +1,77 @@
1
+ interface RoundedRectangle {
2
+ topLeftCornerRadius: number;
3
+ topRightCornerRadius: number;
4
+ bottomRightCornerRadius: number;
5
+ bottomLeftCornerRadius: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ interface NormalizedCorner {
10
+ radius: number;
11
+ roundingAndSmoothingBudget: number;
12
+ }
13
+ interface NormalizedCorners {
14
+ topLeft: NormalizedCorner;
15
+ topRight: NormalizedCorner;
16
+ bottomLeft: NormalizedCorner;
17
+ bottomRight: NormalizedCorner;
18
+ }
19
+ export declare function distributeAndNormalize({ topLeftCornerRadius, topRightCornerRadius, bottomRightCornerRadius, bottomLeftCornerRadius, width, height, }: RoundedRectangle): NormalizedCorners;
20
+ export interface CornerPathParams {
21
+ a: number;
22
+ b: number;
23
+ c: number;
24
+ d: number;
25
+ p: number;
26
+ cornerRadius: number;
27
+ arcSectionLength: number;
28
+ }
29
+ export interface CornerParams {
30
+ cornerAngleAlpha?: number;
31
+ cornerRadius: number;
32
+ cornerSmoothing: number;
33
+ preserveSmoothing: boolean;
34
+ roundingAndSmoothingBudget: number;
35
+ }
36
+ export interface NotchParams {
37
+ start: number;
38
+ length: number;
39
+ slope: number;
40
+ depth: number;
41
+ }
42
+ export declare function getPathParamsForCorner({ cornerRadius, cornerSmoothing, preserveSmoothing, roundingAndSmoothingBudget, cornerAngleAlpha, }: CornerParams): CornerPathParams;
43
+ interface SVGPathInput {
44
+ width: number;
45
+ height: number;
46
+ topRightPathParams: CornerPathParams;
47
+ bottomRightPathParams: CornerPathParams;
48
+ bottomLeftPathParams: CornerPathParams;
49
+ topLeftPathParams: CornerPathParams;
50
+ topNotches?: Array<NotchParams>;
51
+ rightNotches?: Array<NotchParams>;
52
+ bottomNotches?: Array<NotchParams>;
53
+ leftNotches?: Array<NotchParams>;
54
+ }
55
+ export declare function getSVGPathFromPathParams({ width, height, topLeftPathParams, topRightPathParams, bottomLeftPathParams, bottomRightPathParams, topNotches, rightNotches, bottomNotches, leftNotches, }: SVGPathInput): string;
56
+ export interface GetSvgPathParams {
57
+ cornerSmoothing: number;
58
+ preserveSmoothing?: boolean;
59
+ topNotches?: Array<NotchParams>;
60
+ rightNotches?: Array<NotchParams>;
61
+ bottomNotches?: Array<NotchParams>;
62
+ leftNotches?: Array<NotchParams>;
63
+ cornerRadius?: number;
64
+ topLeftCornerRadius?: number;
65
+ topRightCornerRadius?: number;
66
+ bottomRightCornerRadius?: number;
67
+ bottomLeftCornerRadius?: number;
68
+ cornerAngleAlpha?: number;
69
+ topLeftCornerAngleAlpha?: number;
70
+ topRightCornerAngleAlpha?: number;
71
+ bottomRightCornerAngleAlpha?: number;
72
+ bottomLeftCornerAngleAlpha?: number;
73
+ width: number;
74
+ height: number;
75
+ }
76
+ export declare function getSvgPath({ cornerRadius, topLeftCornerRadius, topRightCornerRadius, bottomRightCornerRadius, bottomLeftCornerRadius, cornerAngleAlpha, topLeftCornerAngleAlpha, topRightCornerAngleAlpha, bottomRightCornerAngleAlpha, bottomLeftCornerAngleAlpha, cornerSmoothing, preserveSmoothing, topNotches, rightNotches, bottomNotches, leftNotches, width, height, }: GetSvgPathParams): string;
77
+ export {};
@@ -0,0 +1,62 @@
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 cssUnitParser_index=require("../css-unit-parser/index.cjs"),elementResizer_index=require("../element-resizer/index.cjs"),intersector_index=require("../index-DZ44osDT.cjs"),string=require("../string-CbRNzmd9.cjs");require("construct-style-sheets-polyfill");function distributeAndNormalize({topLeftCornerRadius,topRightCornerRadius,bottomRightCornerRadius,bottomLeftCornerRadius,width,height}){const roundingAndSmoothingBudgetMap={topLeft:-1,topRight:-1,bottomLeft:-1,bottomRight:-1},cornerRadiusMap={topLeft:topLeftCornerRadius,topRight:topRightCornerRadius,bottomLeft:bottomLeftCornerRadius,bottomRight:bottomRightCornerRadius};return Object.entries(cornerRadiusMap).sort(([,radius1],[,radius2])=>radius2-radius1).forEach(([cornerName,radius])=>{const corner=cornerName,adjacents=adjacentsByCorner[corner],budget=Math.min(...adjacents.map(adjacent=>{const adjacentCornerRadius=cornerRadiusMap[adjacent.corner];if(radius===0&&adjacentCornerRadius===0)return 0;const adjacentCornerBudget=roundingAndSmoothingBudgetMap[adjacent.corner],sideLength=adjacent.side==="top"||adjacent.side==="bottom"?width:height;return adjacentCornerBudget>=0?sideLength-roundingAndSmoothingBudgetMap[adjacent.corner]:radius/(radius+adjacentCornerRadius)*sideLength}));roundingAndSmoothingBudgetMap[corner]=budget,cornerRadiusMap[corner]=Math.min(radius,budget)}),{topLeft:{radius:cornerRadiusMap.topLeft,roundingAndSmoothingBudget:roundingAndSmoothingBudgetMap.topLeft},topRight:{radius:cornerRadiusMap.topRight,roundingAndSmoothingBudget:roundingAndSmoothingBudgetMap.topRight},bottomLeft:{radius:cornerRadiusMap.bottomLeft,roundingAndSmoothingBudget:roundingAndSmoothingBudgetMap.bottomLeft},bottomRight:{radius:cornerRadiusMap.bottomRight,roundingAndSmoothingBudget:roundingAndSmoothingBudgetMap.bottomRight}}}__name(distributeAndNormalize,"distributeAndNormalize");const adjacentsByCorner={topLeft:[{corner:"topRight",side:"top"},{corner:"bottomLeft",side:"left"}],topRight:[{corner:"topLeft",side:"top"},{corner:"bottomRight",side:"right"}],bottomLeft:[{corner:"bottomRight",side:"bottom"},{corner:"topLeft",side:"left"}],bottomRight:[{corner:"bottomLeft",side:"bottom"},{corner:"topRight",side:"right"}]};function getPathParamsForCorner({cornerRadius,cornerSmoothing,preserveSmoothing,roundingAndSmoothingBudget,cornerAngleAlpha=90}){let p=(1+cornerSmoothing)*cornerRadius;if(!preserveSmoothing){const maxCornerSmoothing=roundingAndSmoothingBudget/cornerRadius-1;cornerSmoothing=Math.min(cornerSmoothing,maxCornerSmoothing),p=Math.min(p,roundingAndSmoothingBudget)}const arcMeasure=90*(1-cornerSmoothing),arcSectionLength=Math.sin(toRadians(arcMeasure/2))*cornerRadius*Math.sqrt(2),angleAlpha=(cornerAngleAlpha-arcMeasure)/2,p3ToP4Distance=cornerRadius*Math.tan(toRadians(angleAlpha/2)),angleBeta=45*cornerSmoothing,c=p3ToP4Distance*Math.cos(toRadians(angleBeta)),d=c*Math.tan(toRadians(angleBeta));let b=(p-arcSectionLength-c-d)/3,a=2*b;if(preserveSmoothing&&p>roundingAndSmoothingBudget){const p1ToP3MaxDistance=roundingAndSmoothingBudget-d-arcSectionLength-c,minA=p1ToP3MaxDistance/6,maxB=p1ToP3MaxDistance-minA;b=Math.min(b,maxB),a=p1ToP3MaxDistance-b,p=Math.min(p,roundingAndSmoothingBudget)}return{a,b,c,d,p,arcSectionLength,cornerRadius}}__name(getPathParamsForCorner,"getPathParamsForCorner");function getSVGPathFromPathParams({width,height,topLeftPathParams,topRightPathParams,bottomLeftPathParams,bottomRightPathParams,topNotches=[],rightNotches=[],bottomNotches=[],leftNotches=[]}){let d=`M ${topLeftPathParams.p} 0`;return topNotches.forEach(n=>{d+=drawTopNotch(n)}),d+=`L ${width-topRightPathParams.p} 0`,d+=drawTopRightPath(topRightPathParams),rightNotches.forEach(n=>{d+=drawRightNotch(n,width)}),d+=`L ${width} ${height-bottomRightPathParams.p}`,d+=drawBottomRightPath(bottomRightPathParams),bottomNotches.forEach(n=>{d+=drawBottomNotch(n,height)}),d+=`L ${bottomLeftPathParams.p} ${height}`,d+=drawBottomLeftPath(bottomLeftPathParams),leftNotches.forEach(n=>{d+=drawLeftNotch(n)}),d+=`L 0 ${topLeftPathParams.p}`,d+=drawTopLeftPath(topLeftPathParams),d+="Z",d.replace(/[\t\s\n]+/g," ").trim()}__name(getSVGPathFromPathParams,"getSVGPathFromPathParams");function drawTopNotch({start,length,slope,depth}){const end=start+length;return`
2
+ L${start} 0
3
+ C ${start+slope*.5},0 ${start+slope*.5},${depth} ${start+slope},${depth}
4
+ L${end-slope},${depth}
5
+ C ${end-slope*.5},${depth} ${end-slope*.5},0 ${end},0
6
+ `}__name(drawTopNotch,"drawTopNotch");function drawBottomNotch({start,length,slope,depth},height){const end=start+length;return`
7
+ L${end},${height}
8
+ C ${end-slope*.5},${height} ${end-slope*.5},${height-depth} ${end-slope},${height-depth}
9
+ L${start+slope},${height-depth}
10
+ C ${start+slope*.5},${height-depth} ${start+slope*.5},${height} ${start},${height}
11
+ `}__name(drawBottomNotch,"drawBottomNotch");function drawLeftNotch({start,length,slope,depth}){const end=start+length;return`
12
+ L0,${end}
13
+ C 0,${end-slope*.5} ${depth},${end-slope*.5} ${depth},${end-slope}
14
+ L${depth},${start+slope}
15
+ C ${depth},${start+slope*.5} 0,${start+slope*.5} 0,${start}
16
+ `}__name(drawLeftNotch,"drawLeftNotch");function drawRightNotch({start,length,slope,depth},width){const end=start+length;return`
17
+ L${width},${start}
18
+ C ${width},${start+slope*.5} ${width-depth},${start+slope*.5} ${width-depth},${start+slope}
19
+ L${width-depth},${end-slope}
20
+ C ${width-depth},${end-slope*.5} ${width},${end-slope*.5} ${width},${end}
21
+ `}__name(drawRightNotch,"drawRightNotch");function drawTopRightPath({cornerRadius,a,b,c,d,p,arcSectionLength}){return cornerRadius?rounded`
22
+ c ${a} 0 ${a+b} 0 ${a+b+c} ${d}
23
+ a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} ${arcSectionLength}
24
+ c ${d} ${c}
25
+ ${d} ${b+c}
26
+ ${d} ${a+b+c}`:rounded`l ${p} 0`}__name(drawTopRightPath,"drawTopRightPath");function drawBottomRightPath({cornerRadius,a,b,c,d,p,arcSectionLength}){return cornerRadius?rounded`
27
+ c 0 ${a}
28
+ 0 ${a+b}
29
+ ${-d} ${a+b+c}
30
+ a ${cornerRadius} ${cornerRadius} 0 0 1 -${arcSectionLength} ${arcSectionLength}
31
+ c ${-c} ${d}
32
+ ${-(b+c)} ${d}
33
+ ${-(a+b+c)} ${d}`:rounded`l 0 ${p}`}__name(drawBottomRightPath,"drawBottomRightPath");function drawBottomLeftPath({cornerRadius,a,b,c,d,p,arcSectionLength}){return cornerRadius?rounded`
34
+ c ${-a} 0
35
+ ${-(a+b)} 0
36
+ ${-(a+b+c)} ${-d}
37
+ a ${cornerRadius} ${cornerRadius} 0 0 1 -${arcSectionLength} -${arcSectionLength}
38
+ c ${-d} ${-c}
39
+ ${-d} ${-(b+c)}
40
+ ${-d} ${-(a+b+c)}`:rounded`l ${-p} 0`}__name(drawBottomLeftPath,"drawBottomLeftPath");function drawTopLeftPath({cornerRadius,a,b,c,d,p,arcSectionLength}){return cornerRadius?rounded`
41
+ c 0 ${-a}
42
+ 0 ${-(a+b)}
43
+ ${d} ${-(a+b+c)}
44
+ a ${cornerRadius} ${cornerRadius} 0 0 1 ${arcSectionLength} -${arcSectionLength}
45
+ c ${c} ${-d}
46
+ ${b+c} ${-d}
47
+ ${a+b+c} ${-d}`:rounded`l 0 ${-p}`}__name(drawTopLeftPath,"drawTopLeftPath");function toRadians(degrees){return degrees*Math.PI/180}__name(toRadians,"toRadians");function rounded(strings,...values){return strings.reduce((acc,str,i)=>{const value=values[i];return typeof value=="number"?acc+str+value.toFixed(4):acc+str+(value!=null?value:"")},"")}__name(rounded,"rounded");function getSvgPath({cornerRadius=0,topLeftCornerRadius,topRightCornerRadius,bottomRightCornerRadius,bottomLeftCornerRadius,cornerAngleAlpha=90,topLeftCornerAngleAlpha,topRightCornerAngleAlpha,bottomRightCornerAngleAlpha,bottomLeftCornerAngleAlpha,cornerSmoothing,preserveSmoothing=!1,topNotches,rightNotches,bottomNotches,leftNotches,width,height}){if(topLeftCornerRadius=topLeftCornerRadius!=null?topLeftCornerRadius:cornerRadius,topRightCornerRadius=topRightCornerRadius!=null?topRightCornerRadius:cornerRadius,bottomLeftCornerRadius=bottomLeftCornerRadius!=null?bottomLeftCornerRadius:cornerRadius,bottomRightCornerRadius=bottomRightCornerRadius!=null?bottomRightCornerRadius:cornerRadius,topLeftCornerAngleAlpha=topLeftCornerAngleAlpha!=null?topLeftCornerAngleAlpha:cornerAngleAlpha,topRightCornerAngleAlpha=topRightCornerAngleAlpha!=null?topRightCornerAngleAlpha:cornerAngleAlpha,bottomLeftCornerAngleAlpha=bottomLeftCornerAngleAlpha!=null?bottomLeftCornerAngleAlpha:cornerAngleAlpha,bottomRightCornerAngleAlpha=bottomRightCornerAngleAlpha!=null?bottomRightCornerAngleAlpha:cornerAngleAlpha,topLeftCornerRadius===topRightCornerRadius&&topRightCornerRadius===bottomRightCornerRadius&&bottomRightCornerRadius===bottomLeftCornerRadius&&bottomLeftCornerRadius===topLeftCornerRadius&&topLeftCornerAngleAlpha===topRightCornerAngleAlpha&&topRightCornerAngleAlpha===bottomRightCornerAngleAlpha&&bottomRightCornerAngleAlpha===bottomLeftCornerAngleAlpha&&bottomLeftCornerAngleAlpha===topLeftCornerAngleAlpha){const roundingAndSmoothingBudget=Math.min(width,height)/2,cornerRadius2=Math.min(topLeftCornerRadius,roundingAndSmoothingBudget),pathParams=getPathParamsForCorner({cornerRadius:cornerRadius2,cornerSmoothing,cornerAngleAlpha,preserveSmoothing,roundingAndSmoothingBudget});return getSVGPathFromPathParams({width,height,topLeftPathParams:pathParams,topRightPathParams:pathParams,bottomLeftPathParams:pathParams,bottomRightPathParams:pathParams,topNotches,rightNotches,bottomNotches,leftNotches})}const{topLeft,topRight,bottomLeft,bottomRight}=distributeAndNormalize({topLeftCornerRadius,topRightCornerRadius,bottomRightCornerRadius,bottomLeftCornerRadius,width,height});return getSVGPathFromPathParams({width,height,topLeftPathParams:getPathParamsForCorner({cornerSmoothing,preserveSmoothing,cornerRadius:topLeft.radius,roundingAndSmoothingBudget:topLeft.roundingAndSmoothingBudget,cornerAngleAlpha:topLeftCornerAngleAlpha}),topRightPathParams:getPathParamsForCorner({cornerSmoothing,preserveSmoothing,cornerRadius:topRight.radius,roundingAndSmoothingBudget:topRight.roundingAndSmoothingBudget,cornerAngleAlpha:topRightCornerAngleAlpha}),bottomRightPathParams:getPathParamsForCorner({cornerSmoothing,preserveSmoothing,cornerRadius:bottomRight.radius,roundingAndSmoothingBudget:bottomRight.roundingAndSmoothingBudget,cornerAngleAlpha:bottomRightCornerAngleAlpha}),bottomLeftPathParams:getPathParamsForCorner({cornerSmoothing,preserveSmoothing,cornerRadius:bottomLeft.radius,roundingAndSmoothingBudget:bottomLeft.roundingAndSmoothingBudget,cornerAngleAlpha:bottomLeftCornerAngleAlpha}),topNotches,rightNotches,bottomNotches,leftNotches})}__name(getSvgPath,"getSvgPath");var _svgElement,_pathElement,_resizeListener,_NotchedElement_instances,parseCSSNotchValue_fn;const _NotchedElement=class _NotchedElement extends HTMLElement{constructor(){super();__privateAdd(this,_NotchedElement_instances);__privateAdd(this,_svgElement);__privateAdd(this,_pathElement);__privateAdd(this,_resizeListener,__name(()=>{const width=this.offsetWidth,height=this.offsetHeight,computed=getComputedStyle(this);__privateGet(this,_svgElement).setAttributeNS("http://www.w3.org/2000/svg","viewBox",`0 0 ${width} ${height}`);const cornerRadius=cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--notched-corner-radius")),topLeftCornerRadius=cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--notched-top-left-corner-radius")),topRightCornerRadius=cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--notched-top-right-corner-radius")),bottomRightCornerRadius=cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--notched-bottom-right-corner-radius")),bottomLeftCornerRadius=cssUnitParser_index.cssUnitParser.parse(computed.getPropertyValue("--notched-bottom-left-corner-radius")),cornerAngleAlpha=parseFloat(computed.getPropertyValue("--notched-corner-angle-alpha"))||void 0,topLeftCornerAngleAlpha=parseFloat(computed.getPropertyValue("--notched-top-left-corner-angle-alpha"))||void 0,topRightCornerAngleAlpha=parseFloat(computed.getPropertyValue("--notched-top-right-corner-angle-alpha"))||void 0,bottomRightCornerAngleAlpha=parseFloat(computed.getPropertyValue("--notched-bottom-right-corner-angle-alpha"))||void 0,bottomLeftCornerAngleAlpha=parseFloat(computed.getPropertyValue("--notched-bottom-left-corner-angle-alpha"))||void 0,cornerSmoothing=parseFloat(computed.getPropertyValue("--notched-corner-smoothing"))||0,preserveSmoothing=computed.getPropertyValue("--notched-preserve-smoothing")!=="false",topNotches=__privateMethod(this,_NotchedElement_instances,parseCSSNotchValue_fn).call(this,computed.getPropertyValue("--notched-top-notches")),rightNotches=__privateMethod(this,_NotchedElement_instances,parseCSSNotchValue_fn).call(this,computed.getPropertyValue("--notched-right-notches")),bottomNotches=__privateMethod(this,_NotchedElement_instances,parseCSSNotchValue_fn).call(this,computed.getPropertyValue("--notched-bottom-notches")),leftNotches=__privateMethod(this,_NotchedElement_instances,parseCSSNotchValue_fn).call(this,computed.getPropertyValue("--notched-left-notches")),color=computed.getPropertyValue("--notched-color"),path=getSvgPath({cornerRadius,topLeftCornerRadius,topRightCornerRadius,bottomRightCornerRadius,bottomLeftCornerRadius,cornerAngleAlpha,topLeftCornerAngleAlpha,topRightCornerAngleAlpha,bottomRightCornerAngleAlpha,bottomLeftCornerAngleAlpha,cornerSmoothing,preserveSmoothing,topNotches,rightNotches,bottomNotches,leftNotches,width,height});__privateGet(this,_pathElement).setAttribute("d",path),color&&__privateGet(this,_pathElement).setAttribute("fill",color)},"#resizeListener"));const clipId=this.hasAttribute("clip")?"clip-"+string.generateId(10):null,tmpElement=document.createElement("div");tmpElement.innerHTML=`
48
+ <svg xmlns="http://www.w3.org/2000/svg">
49
+ ${clipId?`<clipPath id="${clipId}">`:""}
50
+ <path></path>
51
+ ${clipId?"</clipPath>":""}
52
+ </svg>
53
+ <slot></slot>
54
+ `,clipId&&(this.style.clipPath=`url(#${clipId})`),this.style.position="relative",__privateSet(this,_svgElement,tmpElement.querySelector("svg")),__privateGet(this,_svgElement).style.cssText=`
55
+ position: absolute;
56
+ top: 0;
57
+ left: 0;
58
+ zIndex: -1;
59
+ display: block;
60
+ width: 100%;
61
+ height: 100%;
62
+ `,__privateSet(this,_pathElement,tmpElement.querySelector("path")),this.prepend(tmpElement.firstElementChild)}connectedCallback(){elementResizer_index.elementResizer.subscribe(this,__privateGet(this,_resizeListener)),intersector_index.ticker.subscribe(__privateGet(this,_resizeListener))}disconnectedCallback(){elementResizer_index.elementResizer.unsubscribe(__privateGet(this,_resizeListener))}};_svgElement=new WeakMap,_pathElement=new WeakMap,_resizeListener=new WeakMap,_NotchedElement_instances=new WeakSet,parseCSSNotchValue_fn=__name(function(value){const notchesString=value.split(",").map(v=>v.trim()).filter(v=>!!v),notches=[];return notchesString.forEach(notchString=>{const valuesStrings=notchString.split(" ").map(v=>v.trim()).filter(v=>!!v);notches.push({start:cssUnitParser_index.cssUnitParser.parse(valuesStrings[0])||0,length:cssUnitParser_index.cssUnitParser.parse(valuesStrings[1])||0,slope:cssUnitParser_index.cssUnitParser.parse(valuesStrings[2])||0,depth:cssUnitParser_index.cssUnitParser.parse(valuesStrings[3])||0})}),notches},"#parseCSSNotchValue"),__name(_NotchedElement,"NotchedElement");let NotchedElement=_NotchedElement;customElements.get("e-notched")||customElements.define("e-notched",NotchedElement);exports.NotchedElement=NotchedElement;
@@ -0,0 +1 @@
1
+ export { NotchedElement } from './NotchedElement';