@c15t/dev-tools 2.0.0-rc.8 → 2.0.1

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.
package/dist/tanstack.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  var __webpack_modules__ = {
3
4
  "../../node_modules/.bun/@rsbuild+core@2.0.0-beta.11+490411ac90707e06/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[2].use[2]!./src/styles/animations.module.css" (module, __webpack_exports__, __webpack_require__) {
4
5
  __webpack_require__.d(__webpack_exports__, {
@@ -1964,8 +1965,11 @@ var __webpack_exports__ = {};
1964
1965
  (()=>{
1965
1966
  __webpack_require__.r(__webpack_exports__);
1966
1967
  __webpack_require__.d(__webpack_exports__, {
1968
+ C15tTanStackDevtoolsPanel: ()=>C15tTanStackDevtoolsPanel,
1969
+ c15tDevtools: ()=>c15tDevtools,
1967
1970
  c15tDevtoolsPlugin: ()=>c15tDevtoolsPlugin
1968
1971
  });
1972
+ const external_react_namespaceObject = require("react");
1969
1973
  const external_c15t_namespaceObject = require("c15t");
1970
1974
  var injectStylesIntoStyleTag = __webpack_require__("../../node_modules/.bun/@rsbuild+core@2.0.0-beta.11+490411ac90707e06/node_modules/@rsbuild/core/compiled/style-loader/runtime/injectStylesIntoStyleTag.js");
1971
1975
  var injectStylesIntoStyleTag_default = /*#__PURE__*/ __webpack_require__.n(injectStylesIntoStyleTag);
@@ -1998,99 +2002,6 @@ var __webpack_exports__ = {};
1998
2002
  injectStylesIntoStyleTag_default()(panel_module.A, panel_module_options);
1999
2003
  panel_module.A && panel_module.A.locals && panel_module.A.locals;
2000
2004
  '[data-c15t-trigger], [aria-label*="privacy settings" i], [aria-label*="preference" i]';
2001
- function createElement(options = {}) {
2002
- const { tag = 'div', text, html, children, className, id, style, dataset, onClick, onMouseEnter, onMouseLeave, onKeyDown, onKeyUp, onFocus, onBlur, onChange, onInput, onAnimationEnd, onTransitionEnd, ...attrs } = options;
2003
- const element = document.createElement(tag);
2004
- if (className) element.className = className;
2005
- if (id) element.id = id;
2006
- if (style) {
2007
- for (const [key, value] of Object.entries(style))if (void 0 !== value) element.style.setProperty(key.replace(/([A-Z])/g, '-$1').toLowerCase(), String(value));
2008
- }
2009
- if (dataset) for (const [key, value] of Object.entries(dataset))element.dataset[key] = value;
2010
- if (text) element.textContent = text;
2011
- if (html) element.innerHTML = html;
2012
- if (children) {
2013
- for (const child of children)if (null != child) if ('string' == typeof child) element.appendChild(document.createTextNode(child));
2014
- else element.appendChild(child);
2015
- }
2016
- if (void 0 !== attrs.ariaLabel) element.setAttribute('aria-label', attrs.ariaLabel);
2017
- if (void 0 !== attrs.ariaExpanded) element.setAttribute('aria-expanded', attrs.ariaExpanded);
2018
- if (void 0 !== attrs.ariaHidden) element.setAttribute('aria-hidden', attrs.ariaHidden);
2019
- if (void 0 !== attrs.ariaSelected) element.setAttribute('aria-selected', attrs.ariaSelected);
2020
- if (void 0 !== attrs.ariaControls) element.setAttribute('aria-controls', attrs.ariaControls);
2021
- if (void 0 !== attrs.ariaChecked) element.setAttribute('aria-checked', attrs.ariaChecked);
2022
- for (const [key, value] of Object.entries(attrs))if (void 0 !== value && !key.startsWith('aria')) if ('boolean' == typeof value) {
2023
- if (value) element.setAttribute(key, '');
2024
- } else element.setAttribute(key, String(value));
2025
- if (onClick) element.addEventListener('click', onClick);
2026
- if (onMouseEnter) element.addEventListener('mouseenter', onMouseEnter);
2027
- if (onMouseLeave) element.addEventListener('mouseleave', onMouseLeave);
2028
- if (onKeyDown) element.addEventListener('keydown', onKeyDown);
2029
- if (onKeyUp) element.addEventListener('keyup', onKeyUp);
2030
- if (onFocus) element.addEventListener('focus', onFocus);
2031
- if (onBlur) element.addEventListener('blur', onBlur);
2032
- if (onChange) element.addEventListener('change', onChange);
2033
- if (onInput) element.addEventListener('input', onInput);
2034
- if (onAnimationEnd) element.addEventListener('animationend', onAnimationEnd);
2035
- if (onTransitionEnd) element.addEventListener('transitionend', onTransitionEnd);
2036
- return element;
2037
- }
2038
- function renderer_div(options = {}) {
2039
- return createElement({
2040
- ...options,
2041
- tag: 'div'
2042
- });
2043
- }
2044
- function renderer_button(options = {}) {
2045
- return createElement({
2046
- ...options,
2047
- tag: 'button',
2048
- type: options.type ?? 'button'
2049
- });
2050
- }
2051
- function renderer_span(options = {}) {
2052
- return createElement({
2053
- ...options,
2054
- tag: 'span'
2055
- });
2056
- }
2057
- function input(options = {}) {
2058
- return createElement({
2059
- ...options,
2060
- tag: 'input'
2061
- });
2062
- }
2063
- function renderer_select(options = {}) {
2064
- const { options: selectOptions, selectedValue, ...rest } = options;
2065
- const selectElement = createElement({
2066
- ...rest,
2067
- tag: 'select'
2068
- });
2069
- if (selectOptions) for (const opt of selectOptions){
2070
- const optionElement = document.createElement('option');
2071
- optionElement.value = opt.value;
2072
- optionElement.textContent = opt.label;
2073
- if (selectedValue === opt.value) optionElement.selected = true;
2074
- selectElement.appendChild(optionElement);
2075
- }
2076
- return selectElement;
2077
- }
2078
- function renderer_createSvgElement(svgContent, options = {}) {
2079
- const { className, ariaHidden = true, width = 24, height = 24 } = options;
2080
- const wrapper = document.createElement('div');
2081
- wrapper.innerHTML = svgContent.trim();
2082
- const svg = wrapper.firstElementChild;
2083
- if (svg) {
2084
- if (className) svg.setAttribute('class', className);
2085
- if (ariaHidden) svg.setAttribute('aria-hidden', 'true');
2086
- svg.setAttribute('width', String(width));
2087
- svg.setAttribute('height', String(height));
2088
- }
2089
- return svg;
2090
- }
2091
- function renderer_clearElement(element) {
2092
- while(element.firstChild)element.removeChild(element.firstChild);
2093
- }
2094
2005
  var tabs_module = __webpack_require__("../../node_modules/.bun/@rsbuild+core@2.0.0-beta.11+490411ac90707e06/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[2].use[2]!./src/styles/tabs.module.css");
2095
2006
  var tabs_module_options = {};
2096
2007
  tabs_module_options.styleTagTransform = styleTagTransform_default();
@@ -2099,428 +2010,7 @@ var __webpack_exports__ = {};
2099
2010
  tabs_module_options.domAPI = styleDomAPI_default();
2100
2011
  tabs_module_options.insertStyleElement = insertStyleElement_default();
2101
2012
  injectStylesIntoStyleTag_default()(tabs_module.A, tabs_module_options);
2102
- const styles_tabs_module = tabs_module.A && tabs_module.A.locals ? tabs_module.A.locals : void 0;
2103
- const CONSENTS_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2104
- <rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
2105
- <path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
2106
- </svg>`;
2107
- const LOCATION_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2108
- <circle cx="12" cy="12" r="10"></circle>
2109
- <line x1="2" y1="12" x2="22" y2="12"></line>
2110
- <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>
2111
- </svg>`;
2112
- const POLICY_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2113
- <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
2114
- <path d="M9 12h6"></path>
2115
- <path d="M12 9v6"></path>
2116
- </svg>`;
2117
- const SCRIPTS_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2118
- <polyline points="16 18 22 12 16 6"></polyline>
2119
- <polyline points="8 6 2 12 8 18"></polyline>
2120
- </svg>`;
2121
- const ACTIONS_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2122
- <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path>
2123
- <circle cx="12" cy="12" r="3"></circle>
2124
- </svg>`;
2125
- const IAB_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2126
- <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
2127
- <path d="m9 12 2 2 4-4"></path>
2128
- </svg>`;
2129
- const EVENTS_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2130
- <path d="M12 20h9"></path>
2131
- <path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path>
2132
- </svg>`;
2133
- const MORE_ICON = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
2134
- <circle cx="12" cy="5" r="1.75"></circle>
2135
- <circle cx="12" cy="12" r="1.75"></circle>
2136
- <circle cx="12" cy="19" r="1.75"></circle>
2137
- </svg>`;
2138
- const TABS = [
2139
- {
2140
- id: 'location',
2141
- label: 'Location',
2142
- icon: LOCATION_ICON
2143
- },
2144
- {
2145
- id: 'policy',
2146
- label: 'Policy',
2147
- icon: POLICY_ICON
2148
- },
2149
- {
2150
- id: 'consents',
2151
- label: 'Consents',
2152
- icon: CONSENTS_ICON
2153
- },
2154
- {
2155
- id: "scripts",
2156
- label: 'Scripts',
2157
- icon: SCRIPTS_ICON
2158
- },
2159
- {
2160
- id: 'iab',
2161
- label: 'IAB',
2162
- icon: IAB_ICON
2163
- },
2164
- {
2165
- id: 'actions',
2166
- label: 'Actions',
2167
- icon: ACTIONS_ICON
2168
- },
2169
- {
2170
- id: 'events',
2171
- label: 'Events',
2172
- icon: EVENTS_ICON
2173
- }
2174
- ];
2175
- function tabs_createTabs(options) {
2176
- const { onTabChange, disabledTabs = [] } = options;
2177
- let activeTab = options.activeTab;
2178
- let isOverflowMenuOpen = false;
2179
- let visibleTabIds = [];
2180
- let hiddenTabIds = [];
2181
- const tabButtons = new Map();
2182
- const overflowButtons = new Map();
2183
- const tabList = renderer_div({
2184
- className: styles_tabs_module.tabList
2185
- });
2186
- const tabStrip = renderer_div({
2187
- className: styles_tabs_module.tabStrip,
2188
- role: 'tablist',
2189
- ariaLabel: 'DevTools tabs'
2190
- });
2191
- tabList.appendChild(tabStrip);
2192
- const overflowMenu = renderer_div({
2193
- className: styles_tabs_module.overflowMenu,
2194
- role: 'menu',
2195
- ariaLabel: 'All tabs'
2196
- });
2197
- overflowMenu.dataset.state = 'closed';
2198
- const overflowButton = renderer_button({
2199
- className: styles_tabs_module.overflowButton,
2200
- ariaLabel: 'More tabs',
2201
- ariaExpanded: 'false',
2202
- onClick: ()=>toggleOverflowMenu(),
2203
- onKeyDown: (e)=>{
2204
- if ('ArrowDown' === e.key || 'Enter' === e.key || ' ' === e.key) {
2205
- e.preventDefault();
2206
- openOverflowMenu();
2207
- focusFirstEnabledOverflowItem();
2208
- }
2209
- }
2210
- });
2211
- overflowButton.setAttribute('aria-haspopup', 'menu');
2212
- const overflowIcon = renderer_div({
2213
- className: styles_tabs_module.overflowButtonIcon
2214
- });
2215
- overflowIcon.appendChild(renderer_createSvgElement(MORE_ICON, {
2216
- width: 14,
2217
- height: 14
2218
- }));
2219
- overflowButton.appendChild(overflowIcon);
2220
- const overflowContainer = renderer_div({
2221
- className: styles_tabs_module.overflowContainer,
2222
- children: [
2223
- overflowButton,
2224
- overflowMenu
2225
- ]
2226
- });
2227
- tabList.appendChild(overflowContainer);
2228
- for (const tab of TABS){
2229
- const isActive = tab.id === activeTab;
2230
- const isDisabled = disabledTabs.includes(tab.id);
2231
- const tabButton = renderer_button({
2232
- className: `${styles_tabs_module.tab} ${isActive ? styles_tabs_module.tabActive : ''} ${isDisabled ? styles_tabs_module.tabDisabled : ''}`,
2233
- role: 'tab',
2234
- ariaSelected: isActive ? 'true' : 'false',
2235
- ariaControls: `panel-${tab.id}`,
2236
- ariaDisabled: isDisabled ? 'true' : void 0,
2237
- tabIndex: isActive ? 0 : -1,
2238
- disabled: isDisabled,
2239
- onClick: ()=>{
2240
- if (!isDisabled) {
2241
- closeOverflowMenu();
2242
- setActiveTab(tab.id);
2243
- onTabChange(tab.id);
2244
- }
2245
- },
2246
- onKeyDown: (e)=>handleKeyDown(e, tab.id)
2247
- });
2248
- const iconWrapper = renderer_div({
2249
- className: styles_tabs_module.tabIcon
2250
- });
2251
- iconWrapper.appendChild(renderer_createSvgElement(tab.icon, {
2252
- width: 14,
2253
- height: 14
2254
- }));
2255
- tabButton.appendChild(iconWrapper);
2256
- tabButton.appendChild(document.createTextNode(tab.label));
2257
- tabButtons.set(tab.id, tabButton);
2258
- tabStrip.appendChild(tabButton);
2259
- const overflowItem = renderer_button({
2260
- className: `${styles_tabs_module.overflowItem} ${isActive ? styles_tabs_module.overflowItemActive : ''} ${isDisabled ? styles_tabs_module.overflowItemDisabled : ''}`,
2261
- role: 'menuitemradio',
2262
- ariaChecked: isActive ? 'true' : 'false',
2263
- disabled: isDisabled,
2264
- onClick: ()=>{
2265
- if (!isDisabled) {
2266
- setActiveTab(tab.id);
2267
- onTabChange(tab.id);
2268
- closeOverflowMenu();
2269
- tabButtons.get(tab.id)?.focus();
2270
- }
2271
- },
2272
- onKeyDown: (e)=>handleOverflowKeyDown(e, tab.id)
2273
- });
2274
- const overflowItemIcon = renderer_div({
2275
- className: styles_tabs_module.overflowItemIcon
2276
- });
2277
- overflowItemIcon.appendChild(renderer_createSvgElement(tab.icon, {
2278
- width: 14,
2279
- height: 14
2280
- }));
2281
- overflowItem.appendChild(overflowItemIcon);
2282
- overflowItem.appendChild(document.createTextNode(tab.label));
2283
- overflowButtons.set(tab.id, overflowItem);
2284
- overflowMenu.appendChild(overflowItem);
2285
- }
2286
- function applyActiveState(tab) {
2287
- for (const [tabId, tabButton] of tabButtons){
2288
- const isActive = tabId === tab;
2289
- if (styles_tabs_module.tabActive) tabButton.classList.toggle(styles_tabs_module.tabActive, isActive);
2290
- tabButton.setAttribute('aria-selected', isActive ? 'true' : 'false');
2291
- tabButton.tabIndex = isActive ? 0 : -1;
2292
- }
2293
- for (const [tabId, overflowItem] of overflowButtons){
2294
- const isActive = tabId === tab;
2295
- if (styles_tabs_module.overflowItemActive) overflowItem.classList.toggle(styles_tabs_module.overflowItemActive, isActive);
2296
- overflowItem.setAttribute('aria-checked', isActive ? 'true' : 'false');
2297
- }
2298
- }
2299
- function updateVisibleTabs() {
2300
- const allTabIds = TABS.map((t)=>t.id);
2301
- const iabEnabled = !disabledTabs.includes('iab');
2302
- const preferredSecondTab = iabEnabled ? 'iab' : 'consents';
2303
- const overflowSecondTab = iabEnabled ? 'consents' : 'iab';
2304
- const showOverflowSecondTabInStrip = activeTab === overflowSecondTab;
2305
- const stripSecondTab = showOverflowSecondTabInStrip ? overflowSecondTab : preferredSecondTab;
2306
- const forcedOverflowTab = showOverflowSecondTabInStrip ? preferredSecondTab : overflowSecondTab;
2307
- const layoutTabIds = [
2308
- 'location',
2309
- 'policy',
2310
- stripSecondTab,
2311
- "scripts",
2312
- 'actions',
2313
- 'events',
2314
- forcedOverflowTab
2315
- ];
2316
- const forcedOverflowTabIds = new Set();
2317
- forcedOverflowTabIds.add(forcedOverflowTab);
2318
- for (const [index, tabId] of layoutTabIds.entries()){
2319
- const tabButton = tabButtons.get(tabId);
2320
- if (tabButton) tabButton.style.order = String(index);
2321
- const overflowItem = overflowButtons.get(tabId);
2322
- if (overflowItem) overflowItem.style.order = String(index);
2323
- }
2324
- for (const tabId of allTabIds){
2325
- const tabButton = tabButtons.get(tabId);
2326
- if (tabButton && styles_tabs_module.tabHidden) tabButton.classList.remove(styles_tabs_module.tabHidden);
2327
- }
2328
- if (styles_tabs_module.overflowContainerHidden) overflowContainer.classList.remove(styles_tabs_module.overflowContainerHidden);
2329
- const stripGap = Number.parseFloat(getComputedStyle(tabStrip).gap || '0');
2330
- const calculateVisibleTabs = (availableWidth)=>{
2331
- if (availableWidth <= 0) return [];
2332
- const nextVisible = [];
2333
- let usedWidth = 0;
2334
- for (const tabId of layoutTabIds){
2335
- if (forcedOverflowTabIds.has(tabId)) continue;
2336
- const tabButton = tabButtons.get(tabId);
2337
- if (!tabButton) continue;
2338
- const width = tabButton.getBoundingClientRect().width;
2339
- const nextUsed = 0 === nextVisible.length ? width : usedWidth + stripGap + width;
2340
- if (nextUsed <= availableWidth) {
2341
- nextVisible.push(tabId);
2342
- usedWidth = nextUsed;
2343
- } else break;
2344
- }
2345
- return nextVisible;
2346
- };
2347
- const measureStripWidth = ()=>tabStrip.getBoundingClientRect().width;
2348
- const showOverflowContainer = ()=>{
2349
- if (styles_tabs_module.overflowContainerHidden) overflowContainer.classList.remove(styles_tabs_module.overflowContainerHidden);
2350
- };
2351
- const hideOverflowContainer = ()=>{
2352
- if (styles_tabs_module.overflowContainerHidden) overflowContainer.classList.add(styles_tabs_module.overflowContainerHidden);
2353
- };
2354
- const measureVisibleWidth = (tabIds)=>{
2355
- let width = 0;
2356
- for (const [index, tabId] of tabIds.entries()){
2357
- const tabButton = tabButtons.get(tabId);
2358
- if (tabButton) {
2359
- width += tabButton.getBoundingClientRect().width;
2360
- if (index > 0) width += stripGap;
2361
- }
2362
- }
2363
- return width;
2364
- };
2365
- if (0 === forcedOverflowTabIds.size) {
2366
- hideOverflowContainer();
2367
- const visibleWithoutOverflow = calculateVisibleTabs(measureStripWidth());
2368
- if (visibleWithoutOverflow.length === layoutTabIds.length) visibleTabIds = visibleWithoutOverflow;
2369
- else {
2370
- showOverflowContainer();
2371
- visibleTabIds = calculateVisibleTabs(measureStripWidth());
2372
- }
2373
- } else {
2374
- showOverflowContainer();
2375
- const withOverflow = calculateVisibleTabs(measureStripWidth());
2376
- visibleTabIds = withOverflow.length > 0 ? withOverflow : [
2377
- activeTab
2378
- ];
2379
- }
2380
- if (!visibleTabIds.includes(activeTab) && !disabledTabs.includes(activeTab)) if (visibleTabIds.length > 0) visibleTabIds[visibleTabIds.length - 1] = activeTab;
2381
- else visibleTabIds = [
2382
- activeTab
2383
- ];
2384
- visibleTabIds = [
2385
- ...new Set(visibleTabIds)
2386
- ];
2387
- const maxStripWidth = measureStripWidth();
2388
- while(visibleTabIds.length > 1 && measureVisibleWidth(visibleTabIds) > maxStripWidth + 0.5){
2389
- let removeIndex = visibleTabIds.length - 1;
2390
- if (visibleTabIds[removeIndex] === activeTab) removeIndex = Math.max(0, removeIndex - 1);
2391
- visibleTabIds.splice(removeIndex, 1);
2392
- }
2393
- hiddenTabIds = layoutTabIds.filter((tabId)=>!visibleTabIds.includes(tabId) || forcedOverflowTabIds.has(tabId) && tabId !== activeTab);
2394
- for (const tabId of allTabIds){
2395
- const tabButton = tabButtons.get(tabId);
2396
- if (tabButton) {
2397
- if (styles_tabs_module.tabHidden) tabButton.classList.toggle(styles_tabs_module.tabHidden, hiddenTabIds.includes(tabId));
2398
- }
2399
- }
2400
- for (const tabId of allTabIds){
2401
- const overflowItem = overflowButtons.get(tabId);
2402
- if (overflowItem) {
2403
- if (styles_tabs_module.overflowItemHidden) overflowItem.classList.toggle(styles_tabs_module.overflowItemHidden, !hiddenTabIds.includes(tabId));
2404
- }
2405
- }
2406
- if (styles_tabs_module.overflowContainerHidden) overflowContainer.classList.toggle(styles_tabs_module.overflowContainerHidden, 0 === hiddenTabIds.length);
2407
- if (0 === hiddenTabIds.length) closeOverflowMenu();
2408
- }
2409
- function focusFirstEnabledOverflowItem() {
2410
- const firstEnabled = hiddenTabIds.find((tabId)=>!disabledTabs.includes(tabId));
2411
- if (firstEnabled) overflowButtons.get(firstEnabled)?.focus();
2412
- }
2413
- function openOverflowMenu() {
2414
- if (isOverflowMenuOpen || 0 === hiddenTabIds.length) return;
2415
- isOverflowMenuOpen = true;
2416
- overflowMenu.dataset.state = 'open';
2417
- overflowButton.setAttribute('aria-expanded', 'true');
2418
- document.addEventListener('click', handleOutsideClick);
2419
- document.addEventListener('keydown', handleEscapeKey);
2420
- }
2421
- function closeOverflowMenu() {
2422
- if (!isOverflowMenuOpen) return;
2423
- isOverflowMenuOpen = false;
2424
- overflowMenu.dataset.state = 'closed';
2425
- overflowButton.setAttribute('aria-expanded', 'false');
2426
- document.removeEventListener('click', handleOutsideClick);
2427
- document.removeEventListener('keydown', handleEscapeKey);
2428
- }
2429
- function toggleOverflowMenu() {
2430
- if (isOverflowMenuOpen) closeOverflowMenu();
2431
- else openOverflowMenu();
2432
- }
2433
- function handleOutsideClick(e) {
2434
- if (!overflowContainer.contains(e.target)) closeOverflowMenu();
2435
- }
2436
- function handleEscapeKey(e) {
2437
- if ('Escape' === e.key) closeOverflowMenu();
2438
- }
2439
- function handleKeyDown(e, currentTab) {
2440
- const enabledTabIds = visibleTabIds.filter((tabId)=>!disabledTabs.includes(tabId));
2441
- const currentIndex = enabledTabIds.indexOf(currentTab);
2442
- let newIndex = currentIndex;
2443
- switch(e.key){
2444
- case 'ArrowLeft':
2445
- newIndex = currentIndex > 0 ? currentIndex - 1 : enabledTabIds.length - 1;
2446
- break;
2447
- case 'ArrowRight':
2448
- newIndex = currentIndex < enabledTabIds.length - 1 ? currentIndex + 1 : 0;
2449
- break;
2450
- case 'Home':
2451
- newIndex = 0;
2452
- break;
2453
- case 'End':
2454
- newIndex = enabledTabIds.length - 1;
2455
- break;
2456
- default:
2457
- return;
2458
- }
2459
- e.preventDefault();
2460
- const newTab = enabledTabIds[newIndex];
2461
- if (newTab) {
2462
- setActiveTab(newTab);
2463
- onTabChange(newTab);
2464
- tabButtons.get(newTab)?.focus();
2465
- }
2466
- }
2467
- function handleOverflowKeyDown(e, currentTab) {
2468
- const enabledTabIds = hiddenTabIds.filter((tabId)=>!disabledTabs.includes(tabId));
2469
- const currentIndex = enabledTabIds.indexOf(currentTab);
2470
- if ('Escape' === e.key) {
2471
- e.preventDefault();
2472
- closeOverflowMenu();
2473
- overflowButton.focus();
2474
- return;
2475
- }
2476
- let newIndex = currentIndex;
2477
- switch(e.key){
2478
- case 'ArrowDown':
2479
- newIndex = (currentIndex + 1) % enabledTabIds.length;
2480
- break;
2481
- case 'ArrowUp':
2482
- newIndex = currentIndex > 0 ? currentIndex - 1 : enabledTabIds.length - 1;
2483
- break;
2484
- default:
2485
- return;
2486
- }
2487
- e.preventDefault();
2488
- const newTab = enabledTabIds[newIndex];
2489
- if (newTab) overflowButtons.get(newTab)?.focus();
2490
- }
2491
- function setActiveTab(tab) {
2492
- activeTab = tab;
2493
- applyActiveState(tab);
2494
- updateVisibleTabs();
2495
- }
2496
- const handleWindowResize = ()=>{
2497
- updateVisibleTabs();
2498
- };
2499
- let resizeObserver = null;
2500
- if ("u" > typeof ResizeObserver) {
2501
- resizeObserver = new ResizeObserver(()=>{
2502
- updateVisibleTabs();
2503
- });
2504
- resizeObserver.observe(tabList);
2505
- } else window.addEventListener('resize', handleWindowResize);
2506
- applyActiveState(activeTab);
2507
- requestAnimationFrame(()=>{
2508
- updateVisibleTabs();
2509
- });
2510
- return {
2511
- element: tabList,
2512
- setActiveTab,
2513
- destroy: ()=>{
2514
- closeOverflowMenu();
2515
- if (resizeObserver) {
2516
- resizeObserver.disconnect();
2517
- resizeObserver = null;
2518
- } else window.removeEventListener('resize', handleWindowResize);
2519
- tabButtons.clear();
2520
- overflowButtons.clear();
2521
- }
2522
- };
2523
- }
2013
+ tabs_module.A && tabs_module.A.locals && tabs_module.A.locals;
2524
2014
  function debug_bundle_createDebugBundle(payload) {
2525
2015
  const { namespace, devToolsState, connection, recentEvents, storeState } = payload;
2526
2016
  const bundle = {
@@ -2610,6 +2100,99 @@ var __webpack_exports__ = {};
2610
2100
  localStorage.removeItem(storageKey);
2611
2101
  } catch {}
2612
2102
  }
2103
+ function createElement(options = {}) {
2104
+ const { tag = 'div', text, html, children, className, id, style, dataset, onClick, onMouseEnter, onMouseLeave, onKeyDown, onKeyUp, onFocus, onBlur, onChange, onInput, onAnimationEnd, onTransitionEnd, ...attrs } = options;
2105
+ const element = document.createElement(tag);
2106
+ if (className) element.className = className;
2107
+ if (id) element.id = id;
2108
+ if (style) {
2109
+ for (const [key, value] of Object.entries(style))if (void 0 !== value) element.style.setProperty(key.replace(/([A-Z])/g, '-$1').toLowerCase(), String(value));
2110
+ }
2111
+ if (dataset) for (const [key, value] of Object.entries(dataset))element.dataset[key] = value;
2112
+ if (text) element.textContent = text;
2113
+ if (html) element.innerHTML = html;
2114
+ if (children) {
2115
+ for (const child of children)if (null != child) if ('string' == typeof child) element.appendChild(document.createTextNode(child));
2116
+ else element.appendChild(child);
2117
+ }
2118
+ if (void 0 !== attrs.ariaLabel) element.setAttribute('aria-label', attrs.ariaLabel);
2119
+ if (void 0 !== attrs.ariaExpanded) element.setAttribute('aria-expanded', attrs.ariaExpanded);
2120
+ if (void 0 !== attrs.ariaHidden) element.setAttribute('aria-hidden', attrs.ariaHidden);
2121
+ if (void 0 !== attrs.ariaSelected) element.setAttribute('aria-selected', attrs.ariaSelected);
2122
+ if (void 0 !== attrs.ariaControls) element.setAttribute('aria-controls', attrs.ariaControls);
2123
+ if (void 0 !== attrs.ariaChecked) element.setAttribute('aria-checked', attrs.ariaChecked);
2124
+ for (const [key, value] of Object.entries(attrs))if (void 0 !== value && !key.startsWith('aria')) if ('boolean' == typeof value) {
2125
+ if (value) element.setAttribute(key, '');
2126
+ } else element.setAttribute(key, String(value));
2127
+ if (onClick) element.addEventListener('click', onClick);
2128
+ if (onMouseEnter) element.addEventListener('mouseenter', onMouseEnter);
2129
+ if (onMouseLeave) element.addEventListener('mouseleave', onMouseLeave);
2130
+ if (onKeyDown) element.addEventListener('keydown', onKeyDown);
2131
+ if (onKeyUp) element.addEventListener('keyup', onKeyUp);
2132
+ if (onFocus) element.addEventListener('focus', onFocus);
2133
+ if (onBlur) element.addEventListener('blur', onBlur);
2134
+ if (onChange) element.addEventListener('change', onChange);
2135
+ if (onInput) element.addEventListener('input', onInput);
2136
+ if (onAnimationEnd) element.addEventListener('animationend', onAnimationEnd);
2137
+ if (onTransitionEnd) element.addEventListener('transitionend', onTransitionEnd);
2138
+ return element;
2139
+ }
2140
+ function renderer_div(options = {}) {
2141
+ return createElement({
2142
+ ...options,
2143
+ tag: 'div'
2144
+ });
2145
+ }
2146
+ function renderer_button(options = {}) {
2147
+ return createElement({
2148
+ ...options,
2149
+ tag: 'button',
2150
+ type: options.type ?? 'button'
2151
+ });
2152
+ }
2153
+ function renderer_span(options = {}) {
2154
+ return createElement({
2155
+ ...options,
2156
+ tag: 'span'
2157
+ });
2158
+ }
2159
+ function input(options = {}) {
2160
+ return createElement({
2161
+ ...options,
2162
+ tag: 'input'
2163
+ });
2164
+ }
2165
+ function renderer_select(options = {}) {
2166
+ const { options: selectOptions, selectedValue, ...rest } = options;
2167
+ const selectElement = createElement({
2168
+ ...rest,
2169
+ tag: 'select'
2170
+ });
2171
+ if (selectOptions) for (const opt of selectOptions){
2172
+ const optionElement = document.createElement('option');
2173
+ optionElement.value = opt.value;
2174
+ optionElement.textContent = opt.label;
2175
+ if (selectedValue === opt.value) optionElement.selected = true;
2176
+ selectElement.appendChild(optionElement);
2177
+ }
2178
+ return selectElement;
2179
+ }
2180
+ function renderer_createSvgElement(svgContent, options = {}) {
2181
+ const { className, ariaHidden = true, width = 24, height = 24 } = options;
2182
+ const wrapper = document.createElement('div');
2183
+ wrapper.innerHTML = svgContent.trim();
2184
+ const svg = wrapper.firstElementChild;
2185
+ if (svg) {
2186
+ if (className) svg.setAttribute('class', className);
2187
+ if (ariaHidden) svg.setAttribute('aria-hidden', 'true');
2188
+ svg.setAttribute('width', String(width));
2189
+ svg.setAttribute('height', String(height));
2190
+ }
2191
+ return svg;
2192
+ }
2193
+ function renderer_clearElement(element) {
2194
+ while(element.firstChild)element.removeChild(element.firstChild);
2195
+ }
2613
2196
  var components_module = __webpack_require__("../../node_modules/.bun/@rsbuild+core@2.0.0-beta.11+490411ac90707e06/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[2].use[2]!./src/styles/components.module.css");
2614
2197
  var components_module_options = {};
2615
2198
  components_module_options.styleTagTransform = styleTagTransform_default();
@@ -5924,6 +5507,133 @@ var __webpack_exports__ = {};
5924
5507
  loadedScripts: state.loadedScripts
5925
5508
  };
5926
5509
  }
5510
+ const EMBEDDED_TABS = [
5511
+ {
5512
+ id: 'location',
5513
+ label: 'Location'
5514
+ },
5515
+ {
5516
+ id: 'policy',
5517
+ label: 'Policy'
5518
+ },
5519
+ {
5520
+ id: 'consents',
5521
+ label: 'Consents'
5522
+ },
5523
+ {
5524
+ id: "scripts",
5525
+ label: 'Scripts'
5526
+ },
5527
+ {
5528
+ id: 'iab',
5529
+ label: 'IAB'
5530
+ },
5531
+ {
5532
+ id: 'actions',
5533
+ label: 'Actions'
5534
+ },
5535
+ {
5536
+ id: 'events',
5537
+ label: 'Events'
5538
+ }
5539
+ ];
5540
+ const EMBEDDED_THEME_VARIABLES = {
5541
+ '--c15t-surface': '#1f222b',
5542
+ '--c15t-surface-hover': '#272b35',
5543
+ '--c15t-surface-muted': '#252933',
5544
+ '--c15t-border': 'rgba(255, 255, 255, 0.08)',
5545
+ '--c15t-border-hover': 'rgba(255, 255, 255, 0.16)',
5546
+ '--c15t-text': '#eef2ff',
5547
+ '--c15t-text-muted': '#99a2b3',
5548
+ '--c15t-primary': '#8b5cf6',
5549
+ '--c15t-primary-hover': '#7c3aed',
5550
+ '--c15t-text-on-primary': '#f7f3ff',
5551
+ '--c15t-shadow-sm': 'none',
5552
+ '--c15t-shadow-md': 'none',
5553
+ '--c15t-devtools-surface-elevated': '#1f222b',
5554
+ '--c15t-devtools-surface-muted': '#272b35',
5555
+ '--c15t-devtools-surface-subtle': '#181b22',
5556
+ '--c15t-devtools-border-strong': 'rgba(255, 255, 255, 0.08)',
5557
+ '--c15t-devtools-code-surface': '#15181f',
5558
+ '--c15t-devtools-accent-soft': 'rgba(139, 92, 246, 0.18)',
5559
+ '--c15t-devtools-focus-ring': '#8b5cf6',
5560
+ '--c15t-devtools-badge-success-bg': 'rgba(16, 185, 129, 0.16)',
5561
+ '--c15t-devtools-badge-error-bg': 'rgba(248, 113, 113, 0.18)',
5562
+ '--c15t-devtools-badge-warning-bg': 'rgba(251, 191, 36, 0.18)',
5563
+ '--c15t-devtools-badge-info-bg': 'rgba(96, 165, 250, 0.18)',
5564
+ '--c15t-devtools-badge-neutral-bg': 'rgba(148, 163, 184, 0.16)',
5565
+ '--c15t-devtools-embedded-tab-active-border': 'rgba(139, 92, 246, 0.55)'
5566
+ };
5567
+ function createEmbeddedTabs(options) {
5568
+ const { onTabChange, disabledTabs = [] } = options;
5569
+ let activeTab = options.activeTab;
5570
+ const buttons = new Map();
5571
+ const tabList = renderer_div({
5572
+ role: 'tablist',
5573
+ ariaLabel: 'DevTools tabs',
5574
+ style: {
5575
+ display: 'flex',
5576
+ flexWrap: 'wrap',
5577
+ gap: '0.5rem',
5578
+ alignItems: 'center',
5579
+ paddingBottom: '0.25rem',
5580
+ borderBottom: '1px solid var(--c15t-devtools-border-strong, rgba(255, 255, 255, 0.08))'
5581
+ }
5582
+ });
5583
+ function applyButtonState(tab, buttonElement) {
5584
+ const isActive = tab === activeTab;
5585
+ const isDisabled = disabledTabs.includes(tab);
5586
+ buttonElement.disabled = isDisabled;
5587
+ buttonElement.setAttribute('aria-selected', isActive ? 'true' : 'false');
5588
+ buttonElement.style.borderColor = isActive ? 'var(--c15t-devtools-embedded-tab-active-border, rgba(139, 92, 246, 0.55))' : 'transparent';
5589
+ buttonElement.style.backgroundColor = isActive ? 'var(--c15t-devtools-accent-soft, rgba(139, 92, 246, 0.18))' : 'transparent';
5590
+ buttonElement.style.color = isActive ? 'var(--c15t-text, #eef2ff)' : 'var(--c15t-text-muted, #99a2b3)';
5591
+ buttonElement.style.opacity = isDisabled ? '0.45' : '1';
5592
+ buttonElement.style.cursor = isDisabled ? 'not-allowed' : 'pointer';
5593
+ buttonElement.style.boxShadow = isActive ? 'inset 0 0 0 1px var(--c15t-devtools-embedded-tab-active-border, rgba(139, 92, 246, 0.55))' : 'none';
5594
+ }
5595
+ for (const tab of EMBEDDED_TABS){
5596
+ const buttonElement = renderer_button({
5597
+ role: 'tab',
5598
+ text: tab.label,
5599
+ onClick: ()=>{
5600
+ if (disabledTabs.includes(tab.id)) return;
5601
+ activeTab = tab.id;
5602
+ for (const [tabId, tabButton] of buttons)applyButtonState(tabId, tabButton);
5603
+ onTabChange(tab.id);
5604
+ },
5605
+ style: {
5606
+ display: 'inline-flex',
5607
+ alignItems: 'center',
5608
+ justifyContent: 'center',
5609
+ minHeight: '1.875rem',
5610
+ padding: '0.3125rem 0.75rem',
5611
+ border: '1px solid transparent',
5612
+ borderRadius: '999px',
5613
+ backgroundColor: 'transparent',
5614
+ fontFamily: 'inherit',
5615
+ fontSize: 'var(--c15t-devtools-font-size-xs, 0.75rem)',
5616
+ fontWeight: '500',
5617
+ lineHeight: '1.25',
5618
+ transition: 'background-color var(--c15t-duration-fast, 100ms) var(--c15t-easing, cubic-bezier(0.4, 0, 0.2, 1)), border-color var(--c15t-duration-fast, 100ms) var(--c15t-easing, cubic-bezier(0.4, 0, 0.2, 1)), box-shadow var(--c15t-duration-fast, 100ms) var(--c15t-easing, cubic-bezier(0.4, 0, 0.2, 1)), color var(--c15t-duration-fast, 100ms) var(--c15t-easing, cubic-bezier(0.4, 0, 0.2, 1))'
5619
+ }
5620
+ });
5621
+ if ('iab' === tab.id) buttonElement.title = 'Available when IAB TCF mode is enabled';
5622
+ applyButtonState(tab.id, buttonElement);
5623
+ buttons.set(tab.id, buttonElement);
5624
+ tabList.appendChild(buttonElement);
5625
+ }
5626
+ return {
5627
+ element: tabList,
5628
+ setActiveTab: (tab)=>{
5629
+ activeTab = tab;
5630
+ for (const [tabId, tabButton] of buttons)applyButtonState(tabId, tabButton);
5631
+ },
5632
+ destroy: ()=>{
5633
+ buttons.clear();
5634
+ }
5635
+ };
5636
+ }
5927
5637
  function scriptDebugEventToLogEntry(event) {
5928
5638
  return {
5929
5639
  type: "script",
@@ -5944,9 +5654,11 @@ var __webpack_exports__ = {};
5944
5654
  };
5945
5655
  }
5946
5656
  function createDevToolsPanel(options) {
5947
- const { namespace = 'c15tStore' } = options;
5657
+ const { namespace = 'c15tStore', mode = 'standalone' } = options;
5658
+ const isEmbedded = 'embedded' === mode;
5948
5659
  let detachInstrumentation = null;
5949
5660
  let detachScriptDebug = null;
5661
+ let contentArea = null;
5950
5662
  const stateManager = state_manager_createStateManager({
5951
5663
  isOpen: true
5952
5664
  });
@@ -5974,6 +5686,7 @@ var __webpack_exports__ = {};
5974
5686
  gpc: persistedOverrides.gpc
5975
5687
  });
5976
5688
  }
5689
+ renderActivePanel();
5977
5690
  },
5978
5691
  onDisconnect: ()=>{
5979
5692
  stateManager.setConnected(false);
@@ -5981,6 +5694,7 @@ var __webpack_exports__ = {};
5981
5694
  detachInstrumentation = null;
5982
5695
  detachScriptDebug?.();
5983
5696
  detachScriptDebug = null;
5697
+ renderActivePanel();
5984
5698
  }
5985
5699
  });
