"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
(()=>{
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    AutoScalingText: ()=>AutoScalingText
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_react_namespaceObject = require("react");
const AutoScalingText = (param)=>{
    let { children } = param;
    const ref = (0, external_react_namespaceObject.useRef)();
    const [scale, setScale] = (0, external_react_namespaceObject.useState)(1);
    (0, external_react_namespaceObject.useEffect)(()=>{
        const observer = new ResizeObserver((entries)=>{
            const node = entries[0].target;
            const parentNode = node.parentNode;
            const availableWidth = parentNode.offsetWidth;
            const actualWidth = node.offsetWidth;
            const actualScale = availableWidth / actualWidth;
            setScale((scale)=>{
                if (actualScale < 1) return actualScale;
                if (scale < 1) return 1;
            });
        });
        const node = ref.current;
        observer.observe(node);
        return ()=>observer.unobserve(node);
    }, []);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
        className: "auto-scaling-text",
        style: {
            transition: 'transform 0.5s ease',
            transform: "scale(".concat(scale, ",").concat(scale, ")")
        },
        ref: ref,
        children: children
    });
};
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
