sidebarius 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,345 @@
1
+ /**
2
+ * Sidebarius
3
+ * @version 1.0.0
4
+ * @link https://github.com/phenomenonus/sidebarius
5
+ * @author Mikhail Prugov
6
+ * @copyright 2026
7
+ * @license The MIT License (MIT)
8
+ */
9
+ class Sidebarius {
10
+ /**
11
+ * @param container - The {@link Prop.Container|Container} element (parent) that holds the sticky element.
12
+ * @param containerInner - The {@link Prop.ContainerInner|ContainerInner} element that will be endowed with stickiness and scrolling abilities relative to its parent (container).
13
+ * @param spaceBottom - The space between the bottom of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport} and the bottom of the `visible area` or `collider`. Default is 0.
14
+ * @param spaceTop - The space between the top of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport} and the top of the `visible area` or `collider`. Default is 0.
15
+ * @param {Callback} callback - This callback is called **before** the {@link Prop.ContainerInner|ContainerInner} changes, such as resizing, scrolling, or other layout changes.
16
+ */
17
+ constructor(container, containerInner, spaceBottom = 0, spaceTop = 0, callback = () => { }) {
18
+ var t = this;
19
+ t["d" /* Prop.Container */] = container;
20
+ t["g" /* Prop.ContainerInner */] = containerInner;
21
+ t["o" /* Prop.ListOfRules */] = { left: '', top: '', position: '', width: '', transform: '' };
22
+ t["x" /* Prop.PrevSpaceBottom */] = t["E" /* Prop.SpaceBottom */] = spaceBottom;
23
+ t["y" /* Prop.PrevSpaceTop */] = t["F" /* Prop.SpaceTop */] = spaceTop;
24
+ t["a" /* Prop.Callback */] = callback;
25
+ t["P" /* Method.Init */]();
26
+ t["J" /* Method.CalcDims */] = t["J" /* Method.CalcDims */].bind(t);
27
+ t["K" /* Method.CalcScroll */] = t["K" /* Method.CalcScroll */].bind(t);
28
+ t["U" /* Method.ResizeListener */] = t["U" /* Method.ResizeListener */].bind(t);
29
+ t["V" /* Method.ScrollListener */] = t["V" /* Method.ScrollListener */].bind(t);
30
+ t["D" /* Prop.ResizeObserver */] = new ResizeObserver(t["U" /* Method.ResizeListener */]);
31
+ }
32
+ /**
33
+ * Start sticky scrolling behavior. Use {@link stop} method to stop sticky scrolling behavior.
34
+ */
35
+ start() {
36
+ this["I" /* Method.AddListeners */](); // calls _calcDims method by default, cause is used ResizeObserver
37
+ }
38
+ /**
39
+ * Stop sticky scrolling behavior. Use {@link start} method to start sticky scrolling behavior again.
40
+ */
41
+ stop() {
42
+ var t = this;
43
+ t["R" /* Method.RemoveListeners */]();
44
+ t["P" /* Method.Init */]();
45
+ t["S" /* Method.Render */](0 /* State.None */);
46
+ }
47
+ /**
48
+ * Set the distance to the collider. It triggers re-rendering.
49
+ *
50
+ * @param {number} bottomSpace - The {@link Prop.SpaceBottom|SpaceBottom}.
51
+ * @param {number} spaceTop - The {@link Prop.SpaceTop|SpaceTop}.
52
+ */
53
+ setSpaces(bottomSpace, spaceTop) {
54
+ var s = this;
55
+ s["E" /* Prop.SpaceBottom */] = bottomSpace;
56
+ s["F" /* Prop.SpaceTop */] = spaceTop;
57
+ s["P" /* Method.Init */]();
58
+ s["U" /* Method.ResizeListener */]();
59
+ }
60
+ [("P" /* Method.Init */)]() {
61
+ var t = this;
62
+ t["b" /* Prop.ColliderHeight */] =
63
+ t["c" /* Prop.ColliderTop */] =
64
+ t["e" /* Prop.ContainerBottom */] =
65
+ t["f" /* Prop.ContainerHeight */] =
66
+ t["h" /* Prop.ContainerLeft */] =
67
+ t["i" /* Prop.ContainerTop */] =
68
+ t["j" /* Prop.ContainerWidth */] =
69
+ t["k" /* Prop.Event */] =
70
+ t["l" /* Prop.IsRunningRequest */] =
71
+ t["p" /* Prop.MaxBottomWithTranslateY */] =
72
+ t["q" /* Prop.MaxTopWithTranslateY */] =
73
+ t["r" /* Prop.MaxTranslateY */] =
74
+ t["s" /* Prop.PrevColliderTop */] =
75
+ t["t" /* Prop.PrevContainerLeft */] =
76
+ t["u" /* Prop.PrevContainerTop */] =
77
+ t["v" /* Prop.PrevContainerWidth */] =
78
+ t["w" /* Prop.PrevElementHeight */] =
79
+ t["z" /* Prop.PrevState */] =
80
+ t["A" /* Prop.PrevStrategy */] =
81
+ t["B" /* Prop.PrevViewportScrollX */] =
82
+ t["C" /* Prop.PrevViewportScrollY */] =
83
+ t["G" /* Prop.Strategy */] =
84
+ t["H" /* Prop.TranslateY */] =
85
+ 0;
86
+ }
87
+ ["U" /* Method.ResizeListener */]() {
88
+ this["k" /* Prop.Event */] = 1 /* Event.Resize */;
89
+ this["T" /* Method.Request */]();
90
+ }
91
+ ["V" /* Method.ScrollListener */]() {
92
+ if (this["k" /* Prop.Event */] === 0 /* Event.None */)
93
+ this["k" /* Prop.Event */] = 2 /* Event.Scroll */;
94
+ this["T" /* Method.Request */]();
95
+ }
96
+ ["L" /* Method.GetCoords */](element) {
97
+ const coords = { left: element.offsetLeft, top: element.offsetTop };
98
+ while ((element = 'BODY' === element.tagName ? element.parentElement : element.offsetParent)) {
99
+ coords.top += element.offsetTop;
100
+ coords.left += element.offsetLeft;
101
+ }
102
+ return coords;
103
+ }
104
+ ["S" /* Method.Render */](state) {
105
+ var t = this;
106
+ let r = {};
107
+ if (state === 1 /* State.ContainerBottom */) {
108
+ t["H" /* Prop.TranslateY */] = t["r" /* Prop.MaxTranslateY */];
109
+ r = {
110
+ position: 'relative',
111
+ transform: `translate3d(0px, ${t["H" /* Prop.TranslateY */]}px, 0px)`,
112
+ };
113
+ }
114
+ else if (state === 3 /* State.ColliderBottom */) {
115
+ t["H" /* Prop.TranslateY */] = 0;
116
+ r = {
117
+ top: t["b" /* Prop.ColliderHeight */] + t["F" /* Prop.SpaceTop */] - t["g" /* Prop.ContainerInner */].offsetHeight + 'px',
118
+ left: t["h" /* Prop.ContainerLeft */] - window.scrollX + 'px',
119
+ position: 'fixed',
120
+ width: t["j" /* Prop.ContainerWidth */] + 'px',
121
+ };
122
+ }
123
+ else if (state === 2 /* State.ColliderTop */) {
124
+ t["H" /* Prop.TranslateY */] = 0;
125
+ r = {
126
+ left: t["h" /* Prop.ContainerLeft */] - window.scrollX + 'px',
127
+ top: t["F" /* Prop.SpaceTop */] + 'px',
128
+ position: 'fixed',
129
+ width: t["j" /* Prop.ContainerWidth */] + 'px',
130
+ };
131
+ }
132
+ else if (state === 0 /* State.None */) {
133
+ t["H" /* Prop.TranslateY */] = 0;
134
+ }
135
+ else if (state === 4 /* State.TranslateY */) {
136
+ if (t["z" /* Prop.PrevState */] === 2 /* State.ColliderTop */) {
137
+ t["H" /* Prop.TranslateY */] = t["s" /* Prop.PrevColliderTop */] - t["i" /* Prop.ContainerTop */];
138
+ }
139
+ else if (t["z" /* Prop.PrevState */] === 3 /* State.ColliderBottom */) {
140
+ t["H" /* Prop.TranslateY */] =
141
+ t["s" /* Prop.PrevColliderTop */] + t["b" /* Prop.ColliderHeight */] - t["i" /* Prop.ContainerTop */] - t["w" /* Prop.PrevElementHeight */];
142
+ }
143
+ else if (t["z" /* Prop.PrevState */] === 1 /* State.ContainerBottom */) {
144
+ t["H" /* Prop.TranslateY */] = t["r" /* Prop.MaxTranslateY */];
145
+ }
146
+ r = {
147
+ position: 'relative',
148
+ transform: `translate3d(0px, ${t["H" /* Prop.TranslateY */]}px, 0px)`,
149
+ };
150
+ }
151
+ for (const key in t["o" /* Prop.ListOfRules */]) {
152
+ t["g" /* Prop.ContainerInner */].style[key] =
153
+ r[key] ?? t["o" /* Prop.ListOfRules */][key];
154
+ }
155
+ }
156
+ ["M" /* Method.GetDirection */]() {
157
+ if (this["C" /* Prop.PrevViewportScrollY */] === window.scrollY)
158
+ return 0 /* Direction.None */;
159
+ return this["C" /* Prop.PrevViewportScrollY */] < window.scrollY ? 1 /* Direction.Down */ : 2 /* Direction.Up */;
160
+ }
161
+ ["N" /* Method.GetState */](direction) {
162
+ var t = this;
163
+ if (t["z" /* Prop.PrevState */] === 2 /* State.ColliderTop */) {
164
+ if (t["c" /* Prop.ColliderTop */] <= t["i" /* Prop.ContainerTop */]) {
165
+ return 0 /* State.None */;
166
+ }
167
+ if (t["c" /* Prop.ColliderTop */] + t["g" /* Prop.ContainerInner */].offsetHeight >= t["e" /* Prop.ContainerBottom */]) {
168
+ return 1 /* State.ContainerBottom */;
169
+ }
170
+ if (t["A" /* Prop.PrevStrategy */] === 2 /* Strategy.Top */ && t["g" /* Prop.ContainerInner */].offsetHeight > t["b" /* Prop.ColliderHeight */]) {
171
+ t["A" /* Prop.PrevStrategy */] = t["G" /* Prop.Strategy */];
172
+ return 4 /* State.TranslateY */;
173
+ }
174
+ if (t["G" /* Prop.Strategy */] === 1 /* Strategy.Both */ && direction === 1 /* Direction.Down */) {
175
+ return 4 /* State.TranslateY */;
176
+ }
177
+ // If the parent container block changes its position and etc.
178
+ if (t["B" /* Prop.PrevViewportScrollX */] !== window.scrollX ||
179
+ t["t" /* Prop.PrevContainerLeft */] !== t["h" /* Prop.ContainerLeft */] ||
180
+ t["v" /* Prop.PrevContainerWidth */] !== t["j" /* Prop.ContainerWidth */] ||
181
+ t["u" /* Prop.PrevContainerTop */] !== t["i" /* Prop.ContainerTop */] ||
182
+ t["x" /* Prop.PrevSpaceBottom */] !== t["E" /* Prop.SpaceBottom */] ||
183
+ t["y" /* Prop.PrevSpaceTop */] !== t["F" /* Prop.SpaceTop */]) {
184
+ return 2 /* State.ColliderTop */;
185
+ }
186
+ }
187
+ else if (t["z" /* Prop.PrevState */] === 3 /* State.ColliderBottom */) {
188
+ if (t["c" /* Prop.ColliderTop */] <= t["i" /* Prop.ContainerTop */]) {
189
+ return 0 /* State.None */;
190
+ }
191
+ if (t["c" /* Prop.ColliderTop */] + t["b" /* Prop.ColliderHeight */] >= t["e" /* Prop.ContainerBottom */]) {
192
+ return 1 /* State.ContainerBottom */;
193
+ }
194
+ if (t["g" /* Prop.ContainerInner */].offsetHeight <= t["b" /* Prop.ColliderHeight */]) {
195
+ return 2 /* State.ColliderTop */;
196
+ }
197
+ if (direction === 2 /* Direction.Up */ || t["w" /* Prop.PrevElementHeight */] !== t["g" /* Prop.ContainerInner */].offsetHeight) {
198
+ return 4 /* State.TranslateY */;
199
+ }
200
+ // If the parent container block changes its position and etc.
201
+ if (t["B" /* Prop.PrevViewportScrollX */] !== window.scrollX ||
202
+ t["t" /* Prop.PrevContainerLeft */] !== t["h" /* Prop.ContainerLeft */] ||
203
+ t["v" /* Prop.PrevContainerWidth */] !== t["j" /* Prop.ContainerWidth */] ||
204
+ t["u" /* Prop.PrevContainerTop */] !== t["i" /* Prop.ContainerTop */] ||
205
+ t["x" /* Prop.PrevSpaceBottom */] !== t["E" /* Prop.SpaceBottom */] ||
206
+ t["y" /* Prop.PrevSpaceTop */] !== t["F" /* Prop.SpaceTop */]) {
207
+ return 3 /* State.ColliderBottom */;
208
+ }
209
+ }
210
+ else if (t["z" /* Prop.PrevState */] === 1 /* State.ContainerBottom */) {
211
+ if (t["c" /* Prop.ColliderTop */] <= t["i" /* Prop.ContainerTop */]) {
212
+ return 0 /* State.None */;
213
+ }
214
+ if (direction === 2 /* Direction.Up */ && t["c" /* Prop.ColliderTop */] <= t["q" /* Prop.MaxTopWithTranslateY */]) {
215
+ return 2 /* State.ColliderTop */;
216
+ }
217
+ if (t["g" /* Prop.ContainerInner */].offsetHeight < t["e" /* Prop.ContainerBottom */] - t["c" /* Prop.ColliderTop */]) {
218
+ return 2 /* State.ColliderTop */;
219
+ }
220
+ if (t["v" /* Prop.PrevContainerWidth */] !== t["j" /* Prop.ContainerWidth */] ||
221
+ t["w" /* Prop.PrevElementHeight */] !== t["g" /* Prop.ContainerInner */].offsetHeight) {
222
+ return 1 /* State.ContainerBottom */;
223
+ }
224
+ }
225
+ else if (t["z" /* Prop.PrevState */] === 0 /* State.None */) {
226
+ // If the page loads with the scroll position below the bottom of the container
227
+ if (t["c" /* Prop.ColliderTop */] >= t["e" /* Prop.ContainerBottom */] ||
228
+ (t["c" /* Prop.ColliderTop */] + t["b" /* Prop.ColliderHeight */] >= t["e" /* Prop.ContainerBottom */] && t["G" /* Prop.Strategy */] !== 2 /* Strategy.Top */)) {
229
+ return 1 /* State.ContainerBottom */;
230
+ }
231
+ if (t["g" /* Prop.ContainerInner */].offsetHeight < t["b" /* Prop.ColliderHeight */] && t["c" /* Prop.ColliderTop */] >= t["i" /* Prop.ContainerTop */]) {
232
+ return 2 /* State.ColliderTop */;
233
+ }
234
+ if (t["G" /* Prop.Strategy */] === 1 /* Strategy.Both */ &&
235
+ t["c" /* Prop.ColliderTop */] + t["b" /* Prop.ColliderHeight */] >= t["p" /* Prop.MaxBottomWithTranslateY */]) {
236
+ return 3 /* State.ColliderBottom */;
237
+ }
238
+ }
239
+ else if (t["z" /* Prop.PrevState */] === 4 /* State.TranslateY */) {
240
+ if (t["f" /* Prop.ContainerHeight */] - t["H" /* Prop.TranslateY */] < t["g" /* Prop.ContainerInner */].offsetHeight) {
241
+ return 1 /* State.ContainerBottom */;
242
+ }
243
+ if (t["g" /* Prop.ContainerInner */].offsetHeight < t["b" /* Prop.ColliderHeight */] ||
244
+ t["c" /* Prop.ColliderTop */] <= t["i" /* Prop.ContainerTop */] + t["H" /* Prop.TranslateY */]) {
245
+ return 2 /* State.ColliderTop */;
246
+ }
247
+ if (t["H" /* Prop.TranslateY */] < t["r" /* Prop.MaxTranslateY */] &&
248
+ t["c" /* Prop.ColliderTop */] + t["b" /* Prop.ColliderHeight */] > t["p" /* Prop.MaxBottomWithTranslateY */] + t["H" /* Prop.TranslateY */]) {
249
+ return 3 /* State.ColliderBottom */;
250
+ }
251
+ }
252
+ return 5 /* State.Rest */;
253
+ }
254
+ ["O" /* Method.GetStrategy */]() {
255
+ var t = this;
256
+ if (t["f" /* Prop.ContainerHeight */] <= t["g" /* Prop.ContainerInner */].offsetHeight)
257
+ return 0 /* Strategy.None */;
258
+ if (t["b" /* Prop.ColliderHeight */] < t["g" /* Prop.ContainerInner */].offsetHeight)
259
+ return 1 /* Strategy.Both */;
260
+ return 2 /* Strategy.Top */;
261
+ }
262
+ ["J" /* Method.CalcDims */]() {
263
+ var t = this;
264
+ const containerCoords = t["L" /* Method.GetCoords */](t["d" /* Prop.Container */]);
265
+ t["h" /* Prop.ContainerLeft */] = containerCoords.left;
266
+ t["i" /* Prop.ContainerTop */] = containerCoords.top;
267
+ t["f" /* Prop.ContainerHeight */] = t["d" /* Prop.Container */].clientHeight;
268
+ t["e" /* Prop.ContainerBottom */] = t["i" /* Prop.ContainerTop */] + t["f" /* Prop.ContainerHeight */];
269
+ t["j" /* Prop.ContainerWidth */] = t["d" /* Prop.Container */].clientWidth;
270
+ t["b" /* Prop.ColliderHeight */] = window.innerHeight - t["F" /* Prop.SpaceTop */] - t["E" /* Prop.SpaceBottom */];
271
+ t["r" /* Prop.MaxTranslateY */] = t["d" /* Prop.Container */].clientHeight - t["g" /* Prop.ContainerInner */].offsetHeight;
272
+ t["p" /* Prop.MaxBottomWithTranslateY */] = t["i" /* Prop.ContainerTop */] + t["g" /* Prop.ContainerInner */].offsetHeight;
273
+ t["q" /* Prop.MaxTopWithTranslateY */] = t["i" /* Prop.ContainerTop */] + t["r" /* Prop.MaxTranslateY */];
274
+ t["G" /* Prop.Strategy */] = t["O" /* Method.GetStrategy */]();
275
+ if (t["G" /* Prop.Strategy */] === 0 /* Strategy.None */) {
276
+ if (t["A" /* Prop.PrevStrategy */] !== t["G" /* Prop.Strategy */])
277
+ t["S" /* Method.Render */](0 /* State.None */);
278
+ }
279
+ else {
280
+ t["K" /* Method.CalcScroll */]();
281
+ }
282
+ t["v" /* Prop.PrevContainerWidth */] = t["j" /* Prop.ContainerWidth */];
283
+ t["t" /* Prop.PrevContainerLeft */] = t["h" /* Prop.ContainerLeft */];
284
+ t["u" /* Prop.PrevContainerTop */] = t["i" /* Prop.ContainerTop */];
285
+ t["w" /* Prop.PrevElementHeight */] = t["g" /* Prop.ContainerInner */].offsetHeight;
286
+ t["A" /* Prop.PrevStrategy */] = t["G" /* Prop.Strategy */];
287
+ t["x" /* Prop.PrevSpaceBottom */] = t["E" /* Prop.SpaceBottom */];
288
+ t["y" /* Prop.PrevSpaceTop */] = t["F" /* Prop.SpaceTop */];
289
+ }
290
+ ["K" /* Method.CalcScroll */]() {
291
+ var t = this;
292
+ if (t["G" /* Prop.Strategy */] === 0 /* Strategy.None */)
293
+ return;
294
+ t["c" /* Prop.ColliderTop */] = window.scrollY + t["F" /* Prop.SpaceTop */];
295
+ const direction = t["M" /* Method.GetDirection */]();
296
+ const state = t["N" /* Method.GetState */](direction);
297
+ if (state !== 5 /* State.Rest */) {
298
+ t["a" /* Prop.Callback */](state, direction, t["G" /* Prop.Strategy */]);
299
+ t["S" /* Method.Render */](state);
300
+ t["z" /* Prop.PrevState */] = state;
301
+ }
302
+ else if (t["A" /* Prop.PrevStrategy */] !== t["G" /* Prop.Strategy */]) {
303
+ t["a" /* Prop.Callback */](state, direction, t["G" /* Prop.Strategy */]);
304
+ }
305
+ t["s" /* Prop.PrevColliderTop */] = t["c" /* Prop.ColliderTop */];
306
+ t["B" /* Prop.PrevViewportScrollX */] = window.scrollX;
307
+ t["C" /* Prop.PrevViewportScrollY */] = window.scrollY;
308
+ }
309
+ ["T" /* Method.Request */]() {
310
+ var t = this;
311
+ if (t["l" /* Prop.IsRunningRequest */] === 1)
312
+ return;
313
+ t["l" /* Prop.IsRunningRequest */] = 1;
314
+ window.requestAnimationFrame(() => {
315
+ (t["k" /* Prop.Event */] === 1 /* Event.Resize */ && t["J" /* Method.CalcDims */]()) ||
316
+ (t["k" /* Prop.Event */] === 2 /* Event.Scroll */ && t["K" /* Method.CalcScroll */]());
317
+ t["k" /* Prop.Event */] = 0 /* Event.None */;
318
+ t["l" /* Prop.IsRunningRequest */] = 0;
319
+ });
320
+ }
321
+ ["Q" /* Method.ObserveTreeNodesFromCurrentToBody */](containerInner) {
322
+ while (containerInner) {
323
+ this["D" /* Prop.ResizeObserver */].observe(containerInner);
324
+ if (containerInner.tagName === 'BODY')
325
+ break;
326
+ containerInner = containerInner.parentElement;
327
+ }
328
+ }
329
+ ["I" /* Method.AddListeners */]() {
330
+ window.addEventListener('scroll', this["V" /* Method.ScrollListener */], {
331
+ capture: false,
332
+ passive: true,
333
+ });
334
+ this["Q" /* Method.ObserveTreeNodesFromCurrentToBody */](this["g" /* Prop.ContainerInner */]);
335
+ }
336
+ ["R" /* Method.RemoveListeners */]() {
337
+ window.removeEventListener('scroll', this["V" /* Method.ScrollListener */], {
338
+ capture: false,
339
+ });
340
+ this["D" /* Prop.ResizeObserver */].disconnect();
341
+ }
342
+ }
343
+
344
+ export { Sidebarius as default };
345
+ //# sourceMappingURL=sidebarius.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebarius.esm.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * Event invokes render\n */\nconst enum Event {\n /**\n * Nothing\n */\n None = 0,\n\n /**\n * Resize event\n */\n Resize = 1,\n\n /**\n * Scroll event\n */\n Scroll = 2,\n}\n\n/**\n * Defines `viewport` direction.\n */\nconst enum Direction {\n None = 0,\n Down = 1,\n Up = 2,\n}\n\n/**\n * The element coordinates.\n */\ntype TypeElementCoords = {\n left: number;\n top: number;\n};\n\n/**\n * Strategy.\n */\nconst enum Strategy {\n /**\n * Nothing do.\n */\n None = 0,\n\n /**\n * Sticky both sides by Y-axis.\n */\n Both = 1,\n\n /**\n * Sticky only top side.\n */\n Top = 2,\n}\n\n/**\n * @ enum {number} Position variant of target {@link Prop.ContainerInner|ContainerInner}.\n */\nconst enum State {\n /**\n * Default {@link Prop.ContainerInner|ContainerInner} behavior.\n */\n None = 0,\n\n /**\n * {@link Prop.ContainerInner|ContainerInner} affixed at the bottom of the {@link Prop.Container|Container}.\n */\n ContainerBottom = 1,\n\n /**\n * {@link Prop.ContainerInner|ContainerInner} fixed at the top of the window viewport area (including {@link Prop.SpaceTop|SpaceTop}).\n */\n ColliderTop = 2,\n\n /**\n * {@link Prop.ContainerInner|ContainerInner} fixed at the bottom of the window viewport area (including {@link Prop.SpaceBottom|SpaceBottom}).\n */\n ColliderBottom = 3,\n\n /**\n * The {@link Prop.ContainerInner|ContainerInner} is offset along the Y axis relative to the {@link Prop.Container|Container}.\n */\n TranslateY = 4,\n\n /**\n * Indicates that rendering should be skipped until the state changes.\n */\n Rest = 5,\n}\n\ntype Rules = Pick<CSSStyleDeclaration, 'left' | 'top' | 'position' | 'width' | 'transform'>;\n\n/**\n * This callback is called **before** the `ContainerInner` changes, such as resizing, scrolling, or other layout changes.\n *\n * @param {number} state - The {@link State} of {@link Prop.ContainerInner|ContainerInner}. Represents a behavior indicator of `ContainerInner` that helps determine its positioning.\n * @param {number} direction - The `viewport` {@link Direction}. Defines the direction of movement of the viewport.\n * @param {number} strategy - The {@link Strategy} that determines the positioning behaviour, based on the sizes of both `Container` and `ContainerInner`.\n */\ntype Callback = (state: State, direction: Direction, strategy: Strategy) => void;\n\n/**\n * Properties\n */\nconst enum Prop {\n /**\n *\n */\n Callback = 'a',\n\n /**\n * Height of the {@link https://socs.binus.ac.id/2017/03/09/collision-detection-in-2d-part-2/|collider}.\n */\n ColliderHeight = 'b',\n\n /**\n * Top coordinate of the {@link https://socs.binus.ac.id/2017/03/09/collision-detection-in-2d-part-2/|collider}.\n */\n ColliderTop = 'c',\n\n /**\n * Parent element of {@link ContainerInner}.\n */\n Container = 'd',\n\n /**\n * Bottom coordinate of the {@link Container}.\n */\n ContainerBottom = 'e',\n\n /**\n * Height of the {@link Container}.\n */\n ContainerHeight = 'f',\n\n /**\n * Target element with sticky and scroll abilities.\n */\n ContainerInner = 'g',\n\n /**\n * Coordinate by X-axis of the {@link Container}.\n */\n ContainerLeft = 'h',\n\n /**\n * Coordinate by Y-axis of the {@link Container}.\n */\n ContainerTop = 'i',\n\n /**\n * Width of the {@link Container}.\n */\n ContainerWidth = 'j',\n\n /**\n * Triggered Event.\n */\n Event = 'k',\n\n /**\n * Indicates that a render request has already been initiated.\n * @default false\n */\n IsRunningRequest = 'l',\n\n /**\n * List of available CSS properties. Also is used as default values for rules.\n */\n ListOfRules = 'o',\n\n /**\n * The maximum allowable coordinate for {@link ColliderBottom} along the Y-axis in the downward {@link Direction}.\n */\n MaxBottomWithTranslateY = 'p',\n\n /**\n * The maximum allowable coordinate for {@link ColliderTop} along the Y-axis in the upward {@link Direction}.\n */\n MaxTopWithTranslateY = 'q',\n\n /**\n * The maximum allowed Y-axis coordinates for {@link ContainerInner} relative to the {@link Container}.\n */\n MaxTranslateY = 'r',\n\n /**\n * Previous top coordinate of the {@link https://socs.binus.ac.id/2017/03/09/collision-detection-in-2d-part-2/|collider}.\n */\n PrevColliderTop = 's',\n\n /**\n * Previous coordinate by X-axis of the {@link Container}.\n */\n PrevContainerLeft = 't',\n\n /**\n * Previous coordinate by Y-axis of the {@link Container}.\n */\n PrevContainerTop = 'u',\n\n /**\n * Previous width of the {@link Container}.\n */\n PrevContainerWidth = 'v',\n\n /**\n * Previous {@link ContainerInner} height.\n */\n PrevElementHeight = 'w',\n\n /**\n * Previous space bottom. See also {@link SpaceBottom}.\n * @default 0\n */\n PrevSpaceBottom = 'x',\n\n /**\n * Previous space top. See also {@link SpaceTop}.\n * @default 0\n */\n PrevSpaceTop = 'y',\n\n /**\n * Previous {@link State}.\n * @default State.None\n */\n PrevState = 'z',\n\n /**\n * Previous strategy. See also {@link Strategy}.\n * @default Strategy.None\n */\n PrevStrategy = 'A',\n\n /**\n * Previous coordinate by X-axis of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport}.\n */\n PrevViewportScrollX = 'B',\n\n /**\n * Previous coordinate by Y-axis of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport}.\n */\n PrevViewportScrollY = 'C',\n\n /**\n * Resize observer.\n */\n ResizeObserver = 'D',\n\n /**\n * Space bottom.\n * @default 0\n */\n SpaceBottom = 'E',\n\n /**\n * Space top.\n * @default 0\n */\n SpaceTop = 'F',\n\n /**\n * Current {@link Strategy}. Helps to detect {@link Prop.ContainerInner|ContainerInner} behaviour.\n * @default Strategy.None\n */\n Strategy = 'G',\n\n /**\n * The Current Y-axis coordinates relative to the {@link Prop.Container|Container}.\n */\n TranslateY = 'H',\n}\n\n/**\n * Properties\n */\nconst enum Method {\n /**\n * Add required event listeners. See {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener|addEventListener} and {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver|ResizeObserver}.\n */\n AddListeners = 'I',\n\n /**\n * Calculate {@link https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements|dimensions}.\n */\n CalcDims = 'J',\n\n /**\n * Calculate {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSSOM_view/Coordinate_systems|coordinates}.\n */\n CalcScroll = 'K',\n\n /**\n * Get coordinates for passed element.\n */\n GetCoords = 'L',\n\n /**\n * Get the scroll direction. `None` for horizontal scrolling or no scrolling.\n */\n GetDirection = 'M',\n\n /**\n * Get state of {@link Prop.ContainerInner|ContainerInner}.\n */\n GetState = 'N',\n\n /**\n * Get a {@link Prop.Strategy} that determines the further behavior of the {@link Prop.ContainerInner|ContainerInner}.\n */\n GetStrategy = 'O',\n\n /**\n * Initialize(or reset) properties to default values.\n */\n Init = 'P',\n\n /**\n * Observe {@link https://developer.mozilla.org/en-US/docs/Web/API/Node|nodes} from {@link Prop.ContainerInner|ContainerInner} to {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/body|document body} with help the {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver|ResizeObserver}.\n */\n ObserveTreeNodesFromCurrentToBody = 'Q',\n\n /**\n * Remove all event listeners. See {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener|removeEventListener} and {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver|ResizeObserver}.\n */\n RemoveListeners = 'R',\n\n /**\n * Update styles in {@link Prop.ContainerInner|ContainerInner} and {@link Prop.Container|Container}.\n */\n Render = 'S',\n\n /**\n * Helps apply DOM manipulation and synchronize processing with rendering. See {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame|requestAnimationFrame}.\n */\n Request = 'T',\n\n /**\n * Resize listener.\n */\n ResizeListener = 'U',\n\n /**\n * Scroll listener.\n */\n ScrollListener = 'V',\n}\n\n/**\n * Sidebarius\n * @version 1.0.0\n * @link https://github.com/phenomenonus/sidebarius\n * @author Mikhail Prugov\n * @copyright 2026\n * @license The MIT License (MIT)\n */\nexport default class Sidebarius {\n private [Prop.Callback]!: Callback;\n private [Prop.ColliderHeight]!: number;\n private [Prop.ColliderTop]!: number;\n private [Prop.Container]!: HTMLElement;\n private [Prop.ContainerBottom]!: number;\n private [Prop.ContainerHeight]!: number;\n private [Prop.ContainerInner]!: HTMLElement;\n private [Prop.ContainerLeft]!: number;\n private [Prop.ContainerTop]!: number;\n private [Prop.ContainerWidth]!: number;\n private [Prop.Event]!: Event;\n private [Prop.IsRunningRequest]!: number;\n private [Prop.ListOfRules]!: Rules;\n private [Prop.MaxBottomWithTranslateY]!: number;\n private [Prop.MaxTopWithTranslateY]!: number;\n private [Prop.MaxTranslateY]!: number;\n private [Prop.PrevColliderTop]!: number;\n private [Prop.PrevContainerLeft]!: number;\n private [Prop.PrevContainerTop]!: number;\n private [Prop.PrevContainerWidth]!: number;\n private [Prop.PrevElementHeight]!: number;\n private [Prop.PrevSpaceBottom]!: number;\n private [Prop.PrevSpaceTop]!: number;\n private [Prop.PrevState]!: State;\n private [Prop.PrevStrategy]!: Strategy;\n private [Prop.PrevViewportScrollX]!: number;\n private [Prop.PrevViewportScrollY]!: number;\n private [Prop.ResizeObserver]!: ResizeObserver;\n private [Prop.SpaceBottom]!: number;\n private [Prop.SpaceTop]!: number;\n private [Prop.Strategy]!: Strategy;\n private [Prop.TranslateY]!: number;\n\n /**\n * @param container - The {@link Prop.Container|Container} element (parent) that holds the sticky element.\n * @param containerInner - The {@link Prop.ContainerInner|ContainerInner} element that will be endowed with stickiness and scrolling abilities relative to its parent (container).\n * @param spaceBottom - The space between the bottom of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport} and the bottom of the `visible area` or `collider`. Default is 0.\n * @param spaceTop - The space between the top of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport} and the top of the `visible area` or `collider`. Default is 0.\n * @param {Callback} callback - This callback is called **before** the {@link Prop.ContainerInner|ContainerInner} changes, such as resizing, scrolling, or other layout changes.\n */\n constructor(\n container: HTMLElement,\n containerInner: HTMLElement,\n spaceBottom: number = 0,\n spaceTop: number = 0,\n callback: Callback = () => {},\n ) {\n var t = this;\n\n t[Prop.Container] = container;\n t[Prop.ContainerInner] = containerInner;\n t[Prop.ListOfRules] = { left: '', top: '', position: '', width: '', transform: '' };\n t[Prop.PrevSpaceBottom] = t[Prop.SpaceBottom] = spaceBottom;\n t[Prop.PrevSpaceTop] = t[Prop.SpaceTop] = spaceTop;\n t[Prop.Callback] = callback;\n\n t[Method.Init]();\n t[Method.CalcDims] = t[Method.CalcDims].bind(t);\n t[Method.CalcScroll] = t[Method.CalcScroll].bind(t);\n t[Method.ResizeListener] = t[Method.ResizeListener].bind(t);\n t[Method.ScrollListener] = t[Method.ScrollListener].bind(t);\n t[Prop.ResizeObserver] = new ResizeObserver(t[Method.ResizeListener]);\n }\n\n /**\n * Start sticky scrolling behavior. Use {@link stop} method to stop sticky scrolling behavior.\n */\n public start(): void {\n this[Method.AddListeners](); // calls _calcDims method by default, cause is used ResizeObserver\n }\n\n /**\n * Stop sticky scrolling behavior. Use {@link start} method to start sticky scrolling behavior again.\n */\n public stop(): void {\n var t = this;\n t[Method.RemoveListeners]();\n t[Method.Init]();\n t[Method.Render](State.None);\n }\n\n /**\n * Set the distance to the collider. It triggers re-rendering.\n *\n * @param {number} bottomSpace - The {@link Prop.SpaceBottom|SpaceBottom}.\n * @param {number} spaceTop - The {@link Prop.SpaceTop|SpaceTop}.\n */\n public setSpaces(bottomSpace: number, spaceTop: number): void {\n var s = this;\n s[Prop.SpaceBottom] = bottomSpace;\n s[Prop.SpaceTop] = spaceTop;\n s[Method.Init]();\n s[Method.ResizeListener]();\n }\n\n private [Method.Init](): void {\n var t = this;\n t[Prop.ColliderHeight] =\n t[Prop.ColliderTop] =\n t[Prop.ContainerBottom] =\n t[Prop.ContainerHeight] =\n t[Prop.ContainerLeft] =\n t[Prop.ContainerTop] =\n t[Prop.ContainerWidth] =\n t[Prop.Event] =\n t[Prop.IsRunningRequest] =\n t[Prop.MaxBottomWithTranslateY] =\n t[Prop.MaxTopWithTranslateY] =\n t[Prop.MaxTranslateY] =\n t[Prop.PrevColliderTop] =\n t[Prop.PrevContainerLeft] =\n t[Prop.PrevContainerTop] =\n t[Prop.PrevContainerWidth] =\n t[Prop.PrevElementHeight] =\n t[Prop.PrevState] =\n t[Prop.PrevStrategy] =\n t[Prop.PrevViewportScrollX] =\n t[Prop.PrevViewportScrollY] =\n t[Prop.Strategy] =\n t[Prop.TranslateY] =\n 0;\n }\n\n private [Method.ResizeListener](): void {\n this[Prop.Event] = Event.Resize;\n this[Method.Request]();\n }\n\n private [Method.ScrollListener](): void {\n if (this[Prop.Event] === Event.None) this[Prop.Event] = Event.Scroll;\n this[Method.Request]();\n }\n\n private [Method.GetCoords](element: HTMLElement): TypeElementCoords {\n const coords = { left: element.offsetLeft, top: element.offsetTop };\n let i = 0;\n while (((element as unknown) = 'BODY' === element.tagName ? element.parentElement : element.offsetParent)) {\n coords.top += element.offsetTop;\n coords.left += element.offsetLeft;\n i++;\n }\n return coords;\n }\n\n private [Method.Render](state: State): void {\n var t = this;\n let r: Partial<Rules> = {};\n\n if (state === State.ContainerBottom) {\n t[Prop.TranslateY] = t[Prop.MaxTranslateY];\n r = {\n position: 'relative',\n transform: `translate3d(0px, ${t[Prop.TranslateY]}px, 0px)`,\n };\n } else if (state === State.ColliderBottom) {\n t[Prop.TranslateY] = 0;\n r = {\n top: t[Prop.ColliderHeight] + t[Prop.SpaceTop] - t[Prop.ContainerInner].offsetHeight + 'px',\n left: t[Prop.ContainerLeft] - window.scrollX + 'px',\n position: 'fixed',\n width: t[Prop.ContainerWidth] + 'px',\n };\n } else if (state === State.ColliderTop) {\n t[Prop.TranslateY] = 0;\n r = {\n left: t[Prop.ContainerLeft] - window.scrollX + 'px',\n top: t[Prop.SpaceTop] + 'px',\n position: 'fixed',\n width: t[Prop.ContainerWidth] + 'px',\n };\n } else if (state === State.None) {\n t[Prop.TranslateY] = 0;\n } else if (state === State.TranslateY) {\n if (t[Prop.PrevState] === State.ColliderTop) {\n t[Prop.TranslateY] = t[Prop.PrevColliderTop] - t[Prop.ContainerTop];\n } else if (t[Prop.PrevState] === State.ColliderBottom) {\n t[Prop.TranslateY] =\n t[Prop.PrevColliderTop] + t[Prop.ColliderHeight] - t[Prop.ContainerTop] - t[Prop.PrevElementHeight];\n } else if (t[Prop.PrevState] === State.ContainerBottom) {\n t[Prop.TranslateY] = t[Prop.MaxTranslateY];\n }\n r = {\n position: 'relative',\n transform: `translate3d(0px, ${t[Prop.TranslateY]}px, 0px)`,\n };\n }\n\n for (const key in t[Prop.ListOfRules]) {\n t[Prop.ContainerInner].style[key as keyof Rules] =\n r[key as unknown as keyof Rules] ?? t[Prop.ListOfRules][key as unknown as keyof Rules];\n }\n }\n\n private [Method.GetDirection](): Direction {\n if (this[Prop.PrevViewportScrollY] === window.scrollY) return Direction.None;\n return this[Prop.PrevViewportScrollY] < window.scrollY ? Direction.Down : Direction.Up;\n }\n\n private [Method.GetState](direction: Direction): State {\n var t = this;\n\n if (t[Prop.PrevState] === State.ColliderTop) {\n if (t[Prop.ColliderTop] <= t[Prop.ContainerTop]) {\n return State.None;\n }\n if (t[Prop.ColliderTop] + t[Prop.ContainerInner].offsetHeight >= t[Prop.ContainerBottom]) {\n return State.ContainerBottom;\n }\n if (t[Prop.PrevStrategy] === Strategy.Top && t[Prop.ContainerInner].offsetHeight > t[Prop.ColliderHeight]) {\n t[Prop.PrevStrategy] = t[Prop.Strategy];\n return State.TranslateY;\n }\n if (t[Prop.Strategy] === Strategy.Both && direction === Direction.Down) {\n return State.TranslateY;\n }\n // If the parent container block changes its position and etc.\n if (\n t[Prop.PrevViewportScrollX] !== window.scrollX ||\n t[Prop.PrevContainerLeft] !== t[Prop.ContainerLeft] ||\n t[Prop.PrevContainerWidth] !== t[Prop.ContainerWidth] ||\n t[Prop.PrevContainerTop] !== t[Prop.ContainerTop] ||\n t[Prop.PrevSpaceBottom] !== t[Prop.SpaceBottom] ||\n t[Prop.PrevSpaceTop] !== t[Prop.SpaceTop]\n ) {\n return State.ColliderTop;\n }\n } else if (t[Prop.PrevState] === State.ColliderBottom) {\n if (t[Prop.ColliderTop] <= t[Prop.ContainerTop]) {\n return State.None;\n }\n if (t[Prop.ColliderTop] + t[Prop.ColliderHeight] >= t[Prop.ContainerBottom]) {\n return State.ContainerBottom;\n }\n if (t[Prop.ContainerInner].offsetHeight <= t[Prop.ColliderHeight]) {\n return State.ColliderTop;\n }\n if (direction === Direction.Up || t[Prop.PrevElementHeight] !== t[Prop.ContainerInner].offsetHeight) {\n return State.TranslateY;\n }\n // If the parent container block changes its position and etc.\n if (\n t[Prop.PrevViewportScrollX] !== window.scrollX ||\n t[Prop.PrevContainerLeft] !== t[Prop.ContainerLeft] ||\n t[Prop.PrevContainerWidth] !== t[Prop.ContainerWidth] ||\n t[Prop.PrevContainerTop] !== t[Prop.ContainerTop] ||\n t[Prop.PrevSpaceBottom] !== t[Prop.SpaceBottom] ||\n t[Prop.PrevSpaceTop] !== t[Prop.SpaceTop]\n ) {\n return State.ColliderBottom;\n }\n } else if (t[Prop.PrevState] === State.ContainerBottom) {\n if (t[Prop.ColliderTop] <= t[Prop.ContainerTop]) {\n return State.None;\n }\n if (direction === Direction.Up && t[Prop.ColliderTop] <= t[Prop.MaxTopWithTranslateY]) {\n return State.ColliderTop;\n }\n if (t[Prop.ContainerInner].offsetHeight < t[Prop.ContainerBottom] - t[Prop.ColliderTop]) {\n return State.ColliderTop;\n }\n if (\n t[Prop.PrevContainerWidth] !== t[Prop.ContainerWidth] ||\n t[Prop.PrevElementHeight] !== t[Prop.ContainerInner].offsetHeight\n ) {\n return State.ContainerBottom;\n }\n } else if (t[Prop.PrevState] === State.None) {\n // If the page loads with the scroll position below the bottom of the container\n if (\n t[Prop.ColliderTop] >= t[Prop.ContainerBottom] ||\n (t[Prop.ColliderTop] + t[Prop.ColliderHeight] >= t[Prop.ContainerBottom] && t[Prop.Strategy] !== Strategy.Top)\n ) {\n return State.ContainerBottom;\n }\n if (t[Prop.ContainerInner].offsetHeight < t[Prop.ColliderHeight] && t[Prop.ColliderTop] >= t[Prop.ContainerTop]) {\n return State.ColliderTop;\n }\n if (\n t[Prop.Strategy] === Strategy.Both &&\n t[Prop.ColliderTop] + t[Prop.ColliderHeight] >= t[Prop.MaxBottomWithTranslateY]\n ) {\n return State.ColliderBottom;\n }\n } else if (t[Prop.PrevState] === State.TranslateY) {\n if (t[Prop.ContainerHeight] - t[Prop.TranslateY] < t[Prop.ContainerInner].offsetHeight) {\n return State.ContainerBottom;\n }\n if (\n t[Prop.ContainerInner].offsetHeight < t[Prop.ColliderHeight] ||\n t[Prop.ColliderTop] <= t[Prop.ContainerTop] + t[Prop.TranslateY]\n ) {\n return State.ColliderTop;\n }\n if (\n t[Prop.TranslateY] < t[Prop.MaxTranslateY] &&\n t[Prop.ColliderTop] + t[Prop.ColliderHeight] > t[Prop.MaxBottomWithTranslateY] + t[Prop.TranslateY]\n ) {\n return State.ColliderBottom;\n }\n }\n\n return State.Rest;\n }\n\n private [Method.GetStrategy](): Strategy {\n var t = this;\n if (t[Prop.ContainerHeight] <= t[Prop.ContainerInner].offsetHeight) return Strategy.None;\n if (t[Prop.ColliderHeight] < t[Prop.ContainerInner].offsetHeight) return Strategy.Both;\n return Strategy.Top;\n }\n\n private [Method.CalcDims](): void {\n var t = this;\n const containerCoords = t[Method.GetCoords](t[Prop.Container]);\n t[Prop.ContainerLeft] = containerCoords.left;\n t[Prop.ContainerTop] = containerCoords.top;\n t[Prop.ContainerHeight] = t[Prop.Container].clientHeight;\n t[Prop.ContainerBottom] = t[Prop.ContainerTop] + t[Prop.ContainerHeight];\n t[Prop.ContainerWidth] = t[Prop.Container].clientWidth;\n t[Prop.ColliderHeight] = window.innerHeight - t[Prop.SpaceTop] - t[Prop.SpaceBottom];\n t[Prop.MaxTranslateY] = t[Prop.Container].clientHeight - t[Prop.ContainerInner].offsetHeight;\n t[Prop.MaxBottomWithTranslateY] = t[Prop.ContainerTop] + t[Prop.ContainerInner].offsetHeight;\n t[Prop.MaxTopWithTranslateY] = t[Prop.ContainerTop] + t[Prop.MaxTranslateY];\n\n t[Prop.Strategy] = t[Method.GetStrategy]();\n\n if (t[Prop.Strategy] === Strategy.None) {\n if (t[Prop.PrevStrategy] !== t[Prop.Strategy]) t[Method.Render](State.None);\n } else {\n t[Method.CalcScroll]();\n }\n\n t[Prop.PrevContainerWidth] = t[Prop.ContainerWidth];\n t[Prop.PrevContainerLeft] = t[Prop.ContainerLeft];\n t[Prop.PrevContainerTop] = t[Prop.ContainerTop];\n t[Prop.PrevElementHeight] = t[Prop.ContainerInner].offsetHeight;\n t[Prop.PrevStrategy] = t[Prop.Strategy];\n t[Prop.PrevSpaceBottom] = t[Prop.SpaceBottom];\n t[Prop.PrevSpaceTop] = t[Prop.SpaceTop];\n }\n\n private [Method.CalcScroll](): void {\n var t = this;\n if (t[Prop.Strategy] === Strategy.None) return;\n\n t[Prop.ColliderTop] = window.scrollY + t[Prop.SpaceTop];\n\n const direction = t[Method.GetDirection]();\n const state = t[Method.GetState](direction);\n\n if (state !== State.Rest) {\n t[Prop.Callback](state, direction, t[Prop.Strategy]);\n t[Method.Render](state);\n t[Prop.PrevState] = state;\n } else if (t[Prop.PrevStrategy] !== t[Prop.Strategy]) {\n t[Prop.Callback](state, direction, t[Prop.Strategy]);\n }\n\n t[Prop.PrevColliderTop] = t[Prop.ColliderTop];\n t[Prop.PrevViewportScrollX] = window.scrollX;\n t[Prop.PrevViewportScrollY] = window.scrollY;\n }\n\n private [Method.Request](): void {\n var t = this;\n if (t[Prop.IsRunningRequest] === 1) return;\n t[Prop.IsRunningRequest] = 1;\n window.requestAnimationFrame(() => {\n (t[Prop.Event] === Event.Resize && t[Method.CalcDims]()) ||\n (t[Prop.Event] === Event.Scroll && t[Method.CalcScroll]());\n t[Prop.Event] = Event.None;\n t[Prop.IsRunningRequest] = 0;\n });\n }\n\n private [Method.ObserveTreeNodesFromCurrentToBody](containerInner: HTMLElement): void {\n while (containerInner) {\n this[Prop.ResizeObserver].observe(containerInner);\n if (containerInner.tagName === 'BODY') break;\n (containerInner as unknown) = containerInner.parentElement;\n }\n }\n\n private [Method.AddListeners](): void {\n window.addEventListener('scroll', this[Method.ScrollListener], {\n capture: false,\n passive: true,\n });\n this[Method.ObserveTreeNodesFromCurrentToBody](this[Prop.ContainerInner]);\n }\n\n private [Method.RemoveListeners](): void {\n window.removeEventListener('scroll', this[Method.ScrollListener], {\n capture: false,\n });\n this[Prop.ResizeObserver].disconnect();\n }\n}\n"],"names":[],"mappings":"AA+VA;;;;;;;AAOG;AACW,MAAO,UAAU,CAAA;AAkC7B;;;;;;AAMG;AACH,IAAA,WAAA,CACE,SAAsB,EACtB,cAA2B,EAC3B,cAAsB,CAAC,EACvB,QAAA,GAAmB,CAAC,EACpB,QAAA,GAAqB,QAAO,CAAC,EAAA;QAE7B,IAAI,CAAC,GAAG,IAAI;QAEZ,CAAC,CAAA,GAAA,sBAAgB,GAAG,SAAS;QAC7B,CAAC,CAAA,GAAA,2BAAqB,GAAG,cAAc;QACvC,CAAC,CAAA,GAAA,wBAAkB,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;AACnF,QAAA,CAAC,gCAAsB,GAAG,CAAC,CAAA,GAAA,wBAAkB,GAAG,WAAW;AAC3D,QAAA,CAAC,6BAAmB,GAAG,CAAC,CAAA,GAAA,qBAAe,GAAG,QAAQ;QAClD,CAAC,CAAA,G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 1.0.0
4
+ * @link https://github.com/phenomenonus/sidebarius
5
+ * @author Mikhail Prugov
6
+ * @copyright 2026
7
+ * @license The MIT License (MIT)
8
+ */
9
+ class t{constructor(t,e,i=0,r=0,s=()=>{}){var f=this;f.d=t,f.g=e,f.o={left:"",top:"",position:"",width:"",transform:""},f.x=f.E=i,f.y=f.F=r,f.a=s,f.P(),f.J=f.J.bind(f),f.K=f.K.bind(f),f.U=f.U.bind(f),f.V=f.V.bind(f),f.D=new ResizeObserver(f.U)}start(){this.I()}stop(){var t=this;t.R(),t.P(),t.S(0)}setSpaces(t,e){var i=this;i.E=t,i.F=e,i.P(),i.U()}P(){var t=this;t.b=t.c=t.e=t.f=t.h=t.i=t.j=t.k=t.l=t.p=t.q=t.r=t.s=t.t=t.u=t.v=t.w=t.z=t.A=t.B=t.C=t.G=t.H=0}U(){this.k=1,this.T()}V(){0===this.k&&(this.k=2),this.T()}L(t){const e={left:t.offsetLeft,top:t.offsetTop};for(;t="BODY"===t.tagName?t.parentElement:t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft;return e}S(t){var e=this;let i={};1===t?(e.H=e.r,i={position:"relative",transform:`translate3d(0px, ${e.H}px, 0px)`}):3===t?(e.H=0,i={top:e.b+e.F-e.g.offsetHeight+"px",left:e.h-window.scrollX+"px",position:"fixed",width:e.j+"px"}):2===t?(e.H=0,i={left:e.h-window.scrollX+"px",top:e.F+"px",position:"fixed",width:e.j+"px"}):0===t?e.H=0:4===t&&(2===e.z?e.H=e.s-e.i:3===e.z?e.H=e.s+e.b-e.i-e.w:1===e.z&&(e.H=e.r),i={position:"relative",transform:`translate3d(0px, ${e.H}px, 0px)`});for(const t in e.o)e.g.style[t]=i[t]??e.o[t]}M(){return this.C===window.scrollY?0:this.C<window.scrollY?1:2}N(t){var e=this;if(2===e.z){if(e.c<=e.i)return 0;if(e.c+e.g.offsetHeight>=e.e)return 1;if(2===e.A&&e.g.offsetHeight>e.b)return e.A=e.G,4;if(1===e.G&&1===t)return 4;if(e.B!==window.scrollX||e.t!==e.h||e.v!==e.j||e.u!==e.i||e.x!==e.E||e.y!==e.F)return 2}else if(3===e.z){if(e.c<=e.i)return 0;if(e.c+e.b>=e.e)return 1;if(e.g.offsetHeight<=e.b)return 2;if(2===t||e.w!==e.g.offsetHeight)return 4;if(e.B!==window.scrollX||e.t!==e.h||e.v!==e.j||e.u!==e.i||e.x!==e.E||e.y!==e.F)return 3}else if(1===e.z){if(e.c<=e.i)return 0;if(2===t&&e.c<=e.q)return 2;if(e.g.offsetHeight<e.e-e.c)return 2;if(e.v!==e.j||e.w!==e.g.offsetHeight)return 1}else if(0===e.z){if(e.c>=e.e||e.c+e.b>=e.e&&2!==e.G)return 1;if(e.g.offsetHeight<e.b&&e.c>=e.i)return 2;if(1===e.G&&e.c+e.b>=e.p)return 3}else if(4===e.z){if(e.f-e.H<e.g.offsetHeight)return 1;if(e.g.offsetHeight<e.b||e.c<=e.i+e.H)return 2;if(e.H<e.r&&e.c+e.b>e.p+e.H)return 3}return 5}O(){var t=this;return t.f<=t.g.offsetHeight?0:t.b<t.g.offsetHeight?1:2}J(){var t=this;const e=t.L(t.d);t.h=e.left,t.i=e.top,t.f=t.d.clientHeight,t.e=t.i+t.f,t.j=t.d.clientWidth,t.b=window.innerHeight-t.F-t.E,t.r=t.d.clientHeight-t.g.offsetHeight,t.p=t.i+t.g.offsetHeight,t.q=t.i+t.r,t.G=t.O(),0===t.G?t.A!==t.G&&t.S(0):t.K(),t.v=t.j,t.t=t.h,t.u=t.i,t.w=t.g.offsetHeight,t.A=t.G,t.x=t.E,t.y=t.F}K(){var t=this;if(0===t.G)return;t.c=window.scrollY+t.F;const e=t.M(),i=t.N(e);5!==i?(t.a(i,e,t.G),t.S(i),t.z=i):t.A!==t.G&&t.a(i,e,t.G),t.s=t.c,t.B=window.scrollX,t.C=window.scrollY}T(){var t=this;1!==t.l&&(t.l=1,window.requestAnimationFrame(()=>{1===t.k&&t.J()||2===t.k&&t.K(),t.k=0,t.l=0}))}Q(t){for(;t&&(this.D.observe(t),"BODY"!==t.tagName);)t=t.parentElement}I(){window.addEventListener("scroll",this.V,{capture:!1,passive:!0}),this.Q(this.g)}R(){window.removeEventListener("scroll",this.V,{capture:!1}),this.D.disconnect()}}export{t as default};
10
+ //# sourceMappingURL=sidebarius.esm.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebarius.esm.min.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * Event invokes render\n */\nconst enum Event {\n /**\n * Nothing\n */\n None = 0,\n\n /**\n * Resize event\n */\n Resize = 1,\n\n /**\n * Scroll event\n */\n Scroll = 2,\n}\n\n/**\n * Defines `viewport` direction.\n */\nconst enum Direction {\n None = 0,\n Down = 1,\n Up = 2,\n}\n\n/**\n * The element coordinates.\n */\ntype TypeElementCoords = {\n left: number;\n top: number;\n};\n\n/**\n * Strategy.\n */\nconst enum Strategy {\n /**\n * Nothing do.\n */\n None = 0,\n\n /**\n * Sticky both sides by Y-axis.\n */\n Both = 1,\n\n /**\n * Sticky only top side.\n */\n Top = 2,\n}\n\n/**\n * @ enum {number} Position variant of target {@link Prop.ContainerInner|ContainerInner}.\n */\nconst enum State {\n /**\n * Default {@link Prop.ContainerInner|ContainerInner} behavior.\n */\n None = 0,\n\n /**\n * {@link Prop.ContainerInner|ContainerInner} affixed at the bottom of the {@link Prop.Container|Container}.\n */\n ContainerBottom = 1,\n\n /**\n * {@link Prop.ContainerInner|ContainerInner} fixed at the top of the window viewport area (including {@link Prop.SpaceTop|SpaceTop}).\n */\n ColliderTop = 2,\n\n /**\n * {@link Prop.ContainerInner|ContainerInner} fixed at the bottom of the window viewport area (including {@link Prop.SpaceBottom|SpaceBottom}).\n */\n ColliderBottom = 3,\n\n /**\n * The {@link Prop.ContainerInner|ContainerInner} is offset along the Y axis relative to the {@link Prop.Container|Container}.\n */\n TranslateY = 4,\n\n /**\n * Indicates that rendering should be skipped until the state changes.\n */\n Rest = 5,\n}\n\ntype Rules = Pick<CSSStyleDeclaration, 'left' | 'top' | 'position' | 'width' | 'transform'>;\n\n/**\n * This callback is called **before** the `ContainerInner` changes, such as resizing, scrolling, or other layout changes.\n *\n * @param {number} state - The {@link State} of {@link Prop.ContainerInner|ContainerInner}. Represents a behavior indicator of `ContainerInner` that helps determine its positioning.\n * @param {number} direction - The `viewport` {@link Direction}. Defines the direction of movement of the viewport.\n * @param {number} strategy - The {@link Strategy} that determines the positioning behaviour, based on the sizes of both `Container` and `ContainerInner`.\n */\ntype Callback = (state: State, direction: Direction, strategy: Strategy) => void;\n\n/**\n * Properties\n */\nconst enum Prop {\n /**\n *\n */\n Callback = 'a',\n\n /**\n * Height of the {@link https://socs.binus.ac.id/2017/03/09/collision-detection-in-2d-part-2/|collider}.\n */\n ColliderHeight = 'b',\n\n /**\n * Top coordinate of the {@link https://socs.binus.ac.id/2017/03/09/collision-detection-in-2d-part-2/|collider}.\n */\n ColliderTop = 'c',\n\n /**\n * Parent element of {@link ContainerInner}.\n */\n Container = 'd',\n\n /**\n * Bottom coordinate of the {@link Container}.\n */\n ContainerBottom = 'e',\n\n /**\n * Height of the {@link Container}.\n */\n ContainerHeight = 'f',\n\n /**\n * Target element with sticky and scroll abilities.\n */\n ContainerInner = 'g',\n\n /**\n * Coordinate by X-axis of the {@link Container}.\n */\n ContainerLeft = 'h',\n\n /**\n * Coordinate by Y-axis of the {@link Container}.\n */\n ContainerTop = 'i',\n\n /**\n * Width of the {@link Container}.\n */\n ContainerWidth = 'j',\n\n /**\n * Triggered Event.\n */\n Event = 'k',\n\n /**\n * Indicates that a render request has already been initiated.\n * @default false\n */\n IsRunningRequest = 'l',\n\n /**\n * List of available CSS properties. Also is used as default values for rules.\n */\n ListOfRules = 'o',\n\n /**\n * The maximum allowable coordinate for {@link ColliderBottom} along the Y-axis in the downward {@link Direction}.\n */\n MaxBottomWithTranslateY = 'p',\n\n /**\n * The maximum allowable coordinate for {@link ColliderTop} along the Y-axis in the upward {@link Direction}.\n */\n MaxTopWithTranslateY = 'q',\n\n /**\n * The maximum allowed Y-axis coordinates for {@link ContainerInner} relative to the {@link Container}.\n */\n MaxTranslateY = 'r',\n\n /**\n * Previous top coordinate of the {@link https://socs.binus.ac.id/2017/03/09/collision-detection-in-2d-part-2/|collider}.\n */\n PrevColliderTop = 's',\n\n /**\n * Previous coordinate by X-axis of the {@link Container}.\n */\n PrevContainerLeft = 't',\n\n /**\n * Previous coordinate by Y-axis of the {@link Container}.\n */\n PrevContainerTop = 'u',\n\n /**\n * Previous width of the {@link Container}.\n */\n PrevContainerWidth = 'v',\n\n /**\n * Previous {@link ContainerInner} height.\n */\n PrevElementHeight = 'w',\n\n /**\n * Previous space bottom. See also {@link SpaceBottom}.\n * @default 0\n */\n PrevSpaceBottom = 'x',\n\n /**\n * Previous space top. See also {@link SpaceTop}.\n * @default 0\n */\n PrevSpaceTop = 'y',\n\n /**\n * Previous {@link State}.\n * @default State.None\n */\n PrevState = 'z',\n\n /**\n * Previous strategy. See also {@link Strategy}.\n * @default Strategy.None\n */\n PrevStrategy = 'A',\n\n /**\n * Previous coordinate by X-axis of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport}.\n */\n PrevViewportScrollX = 'B',\n\n /**\n * Previous coordinate by Y-axis of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport}.\n */\n PrevViewportScrollY = 'C',\n\n /**\n * Resize observer.\n */\n ResizeObserver = 'D',\n\n /**\n * Space bottom.\n * @default 0\n */\n SpaceBottom = 'E',\n\n /**\n * Space top.\n * @default 0\n */\n SpaceTop = 'F',\n\n /**\n * Current {@link Strategy}. Helps to detect {@link Prop.ContainerInner|ContainerInner} behaviour.\n * @default Strategy.None\n */\n Strategy = 'G',\n\n /**\n * The Current Y-axis coordinates relative to the {@link Prop.Container|Container}.\n */\n TranslateY = 'H',\n}\n\n/**\n * Properties\n */\nconst enum Method {\n /**\n * Add required event listeners. See {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener|addEventListener} and {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver|ResizeObserver}.\n */\n AddListeners = 'I',\n\n /**\n * Calculate {@link https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements|dimensions}.\n */\n CalcDims = 'J',\n\n /**\n * Calculate {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSSOM_view/Coordinate_systems|coordinates}.\n */\n CalcScroll = 'K',\n\n /**\n * Get coordinates for passed element.\n */\n GetCoords = 'L',\n\n /**\n * Get the scroll direction. `None` for horizontal scrolling or no scrolling.\n */\n GetDirection = 'M',\n\n /**\n * Get state of {@link Prop.ContainerInner|ContainerInner}.\n */\n GetState = 'N',\n\n /**\n * Get a {@link Prop.Strategy} that determines the further behavior of the {@link Prop.ContainerInner|ContainerInner}.\n */\n GetStrategy = 'O',\n\n /**\n * Initialize(or reset) properties to default values.\n */\n Init = 'P',\n\n /**\n * Observe {@link https://developer.mozilla.org/en-US/docs/Web/API/Node|nodes} from {@link Prop.ContainerInner|ContainerInner} to {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/body|document body} with help the {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver|ResizeObserver}.\n */\n ObserveTreeNodesFromCurrentToBody = 'Q',\n\n /**\n * Remove all event listeners. See {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener|removeEventListener} and {@link https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver|ResizeObserver}.\n */\n RemoveListeners = 'R',\n\n /**\n * Update styles in {@link Prop.ContainerInner|ContainerInner} and {@link Prop.Container|Container}.\n */\n Render = 'S',\n\n /**\n * Helps apply DOM manipulation and synchronize processing with rendering. See {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame|requestAnimationFrame}.\n */\n Request = 'T',\n\n /**\n * Resize listener.\n */\n ResizeListener = 'U',\n\n /**\n * Scroll listener.\n */\n ScrollListener = 'V',\n}\n\n/**\n * Sidebarius\n * @version 1.0.0\n * @link https://github.com/phenomenonus/sidebarius\n * @author Mikhail Prugov\n * @copyright 2026\n * @license The MIT License (MIT)\n */\nexport default class Sidebarius {\n private [Prop.Callback]!: Callback;\n private [Prop.ColliderHeight]!: number;\n private [Prop.ColliderTop]!: number;\n private [Prop.Container]!: HTMLElement;\n private [Prop.ContainerBottom]!: number;\n private [Prop.ContainerHeight]!: number;\n private [Prop.ContainerInner]!: HTMLElement;\n private [Prop.ContainerLeft]!: number;\n private [Prop.ContainerTop]!: number;\n private [Prop.ContainerWidth]!: number;\n private [Prop.Event]!: Event;\n private [Prop.IsRunningRequest]!: number;\n private [Prop.ListOfRules]!: Rules;\n private [Prop.MaxBottomWithTranslateY]!: number;\n private [Prop.MaxTopWithTranslateY]!: number;\n private [Prop.MaxTranslateY]!: number;\n private [Prop.PrevColliderTop]!: number;\n private [Prop.PrevContainerLeft]!: number;\n private [Prop.PrevContainerTop]!: number;\n private [Prop.PrevContainerWidth]!: number;\n private [Prop.PrevElementHeight]!: number;\n private [Prop.PrevSpaceBottom]!: number;\n private [Prop.PrevSpaceTop]!: number;\n private [Prop.PrevState]!: State;\n private [Prop.PrevStrategy]!: Strategy;\n private [Prop.PrevViewportScrollX]!: number;\n private [Prop.PrevViewportScrollY]!: number;\n private [Prop.ResizeObserver]!: ResizeObserver;\n private [Prop.SpaceBottom]!: number;\n private [Prop.SpaceTop]!: number;\n private [Prop.Strategy]!: Strategy;\n private [Prop.TranslateY]!: number;\n\n /**\n * @param container - The {@link Prop.Container|Container} element (parent) that holds the sticky element.\n * @param containerInner - The {@link Prop.ContainerInner|ContainerInner} element that will be endowed with stickiness and scrolling abilities relative to its parent (container).\n * @param spaceBottom - The space between the bottom of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport} and the bottom of the `visible area` or `collider`. Default is 0.\n * @param spaceTop - The space between the top of the {@link https://developer.mozilla.org/en-US/docs/Glossary/Viewport|viewport} and the top of the `visible area` or `collider`. Default is 0.\n * @param {Callback} callback - This callback is called **before** the {@link Prop.ContainerInner|ContainerInner} changes, such as resizing, scrolling, or other layout changes.\n */\n constructor(\n container: HTMLElement,\n containerInner: HTMLElement,\n spaceBottom: number = 0,\n spaceTop: number = 0,\n callback: Callback = () => {},\n ) {\n var t = this;\n\n t[Prop.Container] = container;\n t[Prop.ContainerInner] = containerInner;\n t[Prop.ListOfRules] = { left: '', top: '', position: '', width: '', transform: '' };\n t[Prop.PrevSpaceBottom] = t[Prop.SpaceBottom] = spaceBottom;\n t[Prop.PrevSpaceTop] = t[Prop.SpaceTop] = spaceTop;\n t[Prop.Callback] = callback;\n\n t[Method.Init]();\n t[Method.CalcDims] = t[Method.CalcDims].bind(t);\n t[Method.CalcScroll] = t[Method.CalcScroll].bind(t);\n t[Method.ResizeListener] = t[Method.ResizeListener].bind(t);\n t[Method.ScrollListener] = t[Method.ScrollListener].bind(t);\n t[Prop.ResizeObserver] = new ResizeObserver(t[Method.ResizeListener]);\n }\n\n /**\n * Start sticky scrolling behavior. Use {@link stop} method to stop sticky scrolling behavior.\n */\n public start(): void {\n this[Method.AddListeners](); // calls _calcDims method by default, cause is used ResizeObserver\n }\n\n /**\n * Stop sticky scrolling behavior. Use {@link start} method to start sticky scrolling behavior again.\n */\n public stop(): void {\n var t = this;\n t[Method.RemoveListeners]();\n t[Method.Init]();\n t[Method.Render](State.None);\n }\n\n /**\n * Set the distance to the collider. It triggers re-rendering.\n *\n * @param {number} bottomSpace - The {@link Prop.SpaceBottom|SpaceBottom}.\n * @param {number} spaceTop - The {@link Prop.SpaceTop|SpaceTop}.\n */\n public setSpaces(bottomSpace: number, spaceTop: number): void {\n var s = this;\n s[Prop.SpaceBottom] = bottomSpace;\n s[Prop.SpaceTop] = spaceTop;\n s[Method.Init]();\n s[Method.ResizeListener]();\n }\n\n private [Method.Init](): void {\n var t = this;\n t[Prop.ColliderHeight] =\n t[Prop.ColliderTop] =\n t[Prop.ContainerBottom] =\n t[Prop.ContainerHeight] =\n t[Prop.ContainerLeft] =\n t[Prop.ContainerTop] =\n t[Prop.ContainerWidth] =\n t[Prop.Event] =\n t[Prop.IsRunningRequest] =\n t[Prop.MaxBottomWithTranslateY] =\n t[Prop.MaxTopWithTranslateY] =\n t[Prop.MaxTranslateY] =\n t[Prop.PrevColliderTop] =\n t[Prop.PrevContainerLeft] =\n t[Prop.PrevContainerTop] =\n t[Prop.PrevContainerWidth] =\n t[Prop.PrevElementHeight] =\n t[Prop.PrevState] =\n t[Prop.PrevStrategy] =\n t[Prop.PrevViewportScrollX] =\n t[Prop.PrevViewportScrollY] =\n t[Prop.Strategy] =\n t[Prop.TranslateY] =\n 0;\n }\n\n private [Method.ResizeListener](): void {\n this[Prop.Event] = Event.Resize;\n this[Method.Request]();\n }\n\n private [Method.ScrollListener](): void {\n if (this[Prop.Event] === Event.None) this[Prop.Event] = Event.Scroll;\n this[Method.Request]();\n }\n\n private [Method.GetCoords](element: HTMLElement): TypeElementCoords {\n const coords = { left: element.offsetLeft, top: element.offsetTop };\n let i = 0;\n while (((element as unknown) = 'BODY' === element.tagName ? element.parentElement : element.offsetParent)) {\n coords.top += element.offsetTop;\n coords.left += element.offsetLeft;\n i++;\n }\n return coords;\n }\n\n private [Method.Render](state: State): void {\n var t = this;\n let r: Partial<Rules> = {};\n\n if (state === State.ContainerBottom) {\n t[Prop.TranslateY] = t[Prop.MaxTranslateY];\n r = {\n position: 'relative',\n transform: `translate3d(0px, ${t[Prop.TranslateY]}px, 0px)`,\n };\n } else if (state === State.ColliderBottom) {\n t[Prop.TranslateY] = 0;\n r = {\n top: t[Prop.ColliderHeight] + t[Prop.SpaceTop] - t[Prop.ContainerInner].offsetHeight + 'px',\n left: t[Prop.ContainerLeft] - window.scrollX + 'px',\n position: 'fixed',\n width: t[Prop.ContainerWidth] + 'px',\n };\n } else if (state === State.ColliderTop) {\n t[Prop.TranslateY] = 0;\n r = {\n left: t[Prop.ContainerLeft] - window.scrollX + 'px',\n top: t[Prop.SpaceTop] + 'px',\n position: 'fixed',\n width: t[Prop.ContainerWidth] + 'px',\n };\n } else if (state === State.None) {\n t[Prop.TranslateY] = 0;\n } else if (state === State.TranslateY) {\n if (t[Prop.PrevState] === State.ColliderTop) {\n t[Prop.TranslateY] = t[Prop.PrevColliderTop] - t[Prop.ContainerTop];\n } else if (t[Prop.PrevState] === State.ColliderBottom) {\n t[Prop.TranslateY] =\n t[Prop.PrevColliderTop] + t[Prop.ColliderHeight] - t[Prop.ContainerTop] - t[Prop.PrevElementHeight];\n } else if (t[Prop.PrevState] === State.ContainerBottom) {\n t[Prop.TranslateY] = t[Prop.MaxTranslateY];\n }\n r = {\n position: 'relative',\n transform: `translate3d(0px, ${t[Prop.TranslateY]}px, 0px)`,\n };\n }\n\n for (const key in t[Prop.ListOfRules]) {\n t[Prop.ContainerInner].style[key as keyof Rules] =\n r[key as unknown as keyof Rules] ?? t[Prop.ListOfRules][key as unknown as keyof Rules];\n }\n }\n\n private [Method.GetDirection](): Direction {\n if (this[Prop.PrevViewportScrollY] === window.scrollY) return Direction.None;\n return this[Prop.PrevViewportScrollY] < window.scrollY ? Direction.Down : Direction.Up;\n }\n\n private [Method.GetState](direction: Direction): State {\n var t = this;\n\n if (t[Prop.PrevState] === State.ColliderTop) {\n if (t[Prop.ColliderTop] <= t[Prop.ContainerTop]) {\n return State.None;\n }\n if (t[Prop.ColliderTop] + t[Prop.ContainerInner].offsetHeight >= t[Prop.ContainerBottom]) {\n return State.ContainerBottom;\n }\n if (t[Prop.PrevStrategy] === Strategy.Top && t[Prop.ContainerInner].offsetHeight > t[Prop.ColliderHeight]) {\n t[Prop.PrevStrategy] = t[Prop.Strategy];\n return State.TranslateY;\n }\n if (t[Prop.Strategy] === Strategy.Both && direction === Direction.Down) {\n return State.TranslateY;\n }\n // If the parent container block changes its position and etc.\n if (\n t[Prop.PrevViewportScrollX] !== window.scrollX ||\n t[Prop.PrevContainerLeft] !== t[Prop.ContainerLeft] ||\n t[Prop.PrevContainerWidth] !== t[Prop.ContainerWidth] ||\n t[Prop.PrevContainerTop] !== t[Prop.ContainerTop] ||\n t[Prop.PrevSpaceBottom] !== t[Prop.SpaceBottom] ||\n t[Prop.PrevSpaceTop] !== t[Prop.SpaceTop]\n ) {\n return State.ColliderTop;\n }\n } else if (t[Prop.PrevState] === State.ColliderBottom) {\n if (t[Prop.ColliderTop] <= t[Prop.ContainerTop]) {\n return State.None;\n }\n if (t[Prop.ColliderTop] + t[Prop.ColliderHeight] >= t[Prop.ContainerBottom]) {\n return State.ContainerBottom;\n }\n if (t[Prop.ContainerInner].offsetHeight <= t[Prop.ColliderHeight]) {\n return State.ColliderTop;\n }\n if (direction === Direction.Up || t[Prop.PrevElementHeight] !== t[Prop.ContainerInner].offsetHeight) {\n return State.TranslateY;\n }\n // If the parent container block changes its position and etc.\n if (\n t[Prop.PrevViewportScrollX] !== window.scrollX ||\n t[Prop.PrevContainerLeft] !== t[Prop.ContainerLeft] ||\n t[Prop.PrevContainerWidth] !== t[Prop.ContainerWidth] ||\n t[Prop.PrevContainerTop] !== t[Prop.ContainerTop] ||\n t[Prop.PrevSpaceBottom] !== t[Prop.SpaceBottom] ||\n t[Prop.PrevSpaceTop] !== t[Prop.SpaceTop]\n ) {\n return State.ColliderBottom;\n }\n } else if (t[Prop.PrevState] === State.ContainerBottom) {\n if (t[Prop.ColliderTop] <= t[Prop.ContainerTop]) {\n return State.None;\n }\n if (direction === Direction.Up && t[Prop.ColliderTop] <= t[Prop.MaxTopWithTranslateY]) {\n return State.ColliderTop;\n }\n if (t[Prop.ContainerInner].offsetHeight < t[Prop.ContainerBottom] - t[Prop.ColliderTop]) {\n return State.ColliderTop;\n }\n if (\n t[Prop.PrevContainerWidth] !== t[Prop.ContainerWidth] ||\n t[Prop.PrevElementHeight] !== t[Prop.ContainerInner].offsetHeight\n ) {\n return State.ContainerBottom;\n }\n } else if (t[Prop.PrevState] === State.None) {\n // If the page loads with the scroll position below the bottom of the container\n if (\n t[Prop.ColliderTop] >= t[Prop.ContainerBottom] ||\n (t[Prop.ColliderTop] + t[Prop.ColliderHeight] >= t[Prop.ContainerBottom] && t[Prop.Strategy] !== Strategy.Top)\n ) {\n return State.ContainerBottom;\n }\n if (t[Prop.ContainerInner].offsetHeight < t[Prop.ColliderHeight] && t[Prop.ColliderTop] >= t[Prop.ContainerTop]) {\n return State.ColliderTop;\n }\n if (\n t[Prop.Strategy] === Strategy.Both &&\n t[Prop.ColliderTop] + t[Prop.ColliderHeight] >= t[Prop.MaxBottomWithTranslateY]\n ) {\n return State.ColliderBottom;\n }\n } else if (t[Prop.PrevState] === State.TranslateY) {\n if (t[Prop.ContainerHeight] - t[Prop.TranslateY] < t[Prop.ContainerInner].offsetHeight) {\n return State.ContainerBottom;\n }\n if (\n t[Prop.ContainerInner].offsetHeight < t[Prop.ColliderHeight] ||\n t[Prop.ColliderTop] <= t[Prop.ContainerTop] + t[Prop.TranslateY]\n ) {\n return State.ColliderTop;\n }\n if (\n t[Prop.TranslateY] < t[Prop.MaxTranslateY] &&\n t[Prop.ColliderTop] + t[Prop.ColliderHeight] > t[Prop.MaxBottomWithTranslateY] + t[Prop.TranslateY]\n ) {\n return State.ColliderBottom;\n }\n }\n\n return State.Rest;\n }\n\n private [Method.GetStrategy](): Strategy {\n var t = this;\n if (t[Prop.ContainerHeight] <= t[Prop.ContainerInner].offsetHeight) return Strategy.None;\n if (t[Prop.ColliderHeight] < t[Prop.ContainerInner].offsetHeight) return Strategy.Both;\n return Strategy.Top;\n }\n\n private [Method.CalcDims](): void {\n var t = this;\n const containerCoords = t[Method.GetCoords](t[Prop.Container]);\n t[Prop.ContainerLeft] = containerCoords.left;\n t[Prop.ContainerTop] = containerCoords.top;\n t[Prop.ContainerHeight] = t[Prop.Container].clientHeight;\n t[Prop.ContainerBottom] = t[Prop.ContainerTop] + t[Prop.ContainerHeight];\n t[Prop.ContainerWidth] = t[Prop.Container].clientWidth;\n t[Prop.ColliderHeight] = window.innerHeight - t[Prop.SpaceTop] - t[Prop.SpaceBottom];\n t[Prop.MaxTranslateY] = t[Prop.Container].clientHeight - t[Prop.ContainerInner].offsetHeight;\n t[Prop.MaxBottomWithTranslateY] = t[Prop.ContainerTop] + t[Prop.ContainerInner].offsetHeight;\n t[Prop.MaxTopWithTranslateY] = t[Prop.ContainerTop] + t[Prop.MaxTranslateY];\n\n t[Prop.Strategy] = t[Method.GetStrategy]();\n\n if (t[Prop.Strategy] === Strategy.None) {\n if (t[Prop.PrevStrategy] !== t[Prop.Strategy]) t[Method.Render](State.None);\n } else {\n t[Method.CalcScroll]();\n }\n\n t[Prop.PrevContainerWidth] = t[Prop.ContainerWidth];\n t[Prop.PrevContainerLeft] = t[Prop.ContainerLeft];\n t[Prop.PrevContainerTop] = t[Prop.ContainerTop];\n t[Prop.PrevElementHeight] = t[Prop.ContainerInner].offsetHeight;\n t[Prop.PrevStrategy] = t[Prop.Strategy];\n t[Prop.PrevSpaceBottom] = t[Prop.SpaceBottom];\n t[Prop.PrevSpaceTop] = t[Prop.SpaceTop];\n }\n\n private [Method.CalcScroll](): void {\n var t = this;\n if (t[Prop.Strategy] === Strategy.None) return;\n\n t[Prop.ColliderTop] = window.scrollY + t[Prop.SpaceTop];\n\n const direction = t[Method.GetDirection]();\n const state = t[Method.GetState](direction);\n\n if (state !== State.Rest) {\n t[Prop.Callback](state, direction, t[Prop.Strategy]);\n t[Method.Render](state);\n t[Prop.PrevState] = state;\n } else if (t[Prop.PrevStrategy] !== t[Prop.Strategy]) {\n t[Prop.Callback](state, direction, t[Prop.Strategy]);\n }\n\n t[Prop.PrevColliderTop] = t[Prop.ColliderTop];\n t[Prop.PrevViewportScrollX] = window.scrollX;\n t[Prop.PrevViewportScrollY] = window.scrollY;\n }\n\n private [Method.Request](): void {\n var t = this;\n if (t[Prop.IsRunningRequest] === 1) return;\n t[Prop.IsRunningRequest] = 1;\n window.requestAnimationFrame(() => {\n (t[Prop.Event] === Event.Resize && t[Method.CalcDims]()) ||\n (t[Prop.Event] === Event.Scroll && t[Method.CalcScroll]());\n t[Prop.Event] = Event.None;\n t[Prop.IsRunningRequest] = 0;\n });\n }\n\n private [Method.ObserveTreeNodesFromCurrentToBody](containerInner: HTMLElement): void {\n while (containerInner) {\n this[Prop.ResizeObserver].observe(containerInner);\n if (containerInner.tagName === 'BODY') break;\n (containerInner as unknown) = containerInner.parentElement;\n }\n }\n\n private [Method.AddListeners](): void {\n window.addEventListener('scroll', this[Method.ScrollListener], {\n capture: false,\n passive: true,\n });\n this[Method.ObserveTreeNodesFromCurrentToBody](this[Prop.ContainerInner]);\n }\n\n private [Method.RemoveListeners](): void {\n window.removeEventListener('scroll', this[Method.ScrollListener], {\n capture: false,\n });\n this[Prop.ResizeObserver].disconnect();\n }\n}\n"],"names":["Sidebarius","constructor","container","containerInner","spaceBottom","spaceTop","callback","t","this","left","top","position","width","transform","bind","ResizeObserver","start","stop","setSpaces","bottomSpace","s","element","coords","offsetLeft","offsetTop","tagName","parentElement","offsetParent","state","r","offsetHeight","window","scrollX","key","style","scrollY","direction","containerCoords","clientHeight","clientWidth","innerHeight","requestAnimationFrame","observe","addEventListener","capture","passive","removeEventListener","disconnect"],"mappings":";;;;;;;;AAuWc,MAAOA,EAyCnB,WAAAC,CACEC,EACAC,EACAC,EAAsB,EACtBC,EAAmB,EACnBC,EAAqB,QAErB,IAAIC,EAAIC,KAERD,EAAC,EAAmBL,EACpBK,EAAC,EAAwBJ,EACzBI,EAAC,EAAqB,CAAEE,KAAM,GAAIC,IAAK,GAAIC,SAAU,GAAIC,MAAO,GAAIC,UAAW,IAC/EN,IAA0BA,EAAC,EAAqBH,EAChDG,IAAuBA,EAAC,EAAkBF,EAC1CE,EAAC,EAAkBD,EAEnBC,EAAC,IACDA,EAAC,EAAoBA,EAAC,EAAkBO,KAAKP,GAC7CA,EAAC,EAAsBA,EAAC,EAAoBO,KAAKP,GACjDA,EAAC,EAA0BA,EAAC,EAAwBO,KAAKP,GACzDA,EAAC,EAA0BA,EAAC,EAAwBO,KAAKP,GACzDA,EAAC,EAAwB,IAAIQ,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