@zeesoft/i18n-verify 3.0.0 → 3.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/executor.mjs +1 -1
- package/package.json +1 -1
package/dist/executor.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{statSync as t,existsSync as n,mkdirSync as a,readFileSync as r,readdirSync as i,writeFileSync as s,appendFileSync as o,copyFileSync as l}from"fs";import c,{join as d,dirname as u,extname as g}from"path";import{Table as h}from"console-table-printer";import p from"chrome-remote-interface";import m from"globalize";import f from"cldr-data";import{en as y,uk as v,nl as w,ru as b,zh as D,ja as L,pt as S,fr as T,es as I,de as C}from"chrono-node";import{DateTime as N}from"luxon";import{detectTextLangEx as x}from"@isdk/detect-text-language";import E from"jimp";const z={NIGHT_WATCH:"nightwatch",WEB_DRIVER_IO:"webio",CYPRESS:"cypress",SELENIUMJS:"seleniumJS"},M="rgb(0, 154, 61)",P="rgb(255, 0, 0)",A="rgb(255, 255, 0)",R="rgb(0, 0, 255)",O="[32m",_="[31m",k="[33m",j="STRING_LOCALIZED",U="STRING_PARTIALLY_LOCALIZED",F="NUMBER_LOCALIZED",B="CURRENCY_LOCALIZED",G="PERCENTAGE_LOCALIZED",V="DATE_LOCALIZED",q="TIME_LOCALIZED",Q="DATE_TIME_LOCALIZED",H="STRING_NOT_LOCALIZED",Y="NUMBER_NOT_LOCALIZED",Z="CURRENCY_NOT_LOCALIZED",W="PERCENTAGE_NOT_LOCALIZED",J="DATE_NOT_LOCALIZED",X="TIME_NOT_LOCALIZED",K="DATE_TIME_NOT_LOCALIZED",ee="TRUNCATION_ISSUE",te="OVERLAPPING_ISSUE",ne="ENCODING_ISSUE",ae="DNT",re="IGNORE",ie="UNTRANSLATED",se="AUTO_IGNORE",oe="USER_INPUT",le="REVIEWED",ce={[j]:0,[H]:0,[U]:0,[F]:0,[Y]:0,[V]:0,[J]:0,[Q]:0,[K]:0,[q]:0,[X]:0,[B]:0,[Z]:0,[G]:0,[W]:0,[ee]:0,[te]:0,[ne]:0,[ae]:0,[re]:0,[ie]:0,[se]:0,[oe]:0,[le]:0},de={[j]:[M,O],[U]:[A,k],[F]:[M,O],[V]:[M,O],[q]:[M,O],[Q]:[M,O],[B]:[M,O],[G]:[M,O],[H]:[P,_],[J]:[P,_],[K]:[P,_],[X]:[P,_],[Y]:[P,_],[Z]:[P,_],[W]:[P,_],[ee]:[P,_],[te]:[P,_],[ne]:[P,_],[ae]:[M,O],[re]:[M,O],[ie]:[M,O],[se]:[M,O],[oe]:[M,O],[le]:[M,O]},ue={[j]:"string is localized",[U]:"string is partially localized",[F]:"number is localized",[V]:"date is localized",[Q]:"dateTime is localized",[q]:"time is localized",[B]:"currency is localized",[G]:"percentage is localized",[H]:"string is not localized",[J]:"date is not localized",[K]:"dateTime is not localized",[X]:"time is not localized",[Y]:"number is not localized",[Z]:"currency is not localized",[W]:"percentage is not localized",[ee]:"truncation issue detected",[te]:"overlapping issue detected",[ne]:"encoding issue detected",[ae]:"do not translate",[re]:"ignored this issue",[ie]:"string is untranslated",[se]:"automatically ignored issue",[oe]:"user input field",[le]:"string has been reviewed"},ge={EMAIL:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}\b/gi,URL:/^(https?:\/\/)?(www\.)?[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/},he=[".txt",".json"],pe="//*[string-length(normalize-space(text())) > 0 and not(ancestor-or-self::*/@style[contains(.,'display:none')]) or @placeholder] | //input[@type='checkbox']/parent::*[text() and not(ancestor-or-self::*/@style[contains(.,'display:none')])]",me=!0,fe=["☐","�","","â€","î","ÃÂ","ÃÂ","ü","é","é","æ•°","æ®","ラã"],ye=".i18n-verify.rc",ve="html",we="ascii_table",be="metrics.cache",De={SANITY:"sanity",I18N:"i18n",CONTEXT:"context"},Le="bookmark",Se="category",Te="fileName",Ie="screenshot",Ce="strings";class Ne{constructor(e){this.$driver=e}checkIfNullOrEmpty(e){return![null,"",void 0].includes(e)}getElement(){throw new Error("implementation is missing")}getElements(){throw new Error("implementation is missing")}getText(){throw new Error("implementation is missing")}getTitle(){throw new Error("implementation is missing")}getPlaceholderText(){throw new Error("implementation is missing")}getAltText(){throw new Error("implementation is missing")}getWidth(){throw new Error("implementation is missing")}getHeight(){throw new Error("implementation is missing")}getTagName(){throw new Error("implementation is missing")}getValue(){throw new Error("implementation is missing")}getLocation(){throw new Error("implementation is missing")}getElementDimension(){throw new Error("implementation is missing")}getElementID(){throw new Error("implementation is missing")}isElementDisplayed(){throw new Error("implementation is missing")}isElementPresent(){throw new Error("implementation is missing")}getElementString(){throw new Error("implementation is missing")}getElementStrings(){throw new Error("implementation is missing")}captureScreenshot(){throw new Error("implementation is missing")}getElementsCount(){throw new Error("implementation is missing")}switchIframe(){throw new Error("implementation is missing")}switchToParentframe(){throw new Error("implementation is missing")}pause(){throw new Error("implementation is missing")}onScreenStringHighlight(){throw new Error("implementation is missing")}checkIfIframeIsPresent(){throw new Error("implementation is missing")}checkIfIframeBodyIsEmpty(){throw new Error("implementation is missing")}printOnConsole(e){console.log(e)}}const xe=e=>ze(e)&&t(e).isDirectory(),Ee=e=>ze(e)&&t(e).isFile(),ze=e=>n(e),Me=(e,t=!0)=>{ze(e)&&xe(e)||(t&&Ze.debug(`Folder doesn't exists, creating [34m${e}[0m`),(e=>{!ze(e)&&a(e,{recursive:!0})})(e))},Pe=e=>Ee(e)?r(e,{encoding:"utf-8"}):"",$e=e=>xe(e)?i(e):[],Ae=(...e)=>d(...e),Re=(e,t,n="utf-8")=>s(e,t,{encoding:n}),Oe=e=>e.replace(/[^a-zA-Z0-9]+/g,"_");class _e{#e;#t;#n;#a;#r;#i;constructor({appName:e,reportTime:t,isContext:n,isSanity:a,defaultLocale:r,reportFolderTimestamp:i}){this.#e=e,this.#n=t,this.#a=n,this.#r=a,this.#t=r,this.#i=i}getAppName(){return this.#e}getReportTime(){return this.#n}isSanityRun(){return this.#r}isContextRun(){return this.#a}getDefaultLocale(){return this.#t}getDefaultLocale(){return this.#t}getReportFolderTimestamp(){return this.#i}}class ke{#s;$generatedContent;$type;constructor(e){this.$type=e}generate(e){this.#s=e,this.$generatedContent=this.buildContent()}export(e,t="report"){this.write(e,t,this.$generatedContent),Ze.info(`Exported consolidated I18n Verification ${this.$type} report in ${e}`)}write(e,t,n){throw new Error("should be implemented by child report classes")}buildContent(){throw new Error("should be implemented by child report classes")}getMetaInfo(){return{defaultLocale:this.#s.getDefaultLocale(),appName:this.#s.getAppName(),reportTime:this.#s.getReportTime(),isSanity:this.#s.isSanityRun(),isContext:this.#s.isContextRun(),reportFolderTimestamp:this.#s.getReportFolderTimestamp()}}}class je extends ke{constructor(){super(ve)}buildContent(){const e=this.getMetaInfo(),t=`var DataStore;\n // global functions\n function openImageViewer(imageSrc) {\n var imageView = document.getElementById('imageView');\n imageView.src = \`\${window.getProductUrl()}/\${imageSrc}\`;\n document.getElementById('imageViewer').style.display = 'block';\n }\n\n function closeImageViewer() {\n delete document.getElementById('imageView').src;\n document.getElementById('imageViewer').style.display = 'none';\n }\n\n //to dynamically show/hide header based upon query param: ?standalone=<true|false>\n window.getProductUrl = () => {\n if (window.productUrl) {\n return window.productUrl;\n } else {\n window.productUrl = \`\${window.location.protocol}//\${\n window.location.host\n }\${window.location.pathname.match(/^.+[^\\/report\\.html]/g)?.[0]}\`;\n return window.productUrl;\n }\n };\n const params = new URLSearchParams(location.href.match(/(\\?.*$)/g)?.[0]);\n if (params.size) {\n window.isStandaloneReport = params.get('standalone') === 'true';\n if(!window.isStandaloneReport) {\n const overview = document.getElementById('overview');\n if(overview) {\n overview.classList.add('--reduced-zoom');\n }\n }\n }\n ${(e=>`// DataStore\n (() => {\n // prepare appData and set DataStore\n var appData = {\n appName: '${e.appName}',\n defaultLocale: '${e.defaultLocale}',\n sanityRun: ${e.isSanity},\n contextRun: ${e.isContext},\n timeStamp: '${e.reportTime}',\n reportFolderTimestamp: '${e.reportFolderTimestamp}',\n metaData: {\n stats: {},\n statsByLocale: {}\n },\n stringsData: {},\n locales: [],\n hasRuntimeError: false\n };\n\n if (window.rawData) {\n for (const entry of Object.entries(window.rawData)) {\n const locale = entry[0];\n const stats = entry[1].metaData.stats;\n const stringsData = entry[1].stringsData;\n\n if (Object.keys(appData.metaData.stats).length) {\n for (const prop in stats) {\n appData.metaData.stats[prop] += stats[prop];\n }\n } else {\n appData.metaData.stats = {...stats};\n }\n\n appData.metaData.statsByLocale[locale] = stats;\n appData.stringsData[locale] = stringsData;\n }\n\n appData.locales = Object.keys(window.rawData);\n }\n else {\n appData.hasRuntimeError = true;\n }\n\n function SimpleDataStore() {\n this._getData = () => appData;\n\n this.ranSuccessfully = () => this.getLocales().length > 0;\n\n this.getTimestamp = () => this._getData().timeStamp;\n\n this.getAppName = () => this._getData().appName;\n\n this.isDefaultLocale = (locale) =>\n locale === this._getData().defaultLocale;\n\n this.getLocalesData = () => this._getData().stringsData || {};\n\n this.getLocales = () => this._getData().locales || [];\n\n this.getStatByLocale = (locale) =>\n this._getData().metaData.statsByLocale[locale] || {};\n\n this.getOverallStats = () => this._getData().metaData.stats || {};\n\n this.getDataByLocale = (locale) =>\n this._getData().stringsData[locale] || {};\n\n this.isSanityRun = () => this._getData().sanityRun;\n\n this.isContextRun = () => this._getData().contextRun;\n\n this.getReportFolderTimestamp = () => this._getData().reportFolderTimestamp;\n\n this.hasRuntimeError = () => this._getData().hasRuntimeError;\n }\n\n DataStore = new SimpleDataStore();\n })();`)(e)}\n (() => {\n // for sidebar menu\n // hide insights tab\n if(DataStore.hasRuntimeError() || !DataStore.ranSuccessfully() || DataStore.isContextRun()) {\n document.querySelector('.menu-item[data-page="insights"]')?.remove();\n }\n\n if(!DataStore.isContextRun()) {\n document.querySelector('#overview .context-info')?.remove();\n }\n\n const loadContent = (section, highlightMenu = false) => {\n if (highlightMenu) {\n document\n .querySelector('li[data-page="overview"]')\n ?.classList.add('selected');\n }\n\n const contents = document.querySelectorAll('.content');\n const wrapper = document.querySelector('.content-wrapper');\n\n contents.forEach((content) => {\n content.id !== section\n ? content.classList.remove('active')\n : content.classList.add('active');\n\n section === 'overview' &&\n window.persistOverviewCharts &&\n window.persistOverviewCharts();\n\n ['log', 'locale'].includes(section) ? wrapper.classList.add('--hide-overflow') : !DataStore.isContextRun() && wrapper.classList.remove('--hide-overflow');\n window.currentPage = section;\n });\n };\n\n document.addEventListener('DOMContentLoaded', function () {\n const createMenuItems = (() => {\n if(DataStore.isContextRun()) {\n return;\n }\n const ul = document.querySelector('.sidebar .submenu');\n const createListItems = (locale) => {\n const li = document.createElement('li');\n li.classList.add('sub-menu-item');\n li.dataset.locale = locale;\n\n const a = document.createElement('a');\n a.href = '#';\n a.textContent = locale;\n\n li.appendChild(a);\n return li;\n };\n\n for (const locale of DataStore.getLocales()) {\n ul.appendChild(createListItems(locale));\n }\n })();\n\n const menuItems = document.querySelectorAll('.menu-item'),\n submenuItems = document.querySelectorAll('.sub-menu-item');\n\n menuItems.forEach((item) => {\n item.addEventListener('click', function (event) {\n const selectedMenuItem = document.querySelector(\n '.menu-item.selected'\n ),\n selectedSubmenu = document.querySelector('.submenu.active'),\n page = item.dataset.page;\n\n if (selectedMenuItem) {\n selectedMenuItem.classList.remove('selected');\n }\n\n if (selectedSubmenu) {\n selectedSubmenu.classList.remove('active');\n }\n\n if (item.classList.contains('has-submenu')) {\n event.preventDefault();\n item.classList.add('selected');\n const submenu = item.querySelector('.submenu');\n submenu.classList.add('active');\n } else {\n item.classList.add('selected');\n }\n\n if (selectedSubmenu) {\n selectedSubmenu\n .querySelectorAll('.sub-menu-item')\n .forEach((submenuItem) => {\n submenuItem.textContent !== item.textContent &&\n submenuItem.classList.remove('selected');\n });\n }\n\n loadContent(page);\n });\n\n loadContent('overview', true);\n });\n\n submenuItems.forEach((sItem) => {\n sItem.addEventListener('click', function (event) {\n const selectedSubMenuItem = document.querySelector(\n '.sub-menu-item.selected'\n );\n event.preventDefault();\n event.stopPropagation();\n\n if (selectedSubMenuItem) {\n selectedSubMenuItem.classList.remove('selected');\n window.previousSelectedLocale =\n selectedSubMenuItem.dataset.locale;\n }\n\n sItem.classList.add('selected');\n loadContent('locale');\n });\n });\n\n // update footer info\n const footer = document.querySelector('.sidebar .footer');\n footer.textContent = \`\${new Date().getFullYear()} @ Zeesoft. All rights reserved.\`;\n\n // update project info\n document.querySelector(\n 'header .logo'\n ).innerHTML = \`zAutomate.AI | \${DataStore.getAppName()} [\${DataStore.isSanityRun() ? 'Quick Sanity' : DataStore.isContextRun() ? 'Context Creation' : 'I18n Verification'}]\`;\n document.querySelector(\n 'header .report-timestamp .info'\n ).innerHTML = \`Report generated at: \${DataStore.getTimestamp()}\`;\n });\n })();\n //overview content\n (() => {\n if (DataStore.hasRuntimeError()) {\n document.getElementById('overview').innerHtml =\n 'zAutomate.AI was unable to perform the operation. Please check the logs for more information.';\n return;\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n document.querySelectorAll('#overview .card')?.forEach((el) => {\n if(DataStore.isContextRun()) {\n if(!el.classList.contains('context-info')) {\n el.classList.add('--hidden');\n }\n }\n else if(el.classList.contains('context-info')) {\n el.classList.add('--hidden');\n }\n });\n\n let overviewChart,\n stringChart,\n dateTimeChart,\n numberChart,\n ignoredChart;\n\n window.persistOverviewCharts = () => {\n if(DataStore.isContextRun()) {\n return;\n }\n\n const reset = (chart) => {\n chart.resetSeries(true, true);\n };\n\n reset(overviewChart);\n reset(stringChart);\n reset(dateTimeChart);\n reset(numberChart);\n reset(ignoredChart);\n };\n\n if(DataStore.isContextRun()) {\n document.querySelector('.content-wrapper')?.classList.add('--hide-overflow');\n\n const info = document.querySelector('#overview .context-info .info');\n if(info) {\n info.innerHTML = \`\${window.isStandaloneReport ? 'Created' : 'Imported'} context screenshots for the locales \${DataStore.getLocales().map(locale => {\n const localeStats = DataStore.getStatByLocale(locale);\n return \`<strong>\${locale}</strong>(<em>\${localeStats?.context || 0} contexts</em>, <em>\${localeStats?.reviewed || 0} strings</em>)\`;\n }).join(', ')} with version <strong>\${DataStore.getReportFolderTimestamp()}</strong>.\`;\n }\n\n return;\n }\n\n renderOverallChart();\n renderStringChart();\n renderIgnoredChart();\n renderNumberChart();\n renderDatetimeChart();\n\n function renderOverallChart() {\n const overallStats = DataStore.getOverallStats();\n const reviewed = overallStats.reviewed;\n const locales = DataStore.getLocales().length;\n const type = {\n I18NED: 'Internationalized',\n NOT_I18NED: 'Not Internationalized',\n SKIPPED: 'Skipped'\n },\n valueMap = {\n [type.I18NED]:\n overallStats.localizedStrings +\n overallStats.partialStrings + // TODO: need to confirm\n overallStats.untranslatedStrings +\n overallStats.localizedDateTime +\n overallStats.localizedDate +\n overallStats.localizedTime +\n overallStats.localizedNumber +\n overallStats.localizedCurrency +\n overallStats.localizedPercentage,\n [type.NOT_I18NED]:\n overallStats.notLocalizedStrings +\n overallStats.notLocalizedDateTime +\n overallStats.notLocalizedDate +\n overallStats.notLocalizedTime +\n overallStats.notLocalizedNumber +\n overallStats.notLocalizedCurrency +\n overallStats.notLocalizedPercentage,\n [type.SKIPPED]:\n overallStats.dnt +\n overallStats.ignored +\n overallStats.autoIgnored +\n overallStats.userInput\n },\n percentageCalc = (value) => {\n const val = ((value / reviewed) * 100).toFixed(0);\n return isNaN(val) || !isFinite(val) ? 0 : val;\n };\n\n var options = {\n series: [\n {\n name: '',\n data: [\n percentageCalc(valueMap[type.I18NED]),\n percentageCalc(valueMap[type.NOT_I18NED]),\n percentageCalc(valueMap[type.SKIPPED])\n ]\n }\n ],\n chart: {\n type: 'bar',\n height: 200,\n toolbar: {\n show: false\n },\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n plotOptions: {\n bar: {\n horizontal: true,\n borderRadius: 3,\n dataLabels: {\n position: 'right'\n }\n }\n },\n title: {\n text: \`Total Reviewed strings in \${locales} locales: \${reviewed}\`,\n align: 'center',\n floating: true,\n style: {\n fontSize: '14px',\n fontWeight: 'bold'\n }\n },\n dataLabels: {\n enabled: true,\n style: {\n colors: ['#080404b0']\n },\n formatter: (val) => {\n return \`\${val}%\`;\n }\n },\n xaxis: {\n categories: [type.I18NED, type.NOT_I18NED, type.SKIPPED],\n min: 0,\n max: 100,\n labels: {\n formatter: (v) => \`\${v}%\`\n }\n },\n yaxis: {\n labels: {\n style: {\n fontSize: '13px'\n }\n }\n },\n colors: [\n (v) => {\n switch (v.dataPointIndex) {\n case 0:\n return '#31E994'; //green\n case 1:\n return '#ff8173'; //red\n case 2:\n return '#f5eb5f'; //yellow\n }\n }\n ],\n tooltip: {\n theme: 'dark',\n x: {\n formatter: (v) => \`Total Number of \${v} instances:\`\n },\n y: {\n formatter: function (v, { dataPointIndex }) {\n let count = 0;\n switch (dataPointIndex) {\n case 0:\n count = valueMap[type.I18NED];\n break;\n case 1:\n count = valueMap[type.NOT_I18NED];\n break;\n case 2:\n count = valueMap[type.SKIPPED];\n break;\n }\n return \`\${v}% (\${count} strings)\`;\n }\n }\n }\n };\n\n (overviewChart = new ApexCharts(\n document.querySelector('.overall-quality .graph'),\n options\n )).render();\n }\n\n function renderStringChart() {\n const overallStats = DataStore.getOverallStats();\n const type = {\n LOCALIZED: 'Localized',\n PARTIAL: 'Partially Localized',\n NOT_LOCALIZED: 'Not Localized',\n UNTRANSLATED: 'Untranslated',\n ENCODING: 'Encoding Issue',\n IGNORED: 'Ignored'\n },\n valueMap = {\n [type.LOCALIZED]: overallStats.localizedStrings,\n [type.PARTIAL]: overallStats.partialStrings,\n [type.NOT_LOCALIZED]: overallStats.notLocalizedStrings,\n [type.UNTRANSLATED]: overallStats.untranslatedStrings,\n [type.ENCODING]: overallStats.encoding,\n [type.IGNORED]:\n overallStats.dnt +\n overallStats.ignored +\n overallStats.autoIgnored +\n overallStats.userInput\n },\n total = Object.values(valueMap).reduce(\n (acc, curr) => acc + curr,\n 0\n ),\n data = [\n valueMap[type.LOCALIZED],\n valueMap[type.PARTIAL],\n valueMap[type.NOT_LOCALIZED],\n valueMap[type.IGNORED],\n valueMap[type.ENCODING],\n valueMap[type.UNTRANSLATED]\n ],\n options = {\n series:\n data.reduce((acc, curr) => acc + curr, 0) === 0 ? [] : data,\n chart: {\n width: 415,\n type: 'pie',\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n noData: {\n text: 'No metrics available',\n align: 'left',\n verticalAlign: 'middle',\n offsetX: 0,\n offsetY: -50,\n style: {\n fontSize: '14px'\n }\n },\n labels: [\n type.LOCALIZED,\n type.PARTIAL,\n type.NOT_LOCALIZED,\n type.IGNORED,\n type.ENCODING,\n type.UNTRANSLATED\n ],\n tooltip: {\n theme: 'dark',\n y: {\n formatter: function (v, { config, dataPointIndex }) {\n let count = 0,\n value = Number(\n (v /\n config.series.reduce((acc, curr) => acc + curr, 0)) *\n 100\n ).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n\n switch (dataPointIndex) {\n case 0:\n count = valueMap[type.LOCALIZED];\n break;\n case 1:\n count = valueMap[type.PARTIAL];\n break;\n case 2:\n count = valueMap[type.NOT_LOCALIZED];\n break;\n case 3:\n count = valueMap[type.IGNORED];\n break;\n case 4:\n count = valueMap[type.ENCODING];\n break;\n case 5:\n count = valueMap[type.UNTRANSLATED];\n break;\n }\n\n return \`\${value}% (\${count} strings)\`;\n },\n title: {\n formatter: function (a) {\n return \`Total Number of \${a} strings:\`;\n }\n }\n }\n },\n colors: [\n ({ seriesIndex, w }) => {\n const currType = w.config.labels[seriesIndex];\n\n switch (currType) {\n case type.LOCALIZED:\n return '#31E994';\n case type.NOT_LOCALIZED:\n return '#E44242';\n case type.PARTIAL:\n return '#DADF40';\n case type.UNTRANSLATED:\n return '#F44E9E';\n case type.IGNORED:\n return '#AFA6AB';\n case type.ENCODING:\n return '#3AD1F3';\n\n default:\n return '';\n }\n }\n ],\n legend: {\n offsetX: -50,\n width: 170,\n formatter: (seriesName, a, b, c) => {\n let value = ((valueMap[seriesName] / total) * 100).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n return \`\${seriesName} (\${value}%)\`;\n }\n },\n dataLabels: {\n formatter: (v) => \`\${Number(v).toFixed(0)}%\`,\n dropShadow: { enabled: false },\n style: {\n colors: ['#080404b0']\n }\n }\n };\n\n (stringChart = new ApexCharts(\n document.querySelector('.string-quality .graph'),\n options\n )).render();\n }\n\n function renderIgnoredChart() {\n const overallStats = DataStore.getOverallStats();\n const type = {\n DNT: 'DNT',\n IGNORED: 'Ignored',\n USER_INPUTS: 'User Inputs'\n },\n valueMap = {\n [type.DNT]: overallStats.dnt,\n [type.IGNORED]: overallStats.ignored + overallStats.autoIgnored,\n [type.USER_INPUTS]: overallStats.userInput\n },\n total = Object.values(valueMap).reduce(\n (acc, curr) => acc + curr,\n 0\n ),\n data = [\n valueMap[type.DNT],\n valueMap[type.IGNORED],\n valueMap[type.USER_INPUTS]\n ],\n options = {\n series:\n data.reduce((acc, curr) => acc + curr, 0) === 0 ? [] : data,\n chart: {\n width: 360,\n type: 'pie',\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n labels: [type.DNT, type.IGNORED, type.USER_INPUTS],\n tooltip: {\n theme: 'dark',\n y: {\n formatter: function (v, { config, dataPointIndex }) {\n let count = 0,\n value = Number(\n (v /\n config.series.reduce((acc, curr) => acc + curr, 0)) *\n 100\n ).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n\n switch (dataPointIndex) {\n case 0:\n count = valueMap[type.DNT];\n break;\n case 1:\n count = valueMap[type.IGNORED];\n break;\n case 2:\n count = valueMap[type.USER_INPUTS];\n break;\n }\n\n return \`\${value}% (\${count} strings)\`;\n },\n title: {\n formatter: function (a) {\n return \`Total Number of \${a} strings:\`;\n }\n }\n }\n },\n colors: [\n ({ seriesIndex, w }) => {\n const currType = w.config.labels[seriesIndex];\n\n switch (currType) {\n case type.DNT:\n return '#31E994';\n case type.IGNORED:\n return '#3AD1F3';\n case type.USER_INPUTS:\n return '#DADF40';\n\n default:\n return '';\n }\n }\n ],\n noData: {\n text: 'No metrics available',\n align: 'center',\n verticalAlign: 'middle',\n offsetX: -70,\n offsetY: -25,\n style: {\n fontSize: '14px'\n }\n },\n legend: {\n offsetX: -40,\n formatter: (seriesName) => {\n let value = ((valueMap[seriesName] / total) * 100).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n return \`\${seriesName} (\${value}%)\`;\n }\n },\n dataLabels: {\n formatter: (v) => \`\${Number(v).toFixed(0)}%\`,\n style: {\n colors: ['#080404b0']\n },\n dropShadow: { enabled: false }\n }\n };\n\n (ignoredChart = new ApexCharts(\n document.querySelector('.skipped-items .graph'),\n options\n )).render();\n }\n\n function renderNumberChart() {\n const overallStats = DataStore.getOverallStats();\n const types = ['Number', 'Currency', 'Percentage'],\n data = {\n number_i18n: overallStats.localizedNumber,\n currency_i18n: overallStats.localizedCurrency,\n percentage_i18n: overallStats.localizedPercentage,\n number_not_i18n: overallStats.notLocalizedNumber,\n currency_not_i18n: overallStats.notLocalizedCurrency,\n percentage_not_i18n: overallStats.notLocalizedPercentage\n },\n total = Object.values(data).reduce((acc, curr) => acc + curr, 0),\n percentageCalc = (v, t) => {\n const val = ((v / t) * 100).toFixed(0);\n return isNaN(val) || !isFinite(val) ? 0 : val;\n },\n i18nPercentage = percentageCalc(\n data.number_i18n + data.percentage_i18n + data.currency_i18n,\n total\n ),\n nonI18nPercentage = percentageCalc(\n data.number_not_i18n +\n data.percentage_not_i18n +\n data.currency_not_i18n,\n total\n ),\n numberTotal = data.number_i18n + data.number_not_i18n,\n currencyTotal = data.currency_i18n + data.currency_not_i18n,\n percentageTotal = data.percentage_i18n + data.percentage_not_i18n,\n numberI18n = percentageCalc(data.number_i18n, numberTotal),\n currencyI18n = percentageCalc(data.currency_i18n, currencyTotal),\n percentageI18n = percentageCalc(\n data.percentage_i18n,\n currencyTotal\n ),\n numberNotI18n = percentageCalc(data.number_not_i18n, numberTotal),\n currencyNotI18n = percentageCalc(\n data.currency_not_i18n,\n currencyTotal\n ),\n percentageNotI18n = percentageCalc(\n data.percentage_not_i18n,\n currencyTotal\n ),\n options = {\n series: [\n {\n name: 'Internationalized',\n data: [numberI18n, currencyI18n, percentageI18n]\n },\n {\n name: 'Not Internationalized',\n data: [numberNotI18n, currencyNotI18n, percentageNotI18n]\n }\n ],\n chart: {\n type: 'bar',\n height: 220,\n width: 500,\n toolbar: {\n show: false\n },\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n dataLabels: {\n enabled: true,\n dropShadow: { enabled: false },\n style: {\n colors: ['#080404b0']\n },\n formatter: (val) => {\n return \`\${val}%\`;\n }\n },\n stroke: {\n show: true,\n width: 1,\n colors: ['#fff']\n },\n tooltip: {\n theme: 'dark',\n shared: true,\n intersect: false,\n x: {\n formatter: (type) => \`\${type} instances:\`\n },\n y: {\n formatter: (v, { seriesIndex, dataPointIndex }) => {\n const getI18nCount = (type) => {\n switch (type) {\n case 'number':\n return data.number_i18n;\n case 'currency':\n return data.currency_i18n;\n case 'percentage':\n return data.percentage_i18n;\n }\n },\n getNonI18nCount = (type) => {\n switch (type) {\n case 'number':\n return data.number_not_i18n;\n case 'currency':\n return data.currency_not_i18n;\n case 'percentage':\n return data.percentage_not_i18n;\n }\n },\n getCount = (type) => {\n return seriesIndex === 0\n ? getI18nCount(type)\n : getNonI18nCount(type);\n };\n\n switch (dataPointIndex) {\n case 0:\n return getCount('number');\n case 1:\n return getCount('currency');\n case 2:\n return getCount('percentage');\n }\n }\n }\n },\n xaxis: {\n categories: types\n },\n yaxis: {\n min: 0,\n max: 100,\n labels: {\n formatter: (v) => \`\${v}%\`\n }\n },\n colors: ['#31E994', '#ff8173'],\n legend: {\n offsetX: -13,\n position: 'right',\n formatter: (seriesName) => {\n if (seriesName === 'Internationalized') {\n return \`\${seriesName} (\${i18nPercentage}%)\`;\n }\n return \`\${seriesName} (\${nonI18nPercentage}%)\`;\n }\n },\n plotOptions: {\n bar: {\n borderRadius: 3,\n columnWidth: '85%'\n }\n }\n };\n\n (numberChart = new ApexCharts(\n document.querySelector('.number-quality .graph'),\n options\n )).render();\n }\n\n function renderDatetimeChart() {\n const overallStats = DataStore.getOverallStats();\n const types = ['Date', 'Time', 'DateTime'],\n data = {\n date_i18n: overallStats.localizedDate,\n time_i18n: overallStats.localizedTime,\n date_time_i18n: overallStats.localizedDateTime,\n date_not_i18n: overallStats.notLocalizedDate,\n time_not_i18n: overallStats.notLocalizedTime,\n date_time_not_i18n: overallStats.notLocalizedDateTime\n },\n total = Object.values(data).reduce((acc, curr) => acc + curr, 0),\n percentageCalc = (v, t) => {\n const val = ((v / t) * 100).toFixed(0);\n return isNaN(val) || !isFinite(val) ? 0 : val;\n },\n i18nPercentage = percentageCalc(\n data.date_i18n + data.time_i18n + data.date_time_i18n,\n total\n ),\n nonI18nPercentage = percentageCalc(\n data.date_not_i18n + data.time_not_i18n + data.date_time_not_i18n,\n total\n ),\n dateTotal = data.date_i18n + data.date_not_i18n,\n timeTotal = data.time_i18n + data.time_not_i18n,\n dateTimeTotal = data.date_time_i18n + data.date_time_not_i18n,\n dateI18n = percentageCalc(data.date_i18n, dateTotal),\n timeI18n = percentageCalc(data.time_i18n, timeTotal),\n dateTimeI18n = percentageCalc(data.date_time_i18n, dateTimeTotal),\n dateNotI18n = percentageCalc(data.date_not_i18n, dateTotal),\n timeNotI18n = percentageCalc(data.time_not_i18n, timeTotal),\n dateTimeNotI18n = percentageCalc(\n data.date_time_not_i18n,\n dateTimeTotal\n ),\n options = {\n series: [\n {\n name: 'Internationalized',\n data: [dateI18n, timeI18n, dateTimeI18n]\n },\n {\n name: 'Not Internationalized',\n data: [dateNotI18n, timeNotI18n, dateTimeNotI18n]\n }\n ],\n chart: {\n type: 'bar',\n height: 220,\n width: 500,\n toolbar: {\n show: false\n },\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n dataLabels: {\n enabled: true,\n dropShadow: { enabled: false },\n style: {\n colors: ['#080404b0']\n },\n formatter: (val) => {\n return \`\${val}%\`;\n }\n },\n stroke: {\n show: true,\n width: 1,\n colors: ['#fff']\n },\n tooltip: {\n theme: 'dark',\n shared: true,\n intersect: false,\n x: {\n formatter: (type) => \`\${type} instances:\`\n },\n y: {\n formatter: (v, { seriesIndex, dataPointIndex }) => {\n const getI18nCount = (type) => {\n switch (type) {\n case 'date':\n return data.date_i18n;\n case 'time':\n return data.time_i18n;\n case 'date_time':\n return data.date_time_i18n;\n }\n },\n getNonI18nCount = (type) => {\n switch (type) {\n case 'date':\n return data.date_not_i18n;\n case 'time':\n return data.time_not_i18n;\n case 'date_time':\n return data.date_time_not_i18n;\n }\n },\n getCount = (type) => {\n return seriesIndex === 0\n ? getI18nCount(type)\n : getNonI18nCount(type);\n };\n\n switch (dataPointIndex) {\n case 0:\n return getCount('date');\n case 1:\n return getCount('time');\n case 2:\n return getCount('date_time');\n }\n }\n }\n },\n xaxis: {\n categories: types\n },\n yaxis: {\n min: 0,\n max: 100,\n labels: {\n formatter: (v) => \`\${v}%\`\n }\n },\n colors: ['#31E994', '#ff8173'],\n legend: {\n offsetX: 4,\n position: 'right',\n formatter: (seriesName) => {\n if (seriesName === 'Internationalized') {\n return \`\${seriesName} (\${i18nPercentage}%)\`;\n }\n return \`\${seriesName} (\${nonI18nPercentage}%)\`;\n }\n },\n plotOptions: {\n bar: {\n borderRadius: 3,\n columnWidth: '85%'\n }\n }\n };\n\n (dateTimeChart = new ApexCharts(\n document.querySelector('.datetime-quality .graph'),\n options\n )).render();\n }\n });\n })();\n // insights content\n (() => {\n if (!DataStore.ranSuccessfully()) {\n document.getElementById('overview').innerHTML =\n 'Unable to prepare zQA automation report for the project.';\n return;\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n renderCards();\n\n // helper methods to generate cards and its sections\n function createStatSection(locale, data) {\n const holder = document.createElement('div');\n const table = document.createElement('table');\n const tbody = document.createElement('tbody');\n const name = document.createElement('div');\n const addRow = (name, value) => {\n const row = document.createElement('tr');\n\n const col1 = document.createElement('td');\n col1.classList.add('name');\n col1.textContent = name;\n\n const col2 = document.createElement('td');\n col2.classList.add('value');\n col2.textContent = value;\n\n row.appendChild(col1);\n row.appendChild(col2);\n return row;\n };\n\n if (DataStore.isSanityRun()) {\n tbody.appendChild(addRow('Pages viewed', data.reviewed));\n }\n else {\n const tableData = {\n 'Internationlized Strings':\n data.localizedStrings +\n data.untranslatedStrings +\n data.partialStrings,\n 'Not Internationlized Strings': data.notLocalizedStrings,\n 'Internationlized Numbers': data.localizedNumber,\n 'Not Internationlized Numbers': data.notLocalizedNumber,\n 'Internationlized Currency': data.localizedCurrency,\n 'Not Internationlized Currency': data.notLocalizedCurrency,\n 'Internationlized Percentage': data.localizedPercentage,\n 'Not Internationlized Percentage': data.notLocalizedPercentage,\n 'Internationlized Date': data.localizedDate,\n 'Not Internationlized Date': data.notLocalizedDate,\n 'Internationlized Time': data.localizedTime,\n 'Not Internationlized Time': data.notLocalizedTime,\n 'Internationlized DateTime': data.localizedDate,\n 'Not Internationlized DateTime': data.notLocalizedDateTime,\n 'Encoding Issue Strings': data.encoding,\n 'DNT Strings': data.dnt,\n 'Ignored Strings': data.ignored,\n 'Untranslated Strings': data.untranslatedStrings,\n 'Auto Ignored Strings': data.autoIgnored,\n 'User Input Strings': data.userInput,\n 'Total Reviewed': data.reviewed\n };\n\n for (const rowData of Object.entries(tableData)) {\n if (!DataStore.isSanityRun() || !DataStore.isDefaultLocale(locale) || rowData[0] !== 'Untranslated Strings') {\n tbody.appendChild(addRow(rowData[0], rowData[1]));\n }\n }\n }\n\n holder.classList.add('stat');\n name.classList.add('name');\n name.textContent = 'Summary';\n holder.append(name);\n\n table.appendChild(tbody);\n holder.appendChild(table);\n return holder;\n }\n\n function createStatusBarSection(locale, data) {\n const holder = document.createElement('div');\n holder.classList.add('status-bar');\n\n const generateBarEl = (name, total, current) => {\n const getColorClass = (value) => {\n if (value <= 25) {\n return 'red';\n } else if (value <= 50) {\n return 'yellow';\n } else if (value <= 75) {\n return 'blue';\n } else if (value <= 100) {\n return 'green';\n }\n };\n current = (current / total) * 100;\n current = isNaN(current) || !isFinite(current) ? 0 : current;\n const holder = document.createElement('div');\n holder.classList.add('bar-container');\n\n const nameHolder = document.createElement('div');\n nameHolder.classList.add('name');\n nameHolder.textContent = name;\n\n const barHolder = document.createElement('div');\n barHolder.classList.add('bar-holder');\n\n const bar = document.createElement('div');\n bar.classList.add('bar');\n bar.classList.add(\`--\${getColorClass(current)}\`);\n bar.style.width = \`\${current}%\`;\n bar.textContent = \`\${current.toFixed(0)}%\`;\n\n barHolder.appendChild(bar);\n holder.appendChild(nameHolder);\n holder.appendChild(barHolder);\n\n return holder;\n };\n\n const showFull = DataStore.isSanityRun() || DataStore.isDefaultLocale(locale),\n totalI18nCount = showFull\n ? 100\n : data.localizedStrings +\n data.untranslatedStrings +\n data.partialStrings +\n data.notLocalizedStrings,\n i18nStrings = showFull\n ? 100\n : data.localizedStrings +\n data.untranslatedStrings +\n data.partialStrings,\n totalLocCount = showFull\n ? 100\n : totalI18nCount -\n data.untranslatedStrings -\n data.notLocalizedStrings,\n totalNumberCount = showFull\n ? 100\n : data.localizedNumber +\n data.localizedCurrency +\n data.localizedPercentage +\n data.notLocalizedPercentage +\n data.notLocalizedCurrency +\n data.notLocalizedNumber,\n i18nNumbers = showFull\n ? 100\n : totalNumberCount -\n data.notLocalizedPercentage -\n data.notLocalizedCurrency -\n data.notLocalizedNumber,\n totalI18nDateTimeCount = showFull\n ? 100\n : data.localizedDate +\n data.localizedDateTime +\n data.localizedTime +\n data.notLocalizedDate +\n data.notLocalizedDateTime +\n data.notLocalizedTime,\n i18nDateTime = showFull\n ? 100\n : totalI18nDateTimeCount -\n data.notLocalizedDate -\n data.notLocalizedDateTime -\n data.notLocalizedTime;\n\n holder.appendChild(\n generateBarEl('String I18n level', totalI18nCount, i18nStrings)\n );\n\n holder.appendChild(\n generateBarEl('String L10n level', totalI18nCount, totalLocCount)\n );\n\n holder.appendChild(\n generateBarEl('Number I18n level', totalNumberCount, i18nNumbers)\n );\n\n holder.appendChild(\n generateBarEl(\n 'DateTime I18n level',\n totalI18nDateTimeCount,\n i18nDateTime\n )\n );\n return holder;\n }\n\n function generateCardContents(locale, data) {\n const cardContent = document.createElement('div');\n cardContent.classList.add('card-content');\n\n cardContent.appendChild(createStatusBarSection(locale, data));\n cardContent.appendChild(createStatSection(locale, data));\n return cardContent;\n }\n\n function createCardEl(locale, data) {\n const card = document.createElement('div');\n const title = document.createElement('div');\n card.classList.add('card');\n card.dataset.locale = locale;\n\n if(!window.isStandaloneReport) {\n card.classList.add('--reduced-zoom');\n }\n\n title.classList.add('title');\n title.textContent = \`\${locale} details\`;\n\n // fire menu selection event on clicking the card\n card.addEventListener('click', () => {\n const previousSelectedSubMenu = document.querySelector(\n '.sub-menu-item.selected'\n );\n if (previousSelectedSubMenu) {\n window.previousSelectedLocale =\n previousSelectedSubMenu.dataset.locale;\n }\n\n document\n .querySelector(\`.sub-menu-item[data-locale="\${locale}"]\`)\n .click();\n });\n\n card.appendChild(title);\n card.appendChild(generateCardContents(locale, data));\n return card;\n }\n\n function renderCards() {\n // read from global variable appData;\n const localeInfo = DataStore.getLocalesData();\n\n if (Object.keys(localeInfo).length) {\n const cardHolder = document.querySelector(\n '#insights .cards .holder'\n );\n for (const locale in localeInfo) {\n const cardEl = createCardEl(\n locale,\n DataStore.getStatByLocale(locale)\n );\n cardHolder.appendChild(cardEl);\n }\n }\n }\n });\n })();\n // locale grid\n (() => {\n if (!DataStore.ranSuccessfully()) {\n return;\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n let table;\n document.querySelectorAll('.sub-menu-item').forEach((menu) => {\n menu.addEventListener('click', (e) => {\n render(e.currentTarget.dataset.locale);\n });\n });\n\n const updateTitle = (locale) => {\n document.querySelector(\n '#locale .title'\n ).textContent = \`\${locale} \${DataStore.isSanityRun() ? 'Sanity Result' : 'I18n Coverage Details'}\`;\n };\n\n const buildGrid = (locale) => {\n const data = DataStore.getDataByLocale(locale) || {};\n $.fn.dataTable.ext.errMode = 'none';\n const dataSet = [];\n if(DataStore.isSanityRun()) {\n Object.entries(data).map((entry) =>\n entry[1].forEach(\n (v) =>\n dataSet.push([v.description, v.imagePath])\n )\n );\n }\n else {\n Object.entries(data).map((entry) =>\n entry[1].forEach(\n (v) =>\n (v.type !== 'REVIEWED') &&\n dataSet.push([entry[0], v.type, v.description, v.imagePath])\n )\n );\n }\n const containerHeight = document\n .querySelector('#locale')\n .getBoundingClientRect().height;\n const scrollHeight = (72 / 100) * containerHeight;\n table = new DataTable('#locale .coverage-info table', {\n language: {\n lengthMenu: "Show _MENU_ entries per page:"\n },\n columns: DataStore.isSanityRun() ?\n [\n { title: 'Page' },\n { title: 'Screenshot' },\n ] : [\n { title: 'String' },\n { title: 'Type' },\n { title: 'Page' },\n { title: 'Screenshot' }\n ],\n columnDefs: DataStore.isSanityRun() ?\n [\n {\n width: '80%',\n targets: 0\n },\n {\n width: '20%',\n targets: 1,\n orderable: false,\n searchable: false,\n data: null,\n render: function (data) {\n return \`<a href="#" class="view-screenshot-btn" onclick="openImageViewer('\${data[1]}')"><img title="View screenshot for '\${data[0]}'" class="view-screenshot-image"></img></a>\`;\n },\n className: 'dt-head-center dt-body-center'\n }\n ] :\n [\n {\n width: '44%',\n targets: 0\n },\n {\n width: '18%',\n targets: 1\n },\n {\n width: '18%',\n targets: 2\n },\n {\n width: '18%',\n targets: 3,\n orderable: false,\n searchable: false,\n data: null,\n render: function (data) {\n return \`<a href="#" class="view-screenshot-btn" onclick="openImageViewer('\${data[3]}')"><img title="View screenshot for '\${data[2]}'" class="view-screenshot-image"></img></a>\`;\n },\n className: 'dt-head-center dt-body-center'\n }\n ],\n data: dataSet,\n initComplete: function () {\n this.api()\n .columns()\n .every(function () {\n const column = this;\n\n if ((DataStore.isSanityRun() && column[0][0] === 1) || column[0][0] === 3) {\n return;\n }\n\n const select = $(\n '<select class="filter dt-input"><option value="">Filter By</option></select>'\n )\n .appendTo($(column.header()).before())\n .on('change', function () {\n const val = $.fn.dataTable.util.escapeRegex(\n $(this).val()\n );\n\n column\n .search(val ? '^' + val + '$' : '', true, false)\n .draw();\n })\n .on('click', function (e) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n });\n\n column\n .data()\n .unique()\n .sort()\n .each(function (d, j) {\n select.append(\n '<option value="' + d + '">' + d + '</option>'\n );\n });\n });\n },\n sScrollY: scrollHeight,\n pageLength: 25,\n lengthMenu: [10, 25, 50, 100]\n });\n };\n\n const render = (locale) => {\n if (table) {\n table.destroy();\n }\n updateTitle(locale);\n buildGrid(locale);\n };\n });\n })();\n\n // log content\n (() => {\n document.addEventListener('DOMContentLoaded', function () {\n const pre = document.querySelector('#log .log-content pre');\n pre.textContent = 'Loading...';\n document\n .querySelector('li[data-page="log"]')\n ?.addEventListener('click', (e) => {\n pre.textContent = window.logData || (DataStore.hasRuntimeError() ? 'We are facing internal issue. Please try again after sometime.' : 'No log data found!');\n });\n });\n })();`,n=[],a=Ae(Ye.getReportPath(),"logs","log"),r=It.isSanityRun(),i=It.getOptions()?.supportedLocales?.map((e=>Oe(e))),s=$e(Ye.getReportPath()).filter((e=>i.includes(e))),o=1===s.length&&s[0]===Oe(It.getDefaultLocale());let l="";if(s.forEach((t=>(t!==e.defaultLocale||t===e.defaultLocale&&o||r)&&Ee(Ae(Ye.getReportPath(),t,be))&&n.push(Ae(t,be).replace(/\\/g,"/")))),Ee(a)){const t=[e.appName,...It.getL10nReportsPath().split(/[\\/]+/g),It.getMode()];t.push(Ye.getReportTimeStamp()),l=Pe(a).replace(new RegExp(Ye.getReportPath().replace(/\\/g,"\\\\"),"g"),Ae(...t)).replace(/\\/g,"\\\\").replace(/`/g,"\\`")}return function({appName:e,reportTime:t,script:n,style:a,body:r,dataFilePaths:i=[],logData:s}){return`<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="charset" content="charset='UTF-8'" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <meta name="company" content="Zeesoft" />\n <meta name="product" content="zAutomate.AI" />\n <meta name="author" content="Jitendra Maheshwari" />\n <meta name="email" content="jm@zeesoft.com" />\n <meta\n name="description"\n content="zAutomate.AI report"\n />\n <title>${e} - zAutomate.AI report | ${t}</title>\n \x3c!-- 3rd party dependencies --\x3e\n <link\n rel="stylesheet"\n href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.min.css"\n />\n ${i.map((e=>`<script\n src="${e}"\n type="text/javascript">\n <\/script>`)).join("")}\n ${s?`<script type="text/javascript" async/>window.logData = \`${s}\`;<\/script>`:""}\n <script\n src="https://code.jquery.com/jquery-3.7.1.slim.min.js"\n integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="\n crossorigin="anonymous"\n defer\n ><\/script>\n <script src="https://cdn.jsdelivr.net/npm/apexcharts" defer><\/script>\n <script\n src="https://cdn.datatables.net/2.0.3/js/dataTables.min.js"\n defer\n ><\/script>\n <style>\n ${a}\n </style>\n </head>\n <body>\n ${r}\n </body>\n <script type="text/javascript" defer>\n ${n}\n <\/script>\n</html>\n`}({appName:e.appName,reportTime:e.reportTime,body:'<header><div class="logo">zAutomate.AI</div><div class="report-timestamp"><span class="info"></span></div></header>\n <main>\n <div class="sidebar">\n <ul class="menu" id="menu">\n <li class="menu-item" data-page="overview">\n <a href="#">Overview</a>\n </li>\n <li class="menu-item" data-page="log">\n <a href="#">View Log</a>\n </li>\n <li class="menu-item has-submenu" data-page="insights">\n <a href="#" data-page="insights">Insights</a>\n <ul class="submenu"></ul>\n </li>\n </ul>\n <div class="footer"></div>\n </div>\n <div class="content-wrapper">\n <div id="overview" class="content">\n <div class="context-info card">\n <span class="title">Context Creation Details</span>\n <p class="info"></p>\n </div>\n <div class="overall-quality card">\n <span class="title">Overall I18n Coverage</span>\n <div class="section">\n <div class="block">\n <article>\n <p class="desc">\n zI18n-Verify report provides a comprehensive information\n about the I18n and L10n quailty of your application.\n </p>\n <ul class="items">\n <li>\n <h4>Reviewed:</h4>\n <p class="detail">\n Total strings which are captured and processed by\n zI18n-Verify.\n </p>\n </li>\n <li>\n <h4>Internationlized:</h4>\n <p class="detail">\n Different types of value like string, number, date-time\n which are properly Internationalized.\n </p>\n </li>\n <li>\n <h4>Not Internationalized:</h4>\n <p class="detail">\n Values which are not Internationalized. Also includes\n Partially Localized strings and Encoding Issues.\n </p>\n </li>\n <li>\n <h4>Skipped:</h4>\n <p class="detail">\n Values which are skipped from processing because they\n are listed in DNT / Ignored lists or contains Auto\n Ignored pattern / User input pattern.\n </p>\n </li>\n </ul>\n </article>\n </div>\n <div class="block">\n <div class="graph"></div>\n </div>\n </div>\n </div>\n <div class="string-quality card">\n <span class="title">String Coverage</span>\n <div class="graph"></div>\n </div>\n <div class="skipped-items card">\n <span class="title">Skipped Items</span>\n <div class="graph"></div>\n </div>\n <div class="number-quality card">\n <span class="title">Number Coverage</span>\n <div class="graph"></div>\n </div>\n <div class="datetime-quality card">\n <span class="title">DateTime Coverage</span>\n <div class="graph"></div>\n </div>\n </div>\n <div id="log" class="content">\n <span class="title">Runtime log</span>\n <div class="log-content"><pre></pre></div>\n </div>\n <div id="insights" class="content">\n <div class="cards">\n <span class="title">Locale Quality</span>\n <div class="holder"></div>\n </div>\n </div>\n <div id="locale" class="content">\n <span class="title">Locale Quality</span>\n <div class="coverage-info">\n <table class="row-border hover order-column stripe"></table>\n </div>\n <div id="imageViewer" class="image-viewer">\n <span class="close-button" onclick="closeImageViewer()"\n >×</span\n >\n <div class="image-container">\n <img id="imageView" src="" alt="Image" />\n </div>\n </div>\n </div>\n </div>\n </main>',script:t,style:"html {\n width: 100vw;\n height: 100vh;\n }\n\n * {\n user-select: none;\n }\n\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n display: flex;\n flex-direction: column;\n font-family: Arial, sans-serif;\n font-family: 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased; /* Webkit-based browsers */\n -moz-osx-font-smoothing: grayscale; /* Firefox on OS X */\n font-smooth: always; /* Non-standard, some browsers */\n }\n\n header {\n background-color: #333;\n height: 8%;\n display: flex;\n }\n\n main {\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 92%\n }\n\n .sidebar {\n width: 16%;\n height: 100%;\n background-color: #333;\n color: #fff;\n padding: 20px;\n box-sizing: border-box;\n float: left;\n }\n\n .logo {\n flex-grow: 1;\n align-content: center;\n margin-left: 2%;\n letter-spacing: 0.05em;\n color: #14cf96;\n font-weight: bold;\n font-size: 1.6rem;\n }\n\n .report-timestamp {\n flex-grow: 1;\n height: 100%;\n align-content: center;\n margin-right: 1%;\n }\n\n .report-timestamp .info {\n float: right;\n font-size: 1.1rem;\n color: #90a3a9;\n }\n\n .menu {\n list-style-type: none;\n padding: 0;\n margin: 0;\n }\n\n .menu-item {\n margin-bottom: 10px;\n }\n\n .menu-item a {\n color: #fff;\n text-decoration: none;\n display: block;\n padding: 10px;\n border-radius: 5px;\n font-size: 1.05rem;\n }\n\n .menu-item a:hover {\n background-color: #555;\n }\n\n .submenu {\n display: none;\n list-style-type: none;\n padding-left: 20px;\n }\n\n .menu-item.has-submenu > a::after {\n content: '⯆';\n float: right;\n margin-left: 5px;\n }\n\n .menu-item.has-submenu.selected > a::after {\n content: '⯅';\n float: right;\n margin-left: 5px;\n }\n\n .menu-item.selected > a {\n background-color: #555;\n }\n\n .submenu .sub-menu-item {\n margin: 3px auto;\n }\n\n .submenu .sub-menu-item a:hover {\n background-color: #777;\n }\n\n .submenu .sub-menu-item.selected a {\n background-color: #555 !important;\n }\n\n .submenu.active {\n display: block !important;\n }\n\n .view-screenshot-image {\n width: 100px;\n height: 30px;\n content: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgZmlsbD0iIzAwMDAwMCIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIA0KCSB2aWV3Qm94PSIwIDAgNDkwIDQ5MCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMjQ1LjIwNCwxMDEuMjY3QzY3LjE3MSwxMDEuMjY3LDAsMjQ1LDAsMjQ1czY2Ljc2MywxNDMuNzMzLDI0NC43OTYsMTQzLjczM0M0MjIuODI5LDM4OC43MzMsNDkwLDI0NSw0OTAsMjQ1DQoJCVM0MjMuMjM4LDEwMS4yNjcsMjQ1LjIwNCwxMDEuMjY3eiBNMjQ0Ljc5NiwzNzMuNDIxYy0xNDYuMzkzLDAtMjEyLjM2Ny0xMDEuMDUzLTIyNy41MDYtMTI4LjMzMw0KCQljMTUuMjQ5LTI2Ljc5Niw4Mi43MzMtMTI4LjUwOCwyMjcuOTE0LTEyOC41MDhjMTQ2LjUxNCwwLDIxMi40NzUsMTAxLjIyLDIyNy41NDMsMTI4LjQNCgkJQzQ1Ny41NzgsMjcyLjIwMywzOTEuMzEzLDM3My40MjEsMjQ0Ljc5NiwzNzMuNDIxeiIvPg0KCTxwYXRoIGQ9Ik0yNDUuMDAzLDE0Ni4xMjRjLTU0LjUyMSwwLTk4Ljg4MSw0NC4zNTItOTguODgxLDk4Ljg3M2MwLDU0LjUyMSw0NC4zNiw5OC44ODEsOTguODgxLDk4Ljg4MXM5OC44NzMtNDQuMzYsOTguODczLTk4Ljg4MQ0KCQlDMzQzLjg3NiwxOTAuNDc3LDI5OS41MjQsMTQ2LjEyNCwyNDUuMDAzLDE0Ni4xMjR6IE0yNDUuMDAzLDMyOC41NjZjLTQ2LjA4LDAtODMuNTY4LTM3LjQ4OS04My41NjgtODMuNTY4DQoJCWMwLTQ2LjA3MiwzNy40ODktODMuNTYxLDgzLjU2OC04My41NjFjNDYuMDcyLDAsODMuNTYxLDM3LjQ4OSw4My41NjEsODMuNTYxQzMyOC41NjQsMjkxLjA3NywyOTEuMDc1LDMyOC41NjYsMjQ1LjAwMywzMjguNTY2eiIvPg0KCTxwYXRoIGQ9Ik0yNDUuMDAzLDE3NS41ODNjLTM4LjI4MSwwLTY5LjQyMiwzMS4xNDEtNjkuNDIyLDY5LjQxNWMwLDM4LjI3NCwzMS4xNDEsNjkuNDE1LDY5LjQyMiw2OS40MTUNCgkJYzM4LjI3NCwwLDY5LjQxNS0zMS4xNDEsNjkuNDE1LTY5LjQxNUMzMTQuNDE3LDIwNi43MjQsMjgzLjI3NywxNzUuNTgzLDI0NS4wMDMsMTc1LjU4M3ogTTI0NS4wMDMsMjk5LjENCgkJYy0yOS44MzMsMC01NC4xMS0yNC4yNy01NC4xMS01NC4xMDJjMC0yOS44MzIsMjQuMjc3LTU0LjEwMiw1NC4xMS01NC4xMDJzNTQuMTAyLDI0LjI3LDU0LjEwMiw1NC4xMDINCgkJQzI5OS4xMDUsMjc0LjgzLDI3NC44MzUsMjk5LjEsMjQ1LjAwMywyOTkuMXoiLz4NCgk8cGF0aCBkPSJNMjQ1LjAwMywyMDYuNjc5Yy0yMS4xMywwLTM4LjMyNiwxNy4xODktMzguMzI2LDM4LjMxOWMwLDIxLjEyOSwxNy4xOTcsMzguMzI2LDM4LjMyNiwzOC4zMjZzMzguMzE5LTE3LjE5NywzOC4zMTktMzguMzI2DQoJCUMyODMuMzIxLDIyMy44NjgsMjY2LjEzMiwyMDYuNjc5LDI0NS4wMDMsMjA2LjY3OXogTTI0NS4wMDMsMjY4LjAxMWMtMTIuNjg4LDAtMjMuMDE0LTEwLjMyNi0yMy4wMTQtMjMuMDE0DQoJCWMwLTEyLjY4OCwxMC4zMjUtMjMuMDA2LDIzLjAxNC0yMy4wMDZjMTIuNjg4LDAsMjMuMDA2LDEwLjMxOCwyMy4wMDYsMjMuMDA2QzI2OC4wMDksMjU3LjY4NiwyNTcuNjkxLDI2OC4wMTEsMjQ1LjAwMywyNjguMDExeiIvPg0KPC9nPg0KPC9zdmc+);\n }\n\n .content-wrapper {\n padding: 1%;\n float: left;\n width: 84%;\n background-color: #f4f4f4;\n overflow: hidden;\n overflow-y: auto;\n height: 96%;\n }\n\n .content {\n display: none;\n }\n\n .content .title {\n font-size: 1rem;\n color: #080404e2;\n font-weight: 600;\n }\n\n .content .title::after {\n content: ':';\n }\n\n .content.active {\n display: flex !important;\n flex-direction: column;\n gap: 0.9rem;\n flex-wrap: wrap;\n transition: all 2s ease-in-out;\n }\n\n .sidebar .footer {\n bottom: 1.5%;\n position: absolute;\n font-size: 0.8rem;\n color: #14cf96;\n font-family: system-ui;\n }\n\n #overview {\n flex-direction: row;\n justify-content: space-between;\n }\n\n #overview .card {\n display: flex;\n flex-direction: column;\n width: 25rem;\n height: 12.5rem;\n border: 1px solid #ddd;\n box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n background: white;\n padding: 1rem;\n }\n\n #overview .overall-quality {\n height: 20rem;\n flex-basis: 100%;\n line-height: 14px;\n }\n\n #overview .overall-quality .section {\n display: flex;\n flex-direction: row;\n }\n\n #overview .overall-quality .section .block {\n width: 50%;\n }\n\n #overview .overall-quality .section .block article {\n padding: 5px;\n }\n\n #overview .overall-quality .section .block article p.desc {\n font-size: 0.9em;\n }\n\n #overview .overall-quality .section .block article .items li {\n font-size: 0.87em;\n }\n\n #overview .overall-quality .section .block article .items li .detail {\n margin-top: -10px;\n }\n\n #overview .overall-quality .section .block .graph {\n margin-top: 1.5em;\n }\n\n #overview .string-quality,\n #overview .number-quality,\n #overview .datetime-quality,\n #overview .skipped-items {\n flex-basis: 45%;\n }\n\n #overview .string-quality .graph,\n #overview .number-quality .graph,\n #overview .datetime-quality .graph,\n #overview .skipped-items .graph {\n align-self: center;\n }\n\n #overview .string-quality .graph {\n margin-left: 4rem;\n }\n\n #overview .number-quality.card,\n #overview .datetime-quality.card {\n height: 13rem;\n }\n\n #overview .number-quality .graph,\n #overview .datetime-quality .graph {\n margin-top: -0.9rem;\n margin-left: 4.5rem;\n }\n\n #overview .context-info {\n width: 100%;\n height: 90vh;\n }\n\n #insights .cards {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n }\n\n #insights .cards .holder {\n display: flex;\n flex-direction: row;\n gap: 1.5rem;\n flex-wrap: wrap;\n }\n\n #insights .cards .card {\n display: flex;\n flex-direction: column;\n width: 20rem;\n min-height: 10rem;\n border: 1px solid #ddd;\n box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n background: white;\n }\n\n #insights .cards .card:hover {\n transform: scale(1.015);\n box-shadow: 0 22px 35px -16px #07ff7d33;\n cursor: pointer;\n transition: all 0.1s ease-in-out;\n }\n\n #insights .cards .card .title {\n height: 2.5rem;\n font-size: 1rem;\n padding-top: 1rem;\n font-weight: 500;\n width: calc(100% - 1rem);\n background: #0c5ad9d6;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n padding-left: 1rem;\n color: white;\n }\n\n #insights .cards .card .title::after {\n content: '';\n }\n\n #insights .cards .card .card-content {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n padding: 1rem;\n }\n\n #insights .cards .card .status-bar {\n display: flex;\n flex-direction: column;\n gap: 0.8rem;\n }\n\n #insights .cards .card .status-bar .bar-container .name {\n font-size: 0.78rem;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n #insights .cards .card .status-bar .bar-container .name::after {\n content: ':';\n }\n\n #insights .cards .card .status-bar .bar-container .bar-holder {\n width: 100%;\n height: 10px;\n border: 1px solid #00000038;\n border-radius: 2px;\n }\n\n #insights .cards .card .status-bar .bar-container .bar-holder .bar {\n height: 100%;\n font-size: 0.63rem;\n text-align: right;\n color: rgb(0, 0, 0);\n }\n\n .bar.--green {\n background-color: #1dedaf;\n }\n\n .bar.--red {\n background-color: #fe3e3e;\n }\n\n .bar.--yellow {\n background-color: #faef1f;\n }\n\n .bar.--blue {\n background-color: #77c2ff;\n }\n\n #insights .cards .card .stat {\n display: flex;\n flex-direction: column;\n gap: 0.3rem;\n border: 0.5px solid #00000012;\n border-radius: 6px;\n }\n\n #insights .cards .card .stat table td {\n font-size: 0.78rem;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n #insights .cards .card .stat table td.name {\n width: 70%;\n }\n\n #insights .cards .card .stat table td.value::before {\n content: ': ';\n }\n\n #locale {\n background: white;\n padding: 12px;\n border-radius: 5px;\n padding-top: 20px;\n height: 96%;\n flex-direction: row;\n }\n\n #locale .title {\n content: ':';\n }\n\n #locale .coverage-info {\n margin-top: 0.6rem;\n width: 100%;\n max-height: 94%;\n padding-right: 1rem;\n padding-left: 0.1rem;\n }\n\n #locale table thead th select.filter {\n margin-left: 1rem;\n max-width: 8rem;\n text-overflow: ellipsis;\n }\n\n #locale .image-viewer {\n display: none;\n position: fixed;\n z-index: 9999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n text-align: center;\n }\n\n #locale .image-container {\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n display: inline-block;\n }\n\n #locale .image-viewer img {\n max-width: 90%;\n max-height: 90%;\n }\n\n #locale .close-button {\n position: absolute;\n top: 0.5rem;\n right: 1rem;\n color: #ffffffbf;\n font-size: 3.1rem;\n cursor: pointer;\n z-index: 9999;\n }\n\n #locale .close-button:hover {\n color: white;\n }\n\n #locale table tbody td {\n font-size: 0.9em;\n }\n\n #locale table td .view-screenshot-btn {\n color: blue;\n }\n\n @media (max-width: 768px) {\n .sidebar {\n width: 16rem;\n padding: 10px;\n }\n }\n\n .--hidden {\n display: none;\n visibility: hidden;\n }\n\n #log .log-content {\n width: 98%;\n height: 82vh;\n background: white;\n border-radius: 3px;\n overflow: hidden;\n padding: 1em;\n }\n\n #log .log-content pre {\n height: 100%;\n white-space: pre-line;\n word-break: break-all;\n padding: 0;\n margin: 0;\n width: 100%;\n overflow: hidden;\n overflow-y: auto;\n }\n\n .--reduced-zoom {\n zoom: 0.9123;\n }\n \n .--hide-overflow {\n overflow: hidden;\n }",dataFilePaths:n,logData:l})}write(e,t,n){Re(Ae(e,`${t}.html`),n,"utf-8")}}class Ue extends ke{#o;#l=!1;static#c="STATUS";static#d="COUNTS";constructor(){super(we),this.#u()}#u(){this.#o=new h({style:{headerTop:{left:"[94m╔[0m",mid:"[94m╦[0m",right:"[94m╗[0m",other:"[94m═"},headerBottom:{left:"[94m╟[0m",mid:"[94m╬[0m",right:"[94m╢[0m",other:"[94m═"},tableBottom:{left:"[94m╚[0m",mid:"[94m╩[0m",right:"[94m╝[0m",other:"[94m═[0m"},vertical:"[94m║[0m"},columns:[{name:Ue.#c,alignment:"left"},{name:Ue.#d,alignment:"center"}]})}buildContent(){if(ce[le]>0){this.#l=!0;for(const e in ce)e!==le?ce.hasOwnProperty(e)&&this.#o.addRows([{STATUS:e,COUNTS:`${ce[e]}`}]):(this.#o.addRows([{STATUS:"[94m"+"═".repeat(28)+"[0m",COUNTS:"[94m"+"═".repeat(8)+"[0m"}]),this.#o.addRows([{STATUS:"OVERALL_REVIEWED",COUNTS:`${ce[e]}`}]))}}export(){this.#l?this.#o.printTable():Ze.info("There are no visbile elements with UI strings")}}class Fe{static#g(e){switch(e){case ve:return new je;case we:return new Ue;default:throw new Error("unsupported report type requested")}}static export(e,t,n){const a=Fe.#g(e),r=new _e({appName:It.getAppName(),reportTime:(new Date).toLocaleString(),isContext:It.isContextRun(),isSanity:It.isSanityRun(),defaultLocale:It.getDefaultLocale(),reportFolderTimestamp:Ye.getReportTimeStamp()});a.generate(r),a.export(t,n)}}class Be{static#h;static#p;static init(){Be.#p=Ae(Ye.getReportPath(),Oe(It.getLocale())),Be.#h=Ae(Be.#p,be),this.#m()}static exists(){return Ee(Be.#h)}static save(e){this.#m();const t=`!window.rawData && (window.rawData={'${It.getLocale()}':{}});window.rawData['${It.getLocale()}']=${JSON.stringify(e)};`;Re(Be.#h,t)}static getData(){if(!this.exists())return{};try{return JSON.parse(Pe(Be.#h).replace(new RegExp(`(\\!window.rawData && \\(window\\.rawData=\\{'${It.getLocale()}':\\{\\}\\}\\);window\\.rawData\\['${It.getLocale()}'\\]=)|(;$)`,"g"),""))}catch(e){return{}}}static#m(){Me(Be.#p)}static getCacheDirPath(){return Be.#p}}class Ge{#f;#y;#v;#w;#b;#D;#L;#S;#T;#I;#C;#N;#x;#E;#z;#M;#P;#$;#A;#R;#O;#_;#k;#j;#U;constructor(e={}){this.#f=e?.localizedStrings||0,this.#y=e?.notLocalizedStrings||0,this.#v=e?.untranslatedStrings||0,this.#w=e?.partialStrings||0,this.#b=e?.localizedDateTime||0,this.#D=e?.localizedDate||0,this.#L=e?.localizedTime||0,this.#S=e?.notLocalizedDateTime||0,this.#T=e?.notLocalizedDate||0,this.#I=e?.notLocalizedTime||0,this.#C=e?.localizedNumber||0,this.#N=e?.notLocalizedNumber||0,this.#x=e?.localizedCurrency||0,this.#E=e?.notLocalizedCurrency||0,this.#z=e?.localizedPercentage||0,this.#M=e?.notLocalizedPercentage||0,this.#P=e?.ignored||0,this.#$=e?.dnt||0,this.#A=e?.autoIgnored||0,this.#R=e?.userInput||0,this.#O=e?.encoding||0,this.#_=e?.truncation||0,this.#k=e?.overlapping||0,this.#j=e?.reviewed||0,this.#U=e?.context||0}getLocalizedStrings(){return this.#f}setLocalizedStrings(e){this.#f=e}getUntranslatedStrings(){return this.#v}setUntranslatedStrings(e){this.#v=e}getNotLocalizedStrings(){return this.#y}setNotLocalizedStrings(e){this.#y=e}getPartialStrings(){return this.#w}setPartialStrings(e){this.#w=e}getLocalizedDateTime(){return this.#b}setLocalizedDateTime(e){this.#b=e}getLocalizedDate(){return this.#D}setLocalizedDate(e){this.#D=e}getLocalizedTime(){return this.#L}setLocalizedTime(e){this.#L=e}getNotLocalizedDateTime(){return this.#S}setNotLocalizedDateTime(e){this.#S=e}getNotLocalizedDate(){return this.#T}setNotLocalizedDate(e){this.#T=e}getNotLocalizedTime(){return this.#I}setNotLocalizedTime(e){this.#I=e}getLocalizedNumber(){return this.#C}setLocalizedNumber(e){this.#C=e}getNotLocalizeNumber(){return this.#N}setNotLocalizeNumber(e){this.#N=e}getCurrency(){return this.#x}setCurrency(e){this.#x=e}getNotLocalizeCurrency(){return this.#E}setNotLocalizeCurrency(e){this.#E=e}getPercentage(){return this.#z}setPercentage(e){this.#z=e}getNotLocalizePercentage(){return this.#M}setNotLocalizePercentage(e){this.#M=e}getIgnored(){return this.#P}setIgnored(e){this.#P=e}getUserInput(){return this.#R}setUserInput(e){this.#R=e}getDnt(){return this.#$}setDnt(e){this.#$=e}getAutoIgnored(){return this.#A}setAutoIgnored(e){this.#A=e}getEncoding(){return this.#O}setEncoding(e){this.#O=e}getTruncation(){return this.#_}setTruncation(e){this.#_=e}getOverlapping(){return this.#k}setOverlapping(e){this.#k=e}getReviewed(){return this.#j}setReviewed(e){this.#j=e}getContext(){return this.#U}setContext(e){this.#U=e}incrementByType(e){switch(e){case j:++this.#f;break;case H:++this.#y;break;case ie:++this.#v;break;case U:++this.#w;break;case se:++this.#A;break;case re:++this.#P;break;case ae:++this.#$;break;case ne:++this.#O;break;case V:++this.#D;break;case q:++this.#L;break;case Q:++this.#b;break;case J:++this.#T;break;case X:++this.#I;break;case K:++this.#S;break;case F:++this.#C;break;case Y:++this.#N;break;case B:++this.#x;break;case Z:++this.#E;break;case G:++this.#z;break;case W:++this.#M;break;case ee:++this.#_;break;case te:++this.#k;break;case le:++this.#j;break;case oe:++this.#R;break;case"context":++this.#U}}toJSON(){return{localizedStrings:this.#f,notLocalizedStrings:this.#y,untranslatedStrings:this.#v,partialStrings:this.#w,localizedDateTime:this.#b,localizedDate:this.#D,localizedTime:this.#L,notLocalizedDateTime:this.#S,notLocalizedDate:this.#T,notLocalizedTime:this.#I,localizedNumber:this.#C,notLocalizedNumber:this.#N,localizedCurrency:this.#x,notLocalizedCurrency:this.#E,localizedPercentage:this.#z,notLocalizedPercentage:this.#M,ignored:this.#P,dnt:this.#$,autoIgnored:this.#A,userInput:this.#R,encoding:this.#O,truncation:this.#_,overlapping:this.#k,reviewed:this.#j,context:this.#U}}}class Ve{#F;constructor(e={}){this.#F=new Ge(e.stats)}getStats(){return this.#F}setStats(e){this.#F=e}toJSON(){return{stats:this.#F}}}class qe{#B;#G;#V;constructor(e){this.#B=e?.type||"",this.#G=e?.imagePath||"",this.#V=e?.description||""}getType(){return this.#B}setType(e){this.#B=e}getImagePath(){return this.#G}setImagePath(e){this.#G=e}getDescription(){return this.#V}setDescription(e){this.#V=e}toJSON(){return{type:this.#B,description:this.#V,imagePath:this.#G}}}class Qe{#q={};constructor(e){if(e)for(const t in e)e[t].forEach((e=>{this.#q[t]||(this.#q[t]=[]),this.#q[t].push(new qe(e))}))}getStringData(e){return this.#q[e]||[]}setStringData(e,t){return!this.#q[e]&&(this.#q[e]=[]),this.#q[e].push(new qe(t)),!0}checkAndAdd(e,t){!this.#q[e]&&(this.#q[e]=[]);const n=this.getStringData(e).some((e=>e.getDescription()!==t.description||e.getImagePath()!==t.imagePath||e.getType()!==e.type));return n&&this.setStringData(e,t),n}hasStringData(e){return e in this.#q}static createNew(e,t){return t=Array.isArray(t)?t:[t],new Qe({data:{[e]:t}})}toJSON(){return this.#q}}class He{#Q;#H;constructor(e={}){this.#Q=new Ve(e.metaData),this.#H=new Qe(e.stringsData)}getMetaData(){return this.#Q}setMetaData(e){this.#Q=e}getStringEntry(e){return this.#H.getStringData(e)}static addString(e,t,n,a){const r=He.getInstance(),i=r.#Y(e,t,n,a.replace(/\\/g,"/"));return i&&r.save(),i}#Y(e,t,n,a){let r=!1;const i={type:t,description:n,imagePath:a};return r=this.#H.hasStringData(e)?this.#H.checkAndAdd(e,i):this.#H.setStringData(e,i),r&&this.#Q.getStats().incrementByType(t),r}static incrementCountByType(e){const t=He.getInstance();t.#Q.getStats().incrementByType(e),t.save()}toJSON(){return{metaData:this.#Q,stringsData:this.#H}}save(){Be.save(this)}remove(){Be.delete()}static getInstance(){return new He(Be.getData())}}class Ye{static#Z;static#W;static setup(){Ye.#W=Ye.#J();const e=c.resolve();Ye.#Z=Ae(e,It.getL10nReportsPath(),It.getMode(),Ye.#W)}static getReportTimeStamp(){return Ye.#W}static getReportPath(){return Ye.#Z}static reviewedReports(e=null,t=null){return Ye.#X(le,e,t)}static getContextPath(){return this.#K()}static[j](e,t){return Ye.#X(j,e,t)}static[H](e,t){return Ye.#X(H,e,t)}static[U](e,t){return Ye.#X(U,e,t)}static[ae](e,t){return Ye.#X(ae,e,t)}static[re](e,t){return Ye.#X(re,e,t)}static[se](e,t){return Ye.#X(se,e,t)}static[ie](e,t){return Ye.#X(ie,e,t)}static[ne](e,t){return Ye.#X(ne,e,t)}static[Q](e,t){return Ye.#X(Q,e,t)}static[K](e,t){return Ye.#X(K,e,t)}static[V](e,t){return Ye.#X(V,e,t)}static[J](e,t){return Ye.#X(J,e,t)}static[q](e,t){return Ye.#X(q,e,t)}static[X](e,t){return Ye.#X(X,e,t)}static[B](e,t){return Ye.#X(B,e,t)}static[Z](e,t){return Ye.#X(Z,e,t)}static[G](e,t){return Ye.#X(G,e,t)}static[W](e,t){return Ye.#X(W,e,t)}static[F](e,t){return Ye.#X(F,e,t)}static[Y](e,t){return Ye.#X(Y,e,t)}static incrementCount(e,t,n,a){ce.hasOwnProperty(e)&&(ce[e]++,He.addString(t,e,a,n.replace(Ye.#Z,"")))}static#J(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}-${String(e.getHours()).padStart(2,"0")}-${String(e.getMinutes()).padStart(2,"0")}`}static#X=(e,t,n)=>{const a=Ae(Ye.#Z,Oe(It.getLocale()),"screenshots",String(e).toLowerCase());Me(a,me);const r=Ae(Ye.#Z,Oe(It.getLocale()),"strings");if(Me(r,me),null!=t){let a="";if(ze(Ae(r,e+".txt"))){Pe(Ae(r,e+".txt")).includes(n)||(a+=`\n|<<<<<<<<<<<<<------${n}------\x3e>>>>>>>>>>>>|\n`),a+=t}else a+=`\n|<<<<<<<<<<<<<------${n}------\x3e>>>>>>>>>>>>|\n`,a+=t;((e,t,n="utf-8")=>{if(e&&t)try{o(e,t+"\n",{encoding:n,flag:"a"})}catch(e){Ze.error(e)}})(Ae(r,e+".txt"),a)}return a};static#K=()=>{const e=Ae(Ye.#Z,Oe(It.getLocale()),"contexts");return Me(e,me),e};static#ee(e){Fe.export(e,Ye.#Z)}static generateHtml(){Ye.#ee(ve)}static generateAsciiTable(){Ye.#ee(we)}}class Ze{static#te=!1;static#ne;static#ae=[];static info(e){Ze.#re("info",e)}static warn(e){Ze.#re("warn",e)}static error(e,t){Ze.#re("errr",e,t)}static debug(e){Ze.#re("dbug",e)}static#re(e,t,n=""){const a={INFO:"[37m",WARN:"[33m",ERRR:"[31m",DBUG:"[34m"};let r=a[e=e.toUpperCase()]||a.DEFAULT;n=n?` reason: ${n.toString()}`:"";let i=`[${(new Date).toLocaleString()}] [${r}${e}[0m] [${It.getLocale()}] - ${t}${n}`;switch(e){case"INFO":console.info(i);break;case"WARN":console.warn(i);break;case"ERRR":console.error(i);break;case"DBUG":console.debug(i);break;default:console.log(i)}i=i.replace(/\x1b\[\d+m/g,""),Ze.#ie(`${i}\n`)}static#ie=t=>{if(Ze.#te)Ze.#ae.push(t),Ze.#ne=setInterval((()=>{Ze.#te||(clearInterval(Ze.#ne),t=Ze.#ae.join("\n"),Ze.#ae=[],t&&Ze.#ie(t))}),10);else{Ze.#te=!0;const n=Ae(Ye.getReportPath(),"logs"),a=Ae(n,"log");Me(n,me),e.appendFileSync(a,t),Ze.#te=!1}}}class We extends Ne{constructor(e){super(e)}getElement(e){return this.$driver.element.find({selector:e,locateStrategy:e.startsWith("/")?"xpath":"css selector"})}async getElements(e){return await this.$driver.element.findAll({selector:e,locateStrategy:e.startsWith("/")?"xpath":"css selector"})}async getText(e){return await e.getText()}async getTitle(e){return await e.getAttribute("title")}async getPlaceholderText(e){return await e.getAttribute("placeholder")}async getAltText(e){return await e.getAttribute("alt")}async getTagName(e){return await e.getTagName()}async getValue(e){return await e.getAttribute("value")}async getElementID(e){return await e.getAttribute("id")}async getElementDimension(e){const t=await e.getRect();if(![null,"",void 0].includes(t))return[t.x,t.y,t.height,t.width]}async isElementDisplayed(e){return await this.$driver.isVisible(e)}async isElementPresent(e){return await this.$driver.isPresent(e)}async getElementStrings(e){const t=[];return[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAltText(e)},{type:"titleTxt",value:await this.getTitle(e)},{type:"placeTxt",value:await this.getPlaceholderText(e)},{type:"valueTxt",value:await this.getValue(e)}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)})),t}async getElementString(e){let t=null;const n=[this.getText,this.getAltText,this.getTitle,this.getPlaceholderText,this.getValue];for(const a of n)if(t=await a(e),null!==t)return t;return t}async captureScreenshot(e){await Je(this.$driver,e)}async getElementsCount(e){return e.length}async switchIframe(e){await this.$driver.frame(e,(()=>{Ze.debug(`Switching to ${e} frame`)}))}async switchToParentframe(){await this.$driver.frame(null)}pause(e){this.$driver.pause(1e3*e)}async onScreenStringHighlight(e,t){await this.$driver.execute(((e,t)=>{const n=window.getComputedStyle(e).border;e.style.border=`3px solid ${t}`,setTimeout((()=>{e.style.border=n}),40)}),[e,t])}async checkIfIframeIsPresent(){return new Promise((e=>{this.$driver.isPresent({selector:"//iframe",locateStrategy:"xpath",suppressNotFoundErrors:!0},(t=>{e(t.value)}))}))}async checkIfIframeBodyIsEmpty(){const e=await this.$driver.executeScript("return document.body.innerHTML");return""===await e.trim()}}const Je=async(t,n)=>{const a=await p({host:"localhost",port:Xe(t)}),{Page:r}=a;await r.enable();const{data:i}=await r.captureScreenshot({format:"png",captureBeyondViewport:!0}),s=Buffer.from(i,"base64");e.writeFileSync(n,s),console.log(`Screenshot saved as: ${n}`),await a.close()},Xe=e=>{const t=e?.capabilities?.["goog:chromeOptions"]?.debuggerAddress;return t&&t.split(":")?.[1]||9229};class Ke extends Ne{constructor(e){super(e)}getElement(e){return this.$driver.findElement("xpath",e)}async getElements(e){return await this.$driver.findElements("xpath",e)}async getText(e){return await $(e).getText()}async getTitle(e){return await $(e).getAttribute("title")}async getPlaceholderText(e){return await $(e).getAttribute("placeholder")}async getAltText(e){return await $(e).getAttribute("alt")}async getTagName(e){return await $(e).getTagName()}async getValue(e){return await $(e).getValue()}async getElementDimension(e){const t=await this.$driver.getElementRect(e["element-6066-11e4-a52e-4f735466cecf"]);if(![null,"",void 0].includes(t))return[t.x,t.y,t.height,t.width]}isElementDisplayed(e){return $(e).isDisplayed()}async getElementStrings(e){const t=[];return[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAltText(e)},{type:"titleTxt",value:await this.getTitle(e)},{type:"placeTxt",value:await this.getPlaceholderText(e)},{type:"valueTxt",value:await this.getValue(e)}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)})),t}async captureScreenshot(e){await this.$driver.saveScreenshot(e)}async getElementsCount(e){return e.length}}const et=({subject:e,selector:t,options:n={},driver:a})=>{if(!Cypress)return void a.printOnConsole("Cypress object is inaccessible");const r={name:"xpath",message:t};if(Cypress.dom.isElement(e)&&e.length>1)throw new Error("xpath() can only be called on a single element. Your subject contained "+e.length+" elements.");const i=()=>{let n,a=[],i=cy.state("withinSubject");n=Cypress.dom.isElement(e)?e[0]:Cypress.dom.isDocument(e)?e:i?i[0]:cy.state("window").document;let s=(n.ownerDocument||n).evaluate(t,n);if(s.resultType===XPathResult.NUMBER_TYPE){const e=(e=>e.numberValue)(s);return r.consoleProps=()=>({XPath:t,type:"number",result:e}),e}if((e=>e.resultType===XPathResult.STRING_TYPE)(s)){const e=(e=>e.stringValue)(s);return r.consoleProps=()=>({XPath:t,type:"string",result:e}),e}if((e=>e.resultType===XPathResult.BOOLEAN_TYPE)(s)){const e=(e=>e.booleanValue)(s);return r.consoleProps=()=>({XPath:t,type:"boolean",result:e}),e}try{let e=s.iterateNext();for(;e;)a.push(e),e=s.iterateNext();return r.consoleProps=()=>({XPath:t,result:1===a.length?a[0]:a}),a}catch(e){return console.error("Document tree modified during iteration",e),null}},s=()=>Cypress.Promise.try(i).then((e=>{var a;return a=e,Cypress._.isNumber(a)||Cypress._.isString(a)||Cypress._.isBoolean(a)||((e=Cypress.$(e)).selector=t),cy.verifyUpcomingAssertions(e,n,{onRetry:s})}));return s().then((e=>(!1!==n.log&&Cypress.log(r),e))).catch((e=>console.log(e)))};class tt extends Ne{constructor(e){super(e)}async getElement(e){return"string"!=typeof e?this.$driver.wrap(e):e.startsWith("//")?await this.xpath(e).first():await this.$driver.get(e).first()}async getElements(e){return"string"!=typeof e?this.$driver.wrap(e):e.startsWith("//")?await this.xpath(e):await this.$driver.get(e)}async getText(e){return"string"==typeof e?await this.$driver.get(e).invoke("text"):await this.$driver.wrap(e).invoke("text")}async getTitle(e){return"string"==typeof e?await this.$driver.get(e).title():this.$driver.wrap().title()}async getPlaceholderText(e){return"string"==typeof e?this.$driver.get(e).filter("input").invoke("attr","placeholder").then((e=>e)):this.$driver.$$(e).attr("placeholder")}async getAltText(e){return this.$driver.get(e).invoke("attr","alt")}async getWidth(e){return"string"==typeof e?this.$driver.get(e).invoke("width"):this.$driver.$$(e).width()}async getHeight(e){return"string"==typeof e?this.$driver.get(e).invoke("height"):this.$driver.$$(e).height()}async getTagName(e){return"string"==typeof e?this.$driver.get(e).invoke("prop","tagName").then((e=>e.toLowerCase())):this.$driver.$$(e).tagName}async getValue(e){return"string"==typeof e?this.$driver.get(e).invoke("val"):this.$driver.wrap(e).invoke("val")}async getLocation(e){if("string"==typeof e)return this.$driver.get(e).invoke("offset").then((e=>({x:e.left,y:e.top})));{const t=this.$driver.$$(e).offset();return{x:t.left,y:t.top}}}async isElementDisplayed(e){return"string"==typeof e?this.$driver.get(e).then((e=>e.is(":visible"))):this.$driver.$$(e).is(":visible")}async captureScreenshot(e){this.$driver.screenshot(e)}async getElementsCount(e){return new Promise((t=>"string"==typeof e?this.$driver.get(e).its("length").then((e=>t(e))):this.$driver.wrap(e,{timeout:8e3}).its("length").then((e=>t(e)))))}async getElementStrings(e){const t=[];try{[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAltText(e)},{type:"placetxt",value:await this.getPlaceholderText(e)}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)}))}catch(e){Ze.error("Error getting text of element:",e)}return t}printOnConsole(e){this.$driver.log(e)}xpath(e,t,n={}){return et({subject:e,selector:t,options:n,driver:this.$driver})}}class nt extends Ne{constructor(e){super(e)}async getElement(e){return await this.driver.findElement(e)}async getElements(e){return await this.driver.findElements(e)}async getText(e){return await e.getText()}async getTitle(){return await this.driver.getTitle()}async getAttribute(e,t){return await e.getAttribute(t)}async getTagName(e){return await e.getTagName()}async getElementDimension(e){const t=await e.getRect();if(![null,"",void 0].includes(t))return[t.x,t.y,t.height,t.width]}async isElementDisplayed(e){return await e.isDisplayed()}async getElementStrings(e){const t=[];return[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAttribute(e,"alt")},{type:"titleTxt",value:await this.getAttribute(e,"title")},{type:"placeTxt",value:await this.getAttribute(e,"placeholder")},{type:"valueTxt",value:await this.getAttribute(e,"value")}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)})),t}async getElementsCount(e){return e.length}}const at=(e,t=", ")=>e.join(t),rt=(e=!0)=>e?"(?:\\s|\\t|(?: ))":/(?:\s|\t|(?: ))/g;class it{#se={};#B;constructor(e){this.#B=e,this.#oe(),this.buildConfig(),this.#le()}#oe(){this.addToConfig("supportedLocales",It.getOptions()?.supportedLocales,[]),this.addToConfig("defaultLocale",It.getDefaultLocale()),this.addToConfig("defaultLanguage",It.getDefaultLocale()?.split(/[-_ ]/g)[0]),this.addToConfig("language",It.getLocale()?.split(/[-_ ]/g)[0]),this.addToConfig("locale",It.getLocale()),this.addToConfig("qaLocale",It.getQALocale())}buildConfig(){throw new Error(`{{${this.#B}}} buildConfig should be implemented by child class`)}#le(){m.load(f.entireSupplemental()),m.load(f.entireMainFor(this.#ce(this.#se.defaultLocale),this.#ce(this.#se.locale)))}#ce(e){if(this.isQaLocale())return"en";e=e.replace(/[-_ ]/g,"-");const t=f.availableLocales;let n;if(t.find((t=>t===e)))n=e;else{const a=e.split("-")[0];n=t.find((e=>e===a))?a:e}return n}validate(e){throw new Error(`{{${this.#B}}} validate should be implemented by child class`)}isInternationalized(e){throw new Error(`{{${this.#B}}} isInternationalized should be implemented by child class`)}setConfig(e){this.#se=e}addToConfig(e,t,n){this.#se[e]=t??n}getConfig(){return this.#se}isSupportedLocale(){return this.#se.supportedLocales.includes(this.currentLocale())}isQaLocale(){return this.currentLocale()===this.#se?.qaLocale}isDefaultLocale(){return this.currentLocale()===this.defaultLocale()}defaultLocale(){return this.#se?.defaultLocale}defaultLanguage(){return this.#se?.defaultLanguage}currentLocale(){return this.#se?.locale}currentLanguage(){return this.#se.language}getGlobalize(e){return m(this.#ce(e))}}class st extends it{constructor(){super("currency")}validate(e){return this.#de(e)||this.isInternationalized(e)}isInternationalized(e){return this.#ue(this.currentLocale(),e)}buildConfig(){}#ue(e,t){const n=this.#ge(e),a=this.#he(e,n);if(!this.#pe(n,a,t))return!1;const r=this.#me(n,a,t);return!isNaN(this.getGlobalize(e).numberParser()(r))}#pe(e,t,n){return new RegExp(`^(?:-)?(?:${e}|\\${t})(?:${rt()})?(?:-)?[0-9,. ]+$`,"gi").test(n)||new RegExp(`^(?:[- ]?)[0-9,. ]+(?:${rt()})?(?:${e}|\\${t})$`,"gi").test(n)}#me(e,t,n){return n.replace(new RegExp(`^(?:-)(?:${rt()})?`,"gi"),"").replace(new RegExp(`^(?:${rt()})?(?:${e}|\\${t})`,"gi"),"").replace(new RegExp(`^(?:-)(?:${rt()})?`,"gi"),"").replace(new RegExp(`(?:${rt()})?(?:${e}|\\${t})$`,"gi"),"").trim()}#fe(e){return(this.getGlobalize(e).cldr.supplemental(["likelySubtags",e])||e).split(/[-_ ]/).pop()}#ge(e){const t=this.#fe(e),n=this.getGlobalize(e).cldr.supplemental("currencyData").region[t];if(n){const e=n.find((e=>{const t=Object.values(e)[0];return!t._tender&&(!t._to||new Date(t._to)>=new Date)}));return e?Object.keys(e)[0]:"USD"}return"USD"}#he(e,t){const n=this.getGlobalize(e).cldr.main(`numbers/currencies/${t}`);return n?.symbol||"$"}#de(e){return this.#ue(this.defaultLocale(),e)}}const ot=(e,t)=>{t=String(t);const n=(e=>{let[t="en",n="us"]=e.split(/[-_ ]/g);switch(n=String(n).toLowerCase(),t){case"en":return"gb"===n?y.GB:y;case"de":return C;case"es":return I;case"fr":return T;case"pt":return S;case"ja":return L;case"zh":return["hans","cn","sg","hans-cn"].includes(n)?D.hans:["hant","tw","hk","mo","hant-tw"].includes(n)?D.hant:D;case"ru":return b;case"nl":return w;case"uk":return v;default:return y}})(e).parse(String(t).trim());return n.forEach((e=>{t=t.replace(e.text,"")})),0===t.replace(/[^\p{L}\p{N}]+/gu,"").trim().length},lt=e=>{try{return e=e.replace("_","-"),Intl.DateTimeFormat.supportedLocalesOf(e)[0]}catch(t){return Logger.warn(`${e} is unsupported by Intl`),!1}},ct=(e,t,n)=>{if(!1!==(e=lt(e))){if(N.fromFormat(n,t,{locale:lt(e)}).isValid)return!0}return!1};class dt extends it{constructor(){super("date")}validate(e){return this.#ye(e)||this.isInternationalized(e)}isInternationalized(e){return this.#ve(this.isQaLocale()?this.defaultLocale():this.currentLocale(),e)}buildConfig(){}#ve(e,t){return this.#we(e,t)||this.#be(e,t)||this.#De(e,t)}#ye(e){return this.#ve(this.defaultLocale(),e)}#we(e,t){const n=["short","medium","long","full"];for(let a of n){if(this.getGlobalize(e).dateParser({date:a})(t))return!0}return!1}#be(e,t){const n=[N.DATE_SHORT,N.DATE_MED,N.DATE_FULL,N.DATE_HUGE,N.DATE_MED_WITH_WEEKDAY,"D","DD","DDD","DDDD"];for(let a of n){if(ct(e,a,t))return!0}return!1}#De(e,t){return ot(this.isQaLocale()?this.defaultLocale():e,t)}}class ut extends it{constructor(){super("dateTime")}validate(e){return this.#Le(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Se(this.isQaLocale()?this.defaultLocale():this.currentLocale(),e)}buildConfig(){}#Se(e,t){return this.#we(e,t)||this.#be(e,t)||this.#De(e,t)}#Le(e){return this.#Se(this.defaultLocale(),e)}#we(e,t){const n=["short","medium","long","full"];for(let a of n){if(this.getGlobalize(e).dateParser({datetime:a})(t))return!0}return!1}#be(e,t){const n=[N.DATETIME_SHORT,N.DATETIME_SHORT_WITH_SECONDS,N.DATETIME_MED,N.DATETIME_MED_WITH_SECONDS,N.DATETIME_MED_WITH_WEEKDAY,N.DATETIME_FULL,N.DATETIME_FULL_WITH_SECONDS,N.DATETIME_HUGE,N.DATETIME_HUGE_WITH_SECONDS,"f","F","ff","FF"];for(let a of n){if(ct(e,a,t))return!0}return!1}#De(e,t){return ot(this.isQaLocale()?this.defaultLocale():e,t)}}class gt extends it{constructor(){super("number")}validate(e){return this.#Te(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Ie(this.currentLocale(),e)}buildConfig(){}#Ie(e,t){const n=this.getGlobalize(e).numberParser();return!isNaN(n(t))}#Te(e){return this.#Ie(this.defaultLocale(),e)}}class ht extends it{constructor(){super("percentage")}validate(e){return this.#Ce(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Ne(this.currentLocale(),e)}buildConfig(){}#Ne(e,t){if(!this.#xe(e,t))return!1;const n=this.#Ee(t);return!isNaN(this.getGlobalize(e).numberParser()(n))}#Ee(e=""){return e.replace(new RegExp(`(^(?:${rt()})*|(?:${rt()})*$)`,"g"),"").replace(/^-/,"").replace(/٪|%/g,"").trim()}#xe(e,t){const n="[0-9,. ]+";let a;return a=["fa-IR","fa-ir"].includes(e)||e.startsWith("ar")?new RegExp(`(?:-)?(?:${rt()})?(?:٪|%)(?:${rt()})?${n}`,"g"):new RegExp(`(?:-)?(?:${rt()})?${n}(?:${rt()})?(?:٪|%)`,"g"),a.test(t)}#Ce(e){return this.#Ne(this.defaultLocale(),e)}}class pt extends it{constructor(){super("string")}buildConfig(){const e=It.getOptions();this.addToConfig("mockChars",e?.qaMock),this.addToConfig("resource",It.getResourceBundle(),{}),this.addToConfig("garbledChars",It.getGarbledChars()?.filter((e=>String(e).trim())).filter(Boolean),[])}isInternationalized(e){const t=e.trim().replace(/\s*:\s*$/,""),n=this.getConfig()?.resource?.[this.defaultLocale()];return n?.includes(e)||n?.includes(t)}validate(e){return"string"==typeof e}isDntText(e){return this.getConfig()?.resource?.dnt?.includes(e)}isAutoIgnoredText(e){return this.isDefaultLocale()||this.isUserInputText(e)||this.isEmailText(e)||this.isUrlText(e)}isIgnoredText(e){return this.getConfig()?.resource?.ignore?.includes(e)}isUserInputText(e){return e.startsWith("zqa_")}isEmailText(e){return ge.EMAIL.test(e)}isUrlText(e){return ge.URL.test(e)}isFullQaLanguageText(e){const t=this.getConfig();return(e.slice(0,2)===t?.mockChars?.prefix||e.slice(0,2)===t?.mockChars?.prefix.toUpperCase())&&e.slice(-2)===t?.mockChars.suffix}isPartialQaLanguageText(e){const t=this.getConfig();return e.slice(0,2)===t?.mockChars.prefix||e.slice(0,2)===t?.mockChars.prefix.toUpperCase()||e.slice(-2)===t?.mockChars.suffix}hasEncodingIssue(e){return this.getConfig()?.garbledChars?.length>0&&this.getConfig().garbledChars.some((t=>e.includes(t)))}isPartiallyLocalizedText(e){return this.#ze(e)===this.currentLanguage()}#ze(e){const t=Object.keys(x(e)?.scores||{}).filter(Boolean)||[],n=this.currentLanguage();return t.length?t.includes(n)?n:t[0]:this.defaultLanguage()}isLocalized(e){const t=e.trim().replace(/\s*:\s*$/,""),n=this.getConfig()?.resource?.[this.currentLocale()];return n?.includes(e)||n?.includes(t)}}class mt extends it{constructor(){super("time")}validate(e){return this.#Me(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Pe(this.isQaLocale()?this.defaultLocale():this.currentLocale(),e)}buildConfig(){}#Pe(e,t){return this.#we(e,t)||this.#be(e,t)||this.#De(e,t)}#Me(e){return this.#Pe(this.defaultLocale(),e)}#we(e,t){const n=["short","medium","long","full"];for(let a of n){if(this.getGlobalize(e).dateParser({time:a})(t))return!0}return!1}#be(e,t){const n=[N.TIME_SIMPLE,N.TIME_WITH_SECONDS,N.TIME_WITH_SHORT_OFFSET,N.TIME_WITH_LONG_OFFSET,N.TIME_24_SIMPLE,N.TIME_24_WITH_LONG_OFFSET,N.TIME_24_WITH_SECONDS,N.TIME_24_WITH_SHORT_OFFSET,"t","T","tt","TT"];for(let a of n){if(ct(e,a,t))return!0}return!1}#De(e,t){return ot(this.isQaLocale()?this.defaultLocale():e,t)}}class ft{static#$e={};static#Ae;static#Re;static#Oe;static#_e;static#J;static#ke;static#je;static load(){ft.#Ae=new pt,ft.#Re=new gt,ft.#Oe=new dt,ft.#_e=new mt,ft.#J=new ut,ft.#ke=new st,ft.#je=new ht}static getIssueType(e){const t=It.getLocale();if(t){let n=ie;return ft.#$e[t]||(ft.#$e[t]={}),ft.#$e[t][e]?ft.#$e[t][e]:(this.#Ae.isAutoIgnoredText(e)?n=se:this.#Ae.isDntText(e)?n=ae:this.#Ae.isIgnoredText(e)?n=re:this.#Ae.hasEncodingIssue(e)?n=ne:this.#ke.validate(e)?n=this.#ke.isInternationalized(e)?B:Z:this.#je.validate(e)?n=this.#je.isInternationalized(e)?G:W:this.#Re.validate(e)?n=this.#Re.isInternationalized(e)?F:Y:this.#Oe.validate(e)?n=this.#Oe.isInternationalized(e)?V:J:this.#_e.validate(e)?n=this.#_e.isInternationalized(e)?q:X:this.#J.validate(e)?n=this.#J.isInternationalized(e)?Q:K:this.#Ae.validate(e)?this.#Ae.isQaLocale()?n=this.#Ae.isFullQaLanguageText(e)?j:this.#Ae.isPartialQaLanguageText(e)?U:H:!this.#Ae.isDefaultLocale()&&this.#Ae.isSupportedLocale()&&(n=this.#Ae.isLocalized(e)?j:this.#Ae.isPartiallyLocalizedText(e)?U:this.#Ae.isInternationalized(e)?ie:H):this.#Ae.isDefaultLocale()&&(n=se),ft.#$e[t][e]=n,n)}return ie}}class yt{static load(){const e={};if(It.getOptions()?.l10nResourcePath){const t=Ae(process.cwd(),It.getOptions()?.l10nResourcePath);if(Ee(t))yt.#Ue(t,e);else{if(!xe(t))return void console.error(`${t} invalid resource path`);for(const n of $e(t)){const a=Ae(t,n);yt.#Ue(a,e)}}It.setResourceBundle(e)}}static#Ue(e,t){const n=It.getLocale(),a=It.getDefaultLocale(),r=Pe(e),i=(e=>Ee(e)?g(e):"")(e);if(he.includes(i)){if(!r)return void console.error(`${e} is empty or invalid`);if(e.toLowerCase().includes("dnt"))t.dnt=r.split(/\r?\n/);else if(e.toLowerCase().includes("ignore"))t.ignore=r.split(/\r?\n/);else if(e.includes(n)){const e=r.split(/\r?\n/);t[n]=e.map(vt)}else e.includes(a)&&(t[a]=r.split(/\r?\n/))}}}function vt(e){return e.replace(/<\/?[^>]+>/gi,"")}const wt=()=>{yt.load(),ft.load(),Ye.setup(),Be.init()},bt=()=>{let e=process.cwd(),t=0;for(;t<10;){const n=Ae(e,"package.json");if(Ee(n)){const e=Pe(n),t=JSON.parse(e),a={...t?.dependencies||{},...t?.devDependencies||{},...t?.peerDependencies||{}};if("@zeesoft/i18n-verify"!==t.name&&JSON.stringify(a).includes('"@zeesoft/i18n-verify"'))break}e=u(e),t++}return e},Dt=(e=bt())=>Pe(Ae(e,"package.json")),Lt=(e="")=>`{\n "appName": "${Dt()?.match(/"name": "([^"]+)",/)?.[1]||""}",\n "type": "${e}", // set automation framework type ${at(Object.values(z))}\n "qaLocale": "", // set the qa locale used in your project\n "l10nResourcePath": "./l10nResources", // set the dir path of l10n resources\n "l10nReportsPath": "./l10nReports/", // set the dir path of l10n reports\n "supportedLocales": ["en_US", "fr_FR", "ja_JP"], // set the list of supported locales\n "defaultLocale": "en_US", // set default locale of the application\n "qaMock": { // set the prefix and suffix characters of qa locale\n "prefix": "à_",\n "suffix": "_海"\n },\n "mode": "${De.I18N}", // should be one of the following: ${Object.values(De).join(", ")}\n "garbledChars": [""] // set the list of custom garbled characters\n}`,St=()=>{const e=Ae(process.cwd(),ye);if(!Ee(e))throw new Error(`${ye} file is missing. Please add the file in your project root dir`);let t=Pe(e);if(!t)throw new Error(`invalid ${ye} file. Please add valid file in your project root dir`);t=t.replace(/\/\/.+$/gm,"");try{t=JSON.parse(t)}catch(e){throw new Error(`invalid ${ye} file. Please add valid file in your project root dir`)}return t},Tt=(e,t="")=>{e&&!Ee(e)&&Re(e,Lt(t))};class It{static#Fe;static#Be;static#B;static#Ge;static#Ve;static#qe;static#Qe;static#He;static#Ye;static#e;static init(){try{const e=St();(e=>{if("object"!=typeof e||Object.keys(e).length<1)throw new Error(`empty ${ye} file`);const t=[];if(!((e,t,n=[])=>["l10nResourcePath","l10nReportsPath","supportedLocales","defaultLocale","type","mode"].every((e=>(((e,t)=>e in t)(e,t)||n.push(e),!0))))(0,e,t))throw new Error(`following properties are missing in ${ye} file: ${at(t)}`);if(!Object.values(z).includes(e?.type||""))throw new Error(`${ye} has invalid system type`);if(!Object.values(De).includes(e?.mode||""))throw new Error(`${ye} has invalid mode option`)})(e),this.#B=e?.type,this.#Ge=e?.mode,this.#qe=e?.qaLocale,this.#e=e?.appName,this.#Qe=e,this.#Ye=0,this.getGarbledChars()}catch(e){throw Ze.error(e.message),e}}static set(e,t){this.#Ve=t,this.#Fe=((e,t)=>{switch(e){case z.NIGHT_WATCH:return new We(t);case z.WEB_DRIVER_IO:return new Ke(t);case z.CYPRESS:return new tt(t);case z.SELENIUMJS:return new nt(t);default:throw new Error("Unsupported framework")}})(this.#B,e)}static getGarbledChars(){return[...this.#Qe.garbledChars||[],...fe]}static getL10nReportsPath(){return this.#Qe.l10nReportsPath}static setDriver(e){this.#Fe=e}static setType(e){this.#B=e}static setLocale(e){this.#Ve=e}static setOptions(e){this.#Qe=e}static getExecutor(){if(It.#Be)return It.#Be;if(!It.#Fe)throw new Error("Unable to initialize process executor, driver is missing");return this.#Be=new Mt(this.#Fe),this.#Be}static getDriver(){return this.#Fe}static getLocale(){return this.#Ve}static getDefaultLocale(){return this.#Qe.defaultLocale}static getType(){return this.#B}static getOptions(){return this.#Qe}static setQALocale(e){this.#qe=e}static getQALocale(){return this.#qe}static setResourceBundle(e){this.#He=e}static getResourceBundle(e){return this.#He?.[e]||this.#He||[]}static incrementCounter(){this.#Ye++}static getSSCount(e=!1){return e?++this.#Ye:this.#Ye}static getMode(){return this.#Ge}static isSanityRun(){return this.#Ge===De.SANITY}static isI18nVerificationRun(){return this.#Ge===De.I18N}static isContextRun(){return this.#Ge===De.CONTEXT}static getAppName(){return this.#e}}class Ct{#Fe;#Ze;#We;#V;#Je=[];#Xe;#Ke;#et;#tt;constructor(e,t,n,a){this.#Fe=e,this.#Ze=t,this.#We=n,this.#V=a}async run(){try{await this.#nt(),this.shouldCollectStrings()?await this.#at():await this.#rt()}catch(e){Ze.error("unable to run the process",e)}finally{await this.#it()}}async process(e,t,n,a){throw new Error("should be implemeneted by the child class")}shouldCollectStrings(){return!0}async preProcess(){}async postProcess(){}async captureScreen(e){try{return await this.#Fe.captureScreenshot(e),!0}catch(e){return Ze.error("unable to capture screenshot"),!1}}getBaseImageName(){return this.#Ke}getDescription(){return this.#V}getVerificationArea(){return this.#Ze}getVerificationAreaEl(){return this.#et}getVerificationAreaOffsets(){return this.#tt}getDriver(){return this.#Fe}async getElementOffsets(e){const t=await this.#Fe.getElementDimension(e);return{x:t[0],y:t[1],height:t[2],width:t[3]}}async#at(){this.#Je.length?await this.#st():(await this.#ot(),await this.#lt())}async#rt(){await this.process(this.#V)}async#nt(){this.#ct(),this.#dt(),await this.#ut(),await this.#gt(),await this.preProcess()}async#it(){await this.postProcess()}#ct(){const e=this.#Ze||"";if(this.#We?.length>0)for(const t of this.#We)this.#Je.push(e+t);else this.#Xe=""!==e?e+pe:pe}#dt(){this.#Ke=`${It.getSSCount(!0).toString().padStart(3,"0")}_${this.#V.replace(/[^\w\s]/gi,"").replace(/\s+/g,"")}.png`}async#gt(){const e=Ae(Ye.reviewedReports(),this.#Ke);await this.captureScreen(e),Ze.debug("reviewed image has been saved")}async#ut(){if(this.#et=await this.#Fe.getElement(this.#Ze),!this.#et)throw new Error("invalid verification area selector is supplied");this.#tt=await this.getElementOffsets(this.#et)}async#st(){for(const e of this.#Je){const t=await this.#Fe.getElement(e);await this.#ht(t)}}async#ot(){const e=await this.#Fe.getElements(this.#Xe);if(e?.length)for(const t of e)await this.#ht(t,!0)}async#lt(){if(await this.#Fe.checkIfIframeIsPresent()){const e=await this.#Fe.getElements("//iframe");Ze.debug(`Total ${e.length} iframes are located on the ${this.#V}`);for(const t of e){const e=await this.#Fe.getElementID(t);if(void 0!==e&&""!==e){const n=await this.getElementOffsets(t);this.#Fe.switchIframe(e),this.#Fe.pause(2);const a=await this.#Fe.getElement("//body");if(await this.#Fe.isElementPresent(a),!await this.#Fe.checkIfIframeBodyIsEmpty()){const t=await this.#Fe.getElements("//*[normalize-space(text())]");if(t.length>0)for(const a of t)await this.#ht(a,!0,n,e)}}await this.#Fe.switchToParentframe()}}}async#ht(e,t=!1,n,a){if(await this.#pt(e)){const r=t?await this.#Fe.getElementStrings(e):[await this.#Fe.getElementString(e)];if(r?.length)for(const t of r)try{await this.process(t,e,n,a)}catch(e){Ze.error(`unable to process the ${a?`iframe-[${a}] `:""}string "${t}"`,e)}}}async#pt(e){return e&&await this.#Fe.isElementPresent(e)}}class Nt extends Ct{#q={screenshot:"",category:"",fileName:"",bookmark:!0,pageTitle:"",strings:{}};#mt=0;#ft="";constructor(...e){super(...e)}async preProcess(){this.#yt(),this.#vt(),this.#wt(),this.#bt(),this.#Dt()}async process(e,t,n){Ye.incrementCount(le,e,this.getBaseImageName(),this.getDescription()),Ze.debug(`context creation for "${e}"`),await this.#Lt(e,t,n)}async postProcess(){this.#St();const e=this.#Tt();Re(Ae(Ye.getContextPath(),`${this.#q.fileName}.json`),JSON.stringify(e)),He.incrementCountByType("context")}#yt(){this.#mt=$e(Ye.getContextPath()).length+1}#vt(){this.#q.category=this.getDescription()}#wt(){this.#q.pageTitle=`TC-${It.getAppName()}-${this.getDescription().trim().slice(0,2).toUpperCase()}-${`${this.#mt}`.padStart(3,"0")}`}#bt(){this.#q.fileName=`${Oe(It.getAppName())}-${`${this.#mt}`.padStart(3,"0")}`}#Dt(){this.#ft=`${Oe(It.getAppName())}_${`${this.#mt}`.padStart(3,"0")}`}#St(){var e;this.#q.screenshot=`data:image/png;base64,${e=Ae(Ye.reviewedReports(),this.getBaseImageName()),r(e).toString("base64")}`}#Tt(){return{[Le]:this.#q.bookmark,[Se]:this.#q.category,[Te]:this.#q.fileName,[Ie]:this.#q.screenshot,[Ce]:JSON.stringify(this.#q.strings)}}async#Lt(e,t,n){let a;const r=await this.getElementOffsets(t),i=`${this.#ft}_${`${Object.keys(this.#q.strings).length+1}`.padStart(3,0)}`;if(n){a=n;const e=["x","y"];for(const t of e)t in r&&t in a&&(r[t]=a[t]+r[t])}else a=this.getVerificationAreaOffsets();this.#q.strings[i]={text:e,coordinates:{...a}}}}class xt{static async drawRectangle(t,n,a){const r=t?.x-2,i=t?.y-2,s=t?.width+2,o=t?.height+2;try{const t=await E.read(a),l=E.cssColorToHex(n);this.drawRectangleOutline(t,r,i,s,o,l,2);const d=c.dirname(a),u=await t.getBufferAsync(E.MIME_PNG);e.existsSync(d)||(Ze.debug("folder not found"),e.mkdirSync(d,{recursive:!0})),e.writeFileSync(a,u)}catch(e){Ze.error(`Error: ${e}`)}}static async drawRectangleOutline(e,t,n,a,r,i,s){for(let o=t;o<t+a;o++)for(let t=0;t<s;t++)e.setPixelColor(i,o,n+t),e.setPixelColor(i,o,n+r-1-t);for(let o=n;o<n+r;o++)for(let n=0;n<s;n++)e.setPixelColor(i,t+n,o),e.setPixelColor(i,t+a-1-n,o)}}class Et extends Ct{constructor(...e){super(...e)}async process(e,t,a){if("string"!=typeof e||!e||0===Number(e))return;const r=Ae(Ye.reviewedReports(e,this.getBaseImageName()),this.getBaseImageName()),i=ft.getIssueType(e),s=Ae(Ye[i](e,this.getBaseImageName()),this.getBaseImageName());Ye.incrementCount(le,e,this.getBaseImageName(),this.getDescription()),n(r)||l(Ae(Ye.reviewedReports(),this.getBaseImageName()),r),n(r)&&!n(s)&&l(r,s);const o=this.#It(i,e);Ye.incrementCount(i,e,s,this.getDescription()),await this.#Ct(t,o,s,a)}async#Ct(e,t,n,a){await this.#Nt(e,t),await this.#xt(e,t,n,a)}async#Nt(e,t){await this.getDriver().onScreenStringHighlight(e,t)}async#xt(e,t,n,a){let r;const i=await this.getElementOffsets(e),s=R;if(a){r=a;const e=["x","y"];for(const t of e)t in i&&t in r&&(i[t]=r[t]+i[t])}else r=this.getVerificationAreaOffsets();await xt.drawRectangle(r,s,n),await xt.drawRectangle(i,t,n)}#It(e,t){return Ze.debug(`"${t}" - ${de[e][1]}${ue[e]}[0m`),de[e][0]}}class zt extends Ct{constructor(...e){super(...e)}shouldCollectStrings(){return!1}async process(e){Ze.info(`${e} loaded`);const t=Ae(Ye.reviewedReports(e,this.getBaseImageName()),this.getBaseImageName());Ye.incrementCount(le,e,t,this.getDescription()),n(t)||l(Ae(Ye.reviewedReports(),this.getBaseImageName()),t)}}class Mt{#Fe;constructor(e){this.#Fe=e}async start({verificationArea:e,staticLocators:t,description:n}){const a=((e,t,n,a)=>{switch(It.getMode()){case De.I18N:return new Et(e,t,n,a);case De.CONTEXT:return new Nt(e,t,n,a);case De.SANITY:return new zt(e,t,n,a);default:throw new Error("unsupported runner type")}})(this.#Fe,e,t,n);await a.run()}}export{It as C,Mt as E,Ze as L,Ye as R,z as S,Dt as a,ye as b,Tt as c,bt as g,Ae as j,wt as l};
|
|
1
|
+
import e,{statSync as t,existsSync as n,mkdirSync as a,readFileSync as r,readdirSync as i,writeFileSync as s,appendFileSync as o,copyFileSync as l}from"fs";import c,{join as d,dirname as u,extname as g}from"path";import{Table as h}from"console-table-printer";import p from"chrome-remote-interface";import m from"globalize";import f from"cldr-data";import{en as y,uk as v,nl as w,ru as b,zh as D,ja as L,pt as S,fr as T,es as I,de as C}from"chrono-node";import{DateTime as N}from"luxon";import{detectTextLangEx as x}from"@isdk/detect-text-language";import E from"jimp";const z={NIGHT_WATCH:"nightwatch",WEB_DRIVER_IO:"webio",CYPRESS:"cypress",SELENIUMJS:"seleniumJS"},M="rgb(0, 154, 61)",P="rgb(255, 0, 0)",A="rgb(255, 255, 0)",R="rgb(0, 0, 255)",O="[32m",_="[31m",k="[33m",j="STRING_LOCALIZED",U="STRING_PARTIALLY_LOCALIZED",F="NUMBER_LOCALIZED",B="CURRENCY_LOCALIZED",G="PERCENTAGE_LOCALIZED",V="DATE_LOCALIZED",q="TIME_LOCALIZED",Q="DATE_TIME_LOCALIZED",H="STRING_NOT_LOCALIZED",Y="NUMBER_NOT_LOCALIZED",Z="CURRENCY_NOT_LOCALIZED",W="PERCENTAGE_NOT_LOCALIZED",J="DATE_NOT_LOCALIZED",X="TIME_NOT_LOCALIZED",K="DATE_TIME_NOT_LOCALIZED",ee="TRUNCATION_ISSUE",te="OVERLAPPING_ISSUE",ne="ENCODING_ISSUE",ae="DNT",re="IGNORE",ie="UNTRANSLATED",se="AUTO_IGNORE",oe="USER_INPUT",le="REVIEWED",ce={[j]:0,[H]:0,[U]:0,[F]:0,[Y]:0,[V]:0,[J]:0,[Q]:0,[K]:0,[q]:0,[X]:0,[B]:0,[Z]:0,[G]:0,[W]:0,[ee]:0,[te]:0,[ne]:0,[ae]:0,[re]:0,[ie]:0,[se]:0,[oe]:0,[le]:0},de={[j]:[M,O],[U]:[A,k],[F]:[M,O],[V]:[M,O],[q]:[M,O],[Q]:[M,O],[B]:[M,O],[G]:[M,O],[H]:[P,_],[J]:[P,_],[K]:[P,_],[X]:[P,_],[Y]:[P,_],[Z]:[P,_],[W]:[P,_],[ee]:[P,_],[te]:[P,_],[ne]:[P,_],[ae]:[M,O],[re]:[M,O],[ie]:[M,O],[se]:[M,O],[oe]:[M,O],[le]:[M,O]},ue={[j]:"string is localized",[U]:"string is partially localized",[F]:"number is localized",[V]:"date is localized",[Q]:"dateTime is localized",[q]:"time is localized",[B]:"currency is localized",[G]:"percentage is localized",[H]:"string is not localized",[J]:"date is not localized",[K]:"dateTime is not localized",[X]:"time is not localized",[Y]:"number is not localized",[Z]:"currency is not localized",[W]:"percentage is not localized",[ee]:"truncation issue detected",[te]:"overlapping issue detected",[ne]:"encoding issue detected",[ae]:"do not translate",[re]:"ignored this issue",[ie]:"string is untranslated",[se]:"automatically ignored issue",[oe]:"user input field",[le]:"string has been reviewed"},ge={EMAIL:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}\b/gi,URL:/^(https?:\/\/)?(www\.)?[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/},he=[".txt",".json"],pe="//*[string-length(normalize-space(text())) > 0 and not(ancestor-or-self::*/@style[contains(.,'display:none')]) or @placeholder] | //input[@type='checkbox']/parent::*[text() and not(ancestor-or-self::*/@style[contains(.,'display:none')])]",me=!0,fe=["☐","�","","â€","î","ÃÂ","ÃÂ","ü","é","é","æ•°","æ®","ラã"],ye=".i18n-verify.rc",ve="html",we="ascii_table",be="metrics.cache",De={SANITY:"sanity",I18N:"i18n",CONTEXT:"context"},Le="bookmark",Se="category",Te="fileName",Ie="screenshot",Ce="strings";class Ne{constructor(e){this.$driver=e}checkIfNullOrEmpty(e){return![null,"",void 0].includes(e)}getElement(){throw new Error("implementation is missing")}getElements(){throw new Error("implementation is missing")}getText(){throw new Error("implementation is missing")}getTitle(){throw new Error("implementation is missing")}getPlaceholderText(){throw new Error("implementation is missing")}getAltText(){throw new Error("implementation is missing")}getWidth(){throw new Error("implementation is missing")}getHeight(){throw new Error("implementation is missing")}getTagName(){throw new Error("implementation is missing")}getValue(){throw new Error("implementation is missing")}getLocation(){throw new Error("implementation is missing")}getElementDimension(){throw new Error("implementation is missing")}getElementID(){throw new Error("implementation is missing")}isElementDisplayed(){throw new Error("implementation is missing")}isElementPresent(){throw new Error("implementation is missing")}getElementString(){throw new Error("implementation is missing")}getElementStrings(){throw new Error("implementation is missing")}captureScreenshot(){throw new Error("implementation is missing")}getElementsCount(){throw new Error("implementation is missing")}switchIframe(){throw new Error("implementation is missing")}switchToParentframe(){throw new Error("implementation is missing")}pause(){throw new Error("implementation is missing")}onScreenStringHighlight(){throw new Error("implementation is missing")}checkIfIframeIsPresent(){throw new Error("implementation is missing")}checkIfIframeBodyIsEmpty(){throw new Error("implementation is missing")}printOnConsole(e){console.log(e)}}const xe=e=>ze(e)&&t(e).isDirectory(),Ee=e=>ze(e)&&t(e).isFile(),ze=e=>n(e),Me=(e,t=!0)=>{ze(e)&&xe(e)||(t&&Ze.debug(`Folder doesn't exists, creating [34m${e}[0m`),(e=>{!ze(e)&&a(e,{recursive:!0})})(e))},Pe=e=>Ee(e)?r(e,{encoding:"utf-8"}):"",$e=e=>xe(e)?i(e):[],Ae=(...e)=>d(...e),Re=(e,t,n="utf-8")=>s(e,t,{encoding:n}),Oe=e=>e.replace(/[^a-zA-Z0-9]+/g,"_");class _e{#e;#t;#n;#a;#r;#i;constructor({appName:e,reportTime:t,isContext:n,isSanity:a,defaultLocale:r,reportFolderTimestamp:i}){this.#e=e,this.#n=t,this.#a=n,this.#r=a,this.#t=r,this.#i=i}getAppName(){return this.#e}getReportTime(){return this.#n}isSanityRun(){return this.#r}isContextRun(){return this.#a}getDefaultLocale(){return this.#t}getDefaultLocale(){return this.#t}getReportFolderTimestamp(){return this.#i}}class ke{#s;$generatedContent;$type;constructor(e){this.$type=e}generate(e){this.#s=e,this.$generatedContent=this.buildContent()}export(e,t="report"){this.write(e,t,this.$generatedContent),Ze.info(`Exported consolidated I18n Verification ${this.$type} report in ${e}`)}write(e,t,n){throw new Error("should be implemented by child report classes")}buildContent(){throw new Error("should be implemented by child report classes")}getMetaInfo(){return{defaultLocale:this.#s.getDefaultLocale(),appName:this.#s.getAppName(),reportTime:this.#s.getReportTime(),isSanity:this.#s.isSanityRun(),isContext:this.#s.isContextRun(),reportFolderTimestamp:this.#s.getReportFolderTimestamp()}}}class je extends ke{constructor(){super(ve)}buildContent(){const e=this.getMetaInfo(),t=`var DataStore;\n // global functions\n function openImageViewer(imageSrc) {\n var imageView = document.getElementById('imageView');\n imageView.src = \`\${window.getProductUrl()}/\${imageSrc}\`;\n document.getElementById('imageViewer').style.display = 'block';\n }\n\n function closeImageViewer() {\n delete document.getElementById('imageView').src;\n document.getElementById('imageViewer').style.display = 'none';\n }\n\n //to dynamically show/hide header based upon query param: ?standalone=<true|false>\n window.getProductUrl = () => {\n if (window.productUrl) {\n return window.productUrl;\n } else {\n window.productUrl = \`\${window.location.protocol}//\${\n window.location.host\n }\${window.location.pathname.match(/^.+[^\\/report\\.html]/g)?.[0]}\`;\n return window.productUrl;\n }\n };\n const params = new URLSearchParams(location.href.match(/(\\?.*$)/g)?.[0]);\n if (params.size) {\n window.isStandaloneReport = params.get('standalone') === 'true';\n if(!window.isStandaloneReport) {\n const overview = document.getElementById('overview');\n if(overview) {\n overview.classList.add('--reduced-zoom');\n }\n }\n }\n ${(e=>`// DataStore\n (() => {\n // prepare appData and set DataStore\n var appData = {\n appName: '${e.appName}',\n defaultLocale: '${e.defaultLocale}',\n sanityRun: ${e.isSanity},\n contextRun: ${e.isContext},\n timeStamp: '${e.reportTime}',\n reportFolderTimestamp: '${e.reportFolderTimestamp}',\n metaData: {\n stats: {},\n statsByLocale: {}\n },\n stringsData: {},\n locales: [],\n hasRuntimeError: false\n };\n\n if (window.rawData) {\n for (const entry of Object.entries(window.rawData)) {\n const locale = entry[0];\n const stats = entry[1].metaData.stats;\n const stringsData = entry[1].stringsData;\n\n if (Object.keys(appData.metaData.stats).length) {\n for (const prop in stats) {\n appData.metaData.stats[prop] += stats[prop];\n }\n } else {\n appData.metaData.stats = {...stats};\n }\n\n appData.metaData.statsByLocale[locale] = stats;\n appData.stringsData[locale] = stringsData;\n }\n\n appData.locales = Object.keys(window.rawData);\n }\n else {\n appData.hasRuntimeError = true;\n }\n\n function SimpleDataStore() {\n this._getData = () => appData;\n\n this.ranSuccessfully = () => this.getLocales().length > 0;\n\n this.getTimestamp = () => this._getData().timeStamp;\n\n this.getAppName = () => this._getData().appName;\n\n this.isDefaultLocale = (locale) =>\n locale === this._getData().defaultLocale;\n\n this.getLocalesData = () => this._getData().stringsData || {};\n\n this.getLocales = () => this._getData().locales || [];\n\n this.getStatByLocale = (locale) =>\n this._getData().metaData.statsByLocale[locale] || {};\n\n this.getOverallStats = () => this._getData().metaData.stats || {};\n\n this.getDataByLocale = (locale) =>\n this._getData().stringsData[locale] || {};\n\n this.isSanityRun = () => this._getData().sanityRun;\n\n this.isContextRun = () => this._getData().contextRun;\n\n this.getReportFolderTimestamp = () => this._getData().reportFolderTimestamp;\n\n this.hasRuntimeError = () => this._getData().hasRuntimeError;\n }\n\n DataStore = new SimpleDataStore();\n })();`)(e)}\n (() => {\n // for sidebar menu\n // hide insights tab\n if(DataStore.hasRuntimeError() || !DataStore.ranSuccessfully() || DataStore.isContextRun()) {\n document.querySelector('.menu-item[data-page="insights"]')?.remove();\n }\n\n if(!DataStore.isContextRun()) {\n document.querySelector('#overview .context-info')?.remove();\n }\n\n const loadContent = (section, highlightMenu = false) => {\n if (highlightMenu) {\n document\n .querySelector('li[data-page="overview"]')\n ?.classList.add('selected');\n }\n\n const contents = document.querySelectorAll('.content');\n const wrapper = document.querySelector('.content-wrapper');\n\n contents.forEach((content) => {\n content.id !== section\n ? content.classList.remove('active')\n : content.classList.add('active');\n\n section === 'overview' &&\n window.persistOverviewCharts &&\n window.persistOverviewCharts();\n\n ['log', 'locale'].includes(section) ? wrapper.classList.add('--hide-overflow') : !DataStore.isContextRun() && wrapper.classList.remove('--hide-overflow');\n window.currentPage = section;\n });\n };\n\n document.addEventListener('DOMContentLoaded', function () {\n const createMenuItems = (() => {\n if(DataStore.isContextRun()) {\n return;\n }\n const ul = document.querySelector('.sidebar .submenu');\n const createListItems = (locale) => {\n const li = document.createElement('li');\n li.classList.add('sub-menu-item');\n li.dataset.locale = locale;\n\n const a = document.createElement('a');\n a.href = '#';\n a.textContent = locale;\n\n li.appendChild(a);\n return li;\n };\n\n for (const locale of DataStore.getLocales()) {\n ul.appendChild(createListItems(locale));\n }\n })();\n\n const menuItems = document.querySelectorAll('.menu-item'),\n submenuItems = document.querySelectorAll('.sub-menu-item');\n\n menuItems.forEach((item) => {\n item.addEventListener('click', function (event) {\n const selectedMenuItem = document.querySelector(\n '.menu-item.selected'\n ),\n selectedSubmenu = document.querySelector('.submenu.active'),\n page = item.dataset.page;\n\n if (selectedMenuItem) {\n selectedMenuItem.classList.remove('selected');\n }\n\n if (selectedSubmenu) {\n selectedSubmenu.classList.remove('active');\n }\n\n if (item.classList.contains('has-submenu')) {\n event.preventDefault();\n item.classList.add('selected');\n const submenu = item.querySelector('.submenu');\n submenu.classList.add('active');\n } else {\n item.classList.add('selected');\n }\n\n if (selectedSubmenu) {\n selectedSubmenu\n .querySelectorAll('.sub-menu-item')\n .forEach((submenuItem) => {\n submenuItem.textContent !== item.textContent &&\n submenuItem.classList.remove('selected');\n });\n }\n\n loadContent(page);\n });\n\n loadContent('overview', true);\n });\n\n submenuItems.forEach((sItem) => {\n sItem.addEventListener('click', function (event) {\n const selectedSubMenuItem = document.querySelector(\n '.sub-menu-item.selected'\n );\n event.preventDefault();\n event.stopPropagation();\n\n if (selectedSubMenuItem) {\n selectedSubMenuItem.classList.remove('selected');\n window.previousSelectedLocale =\n selectedSubMenuItem.dataset.locale;\n }\n\n sItem.classList.add('selected');\n loadContent('locale');\n });\n });\n\n // update footer info\n const footer = document.querySelector('.sidebar .footer');\n footer.textContent = \`\${new Date().getFullYear()} @ Zeesoft. All rights reserved.\`;\n\n // update project info\n document.querySelector(\n 'header .logo'\n ).innerHTML = \`zAutomate.AI | \${DataStore.getAppName()} [\${DataStore.isSanityRun() ? 'Quick Sanity' : DataStore.isContextRun() ? 'Context Creation' : 'I18n Verification'}]\`;\n document.querySelector(\n 'header .report-timestamp .info'\n ).innerHTML = \`Report generated at: \${DataStore.getTimestamp()}\`;\n });\n })();\n //overview content\n (() => {\n if (DataStore.hasRuntimeError()) {\n document.getElementById('overview').innerHtml =\n 'zAutomate.AI was unable to perform the operation. Please check the logs for more information.';\n return;\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n document.querySelectorAll('#overview .card')?.forEach((el) => {\n if(DataStore.isContextRun()) {\n if(!el.classList.contains('context-info')) {\n el.classList.add('--hidden');\n }\n }\n else if(el.classList.contains('context-info')) {\n el.classList.add('--hidden');\n }\n });\n\n let overviewChart,\n stringChart,\n dateTimeChart,\n numberChart,\n ignoredChart;\n\n window.persistOverviewCharts = () => {\n if(DataStore.isContextRun()) {\n return;\n }\n\n const reset = (chart) => {\n chart.resetSeries(true, true);\n };\n\n reset(overviewChart);\n reset(stringChart);\n reset(dateTimeChart);\n reset(numberChart);\n reset(ignoredChart);\n };\n\n if(DataStore.isContextRun()) {\n document.querySelector('.content-wrapper')?.classList.add('--hide-overflow');\n\n const info = document.querySelector('#overview .context-info .info');\n if(info) {\n info.innerHTML = \`\${window.isStandaloneReport ? 'Created' : 'Imported'} context screenshots for the locales \${DataStore.getLocales().map(locale => {\n const localeStats = DataStore.getStatByLocale(locale);\n return \`<strong>\${locale}</strong>(<em>\${localeStats?.context || 0} contexts</em>, <em>\${localeStats?.reviewed || 0} strings</em>)\`;\n }).join(', ')} with version <strong>\${DataStore.getReportFolderTimestamp()}</strong>.\`;\n }\n\n return;\n }\n\n renderOverallChart();\n renderStringChart();\n renderIgnoredChart();\n renderNumberChart();\n renderDatetimeChart();\n\n function renderOverallChart() {\n const overallStats = DataStore.getOverallStats();\n const reviewed = overallStats.reviewed;\n const locales = DataStore.getLocales().length;\n const type = {\n I18NED: 'Internationalized',\n NOT_I18NED: 'Not Internationalized',\n SKIPPED: 'Skipped'\n },\n valueMap = {\n [type.I18NED]:\n overallStats.localizedStrings +\n overallStats.partialStrings + // TODO: need to confirm\n overallStats.untranslatedStrings +\n overallStats.localizedDateTime +\n overallStats.localizedDate +\n overallStats.localizedTime +\n overallStats.localizedNumber +\n overallStats.localizedCurrency +\n overallStats.localizedPercentage,\n [type.NOT_I18NED]:\n overallStats.notLocalizedStrings +\n overallStats.notLocalizedDateTime +\n overallStats.notLocalizedDate +\n overallStats.notLocalizedTime +\n overallStats.notLocalizedNumber +\n overallStats.notLocalizedCurrency +\n overallStats.notLocalizedPercentage,\n [type.SKIPPED]:\n overallStats.dnt +\n overallStats.ignored +\n overallStats.autoIgnored +\n overallStats.userInput\n },\n percentageCalc = (value) => {\n const val = ((value / reviewed) * 100).toFixed(0);\n return isNaN(val) || !isFinite(val) ? 0 : val;\n };\n\n var options = {\n series: [\n {\n name: '',\n data: [\n percentageCalc(valueMap[type.I18NED]),\n percentageCalc(valueMap[type.NOT_I18NED]),\n percentageCalc(valueMap[type.SKIPPED])\n ]\n }\n ],\n chart: {\n type: 'bar',\n height: 200,\n toolbar: {\n show: false\n },\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n plotOptions: {\n bar: {\n horizontal: true,\n borderRadius: 3,\n dataLabels: {\n position: 'right'\n }\n }\n },\n title: {\n text: \`Total Reviewed strings in \${locales} locales: \${reviewed}\`,\n align: 'center',\n floating: true,\n style: {\n fontSize: '14px',\n fontWeight: 'bold'\n }\n },\n dataLabels: {\n enabled: true,\n style: {\n colors: ['#080404b0']\n },\n formatter: (val) => {\n return \`\${val}%\`;\n }\n },\n xaxis: {\n categories: [type.I18NED, type.NOT_I18NED, type.SKIPPED],\n min: 0,\n max: 100,\n labels: {\n formatter: (v) => \`\${v}%\`\n }\n },\n yaxis: {\n labels: {\n style: {\n fontSize: '13px'\n }\n }\n },\n colors: [\n (v) => {\n switch (v.dataPointIndex) {\n case 0:\n return '#31E994'; //green\n case 1:\n return '#ff8173'; //red\n case 2:\n return '#f5eb5f'; //yellow\n }\n }\n ],\n tooltip: {\n theme: 'dark',\n x: {\n formatter: (v) => \`Total Number of \${v} instances:\`\n },\n y: {\n formatter: function (v, { dataPointIndex }) {\n let count = 0;\n switch (dataPointIndex) {\n case 0:\n count = valueMap[type.I18NED];\n break;\n case 1:\n count = valueMap[type.NOT_I18NED];\n break;\n case 2:\n count = valueMap[type.SKIPPED];\n break;\n }\n return \`\${v}% (\${count} strings)\`;\n }\n }\n }\n };\n\n (overviewChart = new ApexCharts(\n document.querySelector('.overall-quality .graph'),\n options\n )).render();\n }\n\n function renderStringChart() {\n const overallStats = DataStore.getOverallStats();\n const type = {\n LOCALIZED: 'Localized',\n PARTIAL: 'Partially Localized',\n NOT_LOCALIZED: 'Not Localized',\n UNTRANSLATED: 'Untranslated',\n ENCODING: 'Encoding Issue',\n IGNORED: 'Ignored'\n },\n valueMap = {\n [type.LOCALIZED]: overallStats.localizedStrings,\n [type.PARTIAL]: overallStats.partialStrings,\n [type.NOT_LOCALIZED]: overallStats.notLocalizedStrings,\n [type.UNTRANSLATED]: overallStats.untranslatedStrings,\n [type.ENCODING]: overallStats.encoding,\n [type.IGNORED]:\n overallStats.dnt +\n overallStats.ignored +\n overallStats.autoIgnored +\n overallStats.userInput\n },\n total = Object.values(valueMap).reduce(\n (acc, curr) => acc + curr,\n 0\n ),\n data = [\n valueMap[type.LOCALIZED],\n valueMap[type.PARTIAL],\n valueMap[type.NOT_LOCALIZED],\n valueMap[type.IGNORED],\n valueMap[type.ENCODING],\n valueMap[type.UNTRANSLATED]\n ],\n options = {\n series:\n data.reduce((acc, curr) => acc + curr, 0) === 0 ? [] : data,\n chart: {\n width: 415,\n type: 'pie',\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n noData: {\n text: 'No metrics available',\n align: 'left',\n verticalAlign: 'middle',\n offsetX: 0,\n offsetY: -50,\n style: {\n fontSize: '14px'\n }\n },\n labels: [\n type.LOCALIZED,\n type.PARTIAL,\n type.NOT_LOCALIZED,\n type.IGNORED,\n type.ENCODING,\n type.UNTRANSLATED\n ],\n tooltip: {\n theme: 'dark',\n y: {\n formatter: function (v, { config, dataPointIndex }) {\n let count = 0,\n value = Number(\n (v /\n config.series.reduce((acc, curr) => acc + curr, 0)) *\n 100\n ).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n\n switch (dataPointIndex) {\n case 0:\n count = valueMap[type.LOCALIZED];\n break;\n case 1:\n count = valueMap[type.PARTIAL];\n break;\n case 2:\n count = valueMap[type.NOT_LOCALIZED];\n break;\n case 3:\n count = valueMap[type.IGNORED];\n break;\n case 4:\n count = valueMap[type.ENCODING];\n break;\n case 5:\n count = valueMap[type.UNTRANSLATED];\n break;\n }\n\n return \`\${value}% (\${count} strings)\`;\n },\n title: {\n formatter: function (a) {\n return \`Total Number of \${a} strings:\`;\n }\n }\n }\n },\n colors: [\n ({ seriesIndex, w }) => {\n const currType = w.config.labels[seriesIndex];\n\n switch (currType) {\n case type.LOCALIZED:\n return '#31E994';\n case type.NOT_LOCALIZED:\n return '#E44242';\n case type.PARTIAL:\n return '#DADF40';\n case type.UNTRANSLATED:\n return '#F44E9E';\n case type.IGNORED:\n return '#AFA6AB';\n case type.ENCODING:\n return '#3AD1F3';\n\n default:\n return '';\n }\n }\n ],\n legend: {\n offsetX: -50,\n width: 170,\n formatter: (seriesName, a, b, c) => {\n let value = ((valueMap[seriesName] / total) * 100).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n return \`\${seriesName} (\${value}%)\`;\n }\n },\n dataLabels: {\n formatter: (v) => \`\${Number(v).toFixed(0)}%\`,\n dropShadow: { enabled: false },\n style: {\n colors: ['#080404b0']\n }\n }\n };\n\n (stringChart = new ApexCharts(\n document.querySelector('.string-quality .graph'),\n options\n )).render();\n }\n\n function renderIgnoredChart() {\n const overallStats = DataStore.getOverallStats();\n const type = {\n DNT: 'DNT',\n IGNORED: 'Ignored',\n USER_INPUTS: 'User Inputs'\n },\n valueMap = {\n [type.DNT]: overallStats.dnt,\n [type.IGNORED]: overallStats.ignored + overallStats.autoIgnored,\n [type.USER_INPUTS]: overallStats.userInput\n },\n total = Object.values(valueMap).reduce(\n (acc, curr) => acc + curr,\n 0\n ),\n data = [\n valueMap[type.DNT],\n valueMap[type.IGNORED],\n valueMap[type.USER_INPUTS]\n ],\n options = {\n series:\n data.reduce((acc, curr) => acc + curr, 0) === 0 ? [] : data,\n chart: {\n width: 360,\n type: 'pie',\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n labels: [type.DNT, type.IGNORED, type.USER_INPUTS],\n tooltip: {\n theme: 'dark',\n y: {\n formatter: function (v, { config, dataPointIndex }) {\n let count = 0,\n value = Number(\n (v /\n config.series.reduce((acc, curr) => acc + curr, 0)) *\n 100\n ).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n\n switch (dataPointIndex) {\n case 0:\n count = valueMap[type.DNT];\n break;\n case 1:\n count = valueMap[type.IGNORED];\n break;\n case 2:\n count = valueMap[type.USER_INPUTS];\n break;\n }\n\n return \`\${value}% (\${count} strings)\`;\n },\n title: {\n formatter: function (a) {\n return \`Total Number of \${a} strings:\`;\n }\n }\n }\n },\n colors: [\n ({ seriesIndex, w }) => {\n const currType = w.config.labels[seriesIndex];\n\n switch (currType) {\n case type.DNT:\n return '#31E994';\n case type.IGNORED:\n return '#3AD1F3';\n case type.USER_INPUTS:\n return '#DADF40';\n\n default:\n return '';\n }\n }\n ],\n noData: {\n text: 'No metrics available',\n align: 'center',\n verticalAlign: 'middle',\n offsetX: -70,\n offsetY: -25,\n style: {\n fontSize: '14px'\n }\n },\n legend: {\n offsetX: -40,\n formatter: (seriesName) => {\n let value = ((valueMap[seriesName] / total) * 100).toFixed(0);\n value = isNaN(value) || !isFinite(value) ? 0 : value;\n return \`\${seriesName} (\${value}%)\`;\n }\n },\n dataLabels: {\n formatter: (v) => \`\${Number(v).toFixed(0)}%\`,\n style: {\n colors: ['#080404b0']\n },\n dropShadow: { enabled: false }\n }\n };\n\n (ignoredChart = new ApexCharts(\n document.querySelector('.skipped-items .graph'),\n options\n )).render();\n }\n\n function renderNumberChart() {\n const overallStats = DataStore.getOverallStats();\n const types = ['Number', 'Currency', 'Percentage'],\n data = {\n number_i18n: overallStats.localizedNumber,\n currency_i18n: overallStats.localizedCurrency,\n percentage_i18n: overallStats.localizedPercentage,\n number_not_i18n: overallStats.notLocalizedNumber,\n currency_not_i18n: overallStats.notLocalizedCurrency,\n percentage_not_i18n: overallStats.notLocalizedPercentage\n },\n total = Object.values(data).reduce((acc, curr) => acc + curr, 0),\n percentageCalc = (v, t) => {\n const val = ((v / t) * 100).toFixed(0);\n return isNaN(val) || !isFinite(val) ? 0 : val;\n },\n i18nPercentage = percentageCalc(\n data.number_i18n + data.percentage_i18n + data.currency_i18n,\n total\n ),\n nonI18nPercentage = percentageCalc(\n data.number_not_i18n +\n data.percentage_not_i18n +\n data.currency_not_i18n,\n total\n ),\n numberTotal = data.number_i18n + data.number_not_i18n,\n currencyTotal = data.currency_i18n + data.currency_not_i18n,\n percentageTotal = data.percentage_i18n + data.percentage_not_i18n,\n numberI18n = percentageCalc(data.number_i18n, numberTotal),\n currencyI18n = percentageCalc(data.currency_i18n, currencyTotal),\n percentageI18n = percentageCalc(\n data.percentage_i18n,\n currencyTotal\n ),\n numberNotI18n = percentageCalc(data.number_not_i18n, numberTotal),\n currencyNotI18n = percentageCalc(\n data.currency_not_i18n,\n currencyTotal\n ),\n percentageNotI18n = percentageCalc(\n data.percentage_not_i18n,\n currencyTotal\n ),\n options = {\n series: [\n {\n name: 'Internationalized',\n data: [numberI18n, currencyI18n, percentageI18n]\n },\n {\n name: 'Not Internationalized',\n data: [numberNotI18n, currencyNotI18n, percentageNotI18n]\n }\n ],\n chart: {\n type: 'bar',\n height: 220,\n width: 500,\n toolbar: {\n show: false\n },\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n dataLabels: {\n enabled: true,\n dropShadow: { enabled: false },\n style: {\n colors: ['#080404b0']\n },\n formatter: (val) => {\n return \`\${val}%\`;\n }\n },\n stroke: {\n show: true,\n width: 1,\n colors: ['#fff']\n },\n tooltip: {\n theme: 'dark',\n shared: true,\n intersect: false,\n x: {\n formatter: (type) => \`\${type} instances:\`\n },\n y: {\n formatter: (v, { seriesIndex, dataPointIndex }) => {\n const getI18nCount = (type) => {\n switch (type) {\n case 'number':\n return data.number_i18n;\n case 'currency':\n return data.currency_i18n;\n case 'percentage':\n return data.percentage_i18n;\n }\n },\n getNonI18nCount = (type) => {\n switch (type) {\n case 'number':\n return data.number_not_i18n;\n case 'currency':\n return data.currency_not_i18n;\n case 'percentage':\n return data.percentage_not_i18n;\n }\n },\n getCount = (type) => {\n return seriesIndex === 0\n ? getI18nCount(type)\n : getNonI18nCount(type);\n };\n\n switch (dataPointIndex) {\n case 0:\n return getCount('number');\n case 1:\n return getCount('currency');\n case 2:\n return getCount('percentage');\n }\n }\n }\n },\n xaxis: {\n categories: types\n },\n yaxis: {\n min: 0,\n max: 100,\n labels: {\n formatter: (v) => \`\${v}%\`\n }\n },\n colors: ['#31E994', '#ff8173'],\n legend: {\n offsetX: -13,\n position: 'right',\n formatter: (seriesName) => {\n if (seriesName === 'Internationalized') {\n return \`\${seriesName} (\${i18nPercentage}%)\`;\n }\n return \`\${seriesName} (\${nonI18nPercentage}%)\`;\n }\n },\n plotOptions: {\n bar: {\n borderRadius: 3,\n columnWidth: '85%'\n }\n }\n };\n\n (numberChart = new ApexCharts(\n document.querySelector('.number-quality .graph'),\n options\n )).render();\n }\n\n function renderDatetimeChart() {\n const overallStats = DataStore.getOverallStats();\n const types = ['Date', 'Time', 'DateTime'],\n data = {\n date_i18n: overallStats.localizedDate,\n time_i18n: overallStats.localizedTime,\n date_time_i18n: overallStats.localizedDateTime,\n date_not_i18n: overallStats.notLocalizedDate,\n time_not_i18n: overallStats.notLocalizedTime,\n date_time_not_i18n: overallStats.notLocalizedDateTime\n },\n total = Object.values(data).reduce((acc, curr) => acc + curr, 0),\n percentageCalc = (v, t) => {\n const val = ((v / t) * 100).toFixed(0);\n return isNaN(val) || !isFinite(val) ? 0 : val;\n },\n i18nPercentage = percentageCalc(\n data.date_i18n + data.time_i18n + data.date_time_i18n,\n total\n ),\n nonI18nPercentage = percentageCalc(\n data.date_not_i18n + data.time_not_i18n + data.date_time_not_i18n,\n total\n ),\n dateTotal = data.date_i18n + data.date_not_i18n,\n timeTotal = data.time_i18n + data.time_not_i18n,\n dateTimeTotal = data.date_time_i18n + data.date_time_not_i18n,\n dateI18n = percentageCalc(data.date_i18n, dateTotal),\n timeI18n = percentageCalc(data.time_i18n, timeTotal),\n dateTimeI18n = percentageCalc(data.date_time_i18n, dateTimeTotal),\n dateNotI18n = percentageCalc(data.date_not_i18n, dateTotal),\n timeNotI18n = percentageCalc(data.time_not_i18n, timeTotal),\n dateTimeNotI18n = percentageCalc(\n data.date_time_not_i18n,\n dateTimeTotal\n ),\n options = {\n series: [\n {\n name: 'Internationalized',\n data: [dateI18n, timeI18n, dateTimeI18n]\n },\n {\n name: 'Not Internationalized',\n data: [dateNotI18n, timeNotI18n, dateTimeNotI18n]\n }\n ],\n chart: {\n type: 'bar',\n height: 220,\n width: 500,\n toolbar: {\n show: false\n },\n animations: {\n enabled: true,\n easing: 'easeinout',\n speed: 800,\n animateGradually: {\n enabled: true,\n delay: 150\n },\n dynamicAnimation: {\n enabled: true,\n speed: 350\n }\n }\n },\n dataLabels: {\n enabled: true,\n dropShadow: { enabled: false },\n style: {\n colors: ['#080404b0']\n },\n formatter: (val) => {\n return \`\${val}%\`;\n }\n },\n stroke: {\n show: true,\n width: 1,\n colors: ['#fff']\n },\n tooltip: {\n theme: 'dark',\n shared: true,\n intersect: false,\n x: {\n formatter: (type) => \`\${type} instances:\`\n },\n y: {\n formatter: (v, { seriesIndex, dataPointIndex }) => {\n const getI18nCount = (type) => {\n switch (type) {\n case 'date':\n return data.date_i18n;\n case 'time':\n return data.time_i18n;\n case 'date_time':\n return data.date_time_i18n;\n }\n },\n getNonI18nCount = (type) => {\n switch (type) {\n case 'date':\n return data.date_not_i18n;\n case 'time':\n return data.time_not_i18n;\n case 'date_time':\n return data.date_time_not_i18n;\n }\n },\n getCount = (type) => {\n return seriesIndex === 0\n ? getI18nCount(type)\n : getNonI18nCount(type);\n };\n\n switch (dataPointIndex) {\n case 0:\n return getCount('date');\n case 1:\n return getCount('time');\n case 2:\n return getCount('date_time');\n }\n }\n }\n },\n xaxis: {\n categories: types\n },\n yaxis: {\n min: 0,\n max: 100,\n labels: {\n formatter: (v) => \`\${v}%\`\n }\n },\n colors: ['#31E994', '#ff8173'],\n legend: {\n offsetX: 4,\n position: 'right',\n formatter: (seriesName) => {\n if (seriesName === 'Internationalized') {\n return \`\${seriesName} (\${i18nPercentage}%)\`;\n }\n return \`\${seriesName} (\${nonI18nPercentage}%)\`;\n }\n },\n plotOptions: {\n bar: {\n borderRadius: 3,\n columnWidth: '85%'\n }\n }\n };\n\n (dateTimeChart = new ApexCharts(\n document.querySelector('.datetime-quality .graph'),\n options\n )).render();\n }\n });\n })();\n // insights content\n (() => {\n if (!DataStore.ranSuccessfully()) {\n document.getElementById('overview').innerHTML =\n 'Unable to prepare zQA automation report for the project.';\n return;\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n renderCards();\n\n // helper methods to generate cards and its sections\n function createStatSection(locale, data) {\n const holder = document.createElement('div');\n const table = document.createElement('table');\n const tbody = document.createElement('tbody');\n const name = document.createElement('div');\n const addRow = (name, value) => {\n const row = document.createElement('tr');\n\n const col1 = document.createElement('td');\n col1.classList.add('name');\n col1.textContent = name;\n\n const col2 = document.createElement('td');\n col2.classList.add('value');\n col2.textContent = value;\n\n row.appendChild(col1);\n row.appendChild(col2);\n return row;\n };\n\n if (DataStore.isSanityRun()) {\n tbody.appendChild(addRow('Pages viewed', data.reviewed));\n }\n else {\n const tableData = {\n 'Internationlized Strings':\n data.localizedStrings +\n data.untranslatedStrings +\n data.partialStrings,\n 'Not Internationlized Strings': data.notLocalizedStrings,\n 'Internationlized Numbers': data.localizedNumber,\n 'Not Internationlized Numbers': data.notLocalizedNumber,\n 'Internationlized Currency': data.localizedCurrency,\n 'Not Internationlized Currency': data.notLocalizedCurrency,\n 'Internationlized Percentage': data.localizedPercentage,\n 'Not Internationlized Percentage': data.notLocalizedPercentage,\n 'Internationlized Date': data.localizedDate,\n 'Not Internationlized Date': data.notLocalizedDate,\n 'Internationlized Time': data.localizedTime,\n 'Not Internationlized Time': data.notLocalizedTime,\n 'Internationlized DateTime': data.localizedDate,\n 'Not Internationlized DateTime': data.notLocalizedDateTime,\n 'Encoding Issue Strings': data.encoding,\n 'DNT Strings': data.dnt,\n 'Ignored Strings': data.ignored,\n 'Untranslated Strings': data.untranslatedStrings,\n 'Auto Ignored Strings': data.autoIgnored,\n 'User Input Strings': data.userInput,\n 'Total Reviewed': data.reviewed\n };\n\n for (const rowData of Object.entries(tableData)) {\n if (!DataStore.isSanityRun() || !DataStore.isDefaultLocale(locale) || rowData[0] !== 'Untranslated Strings') {\n tbody.appendChild(addRow(rowData[0], rowData[1]));\n }\n }\n }\n\n holder.classList.add('stat');\n name.classList.add('name');\n name.textContent = 'Summary';\n holder.append(name);\n\n table.appendChild(tbody);\n holder.appendChild(table);\n return holder;\n }\n\n function createStatusBarSection(locale, data) {\n const holder = document.createElement('div');\n holder.classList.add('status-bar');\n\n const generateBarEl = (name, total, current) => {\n const getColorClass = (value) => {\n if (value <= 25) {\n return 'red';\n } else if (value <= 50) {\n return 'yellow';\n } else if (value <= 75) {\n return 'blue';\n } else if (value <= 100) {\n return 'green';\n }\n };\n current = (current / total) * 100;\n current = isNaN(current) || !isFinite(current) ? 0 : current;\n const holder = document.createElement('div');\n holder.classList.add('bar-container');\n\n const nameHolder = document.createElement('div');\n nameHolder.classList.add('name');\n nameHolder.textContent = name;\n\n const barHolder = document.createElement('div');\n barHolder.classList.add('bar-holder');\n\n const bar = document.createElement('div');\n bar.classList.add('bar');\n bar.classList.add(\`--\${getColorClass(current)}\`);\n bar.style.width = \`\${current}%\`;\n bar.textContent = \`\${current.toFixed(0)}%\`;\n\n barHolder.appendChild(bar);\n holder.appendChild(nameHolder);\n holder.appendChild(barHolder);\n\n return holder;\n };\n\n const showFull = DataStore.isSanityRun() || DataStore.isDefaultLocale(locale),\n totalI18nCount = showFull\n ? 100\n : data.localizedStrings +\n data.untranslatedStrings +\n data.partialStrings +\n data.notLocalizedStrings,\n i18nStrings = showFull\n ? 100\n : data.localizedStrings +\n data.untranslatedStrings +\n data.partialStrings,\n totalLocCount = showFull\n ? 100\n : totalI18nCount -\n data.untranslatedStrings -\n data.notLocalizedStrings,\n totalNumberCount = showFull\n ? 100\n : data.localizedNumber +\n data.localizedCurrency +\n data.localizedPercentage +\n data.notLocalizedPercentage +\n data.notLocalizedCurrency +\n data.notLocalizedNumber,\n i18nNumbers = showFull\n ? 100\n : totalNumberCount -\n data.notLocalizedPercentage -\n data.notLocalizedCurrency -\n data.notLocalizedNumber,\n totalI18nDateTimeCount = showFull\n ? 100\n : data.localizedDate +\n data.localizedDateTime +\n data.localizedTime +\n data.notLocalizedDate +\n data.notLocalizedDateTime +\n data.notLocalizedTime,\n i18nDateTime = showFull\n ? 100\n : totalI18nDateTimeCount -\n data.notLocalizedDate -\n data.notLocalizedDateTime -\n data.notLocalizedTime;\n\n holder.appendChild(\n generateBarEl('String I18n level', totalI18nCount, i18nStrings)\n );\n\n holder.appendChild(\n generateBarEl('String L10n level', totalI18nCount, totalLocCount)\n );\n\n holder.appendChild(\n generateBarEl('Number I18n level', totalNumberCount, i18nNumbers)\n );\n\n holder.appendChild(\n generateBarEl(\n 'DateTime I18n level',\n totalI18nDateTimeCount,\n i18nDateTime\n )\n );\n return holder;\n }\n\n function generateCardContents(locale, data) {\n const cardContent = document.createElement('div');\n cardContent.classList.add('card-content');\n\n cardContent.appendChild(createStatusBarSection(locale, data));\n cardContent.appendChild(createStatSection(locale, data));\n return cardContent;\n }\n\n function createCardEl(locale, data) {\n const card = document.createElement('div');\n const title = document.createElement('div');\n card.classList.add('card');\n card.dataset.locale = locale;\n\n if(!window.isStandaloneReport) {\n card.classList.add('--reduced-zoom');\n }\n\n title.classList.add('title');\n title.textContent = \`\${locale} details\`;\n\n // fire menu selection event on clicking the card\n card.addEventListener('click', () => {\n const previousSelectedSubMenu = document.querySelector(\n '.sub-menu-item.selected'\n );\n if (previousSelectedSubMenu) {\n window.previousSelectedLocale =\n previousSelectedSubMenu.dataset.locale;\n }\n\n document\n .querySelector(\`.sub-menu-item[data-locale="\${locale}"]\`)\n .click();\n });\n\n card.appendChild(title);\n card.appendChild(generateCardContents(locale, data));\n return card;\n }\n\n function renderCards() {\n // read from global variable appData;\n const localeInfo = DataStore.getLocalesData();\n\n if (Object.keys(localeInfo).length) {\n const cardHolder = document.querySelector(\n '#insights .cards .holder'\n );\n for (const locale in localeInfo) {\n const cardEl = createCardEl(\n locale,\n DataStore.getStatByLocale(locale)\n );\n cardHolder.appendChild(cardEl);\n }\n }\n }\n });\n })();\n // locale grid\n (() => {\n if (!DataStore.ranSuccessfully()) {\n return;\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n let table;\n document.querySelectorAll('.sub-menu-item').forEach((menu) => {\n menu.addEventListener('click', (e) => {\n render(e.currentTarget.dataset.locale);\n });\n });\n\n const updateTitle = (locale) => {\n document.querySelector(\n '#locale .title'\n ).textContent = \`\${locale} \${DataStore.isSanityRun() ? 'Sanity Result' : 'I18n Coverage Details'}\`;\n };\n\n const buildGrid = (locale) => {\n const data = DataStore.getDataByLocale(locale) || {};\n $.fn.dataTable.ext.errMode = 'none';\n const dataSet = [];\n if(DataStore.isSanityRun()) {\n Object.entries(data).map((entry) =>\n entry[1].forEach(\n (v) =>\n dataSet.push([v.description, v.imagePath])\n )\n );\n }\n else {\n Object.entries(data).map((entry) =>\n entry[1].forEach(\n (v) =>\n (v.type !== 'REVIEWED') &&\n dataSet.push([entry[0], v.type, v.description, v.imagePath])\n )\n );\n }\n const containerHeight = document\n .querySelector('#locale')\n .getBoundingClientRect().height;\n const scrollHeight = (72 / 100) * containerHeight;\n table = new DataTable('#locale .coverage-info table', {\n language: {\n lengthMenu: "Show _MENU_ entries per page:"\n },\n columns: DataStore.isSanityRun() ?\n [\n { title: 'Page' },\n { title: 'Screenshot' },\n ] : [\n { title: 'String' },\n { title: 'Type' },\n { title: 'Page' },\n { title: 'Screenshot' }\n ],\n columnDefs: DataStore.isSanityRun() ?\n [\n {\n width: '80%',\n targets: 0\n },\n {\n width: '20%',\n targets: 1,\n orderable: false,\n searchable: false,\n data: null,\n render: function (data) {\n return \`<a href="#" class="view-screenshot-btn" onclick="openImageViewer('\${data[1]}')"><img title="View screenshot for '\${data[0]}'" class="view-screenshot-image"></img></a>\`;\n },\n className: 'dt-head-center dt-body-center'\n }\n ] :\n [\n {\n width: '44%',\n targets: 0\n },\n {\n width: '18%',\n targets: 1\n },\n {\n width: '18%',\n targets: 2\n },\n {\n width: '18%',\n targets: 3,\n orderable: false,\n searchable: false,\n data: null,\n render: function (data) {\n return \`<a href="#" class="view-screenshot-btn" onclick="openImageViewer('\${data[3]}')"><img title="View screenshot for '\${data[2]}'" class="view-screenshot-image"></img></a>\`;\n },\n className: 'dt-head-center dt-body-center'\n }\n ],\n data: dataSet,\n initComplete: function () {\n this.api()\n .columns()\n .every(function () {\n const column = this;\n\n if ((DataStore.isSanityRun() && column[0][0] === 1) || column[0][0] === 3) {\n return;\n }\n\n const select = $(\n '<select class="filter dt-input"><option value="">Filter By</option></select>'\n )\n .appendTo($(column.header()).before())\n .on('change', function () {\n const val = $.fn.dataTable.util.escapeRegex(\n $(this).val()\n );\n\n column\n .search(val ? '^' + val + '$' : '', true, false)\n .draw();\n })\n .on('click', function (e) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n });\n\n column\n .data()\n .unique()\n .sort()\n .each(function (d, j) {\n select.append(\n '<option value="' + d + '">' + d + '</option>'\n );\n });\n });\n },\n sScrollY: scrollHeight,\n pageLength: 25,\n lengthMenu: [10, 25, 50, 100]\n });\n };\n\n const render = (locale) => {\n if (table) {\n table.destroy();\n }\n updateTitle(locale);\n buildGrid(locale);\n };\n });\n })();\n\n // log content\n (() => {\n document.addEventListener('DOMContentLoaded', function () {\n const pre = document.querySelector('#log .log-content pre');\n pre.textContent = 'Loading...';\n document\n .querySelector('li[data-page="log"]')\n ?.addEventListener('click', (e) => {\n pre.textContent = window.logData || (DataStore.hasRuntimeError() ? 'We are facing internal issue. Please try again after sometime.' : 'No log data found!');\n });\n });\n })();`,n=[],a=Ae(Ye.getReportPath(),"logs","log"),r=It.isSanityRun(),i=It.getOptions()?.supportedLocales?.map((e=>Oe(e))),s=$e(Ye.getReportPath()).filter((e=>i.includes(e))),o=1===s.length&&s[0]===Oe(It.getDefaultLocale());let l="";if(s.forEach((t=>(t!==e.defaultLocale||t===e.defaultLocale&&o||r)&&Ee(Ae(Ye.getReportPath(),t,be))&&n.push(Ae(t,be).replace(/\\/g,"/")))),Ee(a)){const t=[e.appName,...It.getL10nReportsPath().split(/[\\/]+/g),It.getMode()];t.push(Ye.getReportTimeStamp()),l=Pe(a).replace(new RegExp(Ye.getReportPath().replace(/\\/g,"\\\\"),"g"),Ae(...t)).replace(/\\/g,"\\\\").replace(/`/g,"\\`")}return function({appName:e,reportTime:t,script:n,style:a,body:r,dataFilePaths:i=[],logData:s}){return`<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="charset" content="charset='UTF-8'" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <meta name="company" content="Zeesoft" />\n <meta name="product" content="zAutomate.AI" />\n <meta name="author" content="Jitendra Maheshwari" />\n <meta name="email" content="jm@zeesoft.com" />\n <meta\n name="description"\n content="zAutomate.AI report"\n />\n <title>${e} - zAutomate.AI report | ${t}</title>\n \x3c!-- 3rd party dependencies --\x3e\n <link\n rel="stylesheet"\n href="https://cdn.datatables.net/2.0.3/css/dataTables.dataTables.min.css"\n />\n ${i.map((e=>`<script\n src="${e}"\n type="text/javascript">\n <\/script>`)).join("")}\n ${s?`<script type="text/javascript" async/>window.logData = \`${s}\`;<\/script>`:""}\n <script\n src="https://code.jquery.com/jquery-3.7.1.slim.min.js"\n integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8="\n crossorigin="anonymous"\n defer\n ><\/script>\n <script src="https://cdn.jsdelivr.net/npm/apexcharts" defer><\/script>\n <script\n src="https://cdn.datatables.net/2.0.3/js/dataTables.min.js"\n defer\n ><\/script>\n <style>\n ${a}\n </style>\n </head>\n <body>\n ${r}\n </body>\n <script type="text/javascript" defer>\n ${n}\n <\/script>\n</html>\n`}({appName:e.appName,reportTime:e.reportTime,body:'<header><div class="logo">zAutomate.AI</div><div class="report-timestamp"><span class="info"></span></div></header>\n <main>\n <div class="sidebar">\n <ul class="menu" id="menu">\n <li class="menu-item" data-page="overview">\n <a href="#">Overview</a>\n </li>\n <li class="menu-item" data-page="log">\n <a href="#">View Log</a>\n </li>\n <li class="menu-item has-submenu" data-page="insights">\n <a href="#" data-page="insights">Insights</a>\n <ul class="submenu"></ul>\n </li>\n </ul>\n <div class="footer"></div>\n </div>\n <div class="content-wrapper">\n <div id="overview" class="content">\n <div class="context-info card">\n <span class="title">Context Creation Details</span>\n <p class="info"></p>\n </div>\n <div class="overall-quality card">\n <span class="title">Overall I18n Coverage</span>\n <div class="section">\n <div class="block">\n <article>\n <p class="desc">\n zI18n-Verify report provides a comprehensive information\n about the I18n and L10n quailty of your application.\n </p>\n <ul class="items">\n <li>\n <h4>Reviewed:</h4>\n <p class="detail">\n Total strings which are captured and processed by\n zI18n-Verify.\n </p>\n </li>\n <li>\n <h4>Internationlized:</h4>\n <p class="detail">\n Different types of value like string, number, date-time\n which are properly Internationalized.\n </p>\n </li>\n <li>\n <h4>Not Internationalized:</h4>\n <p class="detail">\n Values which are not Internationalized. Also includes\n Partially Localized strings and Encoding Issues.\n </p>\n </li>\n <li>\n <h4>Skipped:</h4>\n <p class="detail">\n Values which are skipped from processing because they\n are listed in DNT / Ignored lists or contains Auto\n Ignored pattern / User input pattern.\n </p>\n </li>\n </ul>\n </article>\n </div>\n <div class="block">\n <div class="graph"></div>\n </div>\n </div>\n </div>\n <div class="string-quality card">\n <span class="title">String Coverage</span>\n <div class="graph"></div>\n </div>\n <div class="skipped-items card">\n <span class="title">Skipped Items</span>\n <div class="graph"></div>\n </div>\n <div class="number-quality card">\n <span class="title">Number Coverage</span>\n <div class="graph"></div>\n </div>\n <div class="datetime-quality card">\n <span class="title">DateTime Coverage</span>\n <div class="graph"></div>\n </div>\n </div>\n <div id="log" class="content">\n <span class="title">Runtime log</span>\n <div class="log-content"><pre></pre></div>\n </div>\n <div id="insights" class="content">\n <div class="cards">\n <span class="title">Locale Quality</span>\n <div class="holder"></div>\n </div>\n </div>\n <div id="locale" class="content">\n <span class="title">Locale Quality</span>\n <div class="coverage-info">\n <table class="row-border hover order-column stripe"></table>\n </div>\n <div id="imageViewer" class="image-viewer">\n <span class="close-button" onclick="closeImageViewer()"\n >×</span\n >\n <div class="image-container">\n <img id="imageView" src="" alt="Image" />\n </div>\n </div>\n </div>\n </div>\n </main>',script:t,style:"html {\n width: 100vw;\n height: 100vh;\n }\n\n * {\n user-select: none;\n }\n\n body {\n width: 100%;\n height: 100%;\n margin: 0;\n display: flex;\n flex-direction: column;\n font-family: Arial, sans-serif;\n font-family: 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased; /* Webkit-based browsers */\n -moz-osx-font-smoothing: grayscale; /* Firefox on OS X */\n font-smooth: always; /* Non-standard, some browsers */\n }\n\n header {\n background-color: #333;\n height: 8%;\n display: flex;\n }\n\n main {\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 92%\n }\n\n .sidebar {\n width: 16%;\n height: 100%;\n background-color: #333;\n color: #fff;\n padding: 20px;\n box-sizing: border-box;\n float: left;\n }\n\n .logo {\n flex-grow: 1;\n align-content: center;\n margin-left: 2%;\n color: #14cf96;\n font-weight: bold;\n font-size: 1.4em;\n }\n\n .report-timestamp {\n flex-grow: 1;\n height: 100%;\n align-content: center;\n margin-right: 2%;\n }\n\n .report-timestamp .info {\n float: right;\n font-size: 1.1rem;\n color: #90a3a9;\n }\n\n .menu {\n list-style-type: none;\n padding: 0;\n margin: 0;\n }\n\n .menu-item {\n margin-bottom: 10px;\n }\n\n .menu-item a {\n color: #fff;\n text-decoration: none;\n display: block;\n padding: 10px;\n border-radius: 5px;\n font-size: 1.05rem;\n }\n\n .menu-item a:hover {\n background-color: #555;\n }\n\n .submenu {\n display: none;\n list-style-type: none;\n padding-left: 20px;\n }\n\n .menu-item.has-submenu > a::after {\n content: '⯆';\n float: right;\n margin-left: 5px;\n }\n\n .menu-item.has-submenu.selected > a::after {\n content: '⯅';\n float: right;\n margin-left: 5px;\n }\n\n .menu-item.selected > a {\n background-color: #555;\n }\n\n .submenu .sub-menu-item {\n margin: 3px auto;\n }\n\n .submenu .sub-menu-item a:hover {\n background-color: #777;\n }\n\n .submenu .sub-menu-item.selected a {\n background-color: #555 !important;\n }\n\n .submenu.active {\n display: block !important;\n }\n\n .view-screenshot-image {\n width: 100px;\n height: 30px;\n content: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgZmlsbD0iIzAwMDAwMCIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIA0KCSB2aWV3Qm94PSIwIDAgNDkwIDQ5MCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMjQ1LjIwNCwxMDEuMjY3QzY3LjE3MSwxMDEuMjY3LDAsMjQ1LDAsMjQ1czY2Ljc2MywxNDMuNzMzLDI0NC43OTYsMTQzLjczM0M0MjIuODI5LDM4OC43MzMsNDkwLDI0NSw0OTAsMjQ1DQoJCVM0MjMuMjM4LDEwMS4yNjcsMjQ1LjIwNCwxMDEuMjY3eiBNMjQ0Ljc5NiwzNzMuNDIxYy0xNDYuMzkzLDAtMjEyLjM2Ny0xMDEuMDUzLTIyNy41MDYtMTI4LjMzMw0KCQljMTUuMjQ5LTI2Ljc5Niw4Mi43MzMtMTI4LjUwOCwyMjcuOTE0LTEyOC41MDhjMTQ2LjUxNCwwLDIxMi40NzUsMTAxLjIyLDIyNy41NDMsMTI4LjQNCgkJQzQ1Ny41NzgsMjcyLjIwMywzOTEuMzEzLDM3My40MjEsMjQ0Ljc5NiwzNzMuNDIxeiIvPg0KCTxwYXRoIGQ9Ik0yNDUuMDAzLDE0Ni4xMjRjLTU0LjUyMSwwLTk4Ljg4MSw0NC4zNTItOTguODgxLDk4Ljg3M2MwLDU0LjUyMSw0NC4zNiw5OC44ODEsOTguODgxLDk4Ljg4MXM5OC44NzMtNDQuMzYsOTguODczLTk4Ljg4MQ0KCQlDMzQzLjg3NiwxOTAuNDc3LDI5OS41MjQsMTQ2LjEyNCwyNDUuMDAzLDE0Ni4xMjR6IE0yNDUuMDAzLDMyOC41NjZjLTQ2LjA4LDAtODMuNTY4LTM3LjQ4OS04My41NjgtODMuNTY4DQoJCWMwLTQ2LjA3MiwzNy40ODktODMuNTYxLDgzLjU2OC04My41NjFjNDYuMDcyLDAsODMuNTYxLDM3LjQ4OSw4My41NjEsODMuNTYxQzMyOC41NjQsMjkxLjA3NywyOTEuMDc1LDMyOC41NjYsMjQ1LjAwMywzMjguNTY2eiIvPg0KCTxwYXRoIGQ9Ik0yNDUuMDAzLDE3NS41ODNjLTM4LjI4MSwwLTY5LjQyMiwzMS4xNDEtNjkuNDIyLDY5LjQxNWMwLDM4LjI3NCwzMS4xNDEsNjkuNDE1LDY5LjQyMiw2OS40MTUNCgkJYzM4LjI3NCwwLDY5LjQxNS0zMS4xNDEsNjkuNDE1LTY5LjQxNUMzMTQuNDE3LDIwNi43MjQsMjgzLjI3NywxNzUuNTgzLDI0NS4wMDMsMTc1LjU4M3ogTTI0NS4wMDMsMjk5LjENCgkJYy0yOS44MzMsMC01NC4xMS0yNC4yNy01NC4xMS01NC4xMDJjMC0yOS44MzIsMjQuMjc3LTU0LjEwMiw1NC4xMS01NC4xMDJzNTQuMTAyLDI0LjI3LDU0LjEwMiw1NC4xMDINCgkJQzI5OS4xMDUsMjc0LjgzLDI3NC44MzUsMjk5LjEsMjQ1LjAwMywyOTkuMXoiLz4NCgk8cGF0aCBkPSJNMjQ1LjAwMywyMDYuNjc5Yy0yMS4xMywwLTM4LjMyNiwxNy4xODktMzguMzI2LDM4LjMxOWMwLDIxLjEyOSwxNy4xOTcsMzguMzI2LDM4LjMyNiwzOC4zMjZzMzguMzE5LTE3LjE5NywzOC4zMTktMzguMzI2DQoJCUMyODMuMzIxLDIyMy44NjgsMjY2LjEzMiwyMDYuNjc5LDI0NS4wMDMsMjA2LjY3OXogTTI0NS4wMDMsMjY4LjAxMWMtMTIuNjg4LDAtMjMuMDE0LTEwLjMyNi0yMy4wMTQtMjMuMDE0DQoJCWMwLTEyLjY4OCwxMC4zMjUtMjMuMDA2LDIzLjAxNC0yMy4wMDZjMTIuNjg4LDAsMjMuMDA2LDEwLjMxOCwyMy4wMDYsMjMuMDA2QzI2OC4wMDksMjU3LjY4NiwyNTcuNjkxLDI2OC4wMTEsMjQ1LjAwMywyNjguMDExeiIvPg0KPC9nPg0KPC9zdmc+);\n }\n\n .content-wrapper {\n padding: 1%;\n float: left;\n width: 84%;\n background-color: #f4f4f4;\n overflow: hidden;\n overflow-y: auto;\n height: 96%;\n }\n\n .content {\n display: none;\n }\n\n .content .title {\n font-size: 1rem;\n color: #080404e2;\n font-weight: 600;\n }\n\n .content .title::after {\n content: ':';\n }\n\n .content.active {\n display: flex !important;\n flex-direction: column;\n gap: 0.9rem;\n flex-wrap: wrap;\n transition: all 2s ease-in-out;\n }\n\n .sidebar .footer {\n bottom: 1.5%;\n position: absolute;\n font-size: 0.8rem;\n color: #14cf96;\n font-family: system-ui;\n }\n\n #overview {\n flex-direction: row;\n justify-content: space-between;\n }\n\n #overview .card {\n display: flex;\n flex-direction: column;\n width: 25rem;\n height: 12.5rem;\n border: 1px solid #ddd;\n box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n background: white;\n padding: 1rem;\n }\n\n #overview .overall-quality {\n height: 20rem;\n flex-basis: 100%;\n line-height: 14px;\n }\n\n #overview .overall-quality .section {\n display: flex;\n flex-direction: row;\n }\n\n #overview .overall-quality .section .block {\n width: 50%;\n }\n\n #overview .overall-quality .section .block article {\n padding: 5px;\n }\n\n #overview .overall-quality .section .block article p.desc {\n font-size: 0.9em;\n }\n\n #overview .overall-quality .section .block article .items li {\n font-size: 0.87em;\n }\n\n #overview .overall-quality .section .block article .items li .detail {\n margin-top: -10px;\n }\n\n #overview .overall-quality .section .block .graph {\n margin-top: 1.5em;\n }\n\n #overview .string-quality,\n #overview .number-quality,\n #overview .datetime-quality,\n #overview .skipped-items {\n flex-basis: 45%;\n }\n\n #overview .string-quality .graph,\n #overview .number-quality .graph,\n #overview .datetime-quality .graph,\n #overview .skipped-items .graph {\n align-self: center;\n }\n\n #overview .string-quality .graph {\n margin-left: 4rem;\n }\n\n #overview .number-quality.card,\n #overview .datetime-quality.card {\n height: 13rem;\n }\n\n #overview .number-quality .graph,\n #overview .datetime-quality .graph {\n margin-top: -0.9rem;\n margin-left: 4.5rem;\n }\n\n #overview .context-info {\n width: 100%;\n height: 90vh;\n }\n\n #insights .cards {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n }\n\n #insights .cards .holder {\n display: flex;\n flex-direction: row;\n gap: 1.5rem;\n flex-wrap: wrap;\n }\n\n #insights .cards .card {\n display: flex;\n flex-direction: column;\n width: 20rem;\n min-height: 10rem;\n border: 1px solid #ddd;\n box-shadow: 0 22px 35px -16px rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n background: white;\n }\n\n #insights .cards .card:hover {\n transform: scale(1.015);\n box-shadow: 0 22px 35px -16px #07ff7d33;\n cursor: pointer;\n transition: all 0.1s ease-in-out;\n }\n\n #insights .cards .card .title {\n height: 2.5rem;\n font-size: 1rem;\n padding-top: 1rem;\n font-weight: 500;\n width: calc(100% - 1rem);\n background: #0c5ad9d6;\n border-top-left-radius: 5px;\n border-top-right-radius: 5px;\n padding-left: 1rem;\n color: white;\n }\n\n #insights .cards .card .title::after {\n content: '';\n }\n\n #insights .cards .card .card-content {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n padding: 1rem;\n }\n\n #insights .cards .card .status-bar {\n display: flex;\n flex-direction: column;\n gap: 0.8rem;\n }\n\n #insights .cards .card .status-bar .bar-container .name {\n font-size: 0.78rem;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n #insights .cards .card .status-bar .bar-container .name::after {\n content: ':';\n }\n\n #insights .cards .card .status-bar .bar-container .bar-holder {\n width: 100%;\n height: 10px;\n border: 1px solid #00000038;\n border-radius: 2px;\n }\n\n #insights .cards .card .status-bar .bar-container .bar-holder .bar {\n height: 100%;\n font-size: 0.63rem;\n text-align: right;\n color: rgb(0, 0, 0);\n }\n\n .bar.--green {\n background-color: #1dedaf;\n }\n\n .bar.--red {\n background-color: #fe3e3e;\n }\n\n .bar.--yellow {\n background-color: #faef1f;\n }\n\n .bar.--blue {\n background-color: #77c2ff;\n }\n\n #insights .cards .card .stat {\n display: flex;\n flex-direction: column;\n gap: 0.3rem;\n border: 0.5px solid #00000012;\n border-radius: 6px;\n }\n\n #insights .cards .card .stat table td {\n font-size: 0.78rem;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n #insights .cards .card .stat table td.name {\n width: 70%;\n }\n\n #insights .cards .card .stat table td.value::before {\n content: ': ';\n }\n\n #locale {\n background: white;\n padding: 12px;\n border-radius: 5px;\n padding-top: 20px;\n height: 96%;\n flex-direction: row;\n }\n\n #locale .title {\n content: ':';\n }\n\n #locale .coverage-info {\n margin-top: 0.6rem;\n width: 100%;\n max-height: 94%;\n padding-right: 1rem;\n padding-left: 0.1rem;\n }\n\n #locale table thead th select.filter {\n margin-left: 1rem;\n max-width: 8rem;\n text-overflow: ellipsis;\n }\n\n #locale .image-viewer {\n display: none;\n position: fixed;\n z-index: 9999;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n text-align: center;\n }\n\n #locale .image-container {\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n display: inline-block;\n }\n\n #locale .image-viewer img {\n max-width: 90%;\n max-height: 90%;\n }\n\n #locale .close-button {\n position: absolute;\n top: 0.5rem;\n right: 1rem;\n color: #ffffffbf;\n font-size: 3.1rem;\n cursor: pointer;\n z-index: 9999;\n }\n\n #locale .close-button:hover {\n color: white;\n }\n\n #locale table tbody td {\n font-size: 0.9em;\n }\n\n #locale table td .view-screenshot-btn {\n color: blue;\n }\n\n @media (max-width: 768px) {\n .sidebar {\n width: 16rem;\n padding: 10px;\n }\n }\n\n .--hidden {\n display: none;\n visibility: hidden;\n }\n\n #log .log-content {\n width: 98%;\n height: 80vh;\n background: white;\n border-radius: 3px;\n overflow: hidden;\n padding: 1em;\n }\n\n #log .log-content pre {\n height: 100%;\n white-space: pre-line;\n word-break: break-all;\n padding: 0;\n margin: 0;\n width: 100%;\n overflow: hidden;\n overflow-y: auto;\n user-select: all;\n }\n\n .--reduced-zoom {\n zoom: 0.9123;\n }\n \n .--hide-overflow {\n overflow: hidden;\n }",dataFilePaths:n,logData:l})}write(e,t,n){Re(Ae(e,`${t}.html`),n,"utf-8")}}class Ue extends ke{#o;#l=!1;static#c="STATUS";static#d="COUNTS";constructor(){super(we),this.#u()}#u(){this.#o=new h({style:{headerTop:{left:"[94m╔[0m",mid:"[94m╦[0m",right:"[94m╗[0m",other:"[94m═"},headerBottom:{left:"[94m╟[0m",mid:"[94m╬[0m",right:"[94m╢[0m",other:"[94m═"},tableBottom:{left:"[94m╚[0m",mid:"[94m╩[0m",right:"[94m╝[0m",other:"[94m═[0m"},vertical:"[94m║[0m"},columns:[{name:Ue.#c,alignment:"left"},{name:Ue.#d,alignment:"center"}]})}buildContent(){if(ce[le]>0){this.#l=!0;for(const e in ce)e!==le?ce.hasOwnProperty(e)&&this.#o.addRows([{STATUS:e,COUNTS:`${ce[e]}`}]):(this.#o.addRows([{STATUS:"[94m"+"═".repeat(28)+"[0m",COUNTS:"[94m"+"═".repeat(8)+"[0m"}]),this.#o.addRows([{STATUS:"OVERALL_REVIEWED",COUNTS:`${ce[e]}`}]))}}export(){this.#l?this.#o.printTable():Ze.info("There are no visbile elements with UI strings")}}class Fe{static#g(e){switch(e){case ve:return new je;case we:return new Ue;default:throw new Error("unsupported report type requested")}}static export(e,t,n){const a=Fe.#g(e),r=new _e({appName:It.getAppName(),reportTime:(new Date).toLocaleString(),isContext:It.isContextRun(),isSanity:It.isSanityRun(),defaultLocale:It.getDefaultLocale(),reportFolderTimestamp:Ye.getReportTimeStamp()});a.generate(r),a.export(t,n)}}class Be{static#h;static#p;static init(){Be.#p=Ae(Ye.getReportPath(),Oe(It.getLocale())),Be.#h=Ae(Be.#p,be),this.#m()}static exists(){return Ee(Be.#h)}static save(e){this.#m();const t=`!window.rawData && (window.rawData={'${It.getLocale()}':{}});window.rawData['${It.getLocale()}']=${JSON.stringify(e)};`;Re(Be.#h,t)}static getData(){if(!this.exists())return{};try{return JSON.parse(Pe(Be.#h).replace(new RegExp(`(\\!window.rawData && \\(window\\.rawData=\\{'${It.getLocale()}':\\{\\}\\}\\);window\\.rawData\\['${It.getLocale()}'\\]=)|(;$)`,"g"),""))}catch(e){return{}}}static#m(){Me(Be.#p)}static getCacheDirPath(){return Be.#p}}class Ge{#f;#y;#v;#w;#b;#D;#L;#S;#T;#I;#C;#N;#x;#E;#z;#M;#P;#$;#A;#R;#O;#_;#k;#j;#U;constructor(e={}){this.#f=e?.localizedStrings||0,this.#y=e?.notLocalizedStrings||0,this.#v=e?.untranslatedStrings||0,this.#w=e?.partialStrings||0,this.#b=e?.localizedDateTime||0,this.#D=e?.localizedDate||0,this.#L=e?.localizedTime||0,this.#S=e?.notLocalizedDateTime||0,this.#T=e?.notLocalizedDate||0,this.#I=e?.notLocalizedTime||0,this.#C=e?.localizedNumber||0,this.#N=e?.notLocalizedNumber||0,this.#x=e?.localizedCurrency||0,this.#E=e?.notLocalizedCurrency||0,this.#z=e?.localizedPercentage||0,this.#M=e?.notLocalizedPercentage||0,this.#P=e?.ignored||0,this.#$=e?.dnt||0,this.#A=e?.autoIgnored||0,this.#R=e?.userInput||0,this.#O=e?.encoding||0,this.#_=e?.truncation||0,this.#k=e?.overlapping||0,this.#j=e?.reviewed||0,this.#U=e?.context||0}getLocalizedStrings(){return this.#f}setLocalizedStrings(e){this.#f=e}getUntranslatedStrings(){return this.#v}setUntranslatedStrings(e){this.#v=e}getNotLocalizedStrings(){return this.#y}setNotLocalizedStrings(e){this.#y=e}getPartialStrings(){return this.#w}setPartialStrings(e){this.#w=e}getLocalizedDateTime(){return this.#b}setLocalizedDateTime(e){this.#b=e}getLocalizedDate(){return this.#D}setLocalizedDate(e){this.#D=e}getLocalizedTime(){return this.#L}setLocalizedTime(e){this.#L=e}getNotLocalizedDateTime(){return this.#S}setNotLocalizedDateTime(e){this.#S=e}getNotLocalizedDate(){return this.#T}setNotLocalizedDate(e){this.#T=e}getNotLocalizedTime(){return this.#I}setNotLocalizedTime(e){this.#I=e}getLocalizedNumber(){return this.#C}setLocalizedNumber(e){this.#C=e}getNotLocalizeNumber(){return this.#N}setNotLocalizeNumber(e){this.#N=e}getCurrency(){return this.#x}setCurrency(e){this.#x=e}getNotLocalizeCurrency(){return this.#E}setNotLocalizeCurrency(e){this.#E=e}getPercentage(){return this.#z}setPercentage(e){this.#z=e}getNotLocalizePercentage(){return this.#M}setNotLocalizePercentage(e){this.#M=e}getIgnored(){return this.#P}setIgnored(e){this.#P=e}getUserInput(){return this.#R}setUserInput(e){this.#R=e}getDnt(){return this.#$}setDnt(e){this.#$=e}getAutoIgnored(){return this.#A}setAutoIgnored(e){this.#A=e}getEncoding(){return this.#O}setEncoding(e){this.#O=e}getTruncation(){return this.#_}setTruncation(e){this.#_=e}getOverlapping(){return this.#k}setOverlapping(e){this.#k=e}getReviewed(){return this.#j}setReviewed(e){this.#j=e}getContext(){return this.#U}setContext(e){this.#U=e}incrementByType(e){switch(e){case j:++this.#f;break;case H:++this.#y;break;case ie:++this.#v;break;case U:++this.#w;break;case se:++this.#A;break;case re:++this.#P;break;case ae:++this.#$;break;case ne:++this.#O;break;case V:++this.#D;break;case q:++this.#L;break;case Q:++this.#b;break;case J:++this.#T;break;case X:++this.#I;break;case K:++this.#S;break;case F:++this.#C;break;case Y:++this.#N;break;case B:++this.#x;break;case Z:++this.#E;break;case G:++this.#z;break;case W:++this.#M;break;case ee:++this.#_;break;case te:++this.#k;break;case le:++this.#j;break;case oe:++this.#R;break;case"context":++this.#U}}toJSON(){return{localizedStrings:this.#f,notLocalizedStrings:this.#y,untranslatedStrings:this.#v,partialStrings:this.#w,localizedDateTime:this.#b,localizedDate:this.#D,localizedTime:this.#L,notLocalizedDateTime:this.#S,notLocalizedDate:this.#T,notLocalizedTime:this.#I,localizedNumber:this.#C,notLocalizedNumber:this.#N,localizedCurrency:this.#x,notLocalizedCurrency:this.#E,localizedPercentage:this.#z,notLocalizedPercentage:this.#M,ignored:this.#P,dnt:this.#$,autoIgnored:this.#A,userInput:this.#R,encoding:this.#O,truncation:this.#_,overlapping:this.#k,reviewed:this.#j,context:this.#U}}}class Ve{#F;constructor(e={}){this.#F=new Ge(e.stats)}getStats(){return this.#F}setStats(e){this.#F=e}toJSON(){return{stats:this.#F}}}class qe{#B;#G;#V;constructor(e){this.#B=e?.type||"",this.#G=e?.imagePath||"",this.#V=e?.description||""}getType(){return this.#B}setType(e){this.#B=e}getImagePath(){return this.#G}setImagePath(e){this.#G=e}getDescription(){return this.#V}setDescription(e){this.#V=e}toJSON(){return{type:this.#B,description:this.#V,imagePath:this.#G}}}class Qe{#q={};constructor(e){if(e)for(const t in e)e[t].forEach((e=>{this.#q[t]||(this.#q[t]=[]),this.#q[t].push(new qe(e))}))}getStringData(e){return this.#q[e]||[]}setStringData(e,t){return!this.#q[e]&&(this.#q[e]=[]),this.#q[e].push(new qe(t)),!0}checkAndAdd(e,t){!this.#q[e]&&(this.#q[e]=[]);const n=this.getStringData(e).some((e=>e.getDescription()!==t.description||e.getImagePath()!==t.imagePath||e.getType()!==e.type));return n&&this.setStringData(e,t),n}hasStringData(e){return e in this.#q}static createNew(e,t){return t=Array.isArray(t)?t:[t],new Qe({data:{[e]:t}})}toJSON(){return this.#q}}class He{#Q;#H;constructor(e={}){this.#Q=new Ve(e.metaData),this.#H=new Qe(e.stringsData)}getMetaData(){return this.#Q}setMetaData(e){this.#Q=e}getStringEntry(e){return this.#H.getStringData(e)}static addString(e,t,n,a){const r=He.getInstance(),i=r.#Y(e,t,n,a.replace(/\\/g,"/"));return i&&r.save(),i}#Y(e,t,n,a){let r=!1;const i={type:t,description:n,imagePath:a};return r=this.#H.hasStringData(e)?this.#H.checkAndAdd(e,i):this.#H.setStringData(e,i),r&&this.#Q.getStats().incrementByType(t),r}static incrementCountByType(e){const t=He.getInstance();t.#Q.getStats().incrementByType(e),t.save()}toJSON(){return{metaData:this.#Q,stringsData:this.#H}}save(){Be.save(this)}remove(){Be.delete()}static getInstance(){return new He(Be.getData())}}class Ye{static#Z;static#W;static setup(){Ye.#W=Ye.#J();const e=c.resolve();Ye.#Z=Ae(e,It.getL10nReportsPath(),It.getMode(),Ye.#W)}static getReportTimeStamp(){return Ye.#W}static getReportPath(){return Ye.#Z}static reviewedReports(e=null,t=null){return Ye.#X(le,e,t)}static getContextPath(){return this.#K()}static[j](e,t){return Ye.#X(j,e,t)}static[H](e,t){return Ye.#X(H,e,t)}static[U](e,t){return Ye.#X(U,e,t)}static[ae](e,t){return Ye.#X(ae,e,t)}static[re](e,t){return Ye.#X(re,e,t)}static[se](e,t){return Ye.#X(se,e,t)}static[ie](e,t){return Ye.#X(ie,e,t)}static[ne](e,t){return Ye.#X(ne,e,t)}static[Q](e,t){return Ye.#X(Q,e,t)}static[K](e,t){return Ye.#X(K,e,t)}static[V](e,t){return Ye.#X(V,e,t)}static[J](e,t){return Ye.#X(J,e,t)}static[q](e,t){return Ye.#X(q,e,t)}static[X](e,t){return Ye.#X(X,e,t)}static[B](e,t){return Ye.#X(B,e,t)}static[Z](e,t){return Ye.#X(Z,e,t)}static[G](e,t){return Ye.#X(G,e,t)}static[W](e,t){return Ye.#X(W,e,t)}static[F](e,t){return Ye.#X(F,e,t)}static[Y](e,t){return Ye.#X(Y,e,t)}static incrementCount(e,t,n,a){ce.hasOwnProperty(e)&&(ce[e]++,He.addString(t,e,a,n.replace(Ye.#Z,"")))}static#J(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}-${String(e.getHours()).padStart(2,"0")}-${String(e.getMinutes()).padStart(2,"0")}`}static#X=(e,t,n)=>{const a=Ae(Ye.#Z,Oe(It.getLocale()),"screenshots",String(e).toLowerCase());Me(a,me);const r=Ae(Ye.#Z,Oe(It.getLocale()),"strings");if(Me(r,me),null!=t){let a="";if(ze(Ae(r,e+".txt"))){Pe(Ae(r,e+".txt")).includes(n)||(a+=`\n|<<<<<<<<<<<<<------${n}------\x3e>>>>>>>>>>>>|\n`),a+=t}else a+=`\n|<<<<<<<<<<<<<------${n}------\x3e>>>>>>>>>>>>|\n`,a+=t;((e,t,n="utf-8")=>{if(e&&t)try{o(e,t+"\n",{encoding:n,flag:"a"})}catch(e){Ze.error(e)}})(Ae(r,e+".txt"),a)}return a};static#K=()=>{const e=Ae(Ye.#Z,Oe(It.getLocale()),"contexts");return Me(e,me),e};static#ee(e){Fe.export(e,Ye.#Z)}static generateHtml(){Ye.#ee(ve)}static generateAsciiTable(){Ye.#ee(we)}}class Ze{static#te=!1;static#ne;static#ae=[];static info(e){Ze.#re("info",e)}static warn(e){Ze.#re("warn",e)}static error(e,t){Ze.#re("errr",e,t)}static debug(e){Ze.#re("dbug",e)}static#re(e,t,n=""){const a={INFO:"[37m",WARN:"[33m",ERRR:"[31m",DBUG:"[34m"};let r=a[e=e.toUpperCase()]||a.DEFAULT;n=n?` reason: ${n.toString()}`:"";let i=`[${(new Date).toLocaleString()}] [${r}${e}[0m] [${It.getLocale()}] - ${t}${n}`;switch(e){case"INFO":console.info(i);break;case"WARN":console.warn(i);break;case"ERRR":console.error(i);break;case"DBUG":console.debug(i);break;default:console.log(i)}i=i.replace(/\x1b\[\d+m/g,""),Ze.#ie(`${i}\n`)}static#ie=t=>{if(Ze.#te)Ze.#ae.push(t),Ze.#ne=setInterval((()=>{Ze.#te||(clearInterval(Ze.#ne),t=Ze.#ae.join("\n"),Ze.#ae=[],t&&Ze.#ie(t))}),10);else{Ze.#te=!0;const n=Ae(Ye.getReportPath(),"logs"),a=Ae(n,"log");Me(n,me),e.appendFileSync(a,t),Ze.#te=!1}}}class We extends Ne{constructor(e){super(e)}getElement(e){return this.$driver.element.find({selector:e,locateStrategy:e.startsWith("/")?"xpath":"css selector"})}async getElements(e){return await this.$driver.element.findAll({selector:e,locateStrategy:e.startsWith("/")?"xpath":"css selector"})}async getText(e){return await e.getText()}async getTitle(e){return await e.getAttribute("title")}async getPlaceholderText(e){return await e.getAttribute("placeholder")}async getAltText(e){return await e.getAttribute("alt")}async getTagName(e){return await e.getTagName()}async getValue(e){return await e.getAttribute("value")}async getElementID(e){return await e.getAttribute("id")}async getElementDimension(e){const t=await e.getRect();if(![null,"",void 0].includes(t))return[t.x,t.y,t.height,t.width]}async isElementDisplayed(e){return await this.$driver.isVisible(e)}async isElementPresent(e){return await this.$driver.isPresent(e)}async getElementStrings(e){const t=[];return[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAltText(e)},{type:"titleTxt",value:await this.getTitle(e)},{type:"placeTxt",value:await this.getPlaceholderText(e)},{type:"valueTxt",value:await this.getValue(e)}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)})),t}async getElementString(e){let t=null;const n=[this.getText,this.getAltText,this.getTitle,this.getPlaceholderText,this.getValue];for(const a of n)if(t=await a(e),null!==t)return t;return t}async captureScreenshot(e){await Je(this.$driver,e)}async getElementsCount(e){return e.length}async switchIframe(e){await this.$driver.frame(e,(()=>{Ze.debug(`Switching to ${e} frame`)}))}async switchToParentframe(){await this.$driver.frame(null)}pause(e){this.$driver.pause(1e3*e)}async onScreenStringHighlight(e,t){await this.$driver.execute(((e,t)=>{const n=window.getComputedStyle(e).border;e.style.border=`3px solid ${t}`,setTimeout((()=>{e.style.border=n}),40)}),[e,t])}async checkIfIframeIsPresent(){return new Promise((e=>{this.$driver.isPresent({selector:"//iframe",locateStrategy:"xpath",suppressNotFoundErrors:!0},(t=>{e(t.value)}))}))}async checkIfIframeBodyIsEmpty(){const e=await this.$driver.executeScript("return document.body.innerHTML");return""===await e.trim()}}const Je=async(t,n)=>{const a=await p({host:"localhost",port:Xe(t)}),{Page:r}=a;await r.enable();const{data:i}=await r.captureScreenshot({format:"png",captureBeyondViewport:!0}),s=Buffer.from(i,"base64");e.writeFileSync(n,s),console.log(`Screenshot saved as: ${n}`),await a.close()},Xe=e=>{const t=e?.capabilities?.["goog:chromeOptions"]?.debuggerAddress;return t&&t.split(":")?.[1]||9229};class Ke extends Ne{constructor(e){super(e)}getElement(e){return this.$driver.findElement("xpath",e)}async getElements(e){return await this.$driver.findElements("xpath",e)}async getText(e){return await $(e).getText()}async getTitle(e){return await $(e).getAttribute("title")}async getPlaceholderText(e){return await $(e).getAttribute("placeholder")}async getAltText(e){return await $(e).getAttribute("alt")}async getTagName(e){return await $(e).getTagName()}async getValue(e){return await $(e).getValue()}async getElementDimension(e){const t=await this.$driver.getElementRect(e["element-6066-11e4-a52e-4f735466cecf"]);if(![null,"",void 0].includes(t))return[t.x,t.y,t.height,t.width]}isElementDisplayed(e){return $(e).isDisplayed()}async getElementStrings(e){const t=[];return[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAltText(e)},{type:"titleTxt",value:await this.getTitle(e)},{type:"placeTxt",value:await this.getPlaceholderText(e)},{type:"valueTxt",value:await this.getValue(e)}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)})),t}async captureScreenshot(e){await this.$driver.saveScreenshot(e)}async getElementsCount(e){return e.length}}const et=({subject:e,selector:t,options:n={},driver:a})=>{if(!Cypress)return void a.printOnConsole("Cypress object is inaccessible");const r={name:"xpath",message:t};if(Cypress.dom.isElement(e)&&e.length>1)throw new Error("xpath() can only be called on a single element. Your subject contained "+e.length+" elements.");const i=()=>{let n,a=[],i=cy.state("withinSubject");n=Cypress.dom.isElement(e)?e[0]:Cypress.dom.isDocument(e)?e:i?i[0]:cy.state("window").document;let s=(n.ownerDocument||n).evaluate(t,n);if(s.resultType===XPathResult.NUMBER_TYPE){const e=(e=>e.numberValue)(s);return r.consoleProps=()=>({XPath:t,type:"number",result:e}),e}if((e=>e.resultType===XPathResult.STRING_TYPE)(s)){const e=(e=>e.stringValue)(s);return r.consoleProps=()=>({XPath:t,type:"string",result:e}),e}if((e=>e.resultType===XPathResult.BOOLEAN_TYPE)(s)){const e=(e=>e.booleanValue)(s);return r.consoleProps=()=>({XPath:t,type:"boolean",result:e}),e}try{let e=s.iterateNext();for(;e;)a.push(e),e=s.iterateNext();return r.consoleProps=()=>({XPath:t,result:1===a.length?a[0]:a}),a}catch(e){return console.error("Document tree modified during iteration",e),null}},s=()=>Cypress.Promise.try(i).then((e=>{var a;return a=e,Cypress._.isNumber(a)||Cypress._.isString(a)||Cypress._.isBoolean(a)||((e=Cypress.$(e)).selector=t),cy.verifyUpcomingAssertions(e,n,{onRetry:s})}));return s().then((e=>(!1!==n.log&&Cypress.log(r),e))).catch((e=>console.log(e)))};class tt extends Ne{constructor(e){super(e)}async getElement(e){return"string"!=typeof e?this.$driver.wrap(e):e.startsWith("//")?await this.xpath(e).first():await this.$driver.get(e).first()}async getElements(e){return"string"!=typeof e?this.$driver.wrap(e):e.startsWith("//")?await this.xpath(e):await this.$driver.get(e)}async getText(e){return"string"==typeof e?await this.$driver.get(e).invoke("text"):await this.$driver.wrap(e).invoke("text")}async getTitle(e){return"string"==typeof e?await this.$driver.get(e).title():this.$driver.wrap().title()}async getPlaceholderText(e){return"string"==typeof e?this.$driver.get(e).filter("input").invoke("attr","placeholder").then((e=>e)):this.$driver.$$(e).attr("placeholder")}async getAltText(e){return this.$driver.get(e).invoke("attr","alt")}async getWidth(e){return"string"==typeof e?this.$driver.get(e).invoke("width"):this.$driver.$$(e).width()}async getHeight(e){return"string"==typeof e?this.$driver.get(e).invoke("height"):this.$driver.$$(e).height()}async getTagName(e){return"string"==typeof e?this.$driver.get(e).invoke("prop","tagName").then((e=>e.toLowerCase())):this.$driver.$$(e).tagName}async getValue(e){return"string"==typeof e?this.$driver.get(e).invoke("val"):this.$driver.wrap(e).invoke("val")}async getLocation(e){if("string"==typeof e)return this.$driver.get(e).invoke("offset").then((e=>({x:e.left,y:e.top})));{const t=this.$driver.$$(e).offset();return{x:t.left,y:t.top}}}async isElementDisplayed(e){return"string"==typeof e?this.$driver.get(e).then((e=>e.is(":visible"))):this.$driver.$$(e).is(":visible")}async captureScreenshot(e){this.$driver.screenshot(e)}async getElementsCount(e){return new Promise((t=>"string"==typeof e?this.$driver.get(e).its("length").then((e=>t(e))):this.$driver.wrap(e,{timeout:8e3}).its("length").then((e=>t(e)))))}async getElementStrings(e){const t=[];try{[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAltText(e)},{type:"placetxt",value:await this.getPlaceholderText(e)}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)}))}catch(e){Ze.error("Error getting text of element:",e)}return t}printOnConsole(e){this.$driver.log(e)}xpath(e,t,n={}){return et({subject:e,selector:t,options:n,driver:this.$driver})}}class nt extends Ne{constructor(e){super(e)}async getElement(e){return await this.driver.findElement(e)}async getElements(e){return await this.driver.findElements(e)}async getText(e){return await e.getText()}async getTitle(){return await this.driver.getTitle()}async getAttribute(e,t){return await e.getAttribute(t)}async getTagName(e){return await e.getTagName()}async getElementDimension(e){const t=await e.getRect();if(![null,"",void 0].includes(t))return[t.x,t.y,t.height,t.width]}async isElementDisplayed(e){return await e.isDisplayed()}async getElementStrings(e){const t=[];return[{type:"eleTxt",value:await this.getText(e)},{type:"altTxt",value:await this.getAttribute(e,"alt")},{type:"titleTxt",value:await this.getAttribute(e,"title")},{type:"placeTxt",value:await this.getAttribute(e,"placeholder")},{type:"valueTxt",value:await this.getAttribute(e,"value")}].forEach((({value:e})=>{this.checkIfNullOrEmpty(e)&&t.push(e)})),t}async getElementsCount(e){return e.length}}const at=(e,t=", ")=>e.join(t),rt=(e=!0)=>e?"(?:\\s|\\t|(?: ))":/(?:\s|\t|(?: ))/g;class it{#se={};#B;constructor(e){this.#B=e,this.#oe(),this.buildConfig(),this.#le()}#oe(){this.addToConfig("supportedLocales",It.getOptions()?.supportedLocales,[]),this.addToConfig("defaultLocale",It.getDefaultLocale()),this.addToConfig("defaultLanguage",It.getDefaultLocale()?.split(/[-_ ]/g)[0]),this.addToConfig("language",It.getLocale()?.split(/[-_ ]/g)[0]),this.addToConfig("locale",It.getLocale()),this.addToConfig("qaLocale",It.getQALocale())}buildConfig(){throw new Error(`{{${this.#B}}} buildConfig should be implemented by child class`)}#le(){m.load(f.entireSupplemental()),m.load(f.entireMainFor(this.#ce(this.#se.defaultLocale),this.#ce(this.#se.locale)))}#ce(e){if(this.isQaLocale())return"en";e=e.replace(/[-_ ]/g,"-");const t=f.availableLocales;let n;if(t.find((t=>t===e)))n=e;else{const a=e.split("-")[0];n=t.find((e=>e===a))?a:e}return n}validate(e){throw new Error(`{{${this.#B}}} validate should be implemented by child class`)}isInternationalized(e){throw new Error(`{{${this.#B}}} isInternationalized should be implemented by child class`)}setConfig(e){this.#se=e}addToConfig(e,t,n){this.#se[e]=t??n}getConfig(){return this.#se}isSupportedLocale(){return this.#se.supportedLocales.includes(this.currentLocale())}isQaLocale(){return this.currentLocale()===this.#se?.qaLocale}isDefaultLocale(){return this.currentLocale()===this.defaultLocale()}defaultLocale(){return this.#se?.defaultLocale}defaultLanguage(){return this.#se?.defaultLanguage}currentLocale(){return this.#se?.locale}currentLanguage(){return this.#se.language}getGlobalize(e){return m(this.#ce(e))}}class st extends it{constructor(){super("currency")}validate(e){return this.#de(e)||this.isInternationalized(e)}isInternationalized(e){return this.#ue(this.currentLocale(),e)}buildConfig(){}#ue(e,t){const n=this.#ge(e),a=this.#he(e,n);if(!this.#pe(n,a,t))return!1;const r=this.#me(n,a,t);return!isNaN(this.getGlobalize(e).numberParser()(r))}#pe(e,t,n){return new RegExp(`^(?:-)?(?:${e}|\\${t})(?:${rt()})?(?:-)?[0-9,. ]+$`,"gi").test(n)||new RegExp(`^(?:[- ]?)[0-9,. ]+(?:${rt()})?(?:${e}|\\${t})$`,"gi").test(n)}#me(e,t,n){return n.replace(new RegExp(`^(?:-)(?:${rt()})?`,"gi"),"").replace(new RegExp(`^(?:${rt()})?(?:${e}|\\${t})`,"gi"),"").replace(new RegExp(`^(?:-)(?:${rt()})?`,"gi"),"").replace(new RegExp(`(?:${rt()})?(?:${e}|\\${t})$`,"gi"),"").trim()}#fe(e){return(this.getGlobalize(e).cldr.supplemental(["likelySubtags",e])||e).split(/[-_ ]/).pop()}#ge(e){const t=this.#fe(e),n=this.getGlobalize(e).cldr.supplemental("currencyData").region[t];if(n){const e=n.find((e=>{const t=Object.values(e)[0];return!t._tender&&(!t._to||new Date(t._to)>=new Date)}));return e?Object.keys(e)[0]:"USD"}return"USD"}#he(e,t){const n=this.getGlobalize(e).cldr.main(`numbers/currencies/${t}`);return n?.symbol||"$"}#de(e){return this.#ue(this.defaultLocale(),e)}}const ot=(e,t)=>{t=String(t);const n=(e=>{let[t="en",n="us"]=e.split(/[-_ ]/g);switch(n=String(n).toLowerCase(),t){case"en":return"gb"===n?y.GB:y;case"de":return C;case"es":return I;case"fr":return T;case"pt":return S;case"ja":return L;case"zh":return["hans","cn","sg","hans-cn"].includes(n)?D.hans:["hant","tw","hk","mo","hant-tw"].includes(n)?D.hant:D;case"ru":return b;case"nl":return w;case"uk":return v;default:return y}})(e).parse(String(t).trim());return n.forEach((e=>{t=t.replace(e.text,"")})),0===t.replace(/[^\p{L}\p{N}]+/gu,"").trim().length},lt=e=>{try{return e=e.replace("_","-"),Intl.DateTimeFormat.supportedLocalesOf(e)[0]}catch(t){return Logger.warn(`${e} is unsupported by Intl`),!1}},ct=(e,t,n)=>{if(!1!==(e=lt(e))){if(N.fromFormat(n,t,{locale:lt(e)}).isValid)return!0}return!1};class dt extends it{constructor(){super("date")}validate(e){return this.#ye(e)||this.isInternationalized(e)}isInternationalized(e){return this.#ve(this.isQaLocale()?this.defaultLocale():this.currentLocale(),e)}buildConfig(){}#ve(e,t){return this.#we(e,t)||this.#be(e,t)||this.#De(e,t)}#ye(e){return this.#ve(this.defaultLocale(),e)}#we(e,t){const n=["short","medium","long","full"];for(let a of n){if(this.getGlobalize(e).dateParser({date:a})(t))return!0}return!1}#be(e,t){const n=[N.DATE_SHORT,N.DATE_MED,N.DATE_FULL,N.DATE_HUGE,N.DATE_MED_WITH_WEEKDAY,"D","DD","DDD","DDDD"];for(let a of n){if(ct(e,a,t))return!0}return!1}#De(e,t){return ot(this.isQaLocale()?this.defaultLocale():e,t)}}class ut extends it{constructor(){super("dateTime")}validate(e){return this.#Le(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Se(this.isQaLocale()?this.defaultLocale():this.currentLocale(),e)}buildConfig(){}#Se(e,t){return this.#we(e,t)||this.#be(e,t)||this.#De(e,t)}#Le(e){return this.#Se(this.defaultLocale(),e)}#we(e,t){const n=["short","medium","long","full"];for(let a of n){if(this.getGlobalize(e).dateParser({datetime:a})(t))return!0}return!1}#be(e,t){const n=[N.DATETIME_SHORT,N.DATETIME_SHORT_WITH_SECONDS,N.DATETIME_MED,N.DATETIME_MED_WITH_SECONDS,N.DATETIME_MED_WITH_WEEKDAY,N.DATETIME_FULL,N.DATETIME_FULL_WITH_SECONDS,N.DATETIME_HUGE,N.DATETIME_HUGE_WITH_SECONDS,"f","F","ff","FF"];for(let a of n){if(ct(e,a,t))return!0}return!1}#De(e,t){return ot(this.isQaLocale()?this.defaultLocale():e,t)}}class gt extends it{constructor(){super("number")}validate(e){return this.#Te(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Ie(this.currentLocale(),e)}buildConfig(){}#Ie(e,t){const n=this.getGlobalize(e).numberParser();return!isNaN(n(t))}#Te(e){return this.#Ie(this.defaultLocale(),e)}}class ht extends it{constructor(){super("percentage")}validate(e){return this.#Ce(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Ne(this.currentLocale(),e)}buildConfig(){}#Ne(e,t){if(!this.#xe(e,t))return!1;const n=this.#Ee(t);return!isNaN(this.getGlobalize(e).numberParser()(n))}#Ee(e=""){return e.replace(new RegExp(`(^(?:${rt()})*|(?:${rt()})*$)`,"g"),"").replace(/^-/,"").replace(/٪|%/g,"").trim()}#xe(e,t){const n="[0-9,. ]+";let a;return a=["fa-IR","fa-ir"].includes(e)||e.startsWith("ar")?new RegExp(`(?:-)?(?:${rt()})?(?:٪|%)(?:${rt()})?${n}`,"g"):new RegExp(`(?:-)?(?:${rt()})?${n}(?:${rt()})?(?:٪|%)`,"g"),a.test(t)}#Ce(e){return this.#Ne(this.defaultLocale(),e)}}class pt extends it{constructor(){super("string")}buildConfig(){const e=It.getOptions();this.addToConfig("mockChars",e?.qaMock),this.addToConfig("resource",It.getResourceBundle(),{}),this.addToConfig("garbledChars",It.getGarbledChars()?.filter((e=>String(e).trim())).filter(Boolean),[])}isInternationalized(e){const t=e.trim().replace(/\s*:\s*$/,""),n=this.getConfig()?.resource?.[this.defaultLocale()];return n?.includes(e)||n?.includes(t)}validate(e){return"string"==typeof e}isDntText(e){return this.getConfig()?.resource?.dnt?.includes(e)}isAutoIgnoredText(e){return this.isDefaultLocale()||this.isUserInputText(e)||this.isEmailText(e)||this.isUrlText(e)}isIgnoredText(e){return this.getConfig()?.resource?.ignore?.includes(e)}isUserInputText(e){return e.startsWith("zqa_")}isEmailText(e){return ge.EMAIL.test(e)}isUrlText(e){return ge.URL.test(e)}isFullQaLanguageText(e){const t=this.getConfig();return(e.slice(0,2)===t?.mockChars?.prefix||e.slice(0,2)===t?.mockChars?.prefix.toUpperCase())&&e.slice(-2)===t?.mockChars.suffix}isPartialQaLanguageText(e){const t=this.getConfig();return e.slice(0,2)===t?.mockChars.prefix||e.slice(0,2)===t?.mockChars.prefix.toUpperCase()||e.slice(-2)===t?.mockChars.suffix}hasEncodingIssue(e){return this.getConfig()?.garbledChars?.length>0&&this.getConfig().garbledChars.some((t=>e.includes(t)))}isPartiallyLocalizedText(e){return this.#ze(e)===this.currentLanguage()}#ze(e){const t=Object.keys(x(e)?.scores||{}).filter(Boolean)||[],n=this.currentLanguage();return t.length?t.includes(n)?n:t[0]:this.defaultLanguage()}isLocalized(e){const t=e.trim().replace(/\s*:\s*$/,""),n=this.getConfig()?.resource?.[this.currentLocale()];return n?.includes(e)||n?.includes(t)}}class mt extends it{constructor(){super("time")}validate(e){return this.#Me(e)||this.isInternationalized(e)}isInternationalized(e){return this.#Pe(this.isQaLocale()?this.defaultLocale():this.currentLocale(),e)}buildConfig(){}#Pe(e,t){return this.#we(e,t)||this.#be(e,t)||this.#De(e,t)}#Me(e){return this.#Pe(this.defaultLocale(),e)}#we(e,t){const n=["short","medium","long","full"];for(let a of n){if(this.getGlobalize(e).dateParser({time:a})(t))return!0}return!1}#be(e,t){const n=[N.TIME_SIMPLE,N.TIME_WITH_SECONDS,N.TIME_WITH_SHORT_OFFSET,N.TIME_WITH_LONG_OFFSET,N.TIME_24_SIMPLE,N.TIME_24_WITH_LONG_OFFSET,N.TIME_24_WITH_SECONDS,N.TIME_24_WITH_SHORT_OFFSET,"t","T","tt","TT"];for(let a of n){if(ct(e,a,t))return!0}return!1}#De(e,t){return ot(this.isQaLocale()?this.defaultLocale():e,t)}}class ft{static#$e={};static#Ae;static#Re;static#Oe;static#_e;static#J;static#ke;static#je;static load(){ft.#Ae=new pt,ft.#Re=new gt,ft.#Oe=new dt,ft.#_e=new mt,ft.#J=new ut,ft.#ke=new st,ft.#je=new ht}static getIssueType(e){const t=It.getLocale();if(t){let n=ie;return ft.#$e[t]||(ft.#$e[t]={}),ft.#$e[t][e]?ft.#$e[t][e]:(this.#Ae.isAutoIgnoredText(e)?n=se:this.#Ae.isDntText(e)?n=ae:this.#Ae.isIgnoredText(e)?n=re:this.#Ae.hasEncodingIssue(e)?n=ne:this.#ke.validate(e)?n=this.#ke.isInternationalized(e)?B:Z:this.#je.validate(e)?n=this.#je.isInternationalized(e)?G:W:this.#Re.validate(e)?n=this.#Re.isInternationalized(e)?F:Y:this.#Oe.validate(e)?n=this.#Oe.isInternationalized(e)?V:J:this.#_e.validate(e)?n=this.#_e.isInternationalized(e)?q:X:this.#J.validate(e)?n=this.#J.isInternationalized(e)?Q:K:this.#Ae.validate(e)?this.#Ae.isQaLocale()?n=this.#Ae.isFullQaLanguageText(e)?j:this.#Ae.isPartialQaLanguageText(e)?U:H:!this.#Ae.isDefaultLocale()&&this.#Ae.isSupportedLocale()&&(n=this.#Ae.isLocalized(e)?j:this.#Ae.isPartiallyLocalizedText(e)?U:this.#Ae.isInternationalized(e)?ie:H):this.#Ae.isDefaultLocale()&&(n=se),ft.#$e[t][e]=n,n)}return ie}}class yt{static load(){const e={};if(It.getOptions()?.l10nResourcePath){const t=Ae(process.cwd(),It.getOptions()?.l10nResourcePath);if(Ee(t))yt.#Ue(t,e);else{if(!xe(t))return void console.error(`${t} invalid resource path`);for(const n of $e(t)){const a=Ae(t,n);yt.#Ue(a,e)}}It.setResourceBundle(e)}}static#Ue(e,t){const n=It.getLocale(),a=It.getDefaultLocale(),r=Pe(e),i=(e=>Ee(e)?g(e):"")(e);if(he.includes(i)){if(!r)return void console.error(`${e} is empty or invalid`);if(e.toLowerCase().includes("dnt"))t.dnt=r.split(/\r?\n/);else if(e.toLowerCase().includes("ignore"))t.ignore=r.split(/\r?\n/);else if(e.includes(n)){const e=r.split(/\r?\n/);t[n]=e.map(vt)}else e.includes(a)&&(t[a]=r.split(/\r?\n/))}}}function vt(e){return e.replace(/<\/?[^>]+>/gi,"")}const wt=()=>{yt.load(),ft.load(),Ye.setup(),Be.init()},bt=()=>{let e=process.cwd(),t=0;for(;t<10;){const n=Ae(e,"package.json");if(Ee(n)){const e=Pe(n),t=JSON.parse(e),a={...t?.dependencies||{},...t?.devDependencies||{},...t?.peerDependencies||{}};if("@zeesoft/i18n-verify"!==t.name&&JSON.stringify(a).includes('"@zeesoft/i18n-verify"'))break}e=u(e),t++}return e},Dt=(e=bt())=>Pe(Ae(e,"package.json")),Lt=(e="")=>`{\n "appName": "${Dt()?.match(/"name": "([^"]+)",/)?.[1]||""}",\n "type": "${e}", // set automation framework type ${at(Object.values(z))}\n "qaLocale": "", // set the qa locale used in your project\n "l10nResourcePath": "./l10nResources", // set the dir path of l10n resources\n "l10nReportsPath": "./l10nReports/", // set the dir path of l10n reports\n "supportedLocales": ["en_US", "fr_FR", "ja_JP"], // set the list of supported locales\n "defaultLocale": "en_US", // set default locale of the application\n "qaMock": { // set the prefix and suffix characters of qa locale\n "prefix": "à_",\n "suffix": "_海"\n },\n "mode": "${De.I18N}", // should be one of the following: ${Object.values(De).join(", ")}\n "garbledChars": [""] // set the list of custom garbled characters\n}`,St=()=>{const e=Ae(process.cwd(),ye);if(!Ee(e))throw new Error(`${ye} file is missing. Please add the file in your project root dir`);let t=Pe(e);if(!t)throw new Error(`invalid ${ye} file. Please add valid file in your project root dir`);t=t.replace(/\/\/.+$/gm,"");try{t=JSON.parse(t)}catch(e){throw new Error(`invalid ${ye} file. Please add valid file in your project root dir`)}return t},Tt=(e,t="")=>{e&&!Ee(e)&&Re(e,Lt(t))};class It{static#Fe;static#Be;static#B;static#Ge;static#Ve;static#qe;static#Qe;static#He;static#Ye;static#e;static init(){try{const e=St();(e=>{if("object"!=typeof e||Object.keys(e).length<1)throw new Error(`empty ${ye} file`);const t=[];if(!((e,t,n=[])=>["l10nResourcePath","l10nReportsPath","supportedLocales","defaultLocale","type","mode"].every((e=>(((e,t)=>e in t)(e,t)||n.push(e),!0))))(0,e,t))throw new Error(`following properties are missing in ${ye} file: ${at(t)}`);if(!Object.values(z).includes(e?.type||""))throw new Error(`${ye} has invalid system type`);if(!Object.values(De).includes(e?.mode||""))throw new Error(`${ye} has invalid mode option`)})(e),this.#B=e?.type,this.#Ge=e?.mode,this.#qe=e?.qaLocale,this.#e=e?.appName,this.#Qe=e,this.#Ye=0,this.getGarbledChars()}catch(e){throw Ze.error(e.message),e}}static set(e,t){this.#Ve=t,this.#Fe=((e,t)=>{switch(e){case z.NIGHT_WATCH:return new We(t);case z.WEB_DRIVER_IO:return new Ke(t);case z.CYPRESS:return new tt(t);case z.SELENIUMJS:return new nt(t);default:throw new Error("Unsupported framework")}})(this.#B,e)}static getGarbledChars(){return[...this.#Qe.garbledChars||[],...fe]}static getL10nReportsPath(){return this.#Qe.l10nReportsPath}static setDriver(e){this.#Fe=e}static setType(e){this.#B=e}static setLocale(e){this.#Ve=e}static setOptions(e){this.#Qe=e}static getExecutor(){if(It.#Be)return It.#Be;if(!It.#Fe)throw new Error("Unable to initialize process executor, driver is missing");return this.#Be=new Mt(this.#Fe),this.#Be}static getDriver(){return this.#Fe}static getLocale(){return this.#Ve}static getDefaultLocale(){return this.#Qe.defaultLocale}static getType(){return this.#B}static getOptions(){return this.#Qe}static setQALocale(e){this.#qe=e}static getQALocale(){return this.#qe}static setResourceBundle(e){this.#He=e}static getResourceBundle(e){return this.#He?.[e]||this.#He||[]}static incrementCounter(){this.#Ye++}static getSSCount(e=!1){return e?++this.#Ye:this.#Ye}static getMode(){return this.#Ge}static isSanityRun(){return this.#Ge===De.SANITY}static isI18nVerificationRun(){return this.#Ge===De.I18N}static isContextRun(){return this.#Ge===De.CONTEXT}static getAppName(){return this.#e}}class Ct{#Fe;#Ze;#We;#V;#Je=[];#Xe;#Ke;#et;#tt;constructor(e,t,n,a){this.#Fe=e,this.#Ze=t,this.#We=n,this.#V=a}async run(){try{await this.#nt(),this.shouldCollectStrings()?await this.#at():await this.#rt()}catch(e){Ze.error("unable to run the process",e)}finally{await this.#it()}}async process(e,t,n,a){throw new Error("should be implemeneted by the child class")}shouldCollectStrings(){return!0}async preProcess(){}async postProcess(){}async captureScreen(e){try{return await this.#Fe.captureScreenshot(e),!0}catch(e){return Ze.error("unable to capture screenshot"),!1}}getBaseImageName(){return this.#Ke}getDescription(){return this.#V}getVerificationArea(){return this.#Ze}getVerificationAreaEl(){return this.#et}getVerificationAreaOffsets(){return this.#tt}getDriver(){return this.#Fe}async getElementOffsets(e){const t=await this.#Fe.getElementDimension(e);return{x:t[0],y:t[1],height:t[2],width:t[3]}}async#at(){this.#Je.length?await this.#st():(await this.#ot(),await this.#lt())}async#rt(){await this.process(this.#V)}async#nt(){this.#ct(),this.#dt(),await this.#ut(),await this.#gt(),await this.preProcess()}async#it(){await this.postProcess()}#ct(){const e=this.#Ze||"";if(this.#We?.length>0)for(const t of this.#We)this.#Je.push(e+t);else this.#Xe=""!==e?e+pe:pe}#dt(){this.#Ke=`${It.getSSCount(!0).toString().padStart(3,"0")}_${this.#V.replace(/[^\w\s]/gi,"").replace(/\s+/g,"")}.png`}async#gt(){const e=Ae(Ye.reviewedReports(),this.#Ke);await this.captureScreen(e),Ze.debug("reviewed image has been saved")}async#ut(){if(this.#et=await this.#Fe.getElement(this.#Ze),!this.#et)throw new Error("invalid verification area selector is supplied");this.#tt=await this.getElementOffsets(this.#et)}async#st(){for(const e of this.#Je){const t=await this.#Fe.getElement(e);await this.#ht(t)}}async#ot(){const e=await this.#Fe.getElements(this.#Xe);if(e?.length)for(const t of e)await this.#ht(t,!0)}async#lt(){if(await this.#Fe.checkIfIframeIsPresent()){const e=await this.#Fe.getElements("//iframe");Ze.debug(`Total ${e.length} iframes are located on the ${this.#V}`);for(const t of e){const e=await this.#Fe.getElementID(t);if(void 0!==e&&""!==e){const n=await this.getElementOffsets(t);this.#Fe.switchIframe(e),this.#Fe.pause(2);const a=await this.#Fe.getElement("//body");if(await this.#Fe.isElementPresent(a),!await this.#Fe.checkIfIframeBodyIsEmpty()){const t=await this.#Fe.getElements("//*[normalize-space(text())]");if(t.length>0)for(const a of t)await this.#ht(a,!0,n,e)}}await this.#Fe.switchToParentframe()}}}async#ht(e,t=!1,n,a){if(await this.#pt(e)){const r=t?await this.#Fe.getElementStrings(e):[await this.#Fe.getElementString(e)];if(r?.length)for(const t of r)try{await this.process(t,e,n,a)}catch(e){Ze.error(`unable to process the ${a?`iframe-[${a}] `:""}string "${t}"`,e)}}}async#pt(e){return e&&await this.#Fe.isElementPresent(e)}}class Nt extends Ct{#q={screenshot:"",category:"",fileName:"",bookmark:!0,pageTitle:"",strings:{}};#mt=0;#ft="";constructor(...e){super(...e)}async preProcess(){this.#yt(),this.#vt(),this.#wt(),this.#bt(),this.#Dt()}async process(e,t,n){Ye.incrementCount(le,e,this.getBaseImageName(),this.getDescription()),Ze.debug(`context creation for "${e}"`),await this.#Lt(e,t,n)}async postProcess(){this.#St();const e=this.#Tt();Re(Ae(Ye.getContextPath(),`${this.#q.fileName}.json`),JSON.stringify(e)),He.incrementCountByType("context")}#yt(){this.#mt=$e(Ye.getContextPath()).length+1}#vt(){this.#q.category=this.getDescription()}#wt(){this.#q.pageTitle=`TC-${It.getAppName()}-${this.getDescription().trim().slice(0,2).toUpperCase()}-${`${this.#mt}`.padStart(3,"0")}`}#bt(){this.#q.fileName=`${Oe(It.getAppName())}-${`${this.#mt}`.padStart(3,"0")}`}#Dt(){this.#ft=`${Oe(It.getAppName())}_${`${this.#mt}`.padStart(3,"0")}`}#St(){var e;this.#q.screenshot=`data:image/png;base64,${e=Ae(Ye.reviewedReports(),this.getBaseImageName()),r(e).toString("base64")}`}#Tt(){return{[Le]:this.#q.bookmark,[Se]:this.#q.category,[Te]:this.#q.fileName,[Ie]:this.#q.screenshot,[Ce]:JSON.stringify(this.#q.strings)}}async#Lt(e,t,n){let a;const r=await this.getElementOffsets(t),i=`${this.#ft}_${`${Object.keys(this.#q.strings).length+1}`.padStart(3,0)}`;if(n){a=n;const e=["x","y"];for(const t of e)t in r&&t in a&&(r[t]=a[t]+r[t])}else a=this.getVerificationAreaOffsets();this.#q.strings[i]={text:e,coordinates:{...a}}}}class xt{static async drawRectangle(t,n,a){const r=t?.x-2,i=t?.y-2,s=t?.width+2,o=t?.height+2;try{const t=await E.read(a),l=E.cssColorToHex(n);this.drawRectangleOutline(t,r,i,s,o,l,2);const d=c.dirname(a),u=await t.getBufferAsync(E.MIME_PNG);e.existsSync(d)||(Ze.debug("folder not found"),e.mkdirSync(d,{recursive:!0})),e.writeFileSync(a,u)}catch(e){Ze.error(`Error: ${e}`)}}static async drawRectangleOutline(e,t,n,a,r,i,s){for(let o=t;o<t+a;o++)for(let t=0;t<s;t++)e.setPixelColor(i,o,n+t),e.setPixelColor(i,o,n+r-1-t);for(let o=n;o<n+r;o++)for(let n=0;n<s;n++)e.setPixelColor(i,t+n,o),e.setPixelColor(i,t+a-1-n,o)}}class Et extends Ct{constructor(...e){super(...e)}async process(e,t,a){if("string"!=typeof e||!e||0===Number(e))return;const r=Ae(Ye.reviewedReports(e,this.getBaseImageName()),this.getBaseImageName()),i=ft.getIssueType(e),s=Ae(Ye[i](e,this.getBaseImageName()),this.getBaseImageName());Ye.incrementCount(le,e,this.getBaseImageName(),this.getDescription()),n(r)||l(Ae(Ye.reviewedReports(),this.getBaseImageName()),r),n(r)&&!n(s)&&l(r,s);const o=this.#It(i,e);Ye.incrementCount(i,e,s,this.getDescription()),await this.#Ct(t,o,s,a)}async#Ct(e,t,n,a){await this.#Nt(e,t),await this.#xt(e,t,n,a)}async#Nt(e,t){await this.getDriver().onScreenStringHighlight(e,t)}async#xt(e,t,n,a){let r;const i=await this.getElementOffsets(e),s=R;if(a){r=a;const e=["x","y"];for(const t of e)t in i&&t in r&&(i[t]=r[t]+i[t])}else r=this.getVerificationAreaOffsets();await xt.drawRectangle(r,s,n),await xt.drawRectangle(i,t,n)}#It(e,t){return Ze.debug(`"${t}" - ${de[e][1]}${ue[e]}[0m`),de[e][0]}}class zt extends Ct{constructor(...e){super(...e)}shouldCollectStrings(){return!1}async process(e){Ze.info(`${e} loaded`);const t=Ae(Ye.reviewedReports(e,this.getBaseImageName()),this.getBaseImageName());Ye.incrementCount(le,e,t,this.getDescription()),n(t)||l(Ae(Ye.reviewedReports(),this.getBaseImageName()),t)}}class Mt{#Fe;constructor(e){this.#Fe=e}async start({verificationArea:e,staticLocators:t,description:n}){const a=((e,t,n,a)=>{switch(It.getMode()){case De.I18N:return new Et(e,t,n,a);case De.CONTEXT:return new Nt(e,t,n,a);case De.SANITY:return new zt(e,t,n,a);default:throw new Error("unsupported runner type")}})(this.#Fe,e,t,n);await a.run()}}export{It as C,Mt as E,Ze as L,Ye as R,z as S,Dt as a,ye as b,Tt as c,bt as g,Ae as j,wt as l};
|