PageSourceSearch

https://cdn.infourok.ru/assets/ui/controllers/components/mobile-nav-bar/mobile-nav-bar_controller-hYa8EmA.js

js infourok.ru collected 2026-09-24 08:51:01 UTC 5,835 bytes, 161 lines download raw bytes

1function _assert_this_initialized(self) {
2    if (self === void 0) {
3        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4    }
5    return self;
6}
7function _class_call_check(instance, Constructor) {
8    if (!(instance instanceof Constructor)) {
9        throw new TypeError("Cannot call a class as a function");
10    }
11}
12function _defineProperties(target, props) {
13    for(var i = 0; i < props.length; i++){
14        var descriptor = props[i];
15        descriptor.enumerable = descriptor.enumerable || false;
16        descriptor.configurable = true;
17        if ("value" in descriptor) descriptor.writable = true;
18        Object.defineProperty(target, descriptor.key, descriptor);
19    }
20}
21function _create_class(Constructor, protoProps, staticProps) {
22    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
23    if (staticProps) _defineProperties(Constructor, staticProps);
24    return Constructor;
25}
26function _define_property(obj, key, value) {
27    if (key in obj) {
28        Object.defineProperty(obj, key, {
29            value: value,
30            enumerable: true,
31            configurable: true,
32            writable: true
33        });
34    } else {
35        obj[key] = value;
36    }
37    return obj;
38}
39function _get_prototype_of(o) {
40    _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
41        return o.__proto__ || Object.getPrototypeOf(o);
42    };
43    return _get_prototype_of(o);
44}
45function _inherits(subClass, superClass) {
46    if (typeof superClass !== "function" && superClass !== null) {
47        throw new TypeError("Super expression must either be null or a function");
48    }
49    subClass.prototype = Object.create(superClass && superClass.prototype, {
50        constructor: {
51            value: subClass,
52            writable: true,
53            configurable: true
54        }
55    });
56    if (superClass) _set_prototype_of(subClass, superClass);
57}
58function _instanceof(left, right) {
59    if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
60        return !!right[Symbol.hasInstance](left);
61    } else {
62        return left instanceof right;
63    }
64}
65function _possible_constructor_return(self, call) {
66    if (call && (_type_of(call) === "object" || typeof call === "function")) {
67        return call;
68    }
69    return _assert_this_initialized(self);
70}
71function _set_prototype_of(o, p) {
72    _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
73        o.__proto__ = p;
74        return o;
75    };
76    return _set_prototype_of(o, p);
77}
78function _type_of(obj) {
79    "@swc/helpers - typeof";
80    return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
81}
82function _is_native_reflect_construct() {
83    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
84    if (Reflect.construct.sham) return false;
85    if (typeof Proxy === "function") return true;
86    try {
87        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
88        return true;
89    } catch (e) {
90        return false;
91    }
92}
93function _create_super(Derived) {
94    var hasNativeReflectConstruct = _is_native_reflect_construct();
95    return function _createSuperInternal() {
96        var Super = _get_prototype_of(Derived), result;
97        if (hasNativeReflectConstruct) {
98            var NewTarget = _get_prototype_of(this).constructor;
99            result = Reflect.construct(Super, arguments, NewTarget);
100        } else {
101            result = Super.apply(this, arguments);
102        }
103        return _possible_constructor_return(this, result);
104    };
105}
106import { Controller } from "@hotwired/stimulus";
107var _class = /*#__PURE__*/ function(Controller) {
108    "use strict";
109    _inherits(_class, Controller);
110    var _super = _create_super(_class);
111    function _class() {
112        _class_call_check(this, _class);
113        var _this;
114        _this = _super.apply(this, arguments);
115        _define_property(_assert_this_initialized(_this), "openPopup", null);
116        _define_property(_assert_this_initialized(_this), "previousOverflow", "");
117        return _this;
118    }
119    _create_class(_class, [
120        {
121            key: "disconnect",
122            value: function disconnect() {
123                this.close();
124            }
125        },
126        {
127            key: "onClick",
128            value: function onClick(event) {
129                var target = event.target;
130                if (!_instanceof(target, Element)) return;
131                var button = target.closest("[data-open-menu-popup], [data-open-profile-popup]");
132                if (button) {
133                    var selector = button.hasAttribute("data-open-menu-popup") ? "[data-menu-popup]" : "[data-profile-popup]";
134                    var popup = this.element.querySelector(selector);
135                    if (!popup) return;
136                    var wasOpen = this.openPopup === popup;
137                    this.close();
138                    if (!wasOpen) {
139                        this.previousOverflow = document.body.style.overflow;
140                        this.openPopup = popup;
141                        popup.classList.add("open");
142                        document.body.style.overflow = "hidden";
143                    }
144                } else if (target.closest(".iu-mobile-popup__close, .iu-mobile-popup a[href]")) {
145                    this.close();
146                }
147            }
148        },
149        {
150            key: "close",
151            value: function close() {
152                if (!this.openPopup) return;
153                this.openPopup.classList.remove("open");
154                this.openPopup = null;
155                document.body.style.overflow = this.previousOverflow;
156            }
157        }
158    ]);
159    return _class;
160}(Controller);
161export { _class as default };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.