1var __defProp = Object.defineProperty; 2var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 }); 3function magicNumbers(magicNumber) { 4 const magicNumbers2 = { 5 // integer values 6 int0: 0, 7 int1: 1, 8 int2: 2, 9 int3: 3, 10 int4: 4, 11 int5: 5, 12 int6: 6, 13 int7: 7, 14 int16: 16, 15 intMinus1: -1, 16 // hex values 17 hex0x3: 3, 18 hex0x8: 8, 19 // Keycodes (Leave for backwards compatibility) 20 tabCode: 9, 21 escCode: 27, 22 spaceKeyCode: 32, 23 arrowLeftCode: 37, 24 arrowUpCode: 38, 25 arrowRightCode: 39, 26 arrowDownCode: 40 27 }; 28 return Object.freeze(magicNumbers2), magicNumber in magicNumbers2 ? magicNumbers2[magicNumber] : void 0; 29} 30__name(magicNumbers, "magicNumbers"); 31function keyEvents(keyEvent) { 32 const keyEvents2 = { 33 arrowDown: { code: "ArrowDown", key: "ArrowDown", keyCode: 40 }, 34 arrowLeft: { code: "ArrowLeft", key: "ArrowLeft", keyCode: 37 }, 35 arrowRight: { code: "ArrowRight", key: "ArrowRight", keyCode: 39 }, 36 arrowUp: { code: "ArrowUp", key: "ArrowUp", keyCode: 38 }, 37 escape: { code: "Escape", key: "Escape", keyCode: 27 }, 38 keyC: { code: "KeyC", key: "c", keyCode: 67 }, 39 space: { code: "Space", key: " ", keyCode: 32 }, 40 tab: { code: "Tab", key: "Tab", keyCode: 9 }, 41 home: { code: "Home", key: "Home", keyCode: 36 }, 42 end: { code: "End", key: "End", keyCode: 35 } 43 }; 44 return Object.freeze(keyEvents2), keyEvent in keyEvents2 ? keyEvents2[keyEvent] : void 0; 45} 46__name(keyEvents, "keyEvents"); 47function isKeyEvent(event, checkEvent) { 48 const validKey = event.key && event.key === checkEvent.key && event.key === checkEvent.key, validCode = event.code && checkEvent.code && event.code === checkEvent.code, validKeyCode = event.keyCode && checkEvent.keyCode && event.keyCode === checkEvent.keyCode; 49 return validKey || validCode || validKeyCode; 50} 51__name(isKeyEvent, "isKeyEvent"); 52function uuidv4() { 53 const NUMERIC_0 = magicNumbers("int0"), NUMERIC_16 = magicNumbers("int16"), HEX0x3 = magicNumbers("hex0x3"), HEX0x8 = magicNumbers("hex0x8"); 54 return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (uuid) => { 55 const rand = Math.random() * NUMERIC_16 | NUMERIC_0; 56 return (uuid === "x" ? rand : rand & HEX0x3 | HEX0x8).toString(NUMERIC_16); 57 }); 58} 59__name(uuidv4, "uuidv4"); 60function checkSetElementId(element, defaultElementId = null) { 61 let elementId = element.getAttribute("id"); 62 return elementId || (defaultElementId ? elementId = defaultElementId : elementId = uuidv4()), elementId; 63} 64__name(checkSetElementId, "checkSetElementId"); 65const pendingStyleSheets = /* @__PURE__ */ new Map(); 66function loadStyleSheet(styleSheetSrc) { 67 if (document.querySelector(`link[rel="stylesheet"][href="${styleSheetSrc}"]`) !== null) 68 return Promise.resolve(); 69 if (pendingStyleSheets.has(styleSheetSrc)) 70 return pendingStyleSheets.get(styleSheetSrc); 71 const promise = new Promise((resolve, reject) => { 72 if (document.querySelector(`link[rel="stylesheet"][href="${styleSheetSrc}"]`) !== null) { 73 resolve(); 74 return; 75 } 76 const link = document.createElement("link"); 77 link.rel = "stylesheet", link.href = styleSheetSrc, link.addEventListener("load", () => { 78 pendingStyleSheets.delete(styleSheetSrc), resolve(); 79 }), link.addEventListener("error", () => { 80 pendingStyleSheets.delete(styleSheetSrc), reject(new Error(`Failed to load stylesheet: ${styleSheetSrc}`)); 81 }), document.head.appendChild(link); 82 }); 83 return pendingStyleSheets.set(styleSheetSrc, promise), promise; 84} 85__name(loadStyleSheet, "loadStyleSheet"); 86function loadStyleSheets(styleSheetSrcs) { 87 return Promise.all(styleSheetSrcs.map((src) => loadStyleSheet(src))); 88} 89__name(loadStyleSheets, "loadStyleSheets"); 90function stringToDom(htmlString) { 91 return new DOMParser().parseFromString(htmlString, "text/html").body.firstChild; 92} 93__name(stringToDom, "stringToDom"); 94export { 95 loadStyleSheets as a, 96 checkSetElementId as c, 97 isKeyEvent as i, 98 keyEvents as k, 99 loadStyleSheet as l, 100 magicNumbers as m, 101 stringToDom as s, 102 uuidv4 as u 103}; 104//# sourceMappingURL=chunk.dcf-utility.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.