ribbon-menu-new
Version:
Ribbon Menu for React (Vite, TypeScript)
946 lines (943 loc) • 64.9 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.ribbon-toggle-group{background-color:var(--background-group-color);display:flex;flex-flow:column wrap;border:1px solid var(--borderColor);width:auto}.ribbon-toggle-group .ribbon-icon-button,.ribbon-toggle-group .ribbon-tool-button{height:20px;margin:1px;background-color:inherit;display:flex;align-items:center;justify-content:start;line-height:1.6}.ribbon-toggle-group .ribbon-icon-button>*,.ribbon-toggle-group .ribbon-tool-button>*{height:18px}.ribbon-dropdown .ribbon-toggle-group{background-color:inherit!important}.dropdown{display:block;float:none;width:auto;background:inherit;position:relative}.dropdown .drop-object{position:fixed;z-index:1000}.dropdown .drop-object .drop-object{position:absolute}.dropdown .drop-object.place-right{left:auto;right:0}.dropdown .dropdown{width:100%}.dropdown .dropdown .drop-object{top:-4px;left:100%}.dropdown .dropdown .dropdown-toggle{padding-right:2rem}.dropdown.dropped>.dropdown-toggle:before{transform:rotate(135deg);transition:all .15s ease-in-out}.dropdown.dropped .dropdown.dropped>.dropdown-toggle:before{transform:rotate(45deg);transition:all .15s ease-in-out}.dropdown-toggle{position:relative;cursor:pointer;padding-right:1.5rem;user-select:none}.dropdown-toggle:before{display:block;position:absolute;vertical-align:middle;color:transparent;font-size:0;content:"";height:5px;width:5px;background-color:transparent;border-left:1px solid;border-bottom:1px solid;border-color:var(--textColor);top:50%;left:100%;margin-left:-1rem;margin-top:-.1625rem;z-index:2;transform:rotate(-45deg);transition:all .15s ease-in-out;transform-origin:center center 1px}.dropdown-toggle.drop-marker-light:before,.dropdown-toggle.marker-light:before{border-color:var(--dropdownDividerColor)}.dropdown-toggle.no-marker:before{display:none}.dropdown-toggle.active-toggle:before,.dropdown-toggle.active-container:before{transform:rotate(135deg);transition:all .15s ease-in-out}.dropdown-toggle.marker-center:before{left:50%;top:50%;margin-left:0;margin-top:0;transform:translate(-50%) translateY(-50%) rotate(-45deg)}.dropdown-toggle.marker-center.active-toggle:before,.dropdown-toggle.marker-center.active-container:before{transform:translate(-50%) translateY(-50%) rotate(135deg);transition:all .15s ease-in-out}.drop-left{right:100%;top:0}.drop-right{left:100%;top:0}.drop-up{top:auto;bottom:100%}.drop-object{display:none}.drop-object.open{display:block!important}.ribbon-dropdown{list-style:none inside;margin:0;width:auto;float:left;display:block;position:absolute;background-color:var(--dropdownBackground);color:var(--textColor);padding:2px;border:1px solid var(--borderColor);font-size:12px;box-shadow:2px 2px 2px 0 var(--dropdownShadowColor);z-index:1000;top:100%;left:0}.ribbon-dropdown li,.ribbon-dropdown a{display:block;position:relative;background-color:inherit;color:inherit;height:24px;cursor:pointer}.ribbon-dropdown li{border:1px solid transparent;padding-left:24px;user-select:none}.ribbon-dropdown li:not([disabled]):hover,.ribbon-dropdown li:not(.disabled):hover{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-dropdown a{line-height:24px;text-decoration:none;padding:0 8px;border-left:1px solid var(--dropdownDividerColor);white-space:nowrap}.ribbon-dropdown .divider{display:block;height:1px;width:100%;position:relative;background-color:var(--dropdownDividerColor);pointer-events:none}.ribbon-dropdown *+.divider{margin-top:4px}.ribbon-dropdown .divider+*{margin-top:4px}.ribbon-dropdown .checked:before,.ribbon-dropdown .active:before,.ribbon-dropdown .check-group .active:before,.ribbon-dropdown .checked:after,.ribbon-dropdown .active:after,.ribbon-dropdown .check-group .active:after{position:absolute;display:block;content:""}.ribbon-dropdown .checked:before,.ribbon-dropdown .active:before,.ribbon-dropdown .check-group .active:before{background-color:transparent;border-color:var(--textColor);border-left:2px solid;border-bottom:2px solid;height:.325rem;width:.5rem;left:.5rem;top:50%;transform:translateY(-50%) rotate(-45deg);z-index:2}.ribbon-dropdown .checked:after,.ribbon-dropdown .active:after,.ribbon-dropdown .check-group .active:after{width:23px;height:22px;top:0;left:0;z-index:1}.ribbon-dropdown .checked:after,.ribbon-dropdown .check-group .active:after{border:1px solid var(--itemBorderColor);background-color:var(--itemHoverBackground);color:var(--textActiveColor)}.ribbon-dropdown .active:before{width:.4rem;height:.4rem;background-color:var(--textColor)}.ribbon-dropdown .ribbon-dropdown{top:-4px;left:100%}.ribbon-dropdown .dropdown-toggle:before{transform:rotate(-135deg)!important}.ribbon-dropdown .dropdown-toggle.active-toggle:before{transform:rotate(45deg)!important}.ribbon-dropdown .ribbon-toggle-group{border:none!important}.bold{font-weight:700}.reomve-hover:hover{background-color:none!important}:root{--background-color: #f5f6f7;--background-active-color: #f5f6f7;--background-group-color: #ffffff;--textColor: #000000;--borderColor: #dadbdc;--itemBorderColor: #a4cef9;--itemActiveBorderColor: #1979ca;--itemActiveBackground: rgba(164, 206, 249, .8);--itemHoverBackground: rgba(164, 206, 249, .2);--dropdownBackground: #fbfcfd;--dropdownDividerColor: #f1f1f1;--dropdownShadowColor: rgba(227, 228, 229, .7);--dropdownToggleColor: #000000;--staticMenuColor: #1979ca;--staticTextColor: #ffffff;--scrollbar-thumb-color: rgba(0, 0, 0, .15);--scrollbar-track-color: rgba(0, 0, 0, .5)}.dark-mode{--background-color: #22272e;--background-active-color: #22272e;--background-group-color: #333a44;--textColor: #adadad;--textActiveColor: #ffffff;--borderColor: #444c56;--itemBorderColor: #a4cef9;--itemActiveBorderColor: #1979ca;--itemActiveBackground: rgba(164, 206, 249, .8);--itemHoverBackground: rgba(164, 206, 249, .2);--dropdownBackground: #22272e;--dropdownDividerColor: #444c56;--dropdownShadowColor: rgba(68, 76, 86, .7);--dropdownToggleColor: #ffffff;--staticMenuColor: #1979ca;--staticTextColor: #ffffff;--scrollbar-thumb-color: rgba(0, 0, 0, .15);--scrollbar-track-color: rgba(0, 0, 0, .5)}*,*:before,*:after{box-sizing:border-box}.no-overflow{overflow:hidden}.ribbon-menu{display:block;position:relative;background-color:var(--background-color);color:var(--textColor);overflow-x:scroll}.ribbon-menu div{position:relative}.ribbon-menu .tabs-holder{display:flex;justify-content:flex-start;align-items:center;list-style:none inside;margin:0;padding:0;position:relative;z-index:1;border-bottom:1px solid var(--borderColor)}.ribbon-menu .tabs-holder li,.ribbon-menu .tabs-holder a{display:block;height:24px;line-height:24px}.ribbon-menu .tabs-holder li{color:var(--textColor);background-color:var(--background-color);border-left:1px solid transparent;border-right:1px solid transparent;border-bottom:1px solid var(--borderColor);cursor:pointer}.ribbon-menu .tabs-holder li:hover{border-left-color:var(--borderColor);border-right-color:var(--borderColor);border-top-color:var(--borderColor)}.ribbon-menu .tabs-holder li+li{margin-left:3px}.ribbon-menu .tabs-holder a{text-decoration:none;padding:0 14px;font-size:12px;background-color:inherit;color:inherit}.ribbon-menu .tabs-holder .active{background-color:var(--background-active-color);border:1px solid var(--borderColor);border-bottom-color:transparent}.ribbon-menu .tabs-holder .static{background-color:var(--staticMenuColor);color:var(--staticTextColor)}.ribbon-menu .content-holder{display:block;position:relative;background-color:inherit;border-left:none;border-right:none}.ribbon-menu .content-holder .ribbon-section{display:none;padding:4px;border-bottom:1px solid var(--borderColor);justify-content:flex-start;flex-shrink:0}.ribbon-menu .content-holder .ribbon-section.active{display:flex}.ribbon-menu .content-holder .ribbon-divider{display:block;position:relative;margin:0 4px;height:100%!important;width:1px;background-color:var(--borderColor)}.ribbon-menu .content-holder .group{padding:0 4px 24px;display:flex;cursor:default;background-color:inherit;position:relative;align-items:flex-start;align-content:flex-start;flex-shrink:0}.ribbon-menu .content-holder .group:nth-child(1):last-child{flex-basis:100%}.ribbon-menu .content-holder .group .title{display:block;position:absolute;left:0;bottom:0;width:100%;line-height:24px;height:20px;font-size:11px;text-align:center;border-top:1px solid var(--borderColor);white-space:nowrap}.ribbon-menu .content-holder .group>*:not(.title){margin:2px}.ribbon-menu .content-holder .group+.group{border-left:1px solid var(--borderColor)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background-color:var(--scrollbar-thumb-color)}::-webkit-scrollbar-thumb{background-color:var(--scrollbar-track-color)}*{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color)}.tabSubGroup-min{display:flex;gap:2px}.ribbon-button{cursor:pointer;min-width:0;text-align:center;border:1px solid transparent;background-color:var(--backgroundActiveColor);color:var(--textColor);outline:none;position:relative}.ribbon-button{height:auto;min-height:64px;width:auto;padding:4px 8px;margin:0}.ribbon-button .caption,.ribbon-button .ribbon-icon{display:block;text-align:center}.ribbon-button .caption{font-size:12px}.ribbon-button .ribbon-icon *{height:32px;max-width:32px;font-size:26px;line-height:32px}.ribbon-button.dropdown-toggle{padding-right:12px!important}.ribbon-button.dropdown-toggle:before{margin-left:-8px}.ribbon-button.drop-active{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-button:hover:enabled,.ribbon-button:not(.disabled):hover{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-button:active,.ribbon-button.active,.ribbon-menu .active-container .ribbon-button{border-color:var(--itemActiveBorderColor);background-color:var(--itemActiveBackground)!important;color:var(--textActiveColor)}.ribbon-tool-button{cursor:pointer;min-width:0;text-align:center;border:1px solid transparent;background-color:var(--backgroundActiveColor);color:var(--textColor);outline:none;position:relative}.hidden{display:none}.ribbon-tool-button{width:24px;height:24px;padding:0 2px;margin:0;display:flex;align-items:center;justify-content:center}.ribbon-tool-button *{width:16px;height:16px;line-height:16px;font-size:14px}.ribbon-tool-button.dropdown-toggle{padding-right:2px!important}.ribbon-tool-button.dropdown-toggle:before{display:none}.ribbon-tool-button.dropdown-toggle:after{content:"";display:block;position:absolute;bottom:0;right:0;width:0;height:0;border-style:solid;border-width:0 0 4px 4px;border-color:transparent transparent var(--dropdownToggleColor) transparent!important;z-index:1}.ribbon-tool-button.drop-active{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-tool-button:hover:enabled,.ribbon-tool-button:not(.disabled):hover{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-tool-button:active,.ribbon-tool-button.active,.ribbon-menu .active-container .ribbon-tool-button{border-color:var(--itemActiveBorderColor);background-color:var(--itemActiveBackground)!important;color:var(--textActiveColor)}.ribbon-icon-button{cursor:pointer;min-width:0;text-align:center;border:1px solid transparent;background-color:var(--backgroundActiveColor);color:var(--textColor);outline:none;position:relative}.ribbon-icon-button{height:24px;width:auto;margin:0;display:inline-flex;flex-flow:row nowrap;align-items:center;padding:0 4px}.ribbon-icon-button .caption,.ribbon-icon-button .ribbon-icon{display:block}.ribbon-icon-button .caption{font-size:11px}.ribbon-icon-button .ribbon-icon{display:flex;justify-content:center;align-items:center}.ribbon-icon-button .ribbon-icon *{width:16px;height:16px;line-height:16px;font-size:14px}.ribbon-icon-button .ribbon-icon+.caption,.ribbon-icon-button .caption+.ribbon-icon{margin-left:4px}.ribbon-icon-button [class*=mif-]{vertical-align:inherit}.ribbon-icon-button.dropdown-toggle{padding-right:4px!important}.ribbon-icon-button.dropdown-toggle:before{display:none}.ribbon-icon-button.dropdown-toggle:after{content:"";display:block;position:absolute;bottom:0;right:0;width:0;height:0;border-style:solid;border-width:0 0 4px 4px;border-color:transparent transparent var(--dropdownToggleColor) transparent;z-index:1}.ribbon-icon-button.drop-active{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-icon-button:hover:enabled,.ribbon-icon-button:not(.disabled):hover{border-color:var(--itemBorderColor);background-color:var(--itemHoverBackground)}.ribbon-icon-button:active,.ribbon-icon-button.active,.ribbon-menu .active-container .ribbon-icon-button{border-color:var(--itemActiveBorderColor);background-color:var(--itemActiveBackground)!important;color:var(--textActiveColor)}.ribbon-split-button{text-align:center;border:1px solid transparent;padding:0;margin:0}.ribbon-split-button:not([disabled]):hover,.ribbon-split-button:not(.disabled):hover{border-color:var(--itemBorderColor)}.ribbon-split-button:not([disabled]):hover .ribbon-split,.ribbon-split-button:not(.disabled):hover .ribbon-split{border-top-color:var(--itemBorderColor)}.ribbon-split-button .ribbon-main,.ribbon-split-button .ribbon-split{display:block;text-align:center;min-width:0;min-height:0;padding:2px 4px;width:100%;cursor:pointer}.ribbon-split-button .ribbon-main:hover,.ribbon-split-button .ribbon-split:hover{background-color:var(--itemHoverBackground)}.ribbon-split-button .ribbon-main{background-color:inherit;outline:none;position:relative;border:none}.ribbon-split-button .ribbon-icon *{height:32px;max-width:32px;font-size:26px;line-height:32px}.ribbon-split-button .ribbon-icon+.caption{margin-top:8px}.ribbon-split-button .ribbon-split{font-size:12px;border-top:1px solid transparent;padding-bottom:4px}.ribbon-split-button .ribbon-split.dropdown-toggle{padding-right:4px!important}.ribbon-split-button .ribbon-split.dropdown-toggle:before{display:none}.ribbon-split-button .ribbon-split.dropdown-toggle:after{content:"";display:block;position:absolute;bottom:2px;left:50%;transform:translate(-50%) rotate(45deg);width:0;height:0;border-style:solid;border-width:0 0 4px 4px;border-color:transparent transparent var(--dropdownToggleColor) transparent;z-index:1}.ribbon-split-button .ribbon-dropdown{text-align:left}.ribbon-minimize-icon{position:absolute;bottom:2px;right:6px;padding:1px;size:20px;z-index:100}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
var ot = Object.defineProperty;
var st = (t, o, r) => o in t ? ot(t, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[o] = r;
var B = (t, o, r) => (st(t, typeof o != "symbol" ? o + "" : o, r), r);
import React, { useRef, useState, useLayoutEffect, Children, cloneElement, forwardRef, useImperativeHandle } from "react";
var jsxRuntimeExports = {}, jsxRuntime = {
get exports() {
return jsxRuntimeExports;
},
set exports(t) {
jsxRuntimeExports = t;
}
}, reactJsxRuntime_production_min = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredReactJsxRuntime_production_min;
function requireReactJsxRuntime_production_min() {
if (hasRequiredReactJsxRuntime_production_min)
return reactJsxRuntime_production_min;
hasRequiredReactJsxRuntime_production_min = 1;
var t = React, o = Symbol.for("react.element"), r = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
function d(f, p, E) {
var g, S = {}, _ = null, y = null;
E !== void 0 && (_ = "" + E), p.key !== void 0 && (_ = "" + p.key), p.ref !== void 0 && (y = p.ref);
for (g in p)
s.call(p, g) && !l.hasOwnProperty(g) && (S[g] = p[g]);
if (f && f.defaultProps)
for (g in p = f.defaultProps, p)
S[g] === void 0 && (S[g] = p[g]);
return { $$typeof: o, type: f, key: _, ref: y, props: S, _owner: c.current };
}
return reactJsxRuntime_production_min.Fragment = r, reactJsxRuntime_production_min.jsx = d, reactJsxRuntime_production_min.jsxs = d, reactJsxRuntime_production_min;
}
var reactJsxRuntime_development = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredReactJsxRuntime_development;
function requireReactJsxRuntime_development() {
return hasRequiredReactJsxRuntime_development || (hasRequiredReactJsxRuntime_development = 1, process.env.NODE_ENV !== "production" && function() {
var t = React, o = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), f = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), T = Symbol.iterator, z = "@@iterator";
function A(e) {
if (e === null || typeof e != "object")
return null;
var a = T && e[T] || e[z];
return typeof a == "function" ? a : null;
}
var w = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function O(e) {
{
for (var a = arguments.length, u = new Array(a > 1 ? a - 1 : 0), b = 1; b < a; b++)
u[b - 1] = arguments[b];
$("error", e, u);
}
}
function $(e, a, u) {
{
var b = w.ReactDebugCurrentFrame, v = b.getStackAddendum();
v !== "" && (a += "%s", u = u.concat([v]));
var R = u.map(function(h) {
return String(h);
});
R.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, R);
}
}
var I = !1, N = !1, Te = !1, Oe = !1, ke = !1, oe;
oe = Symbol.for("react.module.reference");
function De(e) {
return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || ke || e === c || e === E || e === g || Oe || e === y || I || N || Te || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === S || e.$$typeof === d || e.$$typeof === f || e.$$typeof === p || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === oe || e.getModuleId !== void 0));
}
function Pe(e, a, u) {
var b = e.displayName;
if (b)
return b;
var v = a.displayName || a.name || "";
return v !== "" ? u + "(" + v + ")" : u;
}
function se(e) {
return e.displayName || "Context";
}
function P(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case s:
return "Fragment";
case r:
return "Portal";
case l:
return "Profiler";
case c:
return "StrictMode";
case E:
return "Suspense";
case g:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case f:
var a = e;
return se(a) + ".Consumer";
case d:
var u = e;
return se(u._context) + ".Provider";
case p:
return Pe(e, e.render, "ForwardRef");
case S:
var b = e.displayName || null;
return b !== null ? b : P(e.type) || "Memo";
case _: {
var v = e, R = v._payload, h = v._init;
try {
return P(h(R));
} catch {
return null;
}
}
}
return null;
}
var F = Object.assign, G = 0, ie, ae, ce, le, ue, de, fe;
function pe() {
}
pe.__reactDisabledLog = !0;
function Le() {
{
if (G === 0) {
ie = console.log, ae = console.info, ce = console.warn, le = console.error, ue = console.group, de = console.groupCollapsed, fe = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: pe,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
G++;
}
}
function Ie() {
{
if (G--, G === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: F({}, e, {
value: ie
}),
info: F({}, e, {
value: ae
}),
warn: F({}, e, {
value: ce
}),
error: F({}, e, {
value: le
}),
group: F({}, e, {
value: ue
}),
groupCollapsed: F({}, e, {
value: de
}),
groupEnd: F({}, e, {
value: fe
})
});
}
G < 0 && O("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var K = w.ReactCurrentDispatcher, X;
function J(e, a, u) {
{
if (X === void 0)
try {
throw Error();
} catch (v) {
var b = v.stack.trim().match(/\n( *(at )?)/);
X = b && b[1] || "";
}
return `
` + X + e;
}
}
var Z = !1, Y;
{
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
Y = new Ne();
}
function be(e, a) {
if (!e || Z)
return "";
{
var u = Y.get(e);
if (u !== void 0)
return u;
}
var b;
Z = !0;
var v = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var R;
R = K.current, K.current = null, Le();
try {
if (a) {
var h = function() {
throw Error();
};
if (Object.defineProperty(h.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(h, []);
} catch (L) {
b = L;
}
Reflect.construct(e, [], h);
} else {
try {
h.call();
} catch (L) {
b = L;
}
e.call(h.prototype);
}
} else {
try {
throw Error();
} catch (L) {
b = L;
}
e();
}
} catch (L) {
if (L && b && typeof L.stack == "string") {
for (var m = L.stack.split(`
`), k = b.stack.split(`
`), j = m.length - 1, C = k.length - 1; j >= 1 && C >= 0 && m[j] !== k[C]; )
C--;
for (; j >= 1 && C >= 0; j--, C--)
if (m[j] !== k[C]) {
if (j !== 1 || C !== 1)
do
if (j--, C--, C < 0 || m[j] !== k[C]) {
var D = `
` + m[j].replace(" at new ", " at ");
return e.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", e.displayName)), typeof e == "function" && Y.set(e, D), D;
}
while (j >= 1 && C >= 0);
break;
}
}
} finally {
Z = !1, K.current = R, Ie(), Error.prepareStackTrace = v;
}
var M = e ? e.displayName || e.name : "", Se = M ? J(M) : "";
return typeof e == "function" && Y.set(e, Se), Se;
}
function Ae(e, a, u) {
return be(e, !1);
}
function Fe(e) {
var a = e.prototype;
return !!(a && a.isReactComponent);
}
function V(e, a, u) {
if (e == null)
return "";
if (typeof e == "function")
return be(e, Fe(e));
if (typeof e == "string")
return J(e);
switch (e) {
case E:
return J("Suspense");
case g:
return J("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case p:
return Ae(e.render);
case S:
return V(e.type, a, u);
case _: {
var b = e, v = b._payload, R = b._init;
try {
return V(R(v), a, u);
} catch {
}
}
}
return "";
}
var U = Object.prototype.hasOwnProperty, me = {}, he = w.ReactDebugCurrentFrame;
function H(e) {
if (e) {
var a = e._owner, u = V(e.type, e._source, a ? a.type : null);
he.setExtraStackFrame(u);
} else
he.setExtraStackFrame(null);
}
function Be(e, a, u, b, v) {
{
var R = Function.call.bind(U);
for (var h in e)
if (R(e, h)) {
var m = void 0;
try {
if (typeof e[h] != "function") {
var k = Error((b || "React class") + ": " + u + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw k.name = "Invariant Violation", k;
}
m = e[h](a, h, b, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (j) {
m = j;
}
m && !(m instanceof Error) && (H(v), O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", b || "React class", u, h, typeof m), H(null)), m instanceof Error && !(m.message in me) && (me[m.message] = !0, H(v), O("Failed %s type: %s", u, m.message), H(null));
}
}
}
var We = Array.isArray;
function Q(e) {
return We(e);
}
function Me(e) {
{
var a = typeof Symbol == "function" && Symbol.toStringTag, u = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
return u;
}
}
function $e(e) {
try {
return ve(e), !1;
} catch {
return !0;
}
}
function ve(e) {
return "" + e;
}
function xe(e) {
if ($e(e))
return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Me(e)), ve(e);
}
var q = w.ReactCurrentOwner, Ge = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, ge, Re, ee;
ee = {};
function qe(e) {
if (U.call(e, "ref")) {
var a = Object.getOwnPropertyDescriptor(e, "ref").get;
if (a && a.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function ze(e) {
if (U.call(e, "key")) {
var a = Object.getOwnPropertyDescriptor(e, "key").get;
if (a && a.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Je(e, a) {
if (typeof e.ref == "string" && q.current && a && q.current.stateNode !== a) {
var u = P(q.current.type);
ee[u] || (O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', P(q.current.type), e.ref), ee[u] = !0);
}
}
function Ye(e, a) {
{
var u = function() {
ge || (ge = !0, O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
};
u.isReactWarning = !0, Object.defineProperty(e, "key", {
get: u,
configurable: !0
});
}
}
function Ve(e, a) {
{
var u = function() {
Re || (Re = !0, O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
};
u.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: u,
configurable: !0
});
}
}
var Ue = function(e, a, u, b, v, R, h) {
var m = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: o,
// Built-in properties that belong on the element
type: e,
key: a,
ref: u,
props: h,
// Record the component responsible for creating this element.
_owner: R
};
return m._store = {}, Object.defineProperty(m._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(m, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: b
}), Object.defineProperty(m, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: v
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
};
function He(e, a, u, b, v) {
{
var R, h = {}, m = null, k = null;
u !== void 0 && (xe(u), m = "" + u), ze(a) && (xe(a.key), m = "" + a.key), qe(a) && (k = a.ref, Je(a, v));
for (R in a)
U.call(a, R) && !Ge.hasOwnProperty(R) && (h[R] = a[R]);
if (e && e.defaultProps) {
var j = e.defaultProps;
for (R in j)
h[R] === void 0 && (h[R] = j[R]);
}
if (m || k) {
var C = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
m && Ye(h, C), k && Ve(h, C);
}
return Ue(e, m, k, v, b, q.current, h);
}
}
var te = w.ReactCurrentOwner, Ee = w.ReactDebugCurrentFrame;
function W(e) {
if (e) {
var a = e._owner, u = V(e.type, e._source, a ? a.type : null);
Ee.setExtraStackFrame(u);
} else
Ee.setExtraStackFrame(null);
}
var ne;
ne = !1;
function re(e) {
return typeof e == "object" && e !== null && e.$$typeof === o;
}
function _e() {
{
if (te.current) {
var e = P(te.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function Ke(e) {
{
if (e !== void 0) {
var a = e.fileName.replace(/^.*[\\\/]/, ""), u = e.lineNumber;
return `
Check your code at ` + a + ":" + u + ".";
}
return "";
}
}
var ye = {};
function Xe(e) {
{
var a = _e();
if (!a) {
var u = typeof e == "string" ? e : e.displayName || e.name;
u && (a = `
Check the top-level render call using <` + u + ">.");
}
return a;
}
}
function we(e, a) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var u = Xe(a);
if (ye[u])
return;
ye[u] = !0;
var b = "";
e && e._owner && e._owner !== te.current && (b = " It was passed a child from " + P(e._owner.type) + "."), W(e), O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, b), W(null);
}
}
function je(e, a) {
{
if (typeof e != "object")
return;
if (Q(e))
for (var u = 0; u < e.length; u++) {
var b = e[u];
re(b) && we(b, a);
}
else if (re(e))
e._store && (e._store.validated = !0);
else if (e) {
var v = A(e);
if (typeof v == "function" && v !== e.entries)
for (var R = v.call(e), h; !(h = R.next()).done; )
re(h.value) && we(h.value, a);
}
}
}
function Ze(e) {
{
var a = e.type;
if (a == null || typeof a == "string")
return;
var u;
if (typeof a == "function")
u = a.propTypes;
else if (typeof a == "object" && (a.$$typeof === p || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
a.$$typeof === S))
u = a.propTypes;
else
return;
if (u) {
var b = P(a);
Be(u, e.props, "prop", b, e);
} else if (a.PropTypes !== void 0 && !ne) {
ne = !0;
var v = P(a);
O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
}
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Qe(e) {
{
for (var a = Object.keys(e.props), u = 0; u < a.length; u++) {
var b = a[u];
if (b !== "children" && b !== "key") {
W(e), O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", b), W(null);
break;
}
}
e.ref !== null && (W(e), O("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
}
}
function Ce(e, a, u, b, v, R) {
{
var h = De(e);
if (!h) {
var m = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var k = Ke(v);
k ? m += k : m += _e();
var j;
e === null ? j = "null" : Q(e) ? j = "array" : e !== void 0 && e.$$typeof === o ? (j = "<" + (P(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : j = typeof e, O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, m);
}
var C = He(e, a, u, v, R);
if (C == null)
return C;
if (h) {
var D = a.children;
if (D !== void 0)
if (b)
if (Q(D)) {
for (var M = 0; M < D.length; M++)
je(D[M], e);
Object.freeze && Object.freeze(D);
} else
O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
je(D, e);
}
return e === s ? Qe(C) : Ze(C), C;
}
}
function et(e, a, u) {
return Ce(e, a, u, !0);
}
function tt(e, a, u) {
return Ce(e, a, u, !1);
}
var nt = tt, rt = et;
reactJsxRuntime_development.Fragment = s, reactJsxRuntime_development.jsx = nt, reactJsxRuntime_development.jsxs = rt;
}()), reactJsxRuntime_development;
}
(function(t) {
process.env.NODE_ENV === "production" ? t.exports = requireReactJsxRuntime_production_min() : t.exports = requireReactJsxRuntime_development();
})(jsxRuntime);
const Fragment = jsxRuntimeExports.Fragment, jsx = jsxRuntimeExports.jsx, jsxs = jsxRuntimeExports.jsxs;
var classnamesExports = {}, classnames = {
get exports() {
return classnamesExports;
},
set exports(t) {
classnamesExports = t;
}
};
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
(function(t) {
(function() {
var o = {}.hasOwnProperty;
function r() {
for (var s = [], c = 0; c < arguments.length; c++) {
var l = arguments[c];
if (l) {
var d = typeof l;
if (d === "string" || d === "number")
s.push(l);
else if (Array.isArray(l)) {
if (l.length) {
var f = r.apply(null, l);
f && s.push(f);
}
} else if (d === "object") {
if (l.toString !== Object.prototype.toString && !l.toString.toString().includes("[native code]")) {
s.push(l.toString());
continue;
}
for (var p in l)
o.call(l, p) && l[p] && s.push(p);
}
}
}
return s.join(" ");
}
t.exports ? (r.default = r, t.exports = r) : window.classNames = r;
})();
})(classnames);
const RibbonTabNav = ({ hotkey: t = "", staticTab: o, label: r, active: s, className: c, onClick: l, index: d }) => {
const f = classnamesExports(
c,
{ static: o },
{ active: s }
);
return /* @__PURE__ */ jsx("li", { className: f, onClick: l, children: /* @__PURE__ */ jsx(
"a",
{
"data-label": r.toLowerCase(),
"data-static": o,
"data-key": d,
href: `#${r.toLowerCase()}`,
"data-hotkey": t,
children: r
}
) });
}, traverse = (t, o) => {
if (t.classList.contains("radio-group"))
o.push(t);
else if (t.classList.contains("check-group"))
o.push(t);
else if (t.classList.contains("ribbon-icon-button"))
o.push(t);
else if (t.classList.contains("dropdown"))
o.push(t);
else if (t.classList.contains("ribbon-tool-button"))
o.push(t);
else if (!t.classList.contains("title"))
if (t.classList.contains("tabSubGroup-min"))
o.push(t);
else {
const r = t.children;
let s = t.childElementCount;
for (let c = 0; c < s; c++)
traverse(r[c], o);
}
}, useMinimization = (t) => {
const o = useRef(null), [r, s] = useState([]), [c, l] = useState([]), [d, f] = useState(!1), [p, E] = useState(null);
return useLayoutEffect(() => {
var S;
let g = 0;
if (o.current && t) {
let _ = 0, y = [], T = [];
const A = document.querySelector(".content-holder").offsetWidth - 100;
o.current.childNodes.forEach((w) => {
if (console.log(w, "child"), w instanceof HTMLElement) {
const O = w.offsetWidth;
let $ = w.children[0];
if (console.log($, $.onclick, "as"), _ > 19e3 || _ + $.offsetWidth > A)
y.push(w), g++, _ = 2e4, f(!0);
else if (_ + O > A) {
console.log(w, "childnode2"), g++;
let I = [];
traverse(w, I), console.log("aq", w);
for (let N = 0; N < I.length; N++)
_ += I[N].offsetWidth, _ > A && (console.log(I[N], "childnode3"), I[N].remove(), T.push(I[N]));
console.log("wq", w), console.log(w.children[w.childElementCount - 1], "kl"), T.push(w.children[w.childElementCount - 1]), f(!0), _ = 2e4;
} else
f(!1);
_ = _ + O;
}
}), console.log("protal", y, o.current.children, g), y.forEach((w) => {
w.remove();
}), s(y), l(T);
} else {
console.log("occuring");
const _ = (S = o.current) == null ? void 0 : S.cloneNode(!0);
E(_), s([]), l([]), f(!1);
}
}, [t, o]), console.log(p, "x"), [o, c, r, d, p];
}, ButtonGroup = "";
class RibbonButtonGroup extends React.Component {
constructor(r) {
super(r);
B(this, "state", {
radio: !1,
buttons: []
});
const { active: s, radio: c = !1, ismin: l = !1 } = r, d = [];
typeof s < "u" && (Array.isArray(s) ? s.forEach((f) => {
d.push(f);
}) : d.push(s)), this.state = {
radio: c,
buttons: d || []
}, this.buttonClick = this.buttonClick.bind(this);
}
buttonClick(r) {
const { children: s, onButtonClick: c = () => {
} } = this.props, { buttons: l, radio: d } = this.state, f = l.includes(r), p = React.Children.toArray(s)[r - 1];
d ? this.setState({
buttons: [r]
}) : (f ? l.splice(l.indexOf(r), 1) : l.push(r), this.setState({
buttons: l
})), typeof c == "function" && c(p);
}
render() {
let { children: r, className: s, classNameActive: c, classNameButton: l, style: d, ismin: f } = this.props;
const { buttons: p, radio: E } = this.state, g = classnamesExports(
"ribbon-toggle-group",
"button-group",
s,
E ? "radio-group" : "check-group"
);
return f && (d = { display: "flex", flexDirection: "row" }), /* @__PURE__ */ jsx("div", { "data-original": "button-group", className: g, style: d, children: React.Children.map(r, (S, _) => {
const y = S.props, T = _ + 1, z = p.includes(T), A = classnamesExports(
y.className,
l,
z ? c || " active " : ""
);
return React.cloneElement(S, {
className: A,
index: T,
onClick: this.buttonClick.bind(this, T)
});
}) });
}
}
const Dropdown = "";
class RibbonDropdown extends React.Component {
constructor(r) {
super(r);
B(this, "state", {
isOpen: !1
});
B(this, "dropdown");
this.state = {
isOpen: !1
}, this.dropdown = React.createRef(), this.toggleState = this.toggleState.bind(this), this.handleClickOutside = this.handleClickOutside.bind(this);
}
componentDidMount() {
document.addEventListener("mousedown", this.handleClickOutside);
}
componentWillUnmount() {
document.removeEventListener("mousedown", this.handleClickOutside);
}
handleClickOutside(r) {
this.dropdown.current && !this.dropdown.current.contains(r.target) && this.setState({
isOpen: !1
});
}
toggleState(r) {
const s = this.state.isOpen, c = this.dropdown.current, l = c.querySelector(".drop-object"), d = c.getBoundingClientRect();
getComputedStyle(l).position === "fixed" && (l.style.top = d.top + d.height + "px", l.style.left = d.left + "px"), this.setState({
isOpen: !s
}), r.preventDefault();
}
render() {
const { children: r } = this.props, [s, c] = Children.toArray(r), { isOpen: l } = this.state, d = classnamesExports(
"dropdown",
l ? "dropped" : ""
);
return /* @__PURE__ */ jsxs("div", {
"data-original": "dropdown",
className: d,
ref: this.dropdown,
/*@ts-ignore*/
children: [
s && cloneElement(s, {
/*@ts-ignore*/
className: ("props" in s && s.props.className ? s.props.className : "") + " dropdown-toggle " + (l ? " drop-active active-toggle " : ""),
onClick: this.toggleState
}),
/* @__PURE__ */ jsx("nav", { className: "drop-object " + (l ? " open " : ""), children: c })
]
});
}
}
const RibbonDropdownDivider = () => /* @__PURE__ */ jsx("li", { className: "divider" }), RibbonDropdownItem = ({ hotkey: t = "", children: o, className: r, target: s, caption: c, onClick: l, ...d }) => /* @__PURE__ */ jsx("li", { className: r, ...d, children: /* @__PURE__ */ jsx("a", { "data-onclick": l ? l.toString() : "", href: s, onClick: l, "data-hotkey": t, children: c || o }) });
class RibbonDropdownCheckItem extends React.Component {
constructor(r) {
super(r);
B(this, "state", {
checked: !1
});
this.state = {
checked: r.checked || !1
};
}
render() {
const { hotkey: r = "", className: s, target: c, caption: l, children: d, onClick: f, ...p } = this.props, { checked: E } = this.state, g = classnamesExports(s, E ? " checked " : "");
return /* @__PURE__ */ jsx("li", { className: g, ...p, onClick: () => {
this.setState({
checked: !E
});
}, children: /* @__PURE__ */ jsx("a", { href: c, onClick: f, "data-hotkey": r, children: l || d }) });
}
}
const DropdownMenu = "", RibbonDropdownMenu = ({ children: t, className: o }) => {
const r = classnamesExports("ribbon-dropdown", o);
return /* @__PURE__ */ jsx("ul", { className: r, children: t });
};
function ExpandMore({ item }) {
let temp;
if (item.classList.contains("radio-group")) {
let n = item.childElementCount, arr = item.children, active = [], cur_elements = [], func_elements = [];
for (let i = 0; i < n; i++) {
arr[i].classList.contains("active") && active.push(i + 1), cur_elements.push(arr[i]);
let x;
arr[i].dataset.onclick !== "" && arr[i].dataset.onclick !== "function () { [native code] }" && (x = eval(arr[i].dataset.onclick)), func_elements.push(x), cur_elements.push(arr[i]);
}
return temp = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(RibbonButtonGroup, { active, radio: !0, children: cur_elements.map((t, o) => /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: t.children[0].innerText, onClick: func_elements[o] }, o)) }) }), temp;
} else if (item.classList.contains("check-group")) {
let n = item.childElementCount, arr = item.children, active = [], cur_elements = [], func_elements = [];
for (let i = 0; i < n; i++) {
arr[i].classList.contains("active") && active.push(i + 1);
let x;
arr[i].dataset.onclick !== "" && arr[i].dataset.onclick !== "function () { [native code] }" && (x = eval(arr[i].dataset.onclick)), func_elements.push(x), cur_elements.push(arr[i]);
}
return temp = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(RibbonButtonGroup, { active, children: cur_elements.map((t, o) => /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: t.children[0].innerText, onClick: func_elements[o] }, o)) }) }), temp;
} else {
if (item.classList.contains("divider"))
return temp = /* @__PURE__ */ jsx(RibbonDropdownDivider, {}), temp;
{
let func;
return item.dataset.onclick !== "" && (func = eval(item.dataset.onclick)), /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: item.children[0].innerText, onClick: func });
}
}
}
const Expanded = "";
var cur = [];
function rec(element) {
let temp;
if (element.classList.contains("radio-group")) {
let n = element.childElementCount, arr = element.children, active = [], cur_elements = [], func_elements = [];
for (let i = 0; i < n; i++) {
arr[i].classList.contains("active") && active.push(i + 1);
let x;
arr[i].dataset.onclick !== "" && arr[i].dataset.onclick !== "function () { [native code] }" && (x = eval(arr[i].dataset.onclick)), func_elements.push(x), cur_elements.push(arr[i]);
}
temp = /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(RibbonButtonGroup, { active, radio: !0, children: cur_elements.map((t, o) => /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: t.querySelector(".caption").innerText, onClick: func_elements[o] }, o)) }),
/* @__PURE__ */ jsx(RibbonDropdownDivider, {})
] });
} else if (element.classList.contains("check-group")) {
let n = element.childElementCount, arr = element.children, active = [], cur_elements = [], func_elements = [];
for (let i = 0; i < n; i++) {
arr[i].classList.contains("active") && active.push(i + 1);
let x;
arr[i].dataset.onclick !== "" && arr[i].dataset.onclick !== "function () { [native code] }" && (x = eval(arr[i].dataset.onclick)), func_elements.push(x), cur_elements.push(arr[i]);
}
temp = /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(RibbonButtonGroup, { active, children: cur_elements.map((t, o) => /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: t.querySelector(".caption").innerText, onClick: func_elements[o] }, o)) }),
/* @__PURE__ */ jsx(RibbonDropdownDivider, {})
] });
} else if (element.classList.contains("ribbon-icon-button")) {
let func;
element.dataset.onclick !== "" && (func = eval(element.dataset.onclick)), temp = /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: element.querySelector(".caption").innerText, onClick: func });
} else if (element.classList.contains("ribbon-tool-button")) {
let func;
element.dataset.onclick.length > 0 && (func = eval(element.dataset.onclick)), temp = /* @__PURE__ */ jsx(RibbonDropdownItem, { caption: element.querySelector(".caption").innerText, onClick: func });
} else if (element.classList.contains("dropdown")) {
const t = element.children[0], o = element.children[1].children[0];
o.innerHTML;
let r = o.childElementCount, s = [];
for (let c = 0; c < r; c++)
s.push(o.children[c]);
temp = /* @__PURE__ */ jsxs(RibbonDropdown, { children: [
/* @__PURE__ */ jsx(RibbonDropdownItem, { caption: t.querySelector(".caption").innerText }),
/* @__PURE__ */ jsx(RibbonDropdownMenu, { children: s.map((c, l) => /* @__PURE__ */ jsx(ExpandMore, { item: c }, l)) })
] });
} else if (element.classList.contains("t