| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 "use strict"; 2 var wp; 3 (wp ||= {}).element = (() => { 4 var __create = Object.create; 5 var __defProp = Object.defineProperty; 6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 var __getOwnPropNames = Object.getOwnPropertyNames; 8 var __getProtoOf = Object.getPrototypeOf; 9 var __hasOwnProp = Object.prototype.hasOwnProperty; 10 var __commonJS = (cb, mod) => function __require() { 11 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 12 }; 13 var __export = (target, all) => { 14 for (var name in all) 15 __defProp(target, name, { get: all[name], enumerable: true }); 16 }; 17 var __copyProps = (to, from, except, desc) => { 18 if (from && typeof from === "object" || typeof from === "function") { 19 for (let key of __getOwnPropNames(from)) 20 if (!__hasOwnProp.call(to, key) && key !== except) 21 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 22 } 23 return to; 24 }; 25 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 26 // If the importer is in node compatibility mode or this is not an ESM 27 // file that has been converted to a CommonJS file using a Babel- 28 // compatible transform (i.e. "__esModule" has not been set), then set 29 // "default" to the CommonJS "module.exports" for node compatibility. 30 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 31 mod 32 )); 33 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 34 35 // vendor-external:react 36 var require_react = __commonJS({ 37 "vendor-external:react"(exports, module) { 38 module.exports = window.React; 39 } 40 }); 41 42 // vendor-external:react-dom 43 var require_react_dom = __commonJS({ 44 "vendor-external:react-dom"(exports, module) { 45 module.exports = window.ReactDOM; 46 } 47 }); 48 49 // node_modules/react-dom/client.js 50 var require_client = __commonJS({ 51 "node_modules/react-dom/client.js"(exports) { 52 "use strict"; 53 var m = require_react_dom(); 54 if (false) { 55 exports.createRoot = m.createRoot; 56 exports.hydrateRoot = m.hydrateRoot; 57 } else { 58 i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; 59 exports.createRoot = function(c, o) { 60 i.usingClientEntryPoint = true; 61 try { 62 return m.createRoot(c, o); 63 } finally { 64 i.usingClientEntryPoint = false; 65 } 66 }; 67 exports.hydrateRoot = function(c, h, o) { 68 i.usingClientEntryPoint = true; 69 try { 70 return m.hydrateRoot(c, h, o); 71 } finally { 72 i.usingClientEntryPoint = false; 73 } 74 }; 75 } 76 var i; 77 } 78 }); 79 80 // package-external:@wordpress/escape-html 81 var require_escape_html = __commonJS({ 82 "package-external:@wordpress/escape-html"(exports, module) { 83 module.exports = window.wp.escapeHtml; 84 } 85 }); 86 87 // packages/element/build-module/index.js 88 var index_exports = {}; 89 __export(index_exports, { 90 Children: () => import_react.Children, 91 Component: () => import_react.Component, 92 Fragment: () => import_react.Fragment, 93 Platform: () => platform_default, 94 PureComponent: () => import_react.PureComponent, 95 RawHTML: () => RawHTML, 96 StrictMode: () => import_react.StrictMode, 97 Suspense: () => import_react.Suspense, 98 cloneElement: () => import_react.cloneElement, 99 concatChildren: () => concatChildren, 100 createContext: () => import_react.createContext, 101 createElement: () => import_react.createElement, 102 createInterpolateElement: () => create_interpolate_element_default, 103 createPortal: () => import_react_dom.createPortal, 104 createRef: () => import_react.createRef, 105 createRoot: () => import_client.createRoot, 106 findDOMNode: () => import_react_dom.findDOMNode, 107 flushSync: () => import_react_dom.flushSync, 108 forwardRef: () => import_react.forwardRef, 109 hydrate: () => import_react_dom.hydrate, 110 hydrateRoot: () => import_client.hydrateRoot, 111 isEmptyElement: () => isEmptyElement, 112 isValidElement: () => import_react.isValidElement, 113 lazy: () => import_react.lazy, 114 memo: () => import_react.memo, 115 render: () => import_react_dom.render, 116 renderToString: () => serialize_default, 117 startTransition: () => import_react.startTransition, 118 switchChildrenNodeName: () => switchChildrenNodeName, 119 unmountComponentAtNode: () => import_react_dom.unmountComponentAtNode, 120 useCallback: () => import_react.useCallback, 121 useContext: () => import_react.useContext, 122 useDebugValue: () => import_react.useDebugValue, 123 useDeferredValue: () => import_react.useDeferredValue, 124 useEffect: () => import_react.useEffect, 125 useId: () => import_react.useId, 126 useImperativeHandle: () => import_react.useImperativeHandle, 127 useInsertionEffect: () => import_react.useInsertionEffect, 128 useLayoutEffect: () => import_react.useLayoutEffect, 129 useMemo: () => import_react.useMemo, 130 useReducer: () => import_react.useReducer, 131 useRef: () => import_react.useRef, 132 useState: () => import_react.useState, 133 useSyncExternalStore: () => import_react.useSyncExternalStore, 134 useTransition: () => import_react.useTransition 135 }); 136 137 // packages/element/build-module/react.js 138 var import_react = __toESM(require_react()); 139 function concatChildren(...childrenArguments) { 140 return childrenArguments.reduce( 141 (accumulator, children, i) => { 142 import_react.Children.forEach(children, (child, j) => { 143 if ((0, import_react.isValidElement)(child) && typeof child !== "string") { 144 child = (0, import_react.cloneElement)(child, { 145 key: [i, j].join() 146 }); 147 } 148 accumulator.push(child); 149 }); 150 return accumulator; 151 }, 152 [] 153 ); 154 } 155 function switchChildrenNodeName(children, nodeName) { 156 return children && import_react.Children.map(children, (elt, index) => { 157 if (typeof elt?.valueOf() === "string") { 158 return (0, import_react.createElement)(nodeName, { key: index }, elt); 159 } 160 if (!(0, import_react.isValidElement)(elt)) { 161 return elt; 162 } 163 const { children: childrenProp, ...props } = elt.props; 164 return (0, import_react.createElement)( 165 nodeName, 166 { key: index, ...props }, 167 childrenProp 168 ); 169 }); 170 } 171 172 // packages/element/build-module/create-interpolate-element.js 173 var indoc; 174 var offset; 175 var output; 176 var stack; 177 var tokenizer = /<(\/)?(\w+)\s*(\/)?>/g; 178 function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) { 179 return { 180 element, 181 tokenStart, 182 tokenLength, 183 prevOffset, 184 leadingTextStart, 185 children: [] 186 }; 187 } 188 var createInterpolateElement = (interpolatedString, conversionMap) => { 189 indoc = interpolatedString; 190 offset = 0; 191 output = []; 192 stack = []; 193 tokenizer.lastIndex = 0; 194 if (!isValidConversionMap(conversionMap)) { 195 throw new TypeError( 196 "The conversionMap provided is not valid. It must be an object with values that are React Elements" 197 ); 198 } 199 do { 200 } while (proceed(conversionMap)); 201 return (0, import_react.createElement)(import_react.Fragment, null, ...output); 202 }; 203 var isValidConversionMap = (conversionMap) => { 204 const isObject2 = typeof conversionMap === "object" && conversionMap !== null; 205 const values = isObject2 && Object.values(conversionMap); 206 return isObject2 && values.length > 0 && values.every((element) => (0, import_react.isValidElement)(element)); 207 }; 208 function proceed(conversionMap) { 209 const next = nextToken(); 210 const [tokenType, name, startOffset, tokenLength] = next; 211 const stackDepth = stack.length; 212 const leadingTextStart = startOffset > offset ? offset : null; 213 if (name && !conversionMap[name]) { 214 addText(); 215 return false; 216 } 217 switch (tokenType) { 218 case "no-more-tokens": 219 if (stackDepth !== 0) { 220 const { leadingTextStart: stackLeadingText, tokenStart } = stack.pop(); 221 output.push(indoc.substr(stackLeadingText, tokenStart)); 222 } 223 addText(); 224 return false; 225 case "self-closed": 226 if (0 === stackDepth) { 227 if (null !== leadingTextStart) { 228 output.push( 229 indoc.substr( 230 leadingTextStart, 231 startOffset - leadingTextStart 232 ) 233 ); 234 } 235 output.push(conversionMap[name]); 236 offset = startOffset + tokenLength; 237 return true; 238 } 239 addChild( 240 createFrame(conversionMap[name], startOffset, tokenLength) 241 ); 242 offset = startOffset + tokenLength; 243 return true; 244 case "opener": 245 stack.push( 246 createFrame( 247 conversionMap[name], 248 startOffset, 249 tokenLength, 250 startOffset + tokenLength, 251 leadingTextStart 252 ) 253 ); 254 offset = startOffset + tokenLength; 255 return true; 256 case "closer": 257 if (1 === stackDepth) { 258 closeOuterElement(startOffset); 259 offset = startOffset + tokenLength; 260 return true; 261 } 262 const stackTop = stack.pop(); 263 const text = indoc.substr( 264 stackTop.prevOffset, 265 startOffset - stackTop.prevOffset 266 ); 267 stackTop.children.push(text); 268 stackTop.prevOffset = startOffset + tokenLength; 269 const frame = createFrame( 270 stackTop.element, 271 stackTop.tokenStart, 272 stackTop.tokenLength, 273 startOffset + tokenLength 274 ); 275 frame.children = stackTop.children; 276 addChild(frame); 277 offset = startOffset + tokenLength; 278 return true; 279 default: 280 addText(); 281 return false; 282 } 283 } 284 function nextToken() { 285 const matches = tokenizer.exec(indoc); 286 if (null === matches) { 287 return ["no-more-tokens"]; 288 } 289 const startedAt = matches.index; 290 const [match, isClosing, name, isSelfClosed] = matches; 291 const length = match.length; 292 if (isSelfClosed) { 293 return ["self-closed", name, startedAt, length]; 294 } 295 if (isClosing) { 296 return ["closer", name, startedAt, length]; 297 } 298 return ["opener", name, startedAt, length]; 299 } 300 function addText() { 301 const length = indoc.length - offset; 302 if (0 === length) { 303 return; 304 } 305 output.push(indoc.substr(offset, length)); 306 } 307 function addChild(frame) { 308 const { element, tokenStart, tokenLength, prevOffset, children } = frame; 309 const parent = stack[stack.length - 1]; 310 const text = indoc.substr( 311 parent.prevOffset, 312 tokenStart - parent.prevOffset 313 ); 314 if (text) { 315 parent.children.push(text); 316 } 317 parent.children.push((0, import_react.cloneElement)(element, null, ...children)); 318 parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength; 319 } 320 function closeOuterElement(endOffset) { 321 const { element, leadingTextStart, prevOffset, tokenStart, children } = stack.pop(); 322 const text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset); 323 if (text) { 324 children.push(text); 325 } 326 if (null !== leadingTextStart) { 327 output.push( 328 indoc.substr(leadingTextStart, tokenStart - leadingTextStart) 329 ); 330 } 331 output.push((0, import_react.cloneElement)(element, null, ...children)); 332 } 333 var create_interpolate_element_default = createInterpolateElement; 334 335 // packages/element/build-module/react-platform.js 336 var import_react_dom = __toESM(require_react_dom()); 337 var import_client = __toESM(require_client()); 338 339 // packages/element/build-module/utils.js 340 var isEmptyElement = (element) => { 341 if (typeof element === "number") { 342 return false; 343 } 344 if (typeof element?.valueOf() === "string" || Array.isArray(element)) { 345 return !element.length; 346 } 347 return !element; 348 }; 349 350 // packages/element/build-module/platform.js 351 var Platform = { 352 /** Platform identifier. Will always be `'web'` in this module. */ 353 OS: "web", 354 /** 355 * Select a value based on the platform. 356 * 357 * @template T 358 * @param spec - Object with optional platform-specific values. 359 * @return The selected value. 360 */ 361 select(spec) { 362 return "web" in spec ? spec.web : spec.default; 363 }, 364 /** Whether the platform is web */ 365 isWeb: true 366 }; 367 var platform_default = Platform; 368 369 // node_modules/is-plain-object/dist/is-plain-object.mjs 370 function isObject(o) { 371 return Object.prototype.toString.call(o) === "[object Object]"; 372 } 373 function isPlainObject(o) { 374 var ctor, prot; 375 if (isObject(o) === false) return false; 376 ctor = o.constructor; 377 if (ctor === void 0) return true; 378 prot = ctor.prototype; 379 if (isObject(prot) === false) return false; 380 if (prot.hasOwnProperty("isPrototypeOf") === false) { 381 return false; 382 } 383 return true; 384 } 385 386 // node_modules/tslib/tslib.es6.mjs 387 var __assign = function() { 388 __assign = Object.assign || function __assign2(t) { 389 for (var s, i = 1, n = arguments.length; i < n; i++) { 390 s = arguments[i]; 391 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 392 } 393 return t; 394 }; 395 return __assign.apply(this, arguments); 396 }; 397 398 // node_modules/lower-case/dist.es2015/index.js 399 function lowerCase(str) { 400 return str.toLowerCase(); 401 } 402 403 // node_modules/no-case/dist.es2015/index.js 404 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 405 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 406 function noCase(input, options) { 407 if (options === void 0) { 408 options = {}; 409 } 410 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; 411 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 412 var start = 0; 413 var end = result.length; 414 while (result.charAt(start) === "\0") 415 start++; 416 while (result.charAt(end - 1) === "\0") 417 end--; 418 return result.slice(start, end).split("\0").map(transform).join(delimiter); 419 } 420 function replace(input, re, value) { 421 if (re instanceof RegExp) 422 return input.replace(re, value); 423 return re.reduce(function(input2, re2) { 424 return input2.replace(re2, value); 425 }, input); 426 } 427 428 // node_modules/dot-case/dist.es2015/index.js 429 function dotCase(input, options) { 430 if (options === void 0) { 431 options = {}; 432 } 433 return noCase(input, __assign({ delimiter: "." }, options)); 434 } 435 436 // node_modules/param-case/dist.es2015/index.js 437 function paramCase(input, options) { 438 if (options === void 0) { 439 options = {}; 440 } 441 return dotCase(input, __assign({ delimiter: "-" }, options)); 442 } 443 444 // packages/element/build-module/serialize.js 445 var import_escape_html = __toESM(require_escape_html()); 446 447 // packages/element/build-module/raw-html.js 448 function RawHTML({ 449 children, 450 ...props 451 }) { 452 let rawHtml = ""; 453 import_react.Children.toArray(children).forEach((child) => { 454 if (typeof child === "string" && child.trim() !== "") { 455 rawHtml += child; 456 } 457 }); 458 return (0, import_react.createElement)("div", { 459 dangerouslySetInnerHTML: { __html: rawHtml }, 460 ...props 461 }); 462 } 463 464 // packages/element/build-module/serialize.js 465 var Context = (0, import_react.createContext)(void 0); 466 Context.displayName = "ElementContext"; 467 var { Provider, Consumer } = Context; 468 var ForwardRef = (0, import_react.forwardRef)(() => { 469 return null; 470 }); 471 var ATTRIBUTES_TYPES = /* @__PURE__ */ new Set(["string", "boolean", "number"]); 472 var SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([ 473 "area", 474 "base", 475 "br", 476 "col", 477 "command", 478 "embed", 479 "hr", 480 "img", 481 "input", 482 "keygen", 483 "link", 484 "meta", 485 "param", 486 "source", 487 "track", 488 "wbr" 489 ]); 490 var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([ 491 "allowfullscreen", 492 "allowpaymentrequest", 493 "allowusermedia", 494 "async", 495 "autofocus", 496 "autoplay", 497 "checked", 498 "controls", 499 "default", 500 "defer", 501 "disabled", 502 "download", 503 "formnovalidate", 504 "hidden", 505 "ismap", 506 "itemscope", 507 "loop", 508 "multiple", 509 "muted", 510 "nomodule", 511 "novalidate", 512 "open", 513 "playsinline", 514 "readonly", 515 "required", 516 "reversed", 517 "selected", 518 "typemustmatch" 519 ]); 520 var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set([ 521 "autocapitalize", 522 "autocomplete", 523 "charset", 524 "contenteditable", 525 "crossorigin", 526 "decoding", 527 "dir", 528 "draggable", 529 "enctype", 530 "formenctype", 531 "formmethod", 532 "http-equiv", 533 "inputmode", 534 "kind", 535 "method", 536 "preload", 537 "scope", 538 "shape", 539 "spellcheck", 540 "translate", 541 "type", 542 "wrap" 543 ]); 544 var CSS_PROPERTIES_SUPPORTS_UNITLESS = /* @__PURE__ */ new Set([ 545 "animation", 546 "animationIterationCount", 547 "baselineShift", 548 "borderImageOutset", 549 "borderImageSlice", 550 "borderImageWidth", 551 "columnCount", 552 "cx", 553 "cy", 554 "fillOpacity", 555 "flexGrow", 556 "flexShrink", 557 "floodOpacity", 558 "fontWeight", 559 "gridColumnEnd", 560 "gridColumnStart", 561 "gridRowEnd", 562 "gridRowStart", 563 "lineHeight", 564 "opacity", 565 "order", 566 "orphans", 567 "r", 568 "rx", 569 "ry", 570 "shapeImageThreshold", 571 "stopOpacity", 572 "strokeDasharray", 573 "strokeDashoffset", 574 "strokeMiterlimit", 575 "strokeOpacity", 576 "strokeWidth", 577 "tabSize", 578 "widows", 579 "x", 580 "y", 581 "zIndex", 582 "zoom" 583 ]); 584 function hasPrefix(string, prefixes) { 585 return prefixes.some((prefix) => string.indexOf(prefix) === 0); 586 } 587 function isInternalAttribute(attribute) { 588 return "key" === attribute || "children" === attribute; 589 } 590 function getNormalAttributeValue(attribute, value) { 591 switch (attribute) { 592 case "style": 593 return renderStyle(value); 594 } 595 return value; 596 } 597 var SVG_ATTRIBUTE_WITH_DASHES_LIST = [ 598 "accentHeight", 599 "alignmentBaseline", 600 "arabicForm", 601 "baselineShift", 602 "capHeight", 603 "clipPath", 604 "clipRule", 605 "colorInterpolation", 606 "colorInterpolationFilters", 607 "colorProfile", 608 "colorRendering", 609 "dominantBaseline", 610 "enableBackground", 611 "fillOpacity", 612 "fillRule", 613 "floodColor", 614 "floodOpacity", 615 "fontFamily", 616 "fontSize", 617 "fontSizeAdjust", 618 "fontStretch", 619 "fontStyle", 620 "fontVariant", 621 "fontWeight", 622 "glyphName", 623 "glyphOrientationHorizontal", 624 "glyphOrientationVertical", 625 "horizAdvX", 626 "horizOriginX", 627 "imageRendering", 628 "letterSpacing", 629 "lightingColor", 630 "markerEnd", 631 "markerMid", 632 "markerStart", 633 "overlinePosition", 634 "overlineThickness", 635 "paintOrder", 636 "panose1", 637 "pointerEvents", 638 "renderingIntent", 639 "shapeRendering", 640 "stopColor", 641 "stopOpacity", 642 "strikethroughPosition", 643 "strikethroughThickness", 644 "strokeDasharray", 645 "strokeDashoffset", 646 "strokeLinecap", 647 "strokeLinejoin", 648 "strokeMiterlimit", 649 "strokeOpacity", 650 "strokeWidth", 651 "textAnchor", 652 "textDecoration", 653 "textRendering", 654 "underlinePosition", 655 "underlineThickness", 656 "unicodeBidi", 657 "unicodeRange", 658 "unitsPerEm", 659 "vAlphabetic", 660 "vHanging", 661 "vIdeographic", 662 "vMathematical", 663 "vectorEffect", 664 "vertAdvY", 665 "vertOriginX", 666 "vertOriginY", 667 "wordSpacing", 668 "writingMode", 669 "xmlnsXlink", 670 "xHeight" 671 ].reduce( 672 (map, attribute) => { 673 map[attribute.toLowerCase()] = attribute; 674 return map; 675 }, 676 {} 677 ); 678 var CASE_SENSITIVE_SVG_ATTRIBUTES = [ 679 "allowReorder", 680 "attributeName", 681 "attributeType", 682 "autoReverse", 683 "baseFrequency", 684 "baseProfile", 685 "calcMode", 686 "clipPathUnits", 687 "contentScriptType", 688 "contentStyleType", 689 "diffuseConstant", 690 "edgeMode", 691 "externalResourcesRequired", 692 "filterRes", 693 "filterUnits", 694 "glyphRef", 695 "gradientTransform", 696 "gradientUnits", 697 "kernelMatrix", 698 "kernelUnitLength", 699 "keyPoints", 700 "keySplines", 701 "keyTimes", 702 "lengthAdjust", 703 "limitingConeAngle", 704 "markerHeight", 705 "markerUnits", 706 "markerWidth", 707 "maskContentUnits", 708 "maskUnits", 709 "numOctaves", 710 "pathLength", 711 "patternContentUnits", 712 "patternTransform", 713 "patternUnits", 714 "pointsAtX", 715 "pointsAtY", 716 "pointsAtZ", 717 "preserveAlpha", 718 "preserveAspectRatio", 719 "primitiveUnits", 720 "refX", 721 "refY", 722 "repeatCount", 723 "repeatDur", 724 "requiredExtensions", 725 "requiredFeatures", 726 "specularConstant", 727 "specularExponent", 728 "spreadMethod", 729 "startOffset", 730 "stdDeviation", 731 "stitchTiles", 732 "suppressContentEditableWarning", 733 "suppressHydrationWarning", 734 "surfaceScale", 735 "systemLanguage", 736 "tableValues", 737 "targetX", 738 "targetY", 739 "textLength", 740 "viewBox", 741 "viewTarget", 742 "xChannelSelector", 743 "yChannelSelector" 744 ].reduce( 745 (map, attribute) => { 746 map[attribute.toLowerCase()] = attribute; 747 return map; 748 }, 749 {} 750 ); 751 var SVG_ATTRIBUTES_WITH_COLONS = [ 752 "xlink:actuate", 753 "xlink:arcrole", 754 "xlink:href", 755 "xlink:role", 756 "xlink:show", 757 "xlink:title", 758 "xlink:type", 759 "xml:base", 760 "xml:lang", 761 "xml:space", 762 "xmlns:xlink" 763 ].reduce( 764 (map, attribute) => { 765 map[attribute.replace(":", "").toLowerCase()] = attribute; 766 return map; 767 }, 768 {} 769 ); 770 function getNormalAttributeName(attribute) { 771 switch (attribute) { 772 case "htmlFor": 773 return "for"; 774 case "className": 775 return "class"; 776 } 777 const attributeLowerCase = attribute.toLowerCase(); 778 if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) { 779 return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]; 780 } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) { 781 return paramCase( 782 SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase] 783 ); 784 } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) { 785 return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]; 786 } 787 return attributeLowerCase; 788 } 789 function getNormalStylePropertyName(property) { 790 if (property.startsWith("--")) { 791 return property; 792 } 793 if (hasPrefix(property, ["ms", "O", "Moz", "Webkit"])) { 794 return "-" + paramCase(property); 795 } 796 return paramCase(property); 797 } 798 function getNormalStylePropertyValue(property, value) { 799 if (typeof value === "number" && 0 !== value && !hasPrefix(property, ["--"]) && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) { 800 return value + "px"; 801 } 802 return value; 803 } 804 function renderElement(element, context, legacyContext = {}) { 805 if (null === element || void 0 === element || false === element) { 806 return ""; 807 } 808 if (Array.isArray(element)) { 809 return renderChildren(element, context, legacyContext); 810 } 811 switch (typeof element) { 812 case "string": 813 return (0, import_escape_html.escapeHTML)(element); 814 case "number": 815 return element.toString(); 816 } 817 const { type, props } = element; 818 switch (type) { 819 case import_react.StrictMode: 820 case import_react.Fragment: 821 return renderChildren(props.children, context, legacyContext); 822 case RawHTML: 823 const { children, ...wrapperProps } = props; 824 return renderNativeComponent( 825 !Object.keys(wrapperProps).length ? null : "div", 826 { 827 ...wrapperProps, 828 dangerouslySetInnerHTML: { __html: children } 829 }, 830 context, 831 legacyContext 832 ); 833 } 834 switch (typeof type) { 835 case "string": 836 return renderNativeComponent(type, props, context, legacyContext); 837 case "function": 838 if (type.prototype && typeof type.prototype.render === "function") { 839 return renderComponent(type, props, context, legacyContext); 840 } 841 return renderElement( 842 type(props, legacyContext), 843 context, 844 legacyContext 845 ); 846 } 847 switch (type && type.$$typeof) { 848 case Provider.$$typeof: 849 return renderChildren(props.children, props.value, legacyContext); 850 case Consumer.$$typeof: 851 return renderElement( 852 props.children(context || type._currentValue), 853 context, 854 legacyContext 855 ); 856 case ForwardRef.$$typeof: 857 return renderElement( 858 type.render(props), 859 context, 860 legacyContext 861 ); 862 } 863 return ""; 864 } 865 function renderNativeComponent(type, props, context, legacyContext = {}) { 866 let content = ""; 867 if (type === "textarea" && props.hasOwnProperty("value")) { 868 content = renderChildren(props.value, context, legacyContext); 869 const { value, ...restProps } = props; 870 props = restProps; 871 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === "string") { 872 content = props.dangerouslySetInnerHTML.__html; 873 } else if (typeof props.children !== "undefined") { 874 content = renderChildren(props.children, context, legacyContext); 875 } 876 if (!type) { 877 return content; 878 } 879 const attributes = renderAttributes(props); 880 if (SELF_CLOSING_TAGS.has(type)) { 881 return "<" + type + attributes + "/>"; 882 } 883 return "<" + type + attributes + ">" + content + "</" + type + ">"; 884 } 885 function renderComponent(Component2, props, context, legacyContext = {}) { 886 const instance = new Component2(props, legacyContext); 887 if (typeof instance.getChildContext === "function") { 888 Object.assign(legacyContext, instance.getChildContext()); 889 } 890 const html = renderElement(instance.render(), context, legacyContext); 891 return html; 892 } 893 function renderChildren(children, context, legacyContext = {}) { 894 let result = ""; 895 const childrenArray = Array.isArray(children) ? children : [children]; 896 for (let i = 0; i < childrenArray.length; i++) { 897 const child = childrenArray[i]; 898 result += renderElement(child, context, legacyContext); 899 } 900 return result; 901 } 902 function renderAttributes(props) { 903 let result = ""; 904 for (const key in props) { 905 const attribute = getNormalAttributeName(key); 906 if (!(0, import_escape_html.isValidAttributeName)(attribute)) { 907 continue; 908 } 909 let value = getNormalAttributeValue(key, props[key]); 910 if (!ATTRIBUTES_TYPES.has(typeof value)) { 911 continue; 912 } 913 if (isInternalAttribute(key)) { 914 continue; 915 } 916 const isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); 917 if (isBooleanAttribute && value === false) { 918 continue; 919 } 920 const isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ["data-", "aria-"]) || ENUMERATED_ATTRIBUTES.has(attribute); 921 if (typeof value === "boolean" && !isMeaningfulAttribute) { 922 continue; 923 } 924 result += " " + attribute; 925 if (isBooleanAttribute) { 926 continue; 927 } 928 if (typeof value === "string") { 929 value = (0, import_escape_html.escapeAttribute)(value); 930 } 931 result += '="' + value + '"'; 932 } 933 return result; 934 } 935 function renderStyle(style) { 936 if (!isPlainObject(style)) { 937 return style; 938 } 939 let result; 940 const styleObj = style; 941 for (const property in styleObj) { 942 const value = styleObj[property]; 943 if (null === value || void 0 === value) { 944 continue; 945 } 946 if (result) { 947 result += ";"; 948 } else { 949 result = ""; 950 } 951 const normalName = getNormalStylePropertyName(property); 952 const normalValue = getNormalStylePropertyValue(property, value); 953 result += normalName + ":" + normalValue; 954 } 955 return result; 956 } 957 var serialize_default = renderElement; 958 return __toCommonJS(index_exports); 959 })(); 960 /*! Bundled license information: 961 962 is-plain-object/dist/is-plain-object.mjs: 963 (*! 964 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 965 * 966 * Copyright (c) 2014-2017, Jon Schlinkert. 967 * Released under the MIT License. 968 *) 969 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Wed Apr 15 08:20:10 2026 | Cross-referenced by PHPXref |