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AC1CxB,OAAOwB,WAAWhB,GAAMqD,EAExBhD,EAAUgC,QAAQd,iBAAiB,sBAAsB+B,SAAS7D,IAC7C,UAAfA,EAAE8D,SACJ9D,EAAE1D,MAAQsH,EAEV5D,EAAEoC,UAAYwB,CAChB,GACA,GACD,CAACtH,IAGFC,IAAAA,cAAA,OAAKwH,UAAU,4BACbxH,IAAAA,cAAA,OAAKwH,UAAU,gBAAgBC,IAAKpD,IAChC,EAIY,oBAAXb,SACTA,OAAOkE,WAAalE,OAAOkE,YAAc,GACzClE,OAAOkE,WAAWC,KAAK,CAAEC,KAAM,cAAeC,UAAWjE,EAAakE,YAAa,kBAGrF,UAMA,MAAMd,EACJjF,cACEZ,KAAK4G,kBAAoB,CAAC,EAC1B5G,KAAK0C,SAAW,IAClB,CAEAoD,iBAAiBpD,GACf1C,KAAK0C,SAAW1C,KAAK0C,UAAYA,CACnC,CAEAmE,KCjIa,SAAU9H,EAAO+H,EAAS7H,GACxC,OACGH,ED+Hc,SChIGwB,IAAbrB,GAEYA,GADS,EAE5B,CD6HQ8H,CAAS,EAAI,GAAO,KACzB/G,KAAKgH,MAAM,IAGbhB,IAAInD,EAAIjE,GACNoB,KAAK4G,kBAAkB/D,GAAMjE,EAC7BoB,KAAK6G,MACP,CAEAG,OACM/I,OAAOgJ,KAAKjH,KAAK4G,mBAAmBjH,OAAS,IAC/CK,KAAK0C,SAASwE,KAAKC,UAAU,CAAC,mCAAsC,IAAInH,KAAK4G,sBAC7E5G,KAAK4G,kBAAoB,CAAC,EAE9B,EAGFvE,OAAOwD,yBAA2BxD,OAAOwD,0BAA4B,IAAIA,C","sources":["webpack://HtmlGeneric/webpack/bootstrap","webpack://HtmlGeneric/webpack/runtime/compat get default export","webpack://HtmlGeneric/webpack/runtime/define property getters","webpack://HtmlGeneric/webpack/runtime/hasOwnProperty shorthand","webpack://HtmlGeneric/webpack/runtime/make namespace object","webpack://HtmlGeneric/external var \"React\"","webpack://HtmlGeneric/../throttle.js","webpack://HtmlGeneric/./utils/runByFeature.js","webpack://HtmlGeneric/./utils/ScriptLoader.js","webpack://HtmlGeneric/./HtmlGeneric.duc.js","webpack://HtmlGeneric/../debounce.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = React;","/* eslint-disable no-undefined,no-param-reassign,no-shadow */\n\n/**\n * Throttle execution of a function. Especially useful for rate limiting\n * execution of handlers on events like resize and scroll.\n *\n * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {boolean} [noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the\n * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time\n * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,\n * the internal counter is reset).\n * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the throttled-function is executed.\n * @param {boolean} [debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),\n * schedule `callback` to execute after `delay` ms.\n *\n * @returns {Function} A new, throttled, function.\n */\nexport default function (delay, noTrailing, callback, debounceMode) {\n\t/*\n\t * After wrapper has stopped being called, this timeout ensures that\n\t * `callback` is executed at the proper times in `throttle` and `end`\n\t * debounce modes.\n\t */\n\tlet timeoutID;\n\tlet cancelled = false;\n\n\t// Keep track of the last time `callback` was executed.\n\tlet lastExec = 0;\n\n\t// Function to clear existing timeout\n\tfunction clearExistingTimeout() {\n\t\tif (timeoutID) {\n\t\t\tclearTimeout(timeoutID);\n\t\t}\n\t}\n\n\t// Function to cancel next exec\n\tfunction cancel() {\n\t\tclearExistingTimeout();\n\t\tcancelled = true;\n\t}\n\n\t// `noTrailing` defaults to falsy.\n\tif (typeof noTrailing !== 'boolean') {\n\t\tdebounceMode = callback;\n\t\tcallback = noTrailing;\n\t\tnoTrailing = undefined;\n\t}\n\n\t/*\n\t * The `wrapper` function encapsulates all of the throttling / debouncing\n\t * functionality and when executed will limit the rate at which `callback`\n\t * is executed.\n\t */\n\tfunction wrapper(...arguments_) {\n\t\tlet self = this;\n\t\tlet elapsed = Date.now() - lastExec;\n\n\t\tif (cancelled) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Execute `callback` and update the `lastExec` timestamp.\n\t\tfunction exec() {\n\t\t\tlastExec = Date.now();\n\t\t\tcallback.apply(self, arguments_);\n\t\t}\n\n\t\t/*\n\t\t * If `debounceMode` is true (at begin) this is used to clear the flag\n\t\t * to allow future `callback` executions.\n\t\t */\n\t\tfunction clear() {\n\t\t\ttimeoutID = undefined;\n\t\t}\n\n\t\tif (debounceMode && !timeoutID) {\n\t\t\t/*\n\t\t\t * Since `wrapper` is being called for the first time and\n\t\t\t * `debounceMode` is true (at begin), execute `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t}\n\n\t\tclearExistingTimeout();\n\n\t\tif (debounceMode === undefined && elapsed > delay) {\n\t\t\t/*\n\t\t\t * In throttle mode, if `delay` time has been exceeded, execute\n\t\t\t * `callback`.\n\t\t\t */\n\t\t\texec();\n\t\t} else if (noTrailing !== true) {\n\t\t\t/*\n\t\t\t * In trailing throttle mode, since `delay` time has not been\n\t\t\t * exceeded, schedule `callback` to execute `delay` ms after most\n\t\t\t * recent execution.\n\t\t\t *\n\t\t\t * If `debounceMode` is true (at begin), schedule `clear` to execute\n\t\t\t * after `delay` ms.\n\t\t\t *\n\t\t\t * If `debounceMode` is false (at end), schedule `callback` to\n\t\t\t * execute after `delay` ms.\n\t\t\t */\n\t\t\ttimeoutID = setTimeout(\n\t\t\t\tdebounceMode ? clear : exec,\n\t\t\t\tdebounceMode === undefined ? delay - elapsed : delay\n\t\t\t);\n\t\t}\n\t}\n\n\twrapper.cancel = cancel;\n\n\t// Return the wrapper function.\n\treturn wrapper;\n}\n","const run = func => func ? func() : null\n\nexport const runByFeature = (features, options) => {\n if (features) {\n const func = Object.entries(options).find(([key, value]) => features[key] ? value : null);\n return func ? run(func[1]) : run(options['otherwise'])\n }\n return run(options['otherwise'])\n}\n","export default class ScriptLoader {\n constructor (options) {\n const { src, global, protocol = document.location.protocol } = options\n this.src = src\n this.global = global\n this.protocol = protocol\n this.isLoaded = false\n this.loaded = false\n }\n\n loadScript () {\n return new Promise((resolve, reject) => {\n // Create script element and set attributes\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.async = true\n script.src = this.src.includes('http') ? this.src : `${this.protocol}//${this.src}`\n\n // Append the script to the DOM\n const el = document.getElementsByTagName('script')[0]\n if(el) {\n el.parentNode.insertBefore(script, el)\n\n // Resolve the promise once the script is loaded\n script.addEventListener('load', () => {\n this.isLoaded = true\n resolve(script)\n })\n\n // Catch any errors while loading the script\n script.addEventListener('error', () => {\n reject(new Error(`${this.src} failed to load.`))\n })\n }\n })\n }\n\n load () {\n return new Promise(async (resolve, reject) => {\n if (!this.isLoaded) {\n try {\n await this.loadScript()\n resolve(window[this.global])\n } catch (e) {\n console.log(e)\n reject(e)\n }\n } else {\n resolve(window[this.global])\n }\n })\n }\n}\n","import React, { useState, useRef, useEffect } from 'react';\nimport { debounce } from 'throttle-debounce'\nimport { runByFeature } from './utils/runByFeature'\n\nimport Loader from './utils/ScriptLoader';\nimport './styles/htmlHeneric.scss';\n\nconst hasJQuery = () => !!window.$ || !!window.jQuery\nconst checkTypeAndConvert = (value, type) => value && (type === 'number') ? value && isNaN(Number(value)) ? -1 : Number(value) : value\n\nconst HtmlGeneric = ({value, options, onChange, schema, onBlur, id, features}) => {\n const [currentValue, setValue] = useState(value || '')\n const container = useRef(null)\n const changeTimeout = useRef(null)\n const parser = new DOMParser()\n const { custom : { objectText, callbackFunctionName }} = options\n const type = ((schema.minimum) || (schema.maximum))\n ? 'number'\n : schema.type\n ? schema.type\n : 'string'\n\n useEffect(() => {\n const run = async () => {\n window.DialValues = window.DialValues || {}\n window.DialValues[id] = value\n if (!window.getDialValue) {\n window.getDialValue = (id, original) => original.replaceAll('#DIAL_VALUE#', window.DialValues[id])\n }\n\n if (objectText) {\n const dom = parser.parseFromString(objectText, 'text/html')\n const scripts = dom.querySelectorAll('script')\n\n if(!hasJQuery()) {\n const loader = new Loader({\n src: 'https://code.jquery.com/jquery-3.6.0.min.js',\n global: 'body'\n })\n\n await loader.load()\n }\n\n for (let script of scripts) {\n if (script.src) {\n const loader = new Loader({\n src: script.src,\n global: 'body'\n })\n await loader.load()\n } else {\n const cloned = document.createElement('script')\n cloned.type = script.type\n cloned.innerHTML = script.innerHTML\n .replaceAll('#DIAL_DISPLAY_NAME#', schema.title)\n .replace(/([`'\"])(\\s|.)*?(\\1)/gm, ((match, p1) => match.replaceAll('#DIAL_VALUE#', `${p1} + getDialValue('${id}', '#DIAL_VALUE#') + ${p1}`)))\n document.body.appendChild(cloned)\n }\n script.remove()\n }\n\n container.current.innerHTML = dom.body.innerHTML\n .replace(/#DIAL_DISPLAY_NAME#/gm, schema.title)\n .replace(/(<.*?\\s+[\\w]+=\".*)(#DIAL_VALUE#)(.*\")/gm, `$1${currentValue}$3 data-xmpie-value=\"${currentValue}\"`)\n .replace(/<(\\w+)(.*?>)(\\s*(#DIAL_VALUE#)\\s*)(<\\/\\1>)/gm, `<$1 data-xmpie-value=\"${currentValue}\" $2${currentValue}$5`)\n .replace(/#DIAL_VALUE#/gm, `${currentValue}`)\n }\n }\n run()\n window[callbackFunctionName] = (pValue) => {\n const valueByType = checkTypeAndConvert(pValue, type)\n runByFeature(features, {\n newTimezoneModel: () => {\n if (features.newHTMLGenericChangeValue) {\n window.GenericHtmlQueueExecutor.registerOnChange((value) => {\n clearTimeout(changeTimeout.current)\n changeTimeout.current = setTimeout(() => {\n window.triggerFormPropertyChange(id, value)\n }, 750)\n })\n window.GenericHtmlQueueExecutor.add(id, valueByType)\n } else {\n window.GenericHtmlQueueExecutor.registerOnChange((value) => {\n onChange(value)\n })\n window.GenericHtmlQueueExecutor.add(id, valueByType)\n }\n },\n newHTMLGenericChangeValue: () => {\n clearTimeout(changeTimeout.current)\n changeTimeout.current = setTimeout(() => {\n window.triggerFormPropertyChange(id, valueByType)\n }, 750)\n },\n otherwise: () => onChange(valueByType)\n })\n setValue(valueByType)\n }\n return () => {\n window.DialValues && delete window.DialValues[id]\n delete window[callbackFunctionName]\n window.GenericHtmlQueueExecutor = new GenericHtmlQueueExecutor()\n }\n },[])\n\n useEffect(() => {\n const newValue = value || ''\n window.DialValues = window.DialValues || {}\n window.DialValues[id] = newValue\n\n container.current.querySelectorAll('[data-xmpie-value]').forEach((e) => {\n if (e.nodeName === 'INPUT') {\n e.value = newValue\n } else {\n e.innerHTML = newValue\n }\n })\n }, [value])\n\n return (\n