{"version":3,"file":"getMaskContent.mjs","names":[],"sources":["../../../src/deepTransformPlugins/getMaskContent.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport { deepTransformNode, type Plugins } from '../interpreter';\n\nconst passTypedNodePlugin: Plugins = {\n  id: 'pass-typed-node-plugin',\n  canHandle: (node) =>\n    typeof node === 'object' && typeof node?.nodeType === 'string',\n  transform: (node, props, deepTransformNode) =>\n    deepTransformNode(node[node.nodeType], props),\n};\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const buildMaskPlugin: Plugins = {\n  id: 'build-mask-plugin',\n  canHandle: (node) => typeof node === 'string' || typeof node === 'number',\n  transform: () => true,\n};\n\nexport const getMaskContent = (source: Dictionary): any => ({\n  ...source,\n  content: deepTransformNode(source.content, {\n    dictionaryKey: source.key,\n    keyPath: [],\n    plugins: [passTypedNodePlugin, buildMaskPlugin],\n  }),\n});\n"],"mappings":";;;AAGA,MAAM,sBAA+B;CACnC,IAAI;CACJ,YAAY,SACV,OAAO,SAAS,YAAY,OAAO,MAAM,aAAa;CACxD,YAAY,MAAM,OAAO,sBACvB,kBAAkB,KAAK,KAAK,WAAW,MAAM;CAChD;;AAGD,MAAa,kBAA2B;CACtC,IAAI;CACJ,YAAY,SAAS,OAAO,SAAS,YAAY,OAAO,SAAS;CACjE,iBAAiB;CAClB;AAED,MAAa,kBAAkB,YAA6B;CAC1D,GAAG;CACH,SAAS,kBAAkB,OAAO,SAAS;EACzC,eAAe,OAAO;EACtB,SAAS,EAAE;EACX,SAAS,CAAC,qBAAqB,gBAAgB;EAChD,CAAC;CACH"}