axyseo 2.0.0-alpha.0.0.47 → 2.0.0-alpha.0.0.49
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/build/languageProcessing/researches/matchKeywordInSubheadings.js +2 -2
- package/build/languageProcessing/researches/matchKeywordInSubheadings.js.map +1 -1
- package/build/scoring/assessments/seo/SchemaAssessment.js +1 -2
- package/build/scoring/assessments/seo/SchemaAssessment.js.map +1 -1
- package/build/values/Paper.js +8 -0
- package/build/values/Paper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSubheadingContentsTopLevel } from "../helpers/html/getSubheadings";
|
|
2
2
|
import stripSomeTags from "../helpers/sanitize/stripNonTextTags";
|
|
3
3
|
import { findTopicFormsInString } from "../helpers/match/findKeywordFormsInString";
|
|
4
4
|
import removeHtmlBlocks from "../helpers/html/htmlParser";
|
|
@@ -51,7 +51,7 @@ export default function matchKeywordInSubheadings(paper, researcher) {
|
|
|
51
51
|
percentReflectingTopic: 0
|
|
52
52
|
};
|
|
53
53
|
const useSynonyms = true;
|
|
54
|
-
const subheadings =
|
|
54
|
+
const subheadings = getSubheadingContentsTopLevel(text);
|
|
55
55
|
if (subheadings.length !== 0) {
|
|
56
56
|
result.count = subheadings.length;
|
|
57
57
|
result.matches = numberOfSubheadingsReflectingTopic(topicForms, subheadings, useSynonyms, locale, functionWords, matchWordCustomHelper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchKeywordInSubheadings.js","names":["
|
|
1
|
+
{"version":3,"file":"matchKeywordInSubheadings.js","names":["getSubheadingContentsTopLevel","stripSomeTags","findTopicFormsInString","removeHtmlBlocks","filterShortcodesFromHTML","numberOfSubheadingsReflectingTopic","topicForms","subheadings","useSynonyms","locale","functionWords","matchWordCustomHelper","filter","subheading","matchedTopicForms","length","percentWordMatches","matchKeywordInSubheadings","paper","researcher","getConfig","getHelper","text","getText","_attributes","shortcodes","getResearch","getLocale","result","count","matches","percentReflectingTopic"],"sources":["../../../src/languageProcessing/researches/matchKeywordInSubheadings.js"],"sourcesContent":["import {getSubheadingContentsTopLevel} from '../helpers/html/getSubheadings';\nimport stripSomeTags from '../helpers/sanitize/stripNonTextTags';\nimport {findTopicFormsInString} from '../helpers/match/findKeywordFormsInString';\nimport removeHtmlBlocks from '../helpers/html/htmlParser';\nimport {filterShortcodesFromHTML} from '../helpers';\n\n/**\n * Computes the amount of subheadings reflecting the topic.\n *\n * @param {Object} topicForms The main key phrase and its synonyms to check.\n * @param {string[]} subheadings The subheadings to check.\n * @param {boolean} useSynonyms Whether to match synonyms or only main keyphrase.\n * @param {string} locale The current locale.\n * @param {Array} functionWords\tThe function words list.\n * @param {function} matchWordCustomHelper The language-specific helper function to match word in text.\n *\n * @returns {number} The amount of subheadings reflecting the topic.\n */\nconst numberOfSubheadingsReflectingTopic = function(\n topicForms,\n subheadings,\n useSynonyms,\n locale,\n functionWords,\n matchWordCustomHelper\n) {\n return subheadings.filter(subheading => {\n const matchedTopicForms = findTopicFormsInString(\n topicForms,\n subheading,\n useSynonyms,\n locale,\n matchWordCustomHelper\n );\n\n if (functionWords.length === 0) {\n return matchedTopicForms.percentWordMatches === 100;\n }\n return matchedTopicForms.percentWordMatches > 50;\n }).length;\n};\n\n/**\n * Checks if there are any h2 or h3 subheadings in the text and if they have the keyphrase or synonyms in them.\n *\n * @param {Object} paper The paper object containing the text and keyword.\n * @param {Researcher} researcher The researcher object.\n *\n * @returns {Object} The result object.\n */\nexport default function matchKeywordInSubheadings(paper, researcher) {\n const functionWords = researcher.getConfig('functionWords');\n\n // A custom helper to match word in text.\n const matchWordCustomHelper = researcher.getHelper('matchWordCustomHelper');\n\n let text = paper.getText();\n text = removeHtmlBlocks(text);\n text = filterShortcodesFromHTML(text, paper._attributes && paper._attributes.shortcodes);\n text = stripSomeTags(text);\n const topicForms = researcher.getResearch('morphology');\n const locale = paper.getLocale();\n const result = {count: 0, matches: 0, percentReflectingTopic: 0};\n const useSynonyms = true;\n const subheadings = getSubheadingContentsTopLevel(text);\n\n if (subheadings.length !== 0) {\n result.count = subheadings.length;\n result.matches = numberOfSubheadingsReflectingTopic(\n topicForms,\n subheadings,\n useSynonyms,\n locale,\n functionWords,\n matchWordCustomHelper\n );\n result.percentReflectingTopic = (result.matches / result.count) * 100;\n }\n\n return result;\n}\n"],"mappings":"AAAA,SAAQA,6BAA6B;AACrC,OAAOC,aAAa;AACpB,SAAQC,sBAAsB;AAC9B,OAAOC,gBAAgB;AACvB,SAAQC,wBAAwB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kCAAkC,GAAG,SAAAA,CACzCC,UAAU,EACVC,WAAW,EACXC,WAAW,EACXC,MAAM,EACNC,aAAa,EACbC,qBAAqB,EACrB;EACA,OAAOJ,WAAW,CAACK,MAAM,CAACC,UAAU,IAAI;IACtC,MAAMC,iBAAiB,GAAGZ,sBAAsB,CAC9CI,UAAU,EACVO,UAAU,EACVL,WAAW,EACXC,MAAM,EACNE,qBACF,CAAC;IAED,IAAID,aAAa,CAACK,MAAM,KAAK,CAAC,EAAE;MAC9B,OAAOD,iBAAiB,CAACE,kBAAkB,KAAK,GAAG;IACrD;IACA,OAAOF,iBAAiB,CAACE,kBAAkB,GAAG,EAAE;EAClD,CAAC,CAAC,CAACD,MAAM;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASE,yBAAyBA,CAACC,KAAK,EAAEC,UAAU,EAAE;EACnE,MAAMT,aAAa,GAAGS,UAAU,CAACC,SAAS,CAAC,eAAe,CAAC;;EAE3D;EACA,MAAMT,qBAAqB,GAAGQ,UAAU,CAACE,SAAS,CAAC,uBAAuB,CAAC;EAE3E,IAAIC,IAAI,GAAGJ,KAAK,CAACK,OAAO,CAAC,CAAC;EAC1BD,IAAI,GAAGnB,gBAAgB,CAACmB,IAAI,CAAC;EAC7BA,IAAI,GAAGlB,wBAAwB,CAACkB,IAAI,EAAEJ,KAAK,CAACM,WAAW,IAAIN,KAAK,CAACM,WAAW,CAACC,UAAU,CAAC;EACxFH,IAAI,GAAGrB,aAAa,CAACqB,IAAI,CAAC;EAC1B,MAAMhB,UAAU,GAAGa,UAAU,CAACO,WAAW,CAAC,YAAY,CAAC;EACvD,MAAMjB,MAAM,GAAGS,KAAK,CAACS,SAAS,CAAC,CAAC;EAChC,MAAMC,MAAM,GAAG;IAACC,KAAK,EAAE,CAAC;IAAEC,OAAO,EAAE,CAAC;IAAEC,sBAAsB,EAAE;EAAC,CAAC;EAChE,MAAMvB,WAAW,GAAG,IAAI;EACxB,MAAMD,WAAW,GAAGP,6BAA6B,CAACsB,IAAI,CAAC;EAEvD,IAAIf,WAAW,CAACQ,MAAM,KAAK,CAAC,EAAE;IAC5Ba,MAAM,CAACC,KAAK,GAAGtB,WAAW,CAACQ,MAAM;IACjCa,MAAM,CAACE,OAAO,GAAGzB,kCAAkC,CACjDC,UAAU,EACVC,WAAW,EACXC,WAAW,EACXC,MAAM,EACNC,aAAa,EACbC,qBACF,CAAC;IACDiB,MAAM,CAACG,sBAAsB,GAAIH,MAAM,CAACE,OAAO,GAAGF,MAAM,CAACC,KAAK,GAAI,GAAG;EACvE;EAEA,OAAOD,MAAM;AACf","ignoreList":[]}
|
|
@@ -42,7 +42,6 @@ export default class SchemaAssessment extends Assessment {
|
|
|
42
42
|
calculateResult(paper, i18n) {
|
|
43
43
|
let status = '';
|
|
44
44
|
const url = paper.getSlug();
|
|
45
|
-
const shopSettings = paper.getShopSettings();
|
|
46
45
|
if (url.includes('product') || url.includes('collection')) {
|
|
47
46
|
if (paper.hasProductSchema()) {
|
|
48
47
|
status = 'good';
|
|
@@ -51,7 +50,7 @@ export default class SchemaAssessment extends Assessment {
|
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
if (url.includes('blogs')) {
|
|
54
|
-
if (
|
|
53
|
+
if (paper.hasArticleSchema()) {
|
|
55
54
|
status = 'good';
|
|
56
55
|
} else {
|
|
57
56
|
status = 'bad';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaAssessment.js","names":["merge","React","Text","AssessmentResult","Assessment","SchemaAssessment","constructor","config","defaultConfig","id","priority","docUrl","ctaType","title","content","good","improve","bad","identifier","_config","calculateResult","paper","i18n","status","url","getSlug","
|
|
1
|
+
{"version":3,"file":"SchemaAssessment.js","names":["merge","React","Text","AssessmentResult","Assessment","SchemaAssessment","constructor","config","defaultConfig","id","priority","docUrl","ctaType","title","content","good","improve","bad","identifier","_config","calculateResult","paper","i18n","status","url","getSlug","includes","hasProductSchema","hasArticleSchema","score","getScore","body","createElement","as","href","target","rel","translate","getResult","researcher","calculatedResult","assessmentResult","setScore","setStatus","setBody","isApplicable","hasShopSettings","hasSlug"],"sources":["../../../../src/scoring/assessments/seo/SchemaAssessment.js"],"sourcesContent":["import {merge} from 'lodash';\nimport React from 'react';\nimport {Text} from '@shopify/polaris';\nimport AssessmentResult from '../../../values/AssessmentResult';\nimport Assessment from '../assessment';\n\n/**\n * Represents the assessment that checks shop has schema.\n */\nexport default class SchemaAssessment extends Assessment {\n /**\n * Sets the identifier and the config.\n *\n * @param {object} config The configuration to use.\n *\n * @returns {void}\n */\n constructor(config = {}) {\n super();\n\n const defaultConfig = {\n id: 'schema',\n priority: 'high',\n docUrl: 'https://docs.avada.io/seo-suite-help-center/seo-audit/on-page-seo/checklist#schema',\n ctaType: 'contactUs',\n title: 'Schema',\n content: {\n good: 'Schema markup is applied effectively.',\n improve: '',\n bad: 'No schema markup applied. Add schema to optimize visibility for search engines.'\n }\n };\n\n this.identifier = 'schema';\n this._config = merge(defaultConfig, config);\n }\n\n /**\n *\n * @param paper\n * @param i18n\n * @returns {{score: number, body: React.JSX.Element, status: string}}\n */\n calculateResult(paper, i18n) {\n let status = '';\n const url = paper.getSlug();\n\n if (url.includes('product') || url.includes('collection')) {\n if (paper.hasProductSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n if (url.includes('blogs')) {\n if (paper.hasArticleSchema()) {\n status = 'good';\n } else {\n status = 'bad';\n }\n }\n\n const score = this.getScore(this._config.priority, status);\n\n return {\n score,\n status,\n body: (\n <Text as={'span'}>\n {this._config.content[status]}{' '}\n {this._config.docUrl && (\n <a href={this._config.docUrl} target=\"_blank\" rel=\"noreferrer\">\n {i18n ? i18n.translate(`Axyseo.Button.learnMore`) : 'Learn more'}\n </a>\n )}\n </Text>\n )\n };\n }\n\n /**\n *\n * @param paper\n * @param researcher\n * @param config\n * @param i18n\n * @returns {AssessmentResult}\n */\n getResult({paper, researcher, i18n}) {\n const calculatedResult = this.calculateResult(paper, i18n);\n const assessmentResult = new AssessmentResult({config: this._config});\n\n assessmentResult.setScore(calculatedResult.score);\n assessmentResult.setStatus(calculatedResult.status);\n assessmentResult.setBody(calculatedResult.body);\n\n return assessmentResult;\n }\n\n /**\n * Checks if the sentence beginnings assessment is applicable to the paper.\n *\n * @param {Object} paper The paper to check.\n * @param {Researcher} researcher The researcher object.\n * @returns {boolean} Returns true if the language is available and the paper is not empty.\n */\n isApplicable(paper, researcher) {\n return paper.hasShopSettings() && paper.hasSlug();\n }\n}\n"],"mappings":"AAAA,SAAQA,KAAK,QAAO,QAAQ;AAC5B,OAAOC,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,QAAO,kBAAkB;AACrC,OAAOC,gBAAgB;AACvB,OAAOC,UAAU;;AAEjB;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,UAAU,CAAC;EACvD;AACF;AACA;AACA;AACA;AACA;AACA;EACEE,WAAWA,CAACC,MAAM,GAAG,CAAC,CAAC,EAAE;IACvB,KAAK,CAAC,CAAC;IAEP,MAAMC,aAAa,GAAG;MACpBC,EAAE,EAAE,QAAQ;MACZC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EAAE,oFAAoF;MAC5FC,OAAO,EAAE,WAAW;MACpBC,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AM,EAAC,QAAQ;QAACC,GAAG,EAAC;MAAY,GAC3Dd,IAAI,GAAGA,IAAI,CAACe,SAAS,CAAC,yBAAyB,CAAC,GAAG,YACnD,CAED;IAEV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,SAASA,CAAC;IAACjB,KAAK;IAAEkB,UAAU;IAAEjB;EAAI,CAAC,EAAE;IACnC,MAAMkB,gBAAgB,GAAG,IAAI,CAACpB,eAAe,CAACC,KAAK,EAAEC,IAAI,CAAC;IAC1D,MAAMmB,gBAAgB,GAAG,IAAItC,gBAAgB,CAAC;MAACI,MAAM,EAAE,IAAI,CAACY;IAAO,CAAC,CAAC;IAErEsB,gBAAgB,CAACC,QAAQ,CAACF,gBAAgB,CAACX,KAAK,CAAC;IACjDY,gBAAgB,CAACE,SAAS,CAACH,gBAAgB,CAACjB,MAAM,CAAC;IACnDkB,gBAAgB,CAACG,OAAO,CAACJ,gBAAgB,CAACT,IAAI,CAAC;IAE/C,OAAOU,gBAAgB;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEI,YAAYA,CAACxB,KAAK,EAAEkB,UAAU,EAAE;IAC9B,OAAOlB,KAAK,CAACyB,eAAe,CAAC,CAAC,IAAIzB,KAAK,CAAC0B,OAAO,CAAC,CAAC;EACnD;AACF","ignoreList":[]}
|
package/build/values/Paper.js
CHANGED
|
@@ -272,6 +272,14 @@ export default class Paper {
|
|
|
272
272
|
return this._attributes?.hasProductSchema || false;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
+
/**
|
|
276
|
+
*
|
|
277
|
+
* @returns {(function(): *)|boolean}
|
|
278
|
+
*/
|
|
279
|
+
hasArticleSchema() {
|
|
280
|
+
return this._attributes?.hasArticleSchema || false;
|
|
281
|
+
}
|
|
282
|
+
|
|
275
283
|
/**
|
|
276
284
|
*
|
|
277
285
|
* @returns {(function(): *)|boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paper.js","names":["defaults","isEmpty","isEqual","isNil","isNull","isObject","cleanHTML","defaultAttributes","keyword","synonyms","description","title","titleWidth","titleCount","h1Count","slug","domain","locale","permalink","date","customData","textTitle","writingDirection","wpBlocks","isFrontPage","Paper","constructor","text","attributes","_text","_tree","hasOwnProperty","url","onlyLetters","replace","_attributes","hasKeyword","getKeyword","getAttributes","hasSynonyms","getSynonyms","hasH1Count","getH1Count","hasTitleCount","getTitleCount","hasText","getText","getDomain","setTree","tree","getTree","hasDescription","getDescription","hasTitle","getTitle","hasTitleWidth","getTitleWidth","hasSlug","hasShopSettings","shopSettings","getSlug","hasProductSchema","hasData","data","hasRelatedKeywords","relatedKeywords","related_keywords","Array","isArray","length","getData","getIgnoredAssessments","ignoredAssessments","getSkippedAssessments","skippedAssessments","getShopSettings","hasUrl","console","warn","getUrl","hasLocale","getLocale","getWritingDirection","hasPermalink","getPermalink","hasDate","getDate","hasCustomData","getCustomData","hasTextTitle","getTextTitle","serialize","_parseClass","equals","paper","parse","serialized"],"sources":["../../src/values/Paper.js"],"sourcesContent":["import {defaults, isEmpty, isEqual, isNil, isNull, isObject} from 'lodash';\nimport {cleanHTML} from '@axyseo/helpers';\n\n/**\n * Default attributes to be used by the Paper if they are left undefined.\n * @type {{keyword: string, synonyms: string, description: string, title: string, titleWidth: number,\n * \t\t slug: string, locale: string, permalink: string, date: string, customData: object, textTitle: string,\n * \t\t writingDirection: \"LTR\", isFrontPage: boolean }}\n */\nconst defaultAttributes = {\n keyword: '',\n synonyms: '',\n description: '',\n title: '',\n titleWidth: 0,\n titleCount: null,\n h1Count: null,\n slug: '',\n domain: '',\n locale: 'en_US',\n permalink: '',\n date: '',\n customData: {},\n textTitle: '',\n writingDirection: 'LTR',\n wpBlocks: [],\n isFrontPage: false\n};\n\n/**\n * Represents an object where the analysis data is stored.\n */\nexport default class Paper {\n /**\n * Constructs the Paper object and sets its attributes.\n *\n * @param {string} text The text to use in the analysis.\n * @param {object} [attributes] The object containing all attributes.\n * @param {string} [attributes.keyword] The main keyword or keyphrase of the text.\n * @param {string} [attributes.synonyms] The synonyms of the main keyword or keyphrase. It should be separated by commas if multiple synonyms are added.\n * @param {string} [attributes.description] The SEO meta description.\n * @param {string} [attributes.title] The SEO title.\n * @param {string} [attributes.domain] The shop domain.\n * @param {number|null} [attributes.titleCount=null] The title tag count value.\n * @param {number|null} [attributes.h1Count=null] The h1 tag count value.\n * @param {number} [attributes.titleWidth=0] The width of the title in pixels.\n * @param {string} [attributes.slug] The slug.\n * @param {string} [attributes.locale=en_US] The locale.\n * @param {string} [attributes.permalink] The full URL for any given post, page, or other pieces of content on a site.\n * @param {string} [attributes.date] The date.\n * @param {Object[]} [attributes.wpBlocks] The array of texts, encoded in WordPress block editor blocks.\n * @param {Object[]} [attributes.ignoredAssessments] The array of texts, show which assessments should be ignored.\n * @param {Object[]} [attributes.skippedAssessments] The array of texts, show which assessments should be skipped (those assessments will have good result).\n * @param {Object} [attributes.data] Given data.\n * @param {Object} [attributes.customData] Custom data.\n * @param {Object} [attributes.shopSettings] Shop's settings.\n * @param {string} [attributes.textTitle] The title of the text.\n * @param {string} [attributes.writingDirection=LTR] The writing direction of the paper. Defaults to left to right (LTR).\n * @param {boolean} [attributes.isFrontPage=false] Whether the current page is the front page of the site. Defaults to false.\n */\n constructor(text, attributes) {\n this._text = cleanHTML(text || '');\n\n this._tree = null;\n\n attributes = attributes || {};\n defaults(attributes, defaultAttributes);\n\n if (attributes.locale === '') {\n attributes.locale = defaultAttributes.locale;\n }\n\n if (attributes.hasOwnProperty('url')) {\n attributes.slug = attributes.url || attributes.slug;\n }\n\n const onlyLetters = attributes.keyword.replace(\n /[‘’“”\"'.?!:;,¿¡«»&*@#±^%|~`[\\](){}⟨⟩<>/\\\\–\\-\\u2014\\u00d7\\u002b\\s]/g,\n ''\n );\n\n if (isEmpty(onlyLetters)) {\n attributes.keyword = defaultAttributes.keyword;\n }\n\n this._attributes = attributes;\n }\n\n /**\n * Checks whether a keyword is available.\n * @returns {boolean} Returns true if the Paper has a keyword.\n */\n hasKeyword() {\n return this._attributes.keyword !== '';\n }\n\n /**\n * Returns the associated keyword or an empty string if no keyword is available.\n * @returns {string} Returns Keyword\n */\n getKeyword() {\n return this._attributes.keyword;\n }\n\n /**\n *\n * @returns {*|{keyword?: string, synonyms?: string, description?: string, title?: string, titleCount?: (number|null), h1Count?: (number|null), titleWidth?: number, slug?: string, locale?: string, permalink?: string, date?: string, wpBlocks?: Object[], customData?: Object, textTitle?: string, writingDirection?: string, isFrontPage?: boolean}|{}|{}}\n */\n getAttributes() {\n return this._attributes;\n }\n\n /**\n * Checks whether synonyms are available.\n * @returns {boolean} Returns true if the Paper has synonyms.\n */\n hasSynonyms() {\n return this._attributes.synonyms !== '';\n }\n\n /**\n * Returns the associated synonyms or an empty string if no synonyms is available.\n * @returns {string} Returns synonyms.\n */\n getSynonyms() {\n return this._attributes.synonyms;\n }\n\n /**\n * Checks whether the h1 count value is available.\n * @returns {boolean} Returns true if the paper has a h1 count value.\n */\n hasH1Count() {\n return !isNull(this._attributes.h1Count);\n }\n\n /**\n * Returns the h1 tag count value.\n * @returns {number | null}\n */\n getH1Count() {\n return this._attributes.h1Count;\n }\n\n /**\n * Checks whether the title count value is available.\n * @returns {boolean} Returns true if the paper has a title count.\n */\n hasTitleCount() {\n return !isNull(this._attributes.titleCount);\n }\n\n /**\n * Returns the title count value.\n * @returns {number | null}\n */\n getTitleCount() {\n return this._attributes.titleCount;\n }\n\n /**\n * Checks whether the text is available.\n * @returns {boolean} Returns true if the paper has a text.\n */\n hasText() {\n return this._text !== '';\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getText() {\n return this._text;\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getDomain() {\n return this._attributes.domain;\n }\n\n /**\n * Sets the tree.\n *\n * @param {Node} tree The tree to set.\n *\n * @returns {void}\n */\n setTree(tree) {\n this._tree = tree;\n }\n\n /**\n * Returns the tree.\n *\n * @returns {Node} The tree.\n */\n getTree() {\n return this._tree;\n }\n\n /**\n * Checks whether a description is available.\n * @returns {boolean} Returns true if the paper has a description.\n */\n hasDescription() {\n return this._attributes.description !== '';\n }\n\n /**\n * Returns the description or an empty string if no description is available.\n * @returns {string} Returns the description.\n */\n getDescription() {\n return this._attributes.description;\n }\n\n /**\n * Checks whether an SEO title is available\n * @returns {boolean} Returns true if the Paper has an SEO title.\n */\n hasTitle() {\n return this._attributes.title !== '';\n }\n\n /**\n * Returns the SEO title, or an empty string if no title is available.\n * @returns {string} Returns the SEO title.\n */\n getTitle() {\n return this._attributes.title;\n }\n\n /**\n * Checks whether an SEO title width in pixels is available.\n * @returns {boolean} Returns true if the Paper's SEO title is wider than 0 pixels.\n */\n hasTitleWidth() {\n return this._attributes.titleWidth !== 0;\n }\n\n /**\n * Gets the SEO title width in pixels, or an empty string of no title width in pixels is available.\n * @returns {number} Returns the SEO title width in pixels.\n */\n getTitleWidth() {\n return this._attributes.titleWidth;\n }\n\n /**\n * Checks whether a slug is available.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasSlug() {\n return this._attributes.slug !== '';\n }\n\n /**\n * Checks whether a shop settings is available.\n * @returns {boolean} Returns true if the Paper has a shop settings.\n */\n hasShopSettings() {\n return !isEmpty(this._attributes?.shopSettings || {});\n }\n\n /**\n * Gets the paper's slug, or an empty string if no slug is available.\n * @returns {string} Returns the slug.\n */\n getSlug() {\n return this._attributes.slug;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasProductSchema() {\n return this._attributes?.hasProductSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasData() {\n const data = this._attributes?.data;\n return isObject(data) && !isEmpty(data);\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasRelatedKeywords() {\n const relatedKeywords = this._attributes?.data?.related_keywords || [];\n return Array.isArray(relatedKeywords) && relatedKeywords.length > 0;\n }\n\n /**\n *\n * @returns {Object|{}}\n */\n getData() {\n return this._attributes?.data || {};\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getIgnoredAssessments() {\n return this._attributes?.ignoredAssessments || [];\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getSkippedAssessments() {\n return this._attributes?.skippedAssessments || [];\n }\n\n /**\n *\n * @returns {*|{}}\n */\n getShopSettings() {\n return this._attributes?.shopSettings || {};\n }\n\n /**\n * Checks if currently edited page is a front page.\n * @returns {boolean} Returns true if the current page is a front page.\n */\n isFrontPage() {\n return this._attributes.isFrontPage;\n }\n\n /**\n * Checks whether an url is available\n * @deprecated Since version 1.19.1. Use hasSlug instead.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasUrl() {\n console.warn('This function is deprecated, use hasSlug instead');\n return this.hasSlug();\n }\n\n /**\n * Returns the url, or an empty string if no url is available.\n * @deprecated Since version 1.19.1. Use getSlug instead.\n * @returns {string} Returns the url\n */\n getUrl() {\n console.warn('This function is deprecated, use getSlug instead');\n return this.getSlug();\n }\n\n /**\n * Checks whether a locale is available.\n * @returns {boolean} Returns true if the paper has a locale.\n */\n hasLocale() {\n return this._attributes.locale !== '';\n }\n\n /**\n * Returns the locale or an empty string if no locale is available\n * @returns {string} Returns the locale.\n */\n getLocale() {\n return this._attributes.locale;\n }\n\n /**\n * Gets the information of the writing direction of the paper.\n * It returns \"LTR\" (left to right) if this attribute is not provided.\n *\n * @returns {string} Returns the information of the writing direction of the paper.\n */\n getWritingDirection() {\n return this._attributes.writingDirection;\n }\n\n /**\n * Checks whether a permalink is available.\n * @returns {boolean} Returns true if the Paper has a permalink.\n */\n hasPermalink() {\n return this._attributes.permalink !== '';\n }\n\n /**\n * Returns the permalink, or an empty string if no permalink is available.\n * @returns {string} Returns the permalink.\n */\n getPermalink() {\n return this._attributes.permalink;\n }\n\n /**\n * Checks whether a date is available.\n * @returns {boolean} Returns true if the Paper has a date.\n */\n hasDate() {\n return this._attributes.date !== '';\n }\n\n /**\n * Returns the date, or an empty string if no date is available.\n * @returns {string} Returns the date.\n */\n getDate() {\n return this._attributes.date;\n }\n\n /**\n * Checks whether custom data is available.\n * @returns {boolean} Returns true if the Paper has custom data.\n */\n hasCustomData() {\n return !isEmpty(this._attributes.customData);\n }\n\n /**\n * Returns the custom data, or an empty object if no data is available.\n * @returns {Object} Returns the custom data.\n */\n getCustomData() {\n return this._attributes.customData;\n }\n\n /**\n * Checks whether a text title is available.\n * @returns {boolean} Returns true if the Paper has a text title.\n */\n hasTextTitle() {\n return this._attributes.textTitle !== '' && !isNil(this._attributes.textTitle);\n }\n\n /**\n * Returns the text title, or an empty string if no data is available.\n * @returns {string} Returns the text title.\n */\n getTextTitle() {\n return this._attributes.textTitle;\n }\n\n /**\n * Serializes the Paper instance to an object.\n *\n * @returns {Object} The serialized Paper.\n */\n serialize() {\n return {\n _parseClass: 'Paper',\n text: this._text,\n ...this._attributes\n };\n }\n\n /**\n * Checks whether the given paper has the same properties as this instance.\n *\n * @param {Paper} paper The paper to compare to.\n *\n * @returns {boolean} Whether the given paper is identical or not.\n */\n equals(paper) {\n return this._text === paper.getText() && isEqual(this._attributes, paper._attributes);\n }\n\n /**\n * Parses the object to a Paper.\n *\n * @param {Object|Paper} serialized The serialized object or Paper instance.\n *\n * @returns {Paper} The parsed Paper.\n */\n static parse(serialized) {\n // For ease of use, check if it is not already a Paper instance.\n if (serialized instanceof Paper) {\n return serialized;\n }\n\n // _parseClass is taken here, so it doesn't end up in the attributes.\n // eslint-disable-next-line no-unused-vars\n const {text, _parseClass, ...attributes} = serialized;\n\n return new Paper(text, attributes);\n }\n}\n"],"mappings":"AAAA,SAAQA,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AAC1E,SAAQC,SAAS;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG;EACxBC,OAAO,EAAE,EAAE;EACXC,QAAQ,EA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,EAAE,IAAI,CAAClB,KAAK,CAAC,IAAI,CAACgC,WAAW,CAACd,SAAS,CAAC;EAChF;;EAEA;AACF;AACA;AACA;EACEqE,YAAYA,CAAA,EAAG;IACb,OAAO,IAAI,CAACvD,WAAW,CAACd,SAAS;EACnC;;EAEA;AACF;AACA;AACA;AACA;EACEsE,SAASA,CAAA,EAAG;IACV,OAAO;MACLC,WAAW,EAAE,OAAO;MACpBjE,IAAI,EAAE,IAAI,CAACE,KAAK;MAChB,GAAG,IAAI,CAACM;IACV,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE0D,MAAMA,CAACC,KAAK,EAAE;IACZ,OAAO,IAAI,CAACjE,KAAK,KAAKiE,KAAK,CAAChD,OAAO,CAAC,CAAC,IAAI5C,OAAO,CAAC,IAAI,CAACiC,WAAW,EAAE2D,KAAK,CAAC3D,WAAW,CAAC;EACvF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAO4D,KAAKA,CAACC,UAAU,EAAE;IACvB;IACA,IAAIA,UAAU,YAAYvE,KAAK,EAAE;MAC/B,OAAOuE,UAAU;IACnB;;IAEA;IACA;IACA,MAAM;MAACrE,IAAI;MAAEiE,WAAW;MAAE,GAAGhE;IAAU,CAAC,GAAGoE,UAAU;IAErD,OAAO,IAAIvE,KAAK,CAACE,IAAI,EAAEC,UAAU,CAAC;EACpC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Paper.js","names":["defaults","isEmpty","isEqual","isNil","isNull","isObject","cleanHTML","defaultAttributes","keyword","synonyms","description","title","titleWidth","titleCount","h1Count","slug","domain","locale","permalink","date","customData","textTitle","writingDirection","wpBlocks","isFrontPage","Paper","constructor","text","attributes","_text","_tree","hasOwnProperty","url","onlyLetters","replace","_attributes","hasKeyword","getKeyword","getAttributes","hasSynonyms","getSynonyms","hasH1Count","getH1Count","hasTitleCount","getTitleCount","hasText","getText","getDomain","setTree","tree","getTree","hasDescription","getDescription","hasTitle","getTitle","hasTitleWidth","getTitleWidth","hasSlug","hasShopSettings","shopSettings","getSlug","hasProductSchema","hasArticleSchema","hasData","data","hasRelatedKeywords","relatedKeywords","related_keywords","Array","isArray","length","getData","getIgnoredAssessments","ignoredAssessments","getSkippedAssessments","skippedAssessments","getShopSettings","hasUrl","console","warn","getUrl","hasLocale","getLocale","getWritingDirection","hasPermalink","getPermalink","hasDate","getDate","hasCustomData","getCustomData","hasTextTitle","getTextTitle","serialize","_parseClass","equals","paper","parse","serialized"],"sources":["../../src/values/Paper.js"],"sourcesContent":["import {defaults, isEmpty, isEqual, isNil, isNull, isObject} from 'lodash';\nimport {cleanHTML} from '@axyseo/helpers';\n\n/**\n * Default attributes to be used by the Paper if they are left undefined.\n * @type {{keyword: string, synonyms: string, description: string, title: string, titleWidth: number,\n * \t\t slug: string, locale: string, permalink: string, date: string, customData: object, textTitle: string,\n * \t\t writingDirection: \"LTR\", isFrontPage: boolean }}\n */\nconst defaultAttributes = {\n keyword: '',\n synonyms: '',\n description: '',\n title: '',\n titleWidth: 0,\n titleCount: null,\n h1Count: null,\n slug: '',\n domain: '',\n locale: 'en_US',\n permalink: '',\n date: '',\n customData: {},\n textTitle: '',\n writingDirection: 'LTR',\n wpBlocks: [],\n isFrontPage: false\n};\n\n/**\n * Represents an object where the analysis data is stored.\n */\nexport default class Paper {\n /**\n * Constructs the Paper object and sets its attributes.\n *\n * @param {string} text The text to use in the analysis.\n * @param {object} [attributes] The object containing all attributes.\n * @param {string} [attributes.keyword] The main keyword or keyphrase of the text.\n * @param {string} [attributes.synonyms] The synonyms of the main keyword or keyphrase. It should be separated by commas if multiple synonyms are added.\n * @param {string} [attributes.description] The SEO meta description.\n * @param {string} [attributes.title] The SEO title.\n * @param {string} [attributes.domain] The shop domain.\n * @param {number|null} [attributes.titleCount=null] The title tag count value.\n * @param {number|null} [attributes.h1Count=null] The h1 tag count value.\n * @param {number} [attributes.titleWidth=0] The width of the title in pixels.\n * @param {string} [attributes.slug] The slug.\n * @param {string} [attributes.locale=en_US] The locale.\n * @param {string} [attributes.permalink] The full URL for any given post, page, or other pieces of content on a site.\n * @param {string} [attributes.date] The date.\n * @param {Object[]} [attributes.wpBlocks] The array of texts, encoded in WordPress block editor blocks.\n * @param {Object[]} [attributes.ignoredAssessments] The array of texts, show which assessments should be ignored.\n * @param {Object[]} [attributes.skippedAssessments] The array of texts, show which assessments should be skipped (those assessments will have good result).\n * @param {Object} [attributes.data] Given data.\n * @param {Object} [attributes.customData] Custom data.\n * @param {Object} [attributes.shopSettings] Shop's settings.\n * @param {string} [attributes.textTitle] The title of the text.\n * @param {string} [attributes.writingDirection=LTR] The writing direction of the paper. Defaults to left to right (LTR).\n * @param {boolean} [attributes.isFrontPage=false] Whether the current page is the front page of the site. Defaults to false.\n */\n constructor(text, attributes) {\n this._text = cleanHTML(text || '');\n\n this._tree = null;\n\n attributes = attributes || {};\n defaults(attributes, defaultAttributes);\n\n if (attributes.locale === '') {\n attributes.locale = defaultAttributes.locale;\n }\n\n if (attributes.hasOwnProperty('url')) {\n attributes.slug = attributes.url || attributes.slug;\n }\n\n const onlyLetters = attributes.keyword.replace(\n /[‘’“”\"'.?!:;,¿¡«»&*@#±^%|~`[\\](){}⟨⟩<>/\\\\–\\-\\u2014\\u00d7\\u002b\\s]/g,\n ''\n );\n\n if (isEmpty(onlyLetters)) {\n attributes.keyword = defaultAttributes.keyword;\n }\n\n this._attributes = attributes;\n }\n\n /**\n * Checks whether a keyword is available.\n * @returns {boolean} Returns true if the Paper has a keyword.\n */\n hasKeyword() {\n return this._attributes.keyword !== '';\n }\n\n /**\n * Returns the associated keyword or an empty string if no keyword is available.\n * @returns {string} Returns Keyword\n */\n getKeyword() {\n return this._attributes.keyword;\n }\n\n /**\n *\n * @returns {*|{keyword?: string, synonyms?: string, description?: string, title?: string, titleCount?: (number|null), h1Count?: (number|null), titleWidth?: number, slug?: string, locale?: string, permalink?: string, date?: string, wpBlocks?: Object[], customData?: Object, textTitle?: string, writingDirection?: string, isFrontPage?: boolean}|{}|{}}\n */\n getAttributes() {\n return this._attributes;\n }\n\n /**\n * Checks whether synonyms are available.\n * @returns {boolean} Returns true if the Paper has synonyms.\n */\n hasSynonyms() {\n return this._attributes.synonyms !== '';\n }\n\n /**\n * Returns the associated synonyms or an empty string if no synonyms is available.\n * @returns {string} Returns synonyms.\n */\n getSynonyms() {\n return this._attributes.synonyms;\n }\n\n /**\n * Checks whether the h1 count value is available.\n * @returns {boolean} Returns true if the paper has a h1 count value.\n */\n hasH1Count() {\n return !isNull(this._attributes.h1Count);\n }\n\n /**\n * Returns the h1 tag count value.\n * @returns {number | null}\n */\n getH1Count() {\n return this._attributes.h1Count;\n }\n\n /**\n * Checks whether the title count value is available.\n * @returns {boolean} Returns true if the paper has a title count.\n */\n hasTitleCount() {\n return !isNull(this._attributes.titleCount);\n }\n\n /**\n * Returns the title count value.\n * @returns {number | null}\n */\n getTitleCount() {\n return this._attributes.titleCount;\n }\n\n /**\n * Checks whether the text is available.\n * @returns {boolean} Returns true if the paper has a text.\n */\n hasText() {\n return this._text !== '';\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getText() {\n return this._text;\n }\n\n /**\n * Returns the associated text or an empty string if no text is available.\n * @returns {string} Returns the text.\n */\n getDomain() {\n return this._attributes.domain;\n }\n\n /**\n * Sets the tree.\n *\n * @param {Node} tree The tree to set.\n *\n * @returns {void}\n */\n setTree(tree) {\n this._tree = tree;\n }\n\n /**\n * Returns the tree.\n *\n * @returns {Node} The tree.\n */\n getTree() {\n return this._tree;\n }\n\n /**\n * Checks whether a description is available.\n * @returns {boolean} Returns true if the paper has a description.\n */\n hasDescription() {\n return this._attributes.description !== '';\n }\n\n /**\n * Returns the description or an empty string if no description is available.\n * @returns {string} Returns the description.\n */\n getDescription() {\n return this._attributes.description;\n }\n\n /**\n * Checks whether an SEO title is available\n * @returns {boolean} Returns true if the Paper has an SEO title.\n */\n hasTitle() {\n return this._attributes.title !== '';\n }\n\n /**\n * Returns the SEO title, or an empty string if no title is available.\n * @returns {string} Returns the SEO title.\n */\n getTitle() {\n return this._attributes.title;\n }\n\n /**\n * Checks whether an SEO title width in pixels is available.\n * @returns {boolean} Returns true if the Paper's SEO title is wider than 0 pixels.\n */\n hasTitleWidth() {\n return this._attributes.titleWidth !== 0;\n }\n\n /**\n * Gets the SEO title width in pixels, or an empty string of no title width in pixels is available.\n * @returns {number} Returns the SEO title width in pixels.\n */\n getTitleWidth() {\n return this._attributes.titleWidth;\n }\n\n /**\n * Checks whether a slug is available.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasSlug() {\n return this._attributes.slug !== '';\n }\n\n /**\n * Checks whether a shop settings is available.\n * @returns {boolean} Returns true if the Paper has a shop settings.\n */\n hasShopSettings() {\n return !isEmpty(this._attributes?.shopSettings || {});\n }\n\n /**\n * Gets the paper's slug, or an empty string if no slug is available.\n * @returns {string} Returns the slug.\n */\n getSlug() {\n return this._attributes.slug;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasProductSchema() {\n return this._attributes?.hasProductSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasArticleSchema() {\n return this._attributes?.hasArticleSchema || false;\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasData() {\n const data = this._attributes?.data;\n return isObject(data) && !isEmpty(data);\n }\n\n /**\n *\n * @returns {(function(): *)|boolean}\n */\n hasRelatedKeywords() {\n const relatedKeywords = this._attributes?.data?.related_keywords || [];\n return Array.isArray(relatedKeywords) && relatedKeywords.length > 0;\n }\n\n /**\n *\n * @returns {Object|{}}\n */\n getData() {\n return this._attributes?.data || {};\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getIgnoredAssessments() {\n return this._attributes?.ignoredAssessments || [];\n }\n\n /**\n *\n * @returns {Object[String]|*[String]}\n */\n getSkippedAssessments() {\n return this._attributes?.skippedAssessments || [];\n }\n\n /**\n *\n * @returns {*|{}}\n */\n getShopSettings() {\n return this._attributes?.shopSettings || {};\n }\n\n /**\n * Checks if currently edited page is a front page.\n * @returns {boolean} Returns true if the current page is a front page.\n */\n isFrontPage() {\n return this._attributes.isFrontPage;\n }\n\n /**\n * Checks whether an url is available\n * @deprecated Since version 1.19.1. Use hasSlug instead.\n * @returns {boolean} Returns true if the Paper has a slug.\n */\n hasUrl() {\n console.warn('This function is deprecated, use hasSlug instead');\n return this.hasSlug();\n }\n\n /**\n * Returns the url, or an empty string if no url is available.\n * @deprecated Since version 1.19.1. Use getSlug instead.\n * @returns {string} Returns the url\n */\n getUrl() {\n console.warn('This function is deprecated, use getSlug instead');\n return this.getSlug();\n }\n\n /**\n * Checks whether a locale is available.\n * @returns {boolean} Returns true if the paper has a locale.\n */\n hasLocale() {\n return this._attributes.locale !== '';\n }\n\n /**\n * Returns the locale or an empty string if no locale is available\n * @returns {string} Returns the locale.\n */\n getLocale() {\n return this._attributes.locale;\n }\n\n /**\n * Gets the information of the writing direction of the paper.\n * It returns \"LTR\" (left to right) if this attribute is not provided.\n *\n * @returns {string} Returns the information of the writing direction of the paper.\n */\n getWritingDirection() {\n return this._attributes.writingDirection;\n }\n\n /**\n * Checks whether a permalink is available.\n * @returns {boolean} Returns true if the Paper has a permalink.\n */\n hasPermalink() {\n return this._attributes.permalink !== '';\n }\n\n /**\n * Returns the permalink, or an empty string if no permalink is available.\n * @returns {string} Returns the permalink.\n */\n getPermalink() {\n return this._attributes.permalink;\n }\n\n /**\n * Checks whether a date is available.\n * @returns {boolean} Returns true if the Paper has a date.\n */\n hasDate() {\n return this._attributes.date !== '';\n }\n\n /**\n * Returns the date, or an empty string if no date is available.\n * @returns {string} Returns the date.\n */\n getDate() {\n return this._attributes.date;\n }\n\n /**\n * Checks whether custom data is available.\n * @returns {boolean} Returns true if the Paper has custom data.\n */\n hasCustomData() {\n return !isEmpty(this._attributes.customData);\n }\n\n /**\n * Returns the custom data, or an empty object if no data is available.\n * @returns {Object} Returns the custom data.\n */\n getCustomData() {\n return this._attributes.customData;\n }\n\n /**\n * Checks whether a text title is available.\n * @returns {boolean} Returns true if the Paper has a text title.\n */\n hasTextTitle() {\n return this._attributes.textTitle !== '' && !isNil(this._attributes.textTitle);\n }\n\n /**\n * Returns the text title, or an empty string if no data is available.\n * @returns {string} Returns the text title.\n */\n getTextTitle() {\n return this._attributes.textTitle;\n }\n\n /**\n * Serializes the Paper instance to an object.\n *\n * @returns {Object} The serialized Paper.\n */\n serialize() {\n return {\n _parseClass: 'Paper',\n text: this._text,\n ...this._attributes\n };\n }\n\n /**\n * Checks whether the given paper has the same properties as this instance.\n *\n * @param {Paper} paper The paper to compare to.\n *\n * @returns {boolean} Whether the given paper is identical or not.\n */\n equals(paper) {\n return this._text === paper.getText() && isEqual(this._attributes, paper._attributes);\n }\n\n /**\n * Parses the object to a Paper.\n *\n * @param {Object|Paper} serialized The serialized object or Paper instance.\n *\n * @returns {Paper} The parsed Paper.\n */\n static parse(serialized) {\n // For ease of use, check if it is not already a Paper instance.\n if (serialized instanceof Paper) {\n return serialized;\n }\n\n // _parseClass is taken here, so it doesn't end up in the attributes.\n // eslint-disable-next-line no-unused-vars\n const {text, _parseClass, ...attributes} = serialized;\n\n return new Paper(text, attributes);\n }\n}\n"],"mappings":"AAAA,SAAQA,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,QAAO,QAAQ;AAC1E,SAAQC,SAAS;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG;EACxBC,OAAO,EAAE,EAAE;EACXC,QAAQ,EAAE,EAAE;EACZC,WAAW,EAAE,EAAE;EACfC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,CAAC;EACbC,UAAU,EAAE,IAAI;EAChBC,OAAO,EAAE,IAAI;EACbC,IAAI,EAAE,EAAE;EACRC,MAAM,EAAE,EAAE;EACVC,MAAM,EAAE,OAAO;EACfC,SAAS,EAAE,EAAE;EACbC,IAAI,E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