5986
5700
  const panelRenderer = panel_renderer_createPanelRenderer({
@@ -6013,25 +5727,33 @@ var __webpack_exports__ = {};
6013
5727
  display: 'flex',
6014
5728
  flexDirection: 'column',
6015
5729
  height: '100%',
6016
- fontFamily: 'var(--c15t-devtools-font-family)',
5730
+ boxSizing: 'border-box',
5731
+ gap: '0.75rem',
5732
+ padding: '0.75rem',
5733
+ fontFamily: 'inherit',
6017
5734
  fontSize: 'var(--c15t-devtools-font-size-sm)',
6018
- color: 'var(--c15t-devtools-text)',
6019
- backgroundColor: 'var(--c15t-devtools-surface)'
5735
+ color: isEmbedded ? 'var(--c15t-text, #eef2ff)' : 'inherit',
5736
+ backgroundColor: 'transparent',
5737
+ colorScheme: isEmbedded ? 'dark' : void 0,
5738
+ ...isEmbedded ? EMBEDDED_THEME_VARIABLES : {}
6020
5739
  }
6021
5740
  });
6022
- const contentArea = renderer_div({
5741
+ contentArea = renderer_div({
6023
5742
  style: {
6024
5743
  flex: '1',
5744
+ minHeight: '0',
6025
5745
  overflowY: 'auto',
6026
- overscrollBehavior: 'contain'
5746
+ overscrollBehavior: 'contain',
5747
+ backgroundColor: 'transparent'
6027
5748
  }
6028
5749
  });
6029
5750
  function renderActivePanel() {
5751
+ if (!contentArea) return;
6030
5752
  const activeTab = syncTabs();
6031
5753
  panelRenderer.renderPanel(contentArea, activeTab);
6032
5754
  }
6033
5755
  let tabsInstance = null;
6034
- let iabDisabled = true;
5756
+ let disabledTabsKey = '';
6035
5757
  function getDisabledTabs() {
6036
5758
  const disabledTabs = [];
6037
5759
  const storeState = storeConnector.getState();
@@ -6040,16 +5762,16 @@ var __webpack_exports__ = {};
6040
5762
  }
6041
5763
  function syncTabs() {
6042
5764
  const disabledTabs = getDisabledTabs();
6043
- const nextIabDisabled = disabledTabs.includes('iab');
5765
+ const nextDisabledTabsKey = disabledTabs.join('|');
6044
5766
  let activeTab = stateManager.getState().activeTab;
6045
5767
  if (disabledTabs.includes(activeTab)) {
6046
5768
  activeTab = 'consents';
6047
5769
  stateManager.setActiveTab(activeTab);
6048
5770
  }
6049
- if (tabsInstance && iabDisabled === nextIabDisabled) tabsInstance.setActiveTab(activeTab);
5771
+ if (tabsInstance && disabledTabsKey === nextDisabledTabsKey) tabsInstance.setActiveTab(activeTab);
6050
5772
  else {
6051
5773
  tabsInstance?.destroy();
6052
- tabsInstance = tabs_createTabs({
5774
+ tabsInstance = createEmbeddedTabs({
6053
5775
  activeTab,
6054
5776
  onTabChange: (tab)=>{
6055
5777
  stateManager.setActiveTab(tab);
@@ -6057,8 +5779,9 @@ var __webpack_exports__ = {};
6057
5779
  },
6058
5780
  disabledTabs
6059
5781
  });
6060
- iabDisabled = nextIabDisabled;
6061
- if (!tabsInstance.element.parentElement) container.appendChild(tabsInstance.element);
5782
+ disabledTabsKey = nextDisabledTabsKey;
5783
+ if (!tabsInstance.element.parentElement) if (contentArea?.parentElement === container) container.insertBefore(tabsInstance.element, contentArea);
5784
+ else container.appendChild(tabsInstance.element);
6062
5785
  }
6063
5786
  return activeTab;
6064
5787
  }
@@ -6082,26 +5805,93 @@ var __webpack_exports__ = {};
6082
5805
  }
6083
5806
  };
6084
5807
  }
6085
- function c15tDevtoolsPlugin(options = {}) {
6086
- const { namespace = 'c15tStore' } = options;
6087
- return {
6088
- name: 'c15t',
6089
- label: 'Consent',
6090
- render: (container)=>{
6091
- const panel = createDevToolsPanel({
6092
- namespace,
6093
- mode: 'embedded'
6094
- });
6095
- container.appendChild(panel.element);
6096
- return ()=>{
6097
- panel.destroy();
6098
- };
5808
+ const embeddedPanelStyle = {
5809
+ height: '100%',
5810
+ width: '100%',
5811
+ minHeight: 0
5812
+ };
5813
+ const EMBEDDED_PANEL_RELEASE_DELAY_MS = 60000;
5814
+ const sharedEmbeddedPanels = new Map();
5815
+ function acquireEmbeddedPanel(namespace) {
5816
+ const existingPanel = sharedEmbeddedPanels.get(namespace);
5817
+ if (existingPanel) {
5818
+ if (existingPanel.releaseTimeout) {
5819
+ clearTimeout(existingPanel.releaseTimeout);
5820
+ existingPanel.releaseTimeout = null;
6099
5821
  }
5822
+ existingPanel.refCount += 1;
5823
+ return existingPanel;
5824
+ }
5825
+ const panel = createDevToolsPanel({
5826
+ namespace,
5827
+ mode: 'embedded'
5828
+ });
5829
+ const entry = {
5830
+ panel,
5831
+ refCount: 1,
5832
+ releaseTimeout: null
6100
5833
  };
5834
+ sharedEmbeddedPanels.set(namespace, entry);
5835
+ return entry;
5836
+ }
5837
+ function releaseEmbeddedPanel(namespace) {
5838
+ const entry = sharedEmbeddedPanels.get(namespace);
5839
+ if (!entry) return;
5840
+ entry.refCount = Math.max(0, entry.refCount - 1);
5841
+ if (entry.refCount > 0 || entry.releaseTimeout) return;
5842
+ entry.releaseTimeout = setTimeout(()=>{
5843
+ const currentEntry = sharedEmbeddedPanels.get(namespace);
5844
+ if (!currentEntry || currentEntry.refCount > 0) return;
5845
+ currentEntry.panel.destroy();
5846
+ sharedEmbeddedPanels.delete(namespace);
5847
+ }, EMBEDDED_PANEL_RELEASE_DELAY_MS);
5848
+ }
5849
+ function C15tTanStackDevtoolsPanel({ namespace = 'c15tStore', style, ...props }) {
5850
+ const containerRef = external_react_namespaceObject.useRef(null);
5851
+ external_react_namespaceObject.useLayoutEffect(()=>{
5852
+ const container = containerRef.current;
5853
+ if (!container) return;
5854
+ const entry = acquireEmbeddedPanel(namespace);
5855
+ container.replaceChildren(entry.panel.element);
5856
+ return ()=>{
5857
+ if (entry.panel.element.parentElement === container) container.removeChild(entry.panel.element);
5858
+ releaseEmbeddedPanel(namespace);
5859
+ };
5860
+ }, [
5861
+ namespace
5862
+ ]);
5863
+ return external_react_namespaceObject.createElement('div', {
5864
+ ...props,
5865
+ ref: containerRef,
5866
+ style: {
5867
+ ...embeddedPanelStyle,
5868
+ ...style
5869
+ }
5870
+ });
5871
+ }
5872
+ function createC15tDevtoolsPlugin(options = {}) {
5873
+ const { namespace = 'c15tStore', id = 'c15t', name = 'c15t', defaultOpen = false, ...panelProps } = options;
5874
+ return {
5875
+ id,
5876
+ name,
5877
+ defaultOpen,
5878
+ render: external_react_namespaceObject.createElement(C15tTanStackDevtoolsPanel, {
5879
+ ...panelProps,
5880
+ namespace
5881
+ })
5882
+ };
5883
+ }
5884
+ function c15tDevtools(options = {}) {
5885
+ return createC15tDevtoolsPlugin(options);
6101
5886
  }
5887
+ const c15tDevtoolsPlugin = c15tDevtools;
6102
5888
  })();
5889
+ exports.C15tTanStackDevtoolsPanel = __webpack_exports__.C15tTanStackDevtoolsPanel;
5890
+ exports.c15tDevtools = __webpack_exports__.c15tDevtools;
6103
5891
  exports.c15tDevtoolsPlugin = __webpack_exports__.c15tDevtoolsPlugin;
6104
5892
  for(var __rspack_i in __webpack_exports__)if (-1 === [
5893
+ "C15tTanStackDevtoolsPanel",
5894
+ "c15tDevtools",
6105
5895
  "c15tDevtoolsPlugin"
6106
5896
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
6107
5897
  Object.defineProperty(exports, '__esModule', {