(obj)
| 177 | } |
| 178 | |
| 179 | const customStringify = (obj) => { |
| 180 | let stringified = JSON.stringify(obj, null, 4) |
| 181 | .replace(/"([^"]+)":/g, '$1:') |
| 182 | .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`)) |
| 183 | .replace(/: "(true|false|\d+)"/g, ': $1') |
| 184 | .replace(/customCSS: ""/g, 'customCSS: ``') |
| 185 | return stringified |
| 186 | .split('\n') |
| 187 | .map((line, index) => { |
| 188 | if (index === 0) return line |
| 189 | return ' '.repeat(8) + line |
| 190 | }) |
| 191 | .join('\n') |
| 192 | } |
| 193 | |
| 194 | const embedPopupHtmlCodeCustomization = (chatflowid) => { |
| 195 | return `<script type="module"> |
no test coverage detected