diff --git a/.devcontainer/devcontainer.example.json b/.devcontainer/devcontainer.example.json index 5058f4c..a155226 100755 --- a/.devcontainer/devcontainer.example.json +++ b/.devcontainer/devcontainer.example.json @@ -1,102 +1,102 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -{ - "name": "PHP", - "image": "mcr.microsoft.com/vscode/devcontainers/php:8.1", - "features": { - // https://github.com/devcontainers/features/tree/main/src/node - "ghcr.io/devcontainers/features/node:1": { - "version": "18.14.0", - "nvmVersion": "0.39.3" - } - }, - "postCreateCommand": "npm install", - "mounts": [ - { - // path in your local machine where WordPress is. - "source": "/home/{yourusername}/projects/_wordpress", - "target": "/home/vscode/_wordpress", - "type": "bind" - } - ], - "customizations": { - "vscode": { - "extensions": [ - "junstyle.php-cs-fixer", - "neilbrayfield.php-docblocker", - "bmewburn.vscode-intelephense-client" - ], - "settings": { - "php-cs-fixer.config": ".php-cs-fixer.php", - "files.eol": "\n", - "files.encoding": "utf8", - "php.suggest.basic": false, - "[smarty]": { - "editor.tabSize": 2 - }, - "[php]": { - "editor.indentSize": "tabSize", - "editor.detectIndentation": false, - "editor.defaultFormatter": "junstyle.php-cs-fixer", - "editor.insertSpaces": true, - "editor.tabSize": 4, - "editor.rulers": [ - 120 - ] - }, - "php-cs-fixer.formatHtml": true, - "php-cs-fixer.onsave": true, - "php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar", - "php.validate.enable": false, - "php-docblocker.useShortNames": true, - "php-docblocker.qualifyClassNames": true, - "php-docblocker.paramDescription": true, - "php-docblocker.returnGap": true, - "php-docblocker.alignParams": true, - "php-docblocker.alignReturn": true, - "php-docblocker.gap": true, - "php-docblocker.defaultType": "string", - "php-docblocker.classTemplate": { - "message": {}, - "since": { - "content": "@since 1.0.0", - "gapAfter": true, - "gapBefore": true - }, - "link": { - "content": "@link " - } - }, - "php-docblocker.functionTemplate": { - "message": { - "gapAfter": true - }, - "since": { - "content": "@since 1.0.0" - }, - "param": { - "gapBefore": true, - "gapAfter": true - }, - "return": {} - }, - "php-docblocker.propertyTemplate": { - "message": { - "gapAfter": true - }, - "since": { - "content": "@since 1.0.0" - }, - "var": { - "content": "@var ${1:mixed}" - }, - "access": { - "access": "@access " - }, - "link": { - "content": "@link " - } - } - } - } - } +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +{ + "name": "PHP", + "image": "mcr.microsoft.com/vscode/devcontainers/php:8.1", + "features": { + // https://github.com/devcontainers/features/tree/main/src/node + "ghcr.io/devcontainers/features/node:1": { + "version": "18.14.0", + "nvmVersion": "0.39.3" + } + }, + "postCreateCommand": "npm install", + "mounts": [ + { + // path in your local machine where WordPress is. + "source": "/home/{yourusername}/projects/_wordpress", + "target": "/home/vscode/_wordpress", + "type": "bind" + } + ], + "customizations": { + "vscode": { + "extensions": [ + "junstyle.php-cs-fixer", + "neilbrayfield.php-docblocker", + "bmewburn.vscode-intelephense-client" + ], + "settings": { + "php-cs-fixer.config": ".php-cs-fixer.php", + "files.eol": "\n", + "files.encoding": "utf8", + "php.suggest.basic": false, + "[smarty]": { + "editor.tabSize": 2 + }, + "[php]": { + "editor.indentSize": "tabSize", + "editor.detectIndentation": false, + "editor.defaultFormatter": "junstyle.php-cs-fixer", + "editor.insertSpaces": true, + "editor.tabSize": 4, + "editor.rulers": [ + 120 + ] + }, + "php-cs-fixer.formatHtml": true, + "php-cs-fixer.onsave": true, + "php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar", + "php.validate.enable": false, + "php-docblocker.useShortNames": true, + "php-docblocker.qualifyClassNames": true, + "php-docblocker.paramDescription": true, + "php-docblocker.returnGap": true, + "php-docblocker.alignParams": true, + "php-docblocker.alignReturn": true, + "php-docblocker.gap": true, + "php-docblocker.defaultType": "string", + "php-docblocker.classTemplate": { + "message": {}, + "since": { + "content": "@since 1.0.0", + "gapAfter": true, + "gapBefore": true + }, + "link": { + "content": "@link " + } + }, + "php-docblocker.functionTemplate": { + "message": { + "gapAfter": true + }, + "since": { + "content": "@since 1.0.0" + }, + "param": { + "gapBefore": true, + "gapAfter": true + }, + "return": {} + }, + "php-docblocker.propertyTemplate": { + "message": { + "gapAfter": true + }, + "since": { + "content": "@since 1.0.0" + }, + "var": { + "content": "@var ${1:mixed}" + }, + "access": { + "access": "@access " + }, + "link": { + "content": "@link " + } + } + } + } + } } \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 0f82ab6..0c075c6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,37 +1,37 @@ -module.exports = { - // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy - // This option interrupts the configuration hierarchy at this file - // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos) - root: true, - - // Rules order is important, please avoid shuffling them - extends: [ - // Base ESLint recommended rules - 'eslint:recommended', - 'standard' - ], - - // add your custom rules here - rules: { - // allow async-await - 'generator-star-spacing': 'off', - // allow paren-less arrow functions - 'arrow-parens': 'off', - 'one-var': 'off', - 'no-void': 'off', - 'multiline-ternary': 'off', - - 'import/first': 'off', - 'import/named': 'error', - 'import/namespace': 'error', - 'import/default': 'error', - 'import/export': 'error', - 'import/extensions': 'off', - 'import/no-unresolved': 'off', - 'import/no-extraneous-dependencies': 'off', - 'prefer-promise-reject-errors': 'off', - - // allow debugger during development only - 'no-debugger': 'error' - } -} +module.exports = { + // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy + // This option interrupts the configuration hierarchy at this file + // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos) + root: true, + + // Rules order is important, please avoid shuffling them + extends: [ + // Base ESLint recommended rules + 'eslint:recommended', + 'standard' + ], + + // add your custom rules here + rules: { + // allow async-await + 'generator-star-spacing': 'off', + // allow paren-less arrow functions + 'arrow-parens': 'off', + 'one-var': 'off', + 'no-void': 'off', + 'multiline-ternary': 'off', + + 'import/first': 'off', + 'import/named': 'error', + 'import/namespace': 'error', + 'import/default': 'error', + 'import/export': 'error', + 'import/extensions': 'off', + 'import/no-unresolved': 'off', + 'import/no-extraneous-dependencies': 'off', + 'prefer-promise-reject-errors': 'off', + + // allow debugger during development only + 'no-debugger': 'error' + } +} diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 104ef13..42636fb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,27 +1,27 @@ -## Descreva o bug -Uma descrição clara e concisa do que é o bug. - -## Informação do sistema -- PHP: [ex. 8.1] -- WordPress: [ex. 6.1] - -## Passos para reproduzir -Etapas para reproduzir o comportamento: -1. Vá para '...' -2. Clique em '....' -3. Role para baixo até '....' -4. Ver erro - -## Comportamento esperado -Uma descrição clara e concisa do que você esperava que acontecesse. - -## Capturas de tela -Se aplicável, adicione capturas de tela para ajudar a explicar seu problema. - -## Critérios de Aceitação - - - -- [ ] Algo acontece quando uma ação é executada. -- [ ] Algo não acontece quando uma ação é executada. -- [ ] O comportamento de correção no Componente A não afeta o comportamento existente no Componente B. +## Descreva o bug +Uma descrição clara e concisa do que é o bug. + +## Informação do sistema +- PHP: [ex. 8.1] +- WordPress: [ex. 6.1] + +## Passos para reproduzir +Etapas para reproduzir o comportamento: +1. Vá para '...' +2. Clique em '....' +3. Role para baixo até '....' +4. Ver erro + +## Comportamento esperado +Uma descrição clara e concisa do que você esperava que acontecesse. + +## Capturas de tela +Se aplicável, adicione capturas de tela para ajudar a explicar seu problema. + +## Critérios de Aceitação + + + +- [ ] Algo acontece quando uma ação é executada. +- [ ] Algo não acontece quando uma ação é executada. +- [ ] O comportamento de correção no Componente A não afeta o comportamento existente no Componente B. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index e179394..1f8720c 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,16 +1,16 @@ -## Sua solicitação de recurso está relacionada a um problema? Por favor descreva -Uma descrição clara e concisa de qual é o problema. Ex. Eu sempre fico frustrado quando [...] - -## Descreva a solução que você gostaria -Uma descrição clara e concisa do que você quer que aconteça. - -## Descreva as alternativas que você considerou -Uma descrição clara e concisa de quaisquer soluções ou recursos alternativos que você considerou. - -## Critérios de Aceitação - - - -- [ ] Algo acontece quando uma ação é executada. -- [ ] Algo não acontece quando uma ação é executada. -- [ ] O comportamento de correção no Componente A não afeta o comportamento existente no Componente B. +## Sua solicitação de recurso está relacionada a um problema? Por favor descreva +Uma descrição clara e concisa de qual é o problema. Ex. Eu sempre fico frustrado quando [...] + +## Descreva a solução que você gostaria +Uma descrição clara e concisa do que você quer que aconteça. + +## Descreva as alternativas que você considerou +Uma descrição clara e concisa de quaisquer soluções ou recursos alternativos que você considerou. + +## Critérios de Aceitação + + + +- [ ] Algo acontece quando uma ação é executada. +- [ ] Algo não acontece quando uma ação é executada. +- [ ] O comportamento de correção no Componente A não afeta o comportamento existente no Componente B. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 08508a3..9db447b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,10 @@ -## Changelog - - - -- Adicionar nova configuração para... - -## Conferir -- [ ] Atualizar versão hardcoded -- [ ] Atualizar README com notas -- [ ] Atualizar CHANGELOG +## Changelog + + + +- Adicionar nova configuração para... + +## Conferir +- [ ] Atualizar versão hardcoded +- [ ] Atualizar README com notas +- [ ] Atualizar CHANGELOG diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33676a1..af1adaf 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,62 +1,62 @@ -name: Generate new release for plugin - -on: - pull_request: - types: [closed] - branches: [main] - -env: - PLUGIN_NAME: payment-erede-for-givewp - PLUGIN_NAME_WITH_UPDATER: payment-erede-for-givewp-updt - -jobs: - release-build: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - # Add plugin files to a root directory - - name: Make plugin root directory with auto-updater - run: "mkdir ${{env.PLUGIN_NAME_WITH_UPDATER}} && cp -r ./languages ./admin ./includes ./public LICENSE *.php ./${{env.PLUGIN_NAME_WITH_UPDATER}}/ && find ./${{env.PLUGIN_NAME_WITH_UPDATER}} -type f -exec chmod 0644 {} + && find ./${{env.PLUGIN_NAME_WITH_UPDATER}} -type d -exec chmod 0755 {} + && ls -lah" - - - name: Make plugin root directory - run: "rm -Rf ./includes/plugin-updater && mkdir ${{env.PLUGIN_NAME}} && mv -t ./${{env.PLUGIN_NAME}} ./languages ./admin ./includes ./public LICENSE *.php *.txt && find ./${{env.PLUGIN_NAME}} -type f -exec chmod 0644 {} + && find ./${{env.PLUGIN_NAME}} -type d -exec chmod 0755 {} + && ls -lah" - - # Compact plugin as .zip - - name: Archive Release - uses: thedoctor0/zip-release@master - with: - type: "zip" - path: "${{ env.PLUGIN_NAME }}" - directory: "." - filename: "${{ env.PLUGIN_NAME }}.zip" - exclusions: "*.git* /*node_modules/* .editorconfig" - - - name: Archive Release with auto-updater - uses: thedoctor0/zip-release@master - with: - type: "zip" - path: "${{ env.PLUGIN_NAME_WITH_UPDATER }}" - directory: "." - filename: "${{ env.PLUGIN_NAME_WITH_UPDATER }}.zip" - exclusions: "*.git* /*node_modules/* .editorconfig" - - # Update version tag - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - # Generate new release - - name: Generate new Release - uses: ncipollo/release-action@v1 - with: - artifacts: "${{ env.PLUGIN_NAME }}.zip,${{env.PLUGIN_NAME_WITH_UPDATER}}.zip" - token: ${{ secrets.GITHUB_TOKEN }} - commit: "main" - draft: true - tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.tag_version.outputs.new_tag }} +name: Generate new release for plugin + +on: + pull_request: + types: [closed] + branches: [main] + +env: + PLUGIN_NAME: payment-erede-for-givewp + PLUGIN_NAME_WITH_UPDATER: payment-erede-for-givewp-updt + +jobs: + release-build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + # Add plugin files to a root directory + - name: Make plugin root directory with auto-updater + run: "mkdir ${{env.PLUGIN_NAME_WITH_UPDATER}} && cp -r ./languages ./admin ./includes ./public LICENSE *.php ./${{env.PLUGIN_NAME_WITH_UPDATER}}/ && find ./${{env.PLUGIN_NAME_WITH_UPDATER}} -type f -exec chmod 0644 {} + && find ./${{env.PLUGIN_NAME_WITH_UPDATER}} -type d -exec chmod 0755 {} + && ls -lah" + + - name: Make plugin root directory + run: "rm -Rf ./includes/plugin-updater && mkdir ${{env.PLUGIN_NAME}} && mv -t ./${{env.PLUGIN_NAME}} ./languages ./admin ./includes ./public LICENSE *.php *.txt && find ./${{env.PLUGIN_NAME}} -type f -exec chmod 0644 {} + && find ./${{env.PLUGIN_NAME}} -type d -exec chmod 0755 {} + && ls -lah" + + # Compact plugin as .zip + - name: Archive Release + uses: thedoctor0/zip-release@master + with: + type: "zip" + path: "${{ env.PLUGIN_NAME }}" + directory: "." + filename: "${{ env.PLUGIN_NAME }}.zip" + exclusions: "*.git* /*node_modules/* .editorconfig" + + - name: Archive Release with auto-updater + uses: thedoctor0/zip-release@master + with: + type: "zip" + path: "${{ env.PLUGIN_NAME_WITH_UPDATER }}" + directory: "." + filename: "${{ env.PLUGIN_NAME_WITH_UPDATER }}.zip" + exclusions: "*.git* /*node_modules/* .editorconfig" + + # Update version tag + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + # Generate new release + - name: Generate new Release + uses: ncipollo/release-action@v1 + with: + artifacts: "${{ env.PLUGIN_NAME }}.zip,${{env.PLUGIN_NAME_WITH_UPDATER}}.zip" + token: ${{ secrets.GITHUB_TOKEN }} + commit: "main" + draft: true + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} diff --git a/.gitignore b/.gitignore index b9c670c..23b077b 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -.devcontainer/devcontainer.json -.vscode/settings.json -vendor -node_modules +.devcontainer/devcontainer.json +.vscode/settings.json +vendor +node_modules includes/logs/*.log \ No newline at end of file diff --git a/.vscode/.php-cs-fixer.php b/.vscode/.php-cs-fixer.php index 05c65b3..3e93d63 100755 --- a/.vscode/.php-cs-fixer.php +++ b/.vscode/.php-cs-fixer.php @@ -1,89 +1,89 @@ -setRules(array( - 'short_scalar_cast' => true, - 'visibility_required' => true, - 'elseif' => true, - 'no_superfluous_elseif' => true, - 'align_multiline_comment' => array('comment_type' => 'phpdocs_like'), - 'array_syntax' => array('syntax' => 'long'), - 'binary_operator_spaces' => true, - 'blank_line_after_opening_tag' => false, - 'braces' => array( - 'position_after_functions_and_oop_constructs' => 'same', - ), - 'cast_spaces' => true, - 'class_attributes_separation' => array( - 'elements' => array( - 'const' => 'one', - 'method' => 'one', - 'property' => 'only_if_meta', - ), - ), - 'class_definition' => array('single_line' => true), - 'class_keyword_remove' => true, - 'concat_space' => array('spacing' => 'one'), - 'control_structure_continuation_position' => true, - 'dir_constant' => true, - 'fully_qualified_strict_types' => true, - 'global_namespace_import' => true, - 'include' => true, - 'list_syntax' => array('syntax' => 'long'), - 'lowercase_cast' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'magic_method_casing' => true, - 'method_chaining_indentation' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, - 'no_alternative_syntax' => array('fix_non_monolithic_code' => false), - 'no_blank_lines_after_class_opening' => false, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_extra_blank_lines' => array( - 'tokens' => array( - 'continue', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ), - ), - 'no_spaces_around_offset' => array('positions' => array('outside')), - 'no_spaces_inside_parenthesis' => false, - 'not_operator_with_space' => true, - // 'not_operator_with_successor_space' => true, - 'phpdoc_tag_casing' => true, - 'phpdoc_types_order' => array( - 'null_adjustment' => 'always_last', - 'sort_algorithm' => 'none', - ), - 'single_line_throw' => true, - 'strict_param' => true, - 'trim_array_spaces' => true, - // WPCS 3.0 proposal, yoda style is optional - 'yoda_style' => array( - 'always_move_variable' => true, - 'equal' => true, - 'identical' => true, - 'always_move_variable' => true, - ), - 'modernize_types_casting' => true, - 'void_return' => true, - 'logical_operators' => true, - 'array_indentation' => true, - 'whitespace_after_comma_in_array' => array( - 'ensure_single_space' => true, - ), - 'method_argument_space' => array( - 'keep_multiple_spaces_after_comma' => false, - 'on_multiline' => 'ensure_fully_multiline', - ), - )) - ->setIndent(' ') - ->setLineEnding("\n") - ->setRiskyAllowed(true); +setRules(array( + 'short_scalar_cast' => true, + 'visibility_required' => true, + 'elseif' => true, + 'no_superfluous_elseif' => true, + 'align_multiline_comment' => array('comment_type' => 'phpdocs_like'), + 'array_syntax' => array('syntax' => 'long'), + 'binary_operator_spaces' => true, + 'blank_line_after_opening_tag' => false, + 'braces' => array( + 'position_after_functions_and_oop_constructs' => 'same', + ), + 'cast_spaces' => true, + 'class_attributes_separation' => array( + 'elements' => array( + 'const' => 'one', + 'method' => 'one', + 'property' => 'only_if_meta', + ), + ), + 'class_definition' => array('single_line' => true), + 'class_keyword_remove' => true, + 'concat_space' => array('spacing' => 'one'), + 'control_structure_continuation_position' => true, + 'dir_constant' => true, + 'fully_qualified_strict_types' => true, + 'global_namespace_import' => true, + 'include' => true, + 'list_syntax' => array('syntax' => 'long'), + 'lowercase_cast' => true, + 'lowercase_static_reference' => true, + 'magic_constant_casing' => true, + 'magic_method_casing' => true, + 'method_chaining_indentation' => true, + 'native_constant_invocation' => true, + 'native_function_casing' => true, + 'native_function_type_declaration_casing' => true, + 'new_with_braces' => true, + 'no_alternative_syntax' => array('fix_non_monolithic_code' => false), + 'no_blank_lines_after_class_opening' => false, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_extra_blank_lines' => array( + 'tokens' => array( + 'continue', + 'extra', + 'parenthesis_brace_block', + 'square_brace_block', + 'throw', + 'use', + ), + ), + 'no_spaces_around_offset' => array('positions' => array('outside')), + 'no_spaces_inside_parenthesis' => false, + 'not_operator_with_space' => true, + // 'not_operator_with_successor_space' => true, + 'phpdoc_tag_casing' => true, + 'phpdoc_types_order' => array( + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ), + 'single_line_throw' => true, + 'strict_param' => true, + 'trim_array_spaces' => true, + // WPCS 3.0 proposal, yoda style is optional + 'yoda_style' => array( + 'always_move_variable' => true, + 'equal' => true, + 'identical' => true, + 'always_move_variable' => true, + ), + 'modernize_types_casting' => true, + 'void_return' => true, + 'logical_operators' => true, + 'array_indentation' => true, + 'whitespace_after_comma_in_array' => array( + 'ensure_single_space' => true, + ), + 'method_argument_space' => array( + 'keep_multiple_spaces_after_comma' => false, + 'on_multiline' => 'ensure_fully_multiline', + ), + )) + ->setIndent(' ') + ->setLineEnding("\n") + ->setRiskyAllowed(true); diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 08cdf12..385436a 100755 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,10 @@ -{ - "recommendations": [ - "mehedidracula.php-namespace-resolver", - "eamodio.gitlens", - "vivaxy.vscode-conventional-commits", - "ms-vscode-remote.remote-containers", - "yzhang.markdown-all-in-one", - "standard.vscode-standard" - ] +{ + "recommendations": [ + "mehedidracula.php-namespace-resolver", + "eamodio.gitlens", + "vivaxy.vscode-conventional-commits", + "ms-vscode-remote.remote-containers", + "yzhang.markdown-all-in-one", + "standard.vscode-standard" + ] } \ No newline at end of file diff --git a/.vscode/settings.example.json b/.vscode/settings.example.json index 2ee2328..9b8fef9 100755 --- a/.vscode/settings.example.json +++ b/.vscode/settings.example.json @@ -1,7 +1,7 @@ -{ - "intelephense.environment.phpVersion": "8.1", - // For autocomplete - "intelephense.environment.includePaths": [ - "/home/vscode/_wordpress" // This path is a bind mount that comes from devcontainer.json. - ] +{ + "intelephense.environment.phpVersion": "8.1", + // For autocomplete + "intelephense.environment.includePaths": [ + "/home/vscode/_wordpress" // This path is a bind mount that comes from devcontainer.json. + ] } \ No newline at end of file diff --git a/admin/class-payment-erede-for-givewp-admin.php b/Admin/LknPaymentEredeForGivewpAdmin.php similarity index 92% rename from admin/class-payment-erede-for-givewp-admin.php rename to Admin/LknPaymentEredeForGivewpAdmin.php index 8d3d87d..66a3b13 100644 --- a/admin/class-payment-erede-for-givewp-admin.php +++ b/Admin/LknPaymentEredeForGivewpAdmin.php @@ -1,323 +1,330 @@ - - */ -class Payment_Erede_For_Givewp_Admin { - /** - * The ID of this plugin. - * - * @since 1.0.0 - * @access private - * @var string $plugin_name The ID of this plugin. - */ - private $plugin_name; - - /** - * The version of this plugin. - * - * @since 1.0.0 - * @access private - * @var string $version The current version of this plugin. - */ - private $version; - - /** - * Initialize the class and set its properties. - * - * @since 1.0.0 - * @param string $plugin_name The name of this plugin. - * @param string $version The version of this plugin. - */ - public function __construct( $plugin_name, $version ) { - $this->plugin_name = $plugin_name; - $this->version = $version; - } - - /** - * Register the stylesheets for the admin area. - * - * @since 1.0.0 - */ - public function enqueue_styles(): void { - /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined - * in that particular class. - * - * The Payment_Erede_For_Givewp_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ - wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/payment-erede-for-givewp-admin.css', array(), $this->version, 'all' ); - } - - /** - * Register the JavaScript for the admin area. - * - * @since 1.0.0 - */ - public function enqueue_scripts(): void { - /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined - * in that particular class. - * - * The Payment_Erede_For_Givewp_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ - wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/payment-erede-for-givewp-admin.js', array('jquery'), $this->version, false ); - - $noticeDesc = sprintf( - ' %1$s %2$s %3$s %4$s', - __('Get new features with', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - '', - __('Payment E-Rede for GiveWP PRO.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - '', - ); - - $currencyExchangeLabel = sprintf( - '%1$s %2$s %3$s %4$s', - __('Calculate exchange rates automatically for international currencies, we have full compatibility with the', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - '', - __('Multicurrency plugin for GiveWP by Link Nacional.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - '', - ); - - wp_localize_script($this->plugin_name, 'lknEredePaymentAdmin', array( - 'notice' => esc_html__($noticeDesc), - 'captureLabelTitle' => esc_html__('Manual capture your transactions', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'captureLabelDesc' => esc_html__('Capture your transactions manually to avoid chargeback and card testing.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'returnLabelTitle' => esc_html__('Refund your transactions', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'returnLabelDesc' => esc_html__('Option to refund transaction amount integrated into GiveWP donation details.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'installmentLabelTitle' => esc_html__('Donations in installments', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'installmentLabelDesc' => esc_html__('Option for your donor to pay the donation in installments.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'currencyExchangeLabelTitle' => esc_html__('International currency exchange', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'currencyExchangeLabelDesc' => $currencyExchangeLabel, - )); - } - - public function register_gateway($gateways) { - $gateways['lkn_erede_credit'] = array( - 'admin_label' => __('E-Rede API - Credit Card', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'checkout_label' => __('E-Rede - Credit Card', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - ); - - $gateways['lkn_erede_debit_3ds'] = array( - 'admin_label' => __('E-Rede API - Debit Card 3DS', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'checkout_label' => __('E-Rede - Debit Card', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - ); - - return $gateways; - } - - public function add_new_setting_section($sections) :array { - $sections['lkn-erede-credit'] = __('E-Rede API - Credit Card', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN); - $sections['lkn-erede-debit-3ds'] = __('E-Rede API - Debit Card 3DS', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN); - - return $sections; - } - - public function add_settings_into_section($settings) :array { - $currentSection = give_get_current_setting_section(); - - switch ($currentSection) { - case 'lkn-erede-credit': - $settings[] = array( - 'type' => 'title', - 'id' => 'lkn_erede_credit', - ); - - $settings[] = array( - 'name' => __('Environment type', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_credit_env_setting_field', - 'desc' => __('Environment type to make transactions.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'radio', - 'default' => 'sandbox', - 'options' => array( - 'sandbox' => __('Homologation environment for developer', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'production' => __('Production', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ), - ); - - $settings[] = array( - 'name' => __('PV', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_credit_pv_setting_field', - 'desc' => __('E-Rede API credential filiation number.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'api_key', - 'default' => '', - ); - - $settings[] = array( - 'name' => __('Token', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_credit_token_setting_field', - 'desc' => __('E-Rede API credential secret token.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'api_key', - 'default' => '', - ); - - $settings[] = array( - 'name' => __('Transaction description', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_credit_softdescription_setting_field', - 'desc' => __('Description that will appear on the customer card statement, does not allow special characters or white space.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'text', - 'default' => '', - ); - - $settings[] = array( - 'name' => __('Billing fields', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_credit_billing_fields_setting_field', - 'desc' => __('Adds additional address fields to your donation form.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'radio', - 'default' => 'disabled', - 'options' => array( - 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ), - ); - - $settings[] = array( - 'name' => __('Debug mode', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_credit_debug_setting_field', - 'desc' => __('Saves transaction logs for testing purposes.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'radio', - 'default' => 'disabled', - 'options' => array( - 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ), - ); - - $settings[] = array( - 'id' => 'lkn_erede_credit', - 'type' => 'sectionend', - ); - - break; - case 'lkn-erede-debit-3ds': - $settings[] = array( - 'type' => 'title', - 'id' => 'lkn_erede_debit_3ds', - ); - - $settings[] = array( - 'name' => __('Environment type', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_debit_3ds_env_setting_field', - 'desc' => __('Environment type to make transactions.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'radio', - 'default' => 'sandbox', - 'options' => array( - 'sandbox' => __('Homologation environment for developer', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'production' => __('Production', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ), - ); - - $settings[] = array( - 'name' => __('PV', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_debit_3ds_pv_setting_field', - 'desc' => __('E-Rede API credential filiation number.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'api_key', - 'default' => '', - ); - - $settings[] = array( - 'name' => __('Token', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_debit_3ds_token_setting_field', - 'desc' => __('E-Rede API credential secret token.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'api_key', - 'default' => '', - ); - - $settings[] = array( - 'name' => __('Transaction description', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_debit_3ds_softdescription_setting_field', - 'desc' => __('Description that will appear on the customer card statement, does not allow special characters or white space.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'text', - 'default' => '', - ); - - $settings[] = array( - 'name' => __('Billing fields', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_debit_3ds_billing_fields_setting_field', - 'desc' => __('Adds additional address fields to your donation form.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'radio', - 'default' => 'disabled', - 'options' => array( - 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ), - ); - - $settings[] = array( - 'name' => __('Debug mode', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'id' => 'lkn_erede_debit_3ds_debug_setting_field', - 'desc' => __('Saves transaction logs for testing purposes.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'type' => 'radio', - 'default' => 'disabled', - 'options' => array( - 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ), - ); - - $settings[] = array( - 'id' => 'lkn_erede_debit_3ds', - 'type' => 'sectionend', - ); - - break; - - default: - # code... - break; - } - - return $settings; - } - - public function add_donation_details($payment_id) :void { - $metaOpt = json_decode(give_get_meta($payment_id, 'lkn_erede_response', true)); - - if (isset($metaOpt->status)) { - load_template( - plugin_dir_path(__FILE__) . 'partials/payment-erede-for-givewp-admin-display.php', - true, - array( - 'status' => $metaOpt->status, - 'message' => $metaOpt->message, - 'transaction_id' => $metaOpt->transaction_id, - 'capture' => $metaOpt->capture, - 'log_exists' => file_exists(PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $metaOpt->log . '.log'), - 'log_data' => base64_encode(file_get_contents(PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $metaOpt->log . '.log')), - 'status_label' => __('Return code:', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'message_label' => __('Return message:', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'transaction_label' => __('Transaction ID:', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'log_label' => __('Transaction log in base64', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), - 'know_more_label' => __('Know more', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) - ) - ); - } - } -} + + */ +class LknPaymentEredeForGivewpAdmin { + /** + * The ID of this plugin. + * + * @since 1.0.0 + * @access private + * @var string $plugin_name The ID of this plugin. + */ + private $plugin_name; + + /** + * The version of this plugin. + * + * @since 1.0.0 + * @access private + * @var string $version The current version of this plugin. + */ + private $version; + + /** + * Initialize the class and set its properties. + * + * @since 1.0.0 + * @param string $plugin_name The name of this plugin. + * @param string $version The version of this plugin. + */ + public function __construct( $plugin_name, $version ) { + $this->plugin_name = $plugin_name; + $this->version = $version; + } + + /** + * Register the stylesheets for the admin area. + * + * @since 1.0.0 + */ + public function enqueue_styles(): void { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined + * in that particular class. + * + * The Payment_Erede_For_Givewp_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/payment-erede-for-givewp-admin.css', array(), $this->version, 'all' ); + } + + /** + * Register the JavaScript for the admin area. + * + * @since 1.0.0 + */ + public function enqueue_scripts(): void { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined + * in that particular class. + * + * The Payment_Erede_For_Givewp_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/payment-erede-for-givewp-admin.js', array('jquery'), $this->version, false ); + + $noticeDesc = sprintf( + ' %1$s %2$s %3$s %4$s', + __('Get new features with', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + '', + __('Payment E-Rede for GiveWP PRO.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + '', + ); + + $currencyExchangeLabel = sprintf( + '%1$s %2$s %3$s %4$s', + __('Calculate exchange rates automatically for international currencies, we have full compatibility with the', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + '', + __('Multicurrency plugin for GiveWP by Link Nacional.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + '', + ); + + wp_localize_script($this->plugin_name, 'lknEredePaymentAdmin', array( + 'notice' => esc_html__($noticeDesc), + 'captureLabelTitle' => esc_html__('Manual capture your transactions', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'captureLabelDesc' => esc_html__('Capture your transactions manually to avoid chargeback and card testing.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'returnLabelTitle' => esc_html__('Refund your transactions', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'returnLabelDesc' => esc_html__('Option to refund transaction amount integrated into GiveWP donation details.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'installmentLabelTitle' => esc_html__('Donations in installments', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'installmentLabelDesc' => esc_html__('Option for your donor to pay the donation in installments.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'currencyExchangeLabelTitle' => esc_html__('International currency exchange', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'currencyExchangeLabelDesc' => $currencyExchangeLabel, + )); + } + + /** + * Add new section to "General" setting tab + * + * @param $sections + * + * @return array + */ + public function new_setting_section($sections) { + $sections['lkn-erede-credit'] = __('E-Rede API - Credit Card', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN); + $sections['lkn-erede-debit-3ds'] = __('E-Rede API - Debit Card 3DS', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN); + + return $sections; + } + + public function add_settings_into_section($settings) :array { + $currentSection = give_get_current_setting_section(); + + switch ($currentSection) { + case 'lkn-erede-credit': + $settings[] = array( + 'type' => 'title', + 'id' => 'lkn_erede_credit', + ); + + $settings[] = array( + 'name' => __('Environment type', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_credit_env_setting_field', + 'desc' => __('Environment type to make transactions.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'sandbox', + 'options' => array( + 'sandbox' => __('Homologation environment for developer', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'production' => __('Production', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ), + ); + + $settings[] = array( + 'name' => __('PV', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_credit_pv_setting_field', + 'desc' => __('E-Rede API credential filiation number.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'api_key', + 'default' => '', + ); + + $settings[] = array( + 'name' => __('Token', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_credit_token_setting_field', + 'desc' => __('E-Rede API credential secret token.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'api_key', + 'default' => '', + ); + + $settings[] = array( + 'name' => __('Transaction description', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_credit_softdescription_setting_field', + 'desc' => __('Description that will appear on the customer card statement, does not allow special characters or white space.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'text', + 'default' => '', + ); + + $settings[] = array( + 'name' => __('Billing fields', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_credit_billing_fields_setting_field', + 'desc' => __('Adds additional address fields to your donation form.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'disabled', + 'options' => array( + 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ), + ); + + $settings[] = array( + 'name' => 'Seguir transação sem autenticação Erede 3DS 2.0', + 'id' => 'lkn_erede_credit_transaction_without_authentication', + 'desc' => __('If the option is enabled, the transaction continues without Erede 3DS 2.0 authentication.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'disabled', + 'options' => array( + 'enabled' => 'Habilitar', + 'disabled' => 'Desabilitar', + ), + ); + + $settings[] = array( + 'name' => __('Debug mode', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_credit_debug_setting_field', + 'desc' => __('Saves transaction logs for testing purposes.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'disabled', + 'options' => array( + 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ), + ); + + $settings[] = array( + 'id' => 'lkn_erede_credit', + 'type' => 'sectionend', + ); + + break; + case 'lkn-erede-debit-3ds': + $settings[] = array( + 'type' => 'title', + 'id' => 'lkn_erede_debit_3ds', + ); + + $settings[] = array( + 'name' => __('Environment type', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_debit_3ds_env_setting_field', + 'desc' => __('Environment type to make transactions.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'sandbox', + 'options' => array( + 'sandbox' => __('Homologation environment for developer', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'production' => __('Production', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ), + ); + + $settings[] = array( + 'name' => __('PV', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_debit_3ds_pv_setting_field', + 'desc' => __('E-Rede API credential filiation number.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'api_key', + 'default' => '', + ); + + $settings[] = array( + 'name' => __('Token', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_debit_3ds_token_setting_field', + 'desc' => __('E-Rede API credential secret token.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'api_key', + 'default' => '', + ); + + $settings[] = array( + 'name' => __('Transaction description', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_debit_3ds_softdescription_setting_field', + 'desc' => __('Description that will appear on the customer card statement, does not allow special characters or white space.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'text', + 'default' => '', + ); + + $settings[] = array( + 'name' => __('Billing fields', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_debit_3ds_billing_fields_setting_field', + 'desc' => __('Adds additional address fields to your donation form.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'disabled', + 'options' => array( + 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ), + ); + + $settings[] = array( + 'name' => __('Debug mode', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'id' => 'lkn_erede_debit_3ds_debug_setting_field', + 'desc' => __('Saves transaction logs for testing purposes.', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'type' => 'radio', + 'default' => 'disabled', + 'options' => array( + 'enabled' => __('Enabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'disabled' => __('Disabled', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ), + ); + + $settings[] = array( + 'id' => 'lkn_erede_debit_3ds', + 'type' => 'sectionend', + ); + + break; + + default: + # code... + break; + } + + return $settings; + } + + public function add_donation_details($payment_id) :void { + $metaOpt = json_decode(give_get_meta($payment_id, 'lkn_erede_response', true)); + + if (isset($metaOpt->status)) { + load_template( + plugin_dir_path(__FILE__) . 'partials/payment-erede-for-givewp-admin-display.php', + true, + array( + 'status' => $metaOpt->status, + 'message' => $metaOpt->message, + 'transaction_id' => $metaOpt->transaction_id, + 'capture' => $metaOpt->capture, + 'log_exists' => file_exists(PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $metaOpt->log . '.log'), + 'log_data' => base64_encode(file_get_contents(PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $metaOpt->log . '.log')), + 'status_label' => __('Return code:', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'message_label' => __('Return message:', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'transaction_label' => __('Transaction ID:', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'log_label' => __('Transaction log in base64', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN), + 'know_more_label' => __('Know more', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN) + ) + ); + } + } +} diff --git a/admin/css/payment-erede-for-givewp-admin.css b/Admin/css/payment-erede-for-givewp-admin.css similarity index 100% rename from admin/css/payment-erede-for-givewp-admin.css rename to Admin/css/payment-erede-for-givewp-admin.css diff --git a/admin/index.php b/Admin/index.php similarity index 100% rename from admin/index.php rename to Admin/index.php diff --git a/admin/js/payment-erede-for-givewp-admin.js b/Admin/js/payment-erede-for-givewp-admin.js similarity index 100% rename from admin/js/payment-erede-for-givewp-admin.js rename to Admin/js/payment-erede-for-givewp-admin.js diff --git a/admin/partials/payment-erede-for-givewp-admin-display.php b/Admin/partials/payment-erede-for-givewp-admin-display.php similarity index 100% rename from admin/partials/payment-erede-for-givewp-admin-display.php rename to Admin/partials/payment-erede-for-givewp-admin-display.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 6af6222..efefbe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ -# 1.0.2 - 22/09/2023 -* Fix a bug in translation. - -# 1.0.1 - 20/09/2023 -* Fix a bug with front-end hook collisions. - -# 1.0.0 - 04/09/2023 +# 2.0.0 - 14/05/2024 +* Added compatibility with GiveWP 3.0.0 template. +* General plugin optimizations. +* Addition of 3DS 2.0 for credit card payments. + +# 1.0.2 - 22/09/2023 +* Fix a bug in translation. + +# 1.0.1 - 20/09/2023 +* Fix a bug with front-end hook collisions. + +# 1.0.0 - 04/09/2023 * First Release. \ No newline at end of file diff --git a/Includes/LknPaymentEredeForGivewp.php b/Includes/LknPaymentEredeForGivewp.php new file mode 100644 index 0000000..3020564 --- /dev/null +++ b/Includes/LknPaymentEredeForGivewp.php @@ -0,0 +1,396 @@ + + */ +class LknPaymentEredeForGivewp { + /** + * The loader that's responsible for maintaining and registering all hooks that power + * the plugin. + * + * @since 1.0.0 + * @access protected + * @var Payment_Erede_For_Givewp_Loader $loader Maintains and registers all hooks for the plugin. + */ + protected $loader; + + /** + * The unique identifier of this plugin. + * + * @since 1.0.0 + * @access protected + * @var string $plugin_name The string used to uniquely identify this plugin. + */ + protected $plugin_name; + + /** + * The current version of the plugin. + * + * @since 1.0.0 + * @access protected + * @var string $version The current version of the plugin. + */ + protected $version; + + /** + * Define the core functionality of the plugin. + * + * Set the plugin name and the plugin version that can be used throughout the plugin. + * Load the dependencies, define the locale, and set the hooks for the admin area and + * the public-facing side of the site. + * + * @since 1.0.0 + */ + public function __construct() { + if ( defined( 'PAYMENT_EREDE_FOR_GIVEWP_VERSION' ) ) { + $this->version = PAYMENT_EREDE_FOR_GIVEWP_VERSION; + } else { + $this->version = '1.0.0'; + } + $this->plugin_name = 'payment-erede-for-givewp'; + + $this->load_dependencies(); + $this->set_locale(); + $this->define_admin_hooks(); + $this->define_public_hooks(); + $this->schedule_events(); + } + + public function schedule_events() : void { + if ( ! wp_next_scheduled( 'lkn_payment_erede_cron_verify_payment' ) ) { + wp_schedule_event( time() + 60, 'every_minute', 'lkn_payment_erede_cron_verify_payment' ); + } else { + wp_schedule_event( time() + 60, 'every_minute', 'lkn_payment_erede_cron_verify_payment' ); + } + + if ( ! wp_next_scheduled( 'lkn_payment_erede_cron_delete_logs' ) ) { + wp_schedule_event( time() + 604800, 'weekly', 'lkn_payment_erede_cron_delete_logs' ); + } + } + + public function verify_payment() : bool { + $paymentsToVerify = give_get_option('lkn_erede_3ds_payments_pending', ''); + $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true) ?: '[]', true); + $logname = gmdate('d.m.Y-H.i.s') . '-3ds-verification'; + + if (is_array($paymentsToVerify) && ! empty($paymentsToVerify)) { + $configs = LknPaymentEredeForGivewpHelper::get_configs('debit-3ds'); + $authorization = base64_encode($configs['pv'] . ':' . $configs['token']); + $paymentsToValidate = array(); + $logname = gmdate('d.m.Y-H.i.s') . '-3ds-verification'; + $headers = array( + 'Authorization' => 'Basic ' . $authorization, + 'Content-Type' => 'application/json' + ); + + foreach ($paymentsToVerify as $payment) { + $donation_payment = Donation::find($payment['id']); + + $responseRaw = wp_remote_get($configs['api_url'] . '?reference=' . 'order' . $payment['id'], array('headers' => $headers)); + $response = json_decode(wp_remote_retrieve_body($responseRaw)); + + if ('enabled' === $configs['debug']) { + // Realizar o logging da informação relevante + $rawHeaders = wp_remote_retrieve_headers($responseRaw); + $logMessage = 'VERIFY PAYMENT - [Raw header]: ' . var_export($rawHeaders, true) . \PHP_EOL . + ' [INFO]: ' . var_export($payment, true) . \PHP_EOL . + ' [BODY]: ' . var_export($response, true); + + LknPaymentEredeForGivewpHelper::log($logMessage, $logname); + } + + if ($response && isset($response->authorization) && isset($response->authorization->returnCode)) { + $returnCode = $response->authorization->returnCode; + } elseif ($response && isset($response->returnCode)) { + $returnCode = $response->returnCode; + } else { + $donation_payment->status = DonationStatus::FAILED(); + $donation_payment->save(); + continue; + } + + // Atualizar o status da doação com base no código de retorno + switch ($returnCode) { + case '00': + // Transação aprovada, atualizar o status da doação para COMPLETE + $donation_payment->status = DonationStatus::COMPLETE(); + $donation_payment->save(); + break; + case '78': + $counter = isset($payment['count']) ? (int) $payment['count'] + 1 : 1; + + if ($counter > 5) { + $donation_payment->status = DonationStatus::FAILED(); + $donation_payment->save(); + } else { + $payment['count'] = $counter; + $paymentsToValidate[] = $payment; + } + break; + default: + // Outro código de retorno não esperado, marcar a doação como FAILED + $donation_payment->status = DonationStatus::FAILED(); + $donation_payment->save(); + break; + } + } + + $pendingPayments = ! empty($paymentsToValidate) ? base64_encode(wp_json_encode($paymentsToValidate)) : ''; + give_update_option('lkn_erede_3ds_payments_pending', $pendingPayments); + } else { + give_update_option('lkn_erede_3ds_payments_pending', ''); + } + + return true; + } + + /** + * Load the required dependencies for this plugin. + * + * Include the following files that make up the plugin: + * + * - Payment_Erede_For_Givewp_Loader. Orchestrates the hooks of the plugin. + * - Payment_Erede_For_Givewp_i18n. Defines internationalization functionality. + * - Payment_Erede_For_Givewp_Admin. Defines all hooks for the admin area. + * - Payment_Erede_For_Givewp_Public. Defines all hooks for the public side of the site. + * + * Create an instance of the loader which will be used to register the hooks + * with WordPress. + * + * @since 1.0.0 + * @access private + */ + private function load_dependencies(): void { + $this->loader = new LknPaymentEredeForGivewpLoader(); + } + + private function set_locale(): void { + $plugin_i18n = new LknPaymentEredeForGivewpI8n(); + + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); + } + + public function define_row_meta($plugin_meta, $plugin_file) :array { + if ( ! defined(PAYMENT_EREDE_FOR_GIVEWP_BASENAME) && ! is_plugin_active(PAYMENT_EREDE_FOR_GIVEWP_BASENAME)) { + return $plugin_meta; + } + + $new_meta_links['setting'] = sprintf( + '%2$s', + admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'), + 'Settings', + ); + + return array_merge($plugin_meta, $new_meta_links); + } + + public function check_environment() : bool { + // Flag to check whether deactivate plugin or not. + $is_deactivate_plugin = false; + + // Load plugin helper functions. + if ( ! function_exists('deactivate_plugins') || ! function_exists('is_plugin_active')) { + require_once ABSPATH . '/wp-admin/includes/plugin.php'; + } + + if ( + defined('GIVE_VERSION') + && version_compare(GIVE_VERSION, PAYMENT_EREDE_FOR_GIVEWP_MIN_GIVE_VERSION, '<') + ) { + // Min. Give. plugin version. + + // Show admin notice. + add_action('admin_notices', array($this, 'givewp_dependency_notice')); + + $is_deactivate_plugin = true; + } + + $is_give_active = defined('GIVE_PLUGIN_BASENAME') ? is_plugin_active(GIVE_PLUGIN_BASENAME) : false; + + if ( ! $is_give_active) { + add_action('admin_notices', array($this, 'givewp_dependency_notice')); + + $is_deactivate_plugin = true; + } + + // Don't let this plugin activate. + if ($is_deactivate_plugin) { + // Deactivate plugin. + deactivate_plugins(PAYMENT_EREDE_FOR_GIVEWP_BASENAME); + + if (isset($_GET['activate'])) { + unset($_GET['activate']); + } + return false; + } + + return true; + } + + public static function givewp_dependency_notice(): void { + // Admin notice. + $message = sprintf( + '

%1$s %2$s %4$s %5$s %6$s+ %7$s.

', + __('Activation error:', ''), + __('You need to have', ''), + 'https://givewp.com', + __('Give WP', ''), + __('version', ''), + PAYMENT_EREDE_FOR_GIVEWP_MIN_GIVE_VERSION, + __('for the Payment Gateway E-Rede for GiveWP plugin to activate.', '') + ); + + echo wp_kses_post($message); + } + + public function custom_check_redirect_params(): void { + if ( is_front_page() ) { + $doacao_id = isset( $_GET['doacao_id'] ) ? (int) ( $_GET['doacao_id'] ) : 0; + $status = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : ''; + + if ( $doacao_id && ( 'success' === $status || 'failure' === $status ) ) { + $redirect_url = ''; + + // Determinar a página de destino com base no status + if ( 'success' === $status ) { + // Obter a URL de sucesso do GiveWP + $redirect_url = give_get_success_page_uri() . '?donation_id=' . $doacao_id; + } elseif ( 'failure' === $status ) { + // Obter a URL de falha do GiveWP + $redirect_url = give_get_failed_transaction_uri(); + } + + // Redirecionar para a URL de destino se encontrada + if ( ! empty( $redirect_url ) ) { + wp_redirect( $redirect_url ); + exit; + } + } + } + } + + /** + * Register all of the hooks related to the admin area functionality + * of the plugin. + * + * @since 1.0.0 + * @access private + */ + private function define_admin_hooks(): void { + $plugin_admin = new LknPaymentEredeForGivewpAdmin( $this->get_plugin_name(), $this->get_version() ); + + $this->loader->add_action( 'template_redirect', $this, 'custom_check_redirect_params' ); + + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); + + $this->loader->add_action('plugins_loaded', $this, 'check_environment', 999); + $this->loader->add_filter('plugin_action_links_' . PAYMENT_EREDE_FOR_GIVEWP_BASENAME, $this, 'define_row_meta', 10, 2); + $this->loader->add_action('lkn_payment_erede_cron_delete_logs', 'Lkn\PaymentEredeForGivewp\Includes\LknPaymentEredeForGivewpHelper', 'delete_old_logs', 10, 0 ); + $this->loader->add_action('lkn_payment_erede_cron_verify_payment', $this, 'verify_payment', 10, 0 ); + + $this->loader->add_filter( 'give_get_settings_gateways', $plugin_admin, 'add_settings_into_section' ); + $this->loader->add_filter('give_get_sections_gateways', $plugin_admin, 'new_setting_section'); + $this->loader->add_action('give_view_donation_details_billing_after', $plugin_admin, 'add_donation_details'); + } + + /** + * Register all of the hooks related to the public-facing functionality + * of the plugin. + * + * @since 1.0.0 + * @access private + */ + private function define_public_hooks(): void { + $plugin_public = new LknPaymentEredeForGivewpPublic( $this->get_plugin_name(), $this->get_version() ); + + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); + $this->loader->add_action('givewp_register_payment_gateway', $this, 'new_gateway_register', 999); + } + + /** + * Register gateway to new GiveWP v3 + * + * @since 3.0.0 + * + * @param PaymentGatewayRegister $paymentGatewayRegister + * + * @return void + */ + final public function new_gateway_register($paymentGatewayRegister): void { + $paymentGatewayRegister->registerGateway('Lkn\PaymentEredeForGivewp\PublicView\LknPaymentEredeForGivewpDebitGateway'); + $paymentGatewayRegister->registerGateway('Lkn\PaymentEredeForGivewp\PublicView\LknPaymentEredeForGivewpCreditGateway'); + } + + /** + * Run the loader to execute all of the hooks with WordPress. + * + * @since 1.0.0 + */ + public function run(): void { + $this->loader->run(); + } + + /** + * The name of the plugin used to uniquely identify it within the context of + * WordPress and to define internationalization functionality. + * + * @since 1.0.0 + * @return string The name of the plugin. + */ + public function get_plugin_name() { + return $this->plugin_name; + } + + /** + * The reference to the class that orchestrates the hooks with the plugin. + * + * @since 1.0.0 + * @return Payment_Erede_For_Givewp_Loader Orchestrates the hooks of the plugin. + */ + public function get_loader() { + return $this->loader; + } + + /** + * Retrieve the version number of the plugin. + * + * @since 1.0.0 + * @return string The version number of the plugin. + */ + public function get_version() { + return $this->version; + } +} diff --git a/includes/class-payment-erede-for-givewp-activator.php b/Includes/LknPaymentEredeForGivewpActivator.php similarity index 84% rename from includes/class-payment-erede-for-givewp-activator.php rename to Includes/LknPaymentEredeForGivewpActivator.php index f6c6206..4c344d3 100644 --- a/includes/class-payment-erede-for-givewp-activator.php +++ b/Includes/LknPaymentEredeForGivewpActivator.php @@ -1,33 +1,35 @@ - - */ -class Payment_Erede_For_Givewp_Activator { - /** - * Short Description. (use period) - * - * Long Description. - * - * @since 1.0.0 - */ - public static function activate(): void { - } -} + + */ +class LknPaymentEredeForGivewpActivator { + /** + * Short Description. (use period) + * + * Long Description. + * + * @since 1.0.0 + */ + public static function activate(): void { + } +} diff --git a/includes/class-payment-erede-for-givewp-deactivator.php b/Includes/LknPaymentEredeForGivewpDeactivator.php similarity index 86% rename from includes/class-payment-erede-for-givewp-deactivator.php rename to Includes/LknPaymentEredeForGivewpDeactivator.php index d5249ee..699bf2c 100644 --- a/includes/class-payment-erede-for-givewp-deactivator.php +++ b/Includes/LknPaymentEredeForGivewpDeactivator.php @@ -1,35 +1,37 @@ - - */ -class Payment_Erede_For_Givewp_Deactivator { - /** - * Short Description. (use period) - * - * Long Description. - * - * @since 1.0.0 - */ - public static function deactivate(): void { - wp_unschedule_hook( 'lkn_payment_erede_cron_delete_logs' ); - wp_unschedule_hook( 'lkn_payment_erede_cron_verify_payment' ); - } -} + + */ +class LknPaymentEredeForGivewpDeactivator { + /** + * Short Description. (use period) + * + * Long Description. + * + * @since 1.0.0 + */ + public static function deactivate(): void { + wp_unschedule_hook( 'lkn_payment_erede_cron_delete_logs' ); + wp_unschedule_hook( 'lkn_payment_erede_cron_verify_payment' ); + } +} diff --git a/includes/class-payment-erede-for-givewp-helper.php b/Includes/LknPaymentEredeForGivewpHelper.php similarity index 82% rename from includes/class-payment-erede-for-givewp-helper.php rename to Includes/LknPaymentEredeForGivewpHelper.php index a147b9d..31a2cec 100644 --- a/includes/class-payment-erede-for-givewp-helper.php +++ b/Includes/LknPaymentEredeForGivewpHelper.php @@ -1,122 +1,115 @@ - - */ -abstract class Payment_Erede_For_Givewp_Helper { - /** - * Get all paymethod config options - * - * @since 1.0.0 - * - * @param string $type - * - * @return array - */ - public static function get_configs($type) :array { - $configs = array(); - - switch ($type) { - case 'credit': - $configs['env'] = give_get_option('lkn_erede_credit_env_setting_field', 'sandbox'); - $configs['pv'] = give_get_option('lkn_erede_credit_pv_setting_field', ''); - $configs['token'] = give_get_option('lkn_erede_credit_token_setting_field', ''); - $configs['billing_fields'] = give_get_option('lkn_erede_credit_billing_fields_setting_field', 'disabled'); - $configs['debug'] = give_get_option('lkn_erede_credit_debug_setting_field', 'disabled'); - $description = give_get_option('lkn_erede_credit_softdescription_setting_field', __('Donation', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN)); - $configs['description'] = Payment_Erede_For_Givewp_Helper::format_softdescriptor_string($description); - - if ('production' === $configs['env']) { - $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions'; - } else { - $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions'; - } - - break; - case 'debit-3ds': - $configs['env'] = give_get_option('lkn_erede_debit_3ds_env_setting_field', 'sandbox'); - $configs['pv'] = give_get_option('lkn_erede_debit_3ds_pv_setting_field', ''); - $configs['token'] = give_get_option('lkn_erede_debit_3ds_token_setting_field', ''); - $configs['billing_fields'] = give_get_option('lkn_erede_debit_3ds_billing_fields_setting_field', 'disabled'); - $configs['debug'] = give_get_option('lkn_erede_debit_3ds_debug_setting_field', 'disabled'); - $description = give_get_option('lkn_erede_debit_3ds_softdescription_setting_field', __('Donation', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN)); - $configs['description'] = Payment_Erede_For_Givewp_Helper::format_softdescriptor_string($description); - - if ('production' === $configs['env']) { - $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions'; - } else { - $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions'; - } - - break; - - default: - # code... - break; - } - - return $configs; - } - - /** - * Get billing fields option - * - * @since 1.0.0 - * - * @return string - */ - public static function get_billing_fields_opt() :string { - return give_get_option('lkn_erede_credit_billing_fields_setting_field', 'disabled'); - } - - public static function log($message, $type) :void { - error_log($message, 3, PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $type . '.log'); - } - - public static function delete_old_logs() :void { - $logsPath = PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR; - - foreach (scandir($logsPath) as $logFilename) { - if ('.' !== $logFilename && '..' !== $logFilename && 'index.php' !== $logFilename) { - $logDate = explode('-', $logFilename)[0]; - $logDate = explode('.', $logDate); - - $logDay = $logDate[0]; - $logMonth = $logDate[1]; - $logYear = $logDate[2]; - - $logDate = $logYear . '-' . $logMonth . '-' . $logDay; - - $logDate = new DateTime($logDate); - $now = new DateTime(date('Y-m-d')); - - $interval = $logDate->diff($now); - $logAge = $interval->format('%a'); - - if ($logAge >= 15) { - unlink($logsPath . '/' . $logFilename); - } - } - } - } - - public static function format_softdescriptor_string($str) :string { - $str = preg_replace('/[áàãâä]/ui', 'a', $str); - $str = preg_replace('/[éèêë]/ui', 'e', $str); - $str = preg_replace('/[íìîï]/ui', 'i', $str); - $str = preg_replace('/[óòõôö]/ui', 'o', $str); - $str = preg_replace('/[úùûü]/ui', 'u', $str); - $str = preg_replace('/[ç]/ui', 'c', $str); - $str = preg_replace('/[^a-zA-Z0-9_]/', '', $str); - - return $str; - } -} + + */ +abstract class LknPaymentEredeForGivewpHelper { + /** + * Get all paymethod config options + * + * @since 1.0.0 + * + * @param string $type + * + * @return array + */ + public static function get_configs($type) :array { + $configs = array(); + switch ($type) { + case 'credit': + $configs['env'] = give_get_option('lkn_erede_credit_env_setting_field', 'sandbox'); + $configs['pv'] = give_get_option('lkn_erede_credit_pv_setting_field', ''); + $configs['token'] = give_get_option('lkn_erede_credit_token_setting_field', ''); + $configs['billing_fields'] = give_get_option('lkn_erede_credit_billing_fields_setting_field', 'disabled'); + $configs['debug'] = give_get_option('lkn_erede_credit_debug_setting_field', 'disabled'); + $description = give_get_option('lkn_erede_credit_softdescription_setting_field', 'Doação'); + $configs['description'] = LknPaymentEredeForGivewpHelper::format_softdescriptor_string($description); + $configs['withoutAuth3DS'] = give_get_option('lkn_erede_credit_transaction_without_authentication'); + + if ('production' === $configs['env']) { + $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions'; + } else { + $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions'; + } + + break; + case 'debit-3ds': + $configs['env'] = give_get_option('lkn_erede_debit_3ds_env_setting_field', 'sandbox'); + $configs['pv'] = give_get_option('lkn_erede_debit_3ds_pv_setting_field', ''); + $configs['token'] = give_get_option('lkn_erede_debit_3ds_token_setting_field', ''); + $configs['billing_fields'] = give_get_option('lkn_erede_debit_3ds_billing_fields_setting_field', 'disabled'); + $configs['debug'] = give_get_option('lkn_erede_debit_3ds_debug_setting_field', 'disabled'); + $description = give_get_option('lkn_erede_debit_3ds_softdescription_setting_field', 'Doação'); + $configs['description'] = LknPaymentEredeForGivewpHelper::format_softdescriptor_string($description); + + if ('production' === $configs['env']) { + $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions'; + } else { + $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions'; + } + + break; + + default: + # code... + break; + } + + return $configs; + } + + public static function log($message, $type) :void { + error_log($message, 3, PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $type . '.log'); + } + + public static function delete_old_logs() :void { + $logsPath = PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR; + + foreach (scandir($logsPath) as $logFilename) { + if ('.' !== $logFilename && '..' !== $logFilename && 'index.php' !== $logFilename) { + $logDate = explode('-', $logFilename)[0]; + $logDate = explode('.', $logDate); + + $logDay = $logDate[0]; + $logMonth = $logDate[1]; + $logYear = $logDate[2]; + + $logDate = $logYear . '-' . $logMonth . '-' . $logDay; + + $logDate = new DateTime($logDate); + $now = new DateTime(gmdate('Y-m-d')); + + $interval = $logDate->diff($now); + $logAge = $interval->format('%a'); + + if ($logAge >= 15) { + wp_delete_file($logsPath . '/' . $logFilename); + } + } + } + } + + public static function format_softdescriptor_string($str) :string { + $str = preg_replace('/[áàãâä]/ui', 'a', $str); + $str = preg_replace('/[éèêë]/ui', 'e', $str); + $str = preg_replace('/[íìîï]/ui', 'i', $str); + $str = preg_replace('/[óòõôö]/ui', 'o', $str); + $str = preg_replace('/[úùûü]/ui', 'u', $str); + $str = preg_replace('/[ç]/ui', 'c', $str); + $str = preg_replace('/[^a-zA-Z0-9_]/', '', $str); + + return $str; + } +} diff --git a/includes/class-payment-erede-for-givewp-i18n.php b/Includes/LknPaymentEredeForGivewpI8n.php similarity index 92% rename from includes/class-payment-erede-for-givewp-i18n.php rename to Includes/LknPaymentEredeForGivewpI8n.php index c61f8f1..974326a 100644 --- a/includes/class-payment-erede-for-givewp-i18n.php +++ b/Includes/LknPaymentEredeForGivewpI8n.php @@ -1,5 +1,7 @@ */ -class Payment_Erede_For_Givewp_i18n { +class LknPaymentEredeForGivewpI8n { /** * Load the plugin text domain for translation. * @@ -37,4 +39,4 @@ public function load_plugin_textdomain(): void { dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' ); } -} +} \ No newline at end of file diff --git a/includes/class-payment-erede-for-givewp-loader.php b/Includes/LknPaymentEredeForGivewpLoader.php similarity index 96% rename from includes/class-payment-erede-for-givewp-loader.php rename to Includes/LknPaymentEredeForGivewpLoader.php index 1968e4b..af3ab92 100644 --- a/includes/class-payment-erede-for-givewp-loader.php +++ b/Includes/LknPaymentEredeForGivewpLoader.php @@ -1,121 +1,123 @@ - - */ -class Payment_Erede_For_Givewp_Loader { - /** - * The array of actions registered with WordPress. - * - * @since 1.0.0 - * @access protected - * @var array $actions The actions registered with WordPress to fire when the plugin loads. - */ - protected $actions; - - /** - * The array of filters registered with WordPress. - * - * @since 1.0.0 - * @access protected - * @var array $filters The filters registered with WordPress to fire when the plugin loads. - */ - protected $filters; - - /** - * Initialize the collections used to maintain the actions and filters. - * - * @since 1.0.0 - */ - public function __construct() { - $this->actions = array(); - $this->filters = array(); - } - - /** - * Add a new action to the collection to be registered with WordPress. - * - * @since 1.0.0 - * @param string $hook The name of the WordPress action that is being registered. - * @param object $component A reference to the instance of the object on which the action is defined. - * @param string $callback The name of the function definition on the $component. - * @param int $priority Optional. The priority at which the function should be fired. Default is 10. - * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. - */ - public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void { - $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); - } - - /** - * Add a new filter to the collection to be registered with WordPress. - * - * @since 1.0.0 - * @param string $hook The name of the WordPress filter that is being registered. - * @param object $component A reference to the instance of the object on which the filter is defined. - * @param string $callback The name of the function definition on the $component. - * @param int $priority Optional. The priority at which the function should be fired. Default is 10. - * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 - */ - public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void { - $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); - } - - /** - * A utility function that is used to register the actions and hooks into a single - * collection. - * - * @since 1.0.0 - * @access private - * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). - * @param string $hook The name of the WordPress filter that is being registered. - * @param object $component A reference to the instance of the object on which the filter is defined. - * @param string $callback The name of the function definition on the $component. - * @param int $priority The priority at which the function should be fired. - * @param int $accepted_args The number of arguments that should be passed to the $callback. - * @return array The collection of actions and filters registered with WordPress. - */ - private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { - $hooks[] = array( - 'hook' => $hook, - 'component' => $component, - 'callback' => $callback, - 'priority' => $priority, - 'accepted_args' => $accepted_args - ); - - return $hooks; - } - - /** - * Register the filters and actions with WordPress. - * - * @since 1.0.0 - */ - public function run(): void { - foreach ( $this->filters as $hook ) { - add_filter( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] ); - } - - foreach ( $this->actions as $hook ) { - add_action( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] ); - } - } -} + + */ +class LknPaymentEredeForGivewpLoader { + /** + * The array of actions registered with WordPress. + * + * @since 1.0.0 + * @access protected + * @var array $actions The actions registered with WordPress to fire when the plugin loads. + */ + protected $actions; + + /** + * The array of filters registered with WordPress. + * + * @since 1.0.0 + * @access protected + * @var array $filters The filters registered with WordPress to fire when the plugin loads. + */ + protected $filters; + + /** + * Initialize the collections used to maintain the actions and filters. + * + * @since 1.0.0 + */ + public function __construct() { + $this->actions = array(); + $this->filters = array(); + } + + /** + * Add a new action to the collection to be registered with WordPress. + * + * @since 1.0.0 + * @param string $hook The name of the WordPress action that is being registered. + * @param object $component A reference to the instance of the object on which the action is defined. + * @param string $callback The name of the function definition on the $component. + * @param int $priority Optional. The priority at which the function should be fired. Default is 10. + * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. + */ + public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void { + $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); + } + + /** + * Add a new filter to the collection to be registered with WordPress. + * + * @since 1.0.0 + * @param string $hook The name of the WordPress filter that is being registered. + * @param object $component A reference to the instance of the object on which the filter is defined. + * @param string $callback The name of the function definition on the $component. + * @param int $priority Optional. The priority at which the function should be fired. Default is 10. + * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1 + */ + public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void { + $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); + } + + /** + * A utility function that is used to register the actions and hooks into a single + * collection. + * + * @since 1.0.0 + * @access private + * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). + * @param string $hook The name of the WordPress filter that is being registered. + * @param object $component A reference to the instance of the object on which the filter is defined. + * @param string $callback The name of the function definition on the $component. + * @param int $priority The priority at which the function should be fired. + * @param int $accepted_args The number of arguments that should be passed to the $callback. + * @return array The collection of actions and filters registered with WordPress. + */ + private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { + $hooks[] = array( + 'hook' => $hook, + 'component' => $component, + 'callback' => $callback, + 'priority' => $priority, + 'accepted_args' => $accepted_args + ); + + return $hooks; + } + + /** + * Register the filters and actions with WordPress. + * + * @since 1.0.0 + */ + public function run(): void { + foreach ( $this->filters as $hook ) { + add_filter( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] ); + } + + foreach ( $this->actions as $hook ) { + add_action( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] ); + } + } +} diff --git a/includes/index.php b/Includes/index.php similarity index 100% rename from includes/index.php rename to Includes/index.php diff --git a/includes/logs/index.php b/Includes/logs/index.php similarity index 100% rename from includes/logs/index.php rename to Includes/logs/index.php diff --git a/LICENSE b/LICENSE index f288702..3877ae0 100755 --- a/LICENSE +++ b/LICENSE @@ -1,674 +1,674 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Public/LknPaymentEredeForGivewpCreditGateway.php b/Public/LknPaymentEredeForGivewpCreditGateway.php new file mode 100644 index 0000000..87f7149 --- /dev/null +++ b/Public/LknPaymentEredeForGivewpCreditGateway.php @@ -0,0 +1,450 @@ +credit_card_form($formId, $args); + } + + /** + * @inheritDoc + */ + public function createPayment(Donation $donation, $gatewayData): GatewayCommand { + try { + // Set the configs values + $configs = LknPaymentEredeForGivewpHelper::get_configs('credit'); + $logname = gmdate('d.m.Y-H.i.s') . '-credit'; + $withoutAuth3DS = $configs['withoutAuth3DS']; + + $donation->firstName = sanitize_text_field($donation->firstName); + $donation->lastName = sanitize_text_field($donation->lastName); + $donation->email = sanitize_email($donation->email); + + // Donation informations. + $donPrice = $donation->amount->formatToDecimal(); + + $cardNum = preg_replace('/\D/', '', sanitize_text_field($gatewayData['paymentCardNum'])); + $CardCVC = $gatewayData['paymentCardCVC']; + $CardName = sanitize_text_field($gatewayData['paymentCardName']); + $CardExp = $gatewayData['paymentCardExp']; + + // 3DS. + $userAgent = $gatewayData['paymentUserAgent']; + $colorDepth = $gatewayData['paymentColorDepth']; + $lang = $gatewayData['paymentLanguage']; + $height = $gatewayData['paymentHeight']; + $width = $gatewayData['paymentWidth']; + $timezone = $gatewayData['paymentTimezoneOffset']; + + //Separando mes e ano + $expDate = explode('/', $CardExp); + $cardExpiryMonth = trim($expDate[0]); + $cardExpiryYear = trim($expDate[1]); + + $headers = array( + 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ), + 'Content-Type' => 'application/json' + ); + + $currencyCode = give_get_currency($donation->formId, $donation); + + $payment_id = $donation->id; + $amount = $donPrice; + $amount = number_format($amount, 2, '', ''); + + // Construir a URL com parâmetros + $redirect_url_sucess = add_query_arg( + array( + 'doacao_id' => $payment_id, + 'status' => 'success' + ), + home_url() + ); + + $redirect_url_fail = add_query_arg( + array( + 'doacao_id' => $payment_id, + 'status' => 'failure' + ), + home_url() + ); + + if ('enabled' == $withoutAuth3DS) { + $body = array( + 'capture' => true, + 'kind' => 'credit', + 'reference' => $payment_id, + 'amount' => $amount, + 'cardholderName' => $CardName, + 'cardNumber' => $cardNum, + 'expirationMonth' => $cardExpiryMonth, + 'expirationYear' => $cardExpiryYear, + 'securityCode' => $CardCVC, + 'softDescriptor' => $configs['description'], + 'subscription' => false, + 'origin' => 1, + 'distributorAffiliation' => 0, + 'storageCard' => '0', + 'transactionCredentials' => array( + 'credentialId' => '01' + ) + ); + } else { + $body = array( + 'capture' => false, + 'kind' => 'credit', + 'reference' => 'order' . $payment_id, + 'amount' => $amount, + 'cardholderName' => $CardName, + 'cardNumber' => $cardNum, + 'expirationMonth' => $cardExpiryMonth, + 'expirationYear' => $cardExpiryYear, + 'securityCode' => $CardCVC, + 'softDescriptor' => $configs['description'], + 'threeDSecure' => array( + 'embedded' => true, + 'onFailure' => 'decline', + 'userAgent' => $userAgent, + 'device' => array( + 'colorDepth' => $colorDepth, + 'deviceType3ds' => 'BROWSER', + 'javaEnabled' => false, + 'language' => $lang, + 'screenHeight' => $height, + 'screenWidth' => $width, + 'timeZoneOffset' => $timezone + ) + ), + 'urls' => array( + array( + 'kind' => 'threeDSecureSuccess', + 'url' => $redirect_url_sucess + ), + array( + 'kind' => 'threeDSecureFailure', + 'url' => $redirect_url_fail + ) + ) + ); + } + + $body = apply_filters('lkn_erede_credit_body', $body, $currencyCode, $donation); + + $response = wp_remote_post($configs['api_url'], array( + 'headers' => $headers, + 'body' => wp_json_encode($body) + )); + + if ('enabled' === $configs['debug']) { + LknPaymentEredeForGivewpHelper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(json_decode(wp_remote_retrieve_body($response)), true), $logname); + } + + $response = json_decode(wp_remote_retrieve_body($response)); + + $arrMetaData = array( + 'status' => $response->returnCode ?? '500', + 'message' => $response->returnMessage ?? 'Error on processing payment', + 'transaction_id' => $response->tid ?? '0', + 'capture' => $body['capture'] + ); + + if ('enabled' === $configs['debug']) { + $arrMetaData['log'] = $logname; + } + + give_update_payment_meta($payment_id, 'lkn_erede_response', wp_json_encode($arrMetaData)); + + switch ($response->returnCode) { + case '00': + + $donation->status = DonationStatus::COMPLETE(); + $donation->save(); + + return new PaymentComplete($payment_id); + exit; + + case '220': + + $paymentsToVerify = give_get_option('lkn_erede_3ds_payments_pending', ''); + + if (empty($paymentsToVerify)) { + $paymentsToVerify = array(); + } else { + $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true); + } + + $paymentsToVerify[] = array('id' => $payment_id, 'count' => '0'); + $paymentsToVerify = base64_encode(wp_json_encode($paymentsToVerify)); + give_update_option('lkn_erede_3ds_payments_pending', $paymentsToVerify); + + $donation->status = DonationStatus::PENDING(); + $donation->save(); + + return new RedirectOffsite($response->threeDSecure->url); + exit; + + default: + $errorMessage = $response->returnMessage ?? 'Error on processing payment'; + + $donation->status = DonationStatus::FAILED(); + $donation->save(); + + DonationNote::create(array( + 'donationId' => $donation->id, + 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage) + )); + + throw new PaymentGatewayException($errorMessage); + } + } catch (Exception $e) { + $errorMessage = $response->returnMessage ?? 'Error on processing payment'; + + $donation->status = DonationStatus::FAILED(); + $donation->save(); + + DonationNote::create(array( + 'donationId' => $donation->id, + 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage) + )); + + throw new PaymentGatewayException($errorMessage); + } + } + + /* ========== FORM RENDER ========== */ + + /** + * Function that build the donation form + * + * @param int $form_id - the form identificator + * + * @param array $args - list of additional arguments + * + * @return mixed + */ + final public static function credit_card_form($form_id, $args) { + $configs = LknPaymentEredeForGivewpHelper::get_configs('credit'); + + ob_start(); + + do_action('give_before_cc_fields', $form_id); ?> + +
+ + Informações de cartão de crédito + + + +
+ + + Doação Segura por Criptografia SSL + +
+ notices->print_frontend_notice( + sprintf( + '%1$s %2$s', + esc_html__('Erro:', 'give'), + esc_html__('Doação desabilitada por falta de SSL (HTTPS).', 'give') + ) + ); + + exit; + } + + ?> + + + + + + + + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ +
+ +
+ +debit_card_form($formId, $args); + } + + /** + * @inheritDoc + */ + public function createPayment(Donation $donation, $gatewayData): GatewayCommand { + try { + // Set the configs values + $configs = LknPaymentEredeForGivewpHelper::get_configs('debit-3ds'); + $logname = gmdate('d.m.Y-H.i.s') . '-debit-3ds'; + + // Donation informations. + $donation->firstName = sanitize_text_field($donation->firstName); + $donation->lastName = sanitize_text_field($donation->lastName); + $donation->email = sanitize_email($donation->email); + $donPrice = $donation->amount->formatToDecimal(); + + // Card informations. + $cardNum = preg_replace('/\D/', '', sanitize_text_field($gatewayData['paymentCardNum'])); + $CardCVC = $gatewayData['paymentCardCVC']; + $CardName = sanitize_text_field($gatewayData['paymentCardName']); + $CardExp = $gatewayData['paymentCardExp']; + + // 3DS. + $userAgent = $gatewayData['paymentUserAgent']; + $colorDepth = $gatewayData['paymentColorDepth']; + $lang = $gatewayData['paymentLanguage']; + $height = $gatewayData['paymentHeight']; + $width = $gatewayData['paymentWidth']; + $timezone = $gatewayData['paymentTimezoneOffset']; + + //Separando mes e ano. + $expDate = explode('/', $CardExp); + $cardExpiryMonth = trim($expDate[0]); + $cardExpiryYear = trim($expDate[1]); + + $headers = array( + 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ), + 'Content-Type' => 'application/json' + ); + + $currencyCode = give_get_currency($donation->formId, $donation); + $payment_id = $donation->id; + + $amount = $donPrice; + $amount = number_format($amount, 2, '', ''); + + // Construir a URL com parâmetros + $redirect_url_sucess = add_query_arg( + array( + 'doacao_id' => $payment_id, + 'status' => 'success' + ), + home_url() + ); + + $redirect_url_fail = add_query_arg( + array( + 'doacao_id' => $payment_id, + 'status' => 'failure' + ), + home_url() + ); + + $body = array( + 'capture' => true, + 'kind' => 'debit', + 'reference' => 'order' . $payment_id, + 'amount' => $amount, + 'cardholderName' => $CardName, + 'cardNumber' => $cardNum, + 'expirationMonth' => $cardExpiryMonth, + 'expirationYear' => $cardExpiryYear, + 'securityCode' => $CardCVC, + 'softDescriptor' => $configs['description'], + 'threeDSecure' => array( + 'embedded' => true, + 'onFailure' => 'decline', + 'userAgent' => $userAgent, + 'device' => array( + 'colorDepth' => $colorDepth, + 'deviceType3ds' => 'BROWSER', + 'javaEnabled' => false, + 'language' => $lang, + 'screenHeight' => $height, + 'screenWidth' => $width, + 'timeZoneOffset' => $timezone + ) + ), + 'urls' => array( + array( + 'kind' => 'threeDSecureSuccess', + 'url' => $redirect_url_sucess + ), + array( + 'kind' => 'threeDSecureFailure', + 'url' => $redirect_url_fail + ) + ) + ); + + $body = apply_filters('lkn_erede_debit_3ds_body', $body, $currencyCode, $donation); + + $response = wp_remote_post($configs['api_url'], array( + 'headers' => $headers, + 'body' => wp_json_encode($body) + )); + + if ('enabled' === $configs['debug']) { + LknPaymentEredeForGivewpHelper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(wp_remote_retrieve_body($response), true), $logname); + } + + $response = json_decode(wp_remote_retrieve_body($response)); + + $arrMetaData = array( + 'status' => $response->returnCode ?? '500', + 'message' => $response->returnMessage ?? 'Error on processing payment', + 'transaction_id' => $response->tid ?? '0', + 'capture' => $body['capture'] + ); + + if ('enabled' === $configs['debug']) { + $arrMetaData['log'] = $logname; + } + + give_update_payment_meta($payment_id, 'lkn_erede_response', wp_json_encode($arrMetaData)); + + switch ($response->returnCode) { + case '200': + + $donation->status = DonationStatus::COMPLETE(); + $donation->save(); + + return new PaymentComplete($payment_id); + exit; + + case '220': + + $paymentsToVerify = give_get_option('lkn_erede_3ds_payments_pending', ''); + + if (empty($paymentsToVerify)) { + $paymentsToVerify = array(); + } else { + $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true); + } + + $paymentsToVerify[] = array('id' => $payment_id, 'count' => '0'); + $paymentsToVerify = base64_encode(wp_json_encode($paymentsToVerify)); + give_update_option('lkn_erede_3ds_payments_pending', $paymentsToVerify); + + $donation->status = DonationStatus::PENDING(); + $donation->save(); + + return new RedirectOffsite($response->threeDSecure->url); + exit; + + default: + $errorMessage = $response->returnMessage ?? 'Error on processing payment'; + + $donation->status = DonationStatus::FAILED(); + $donation->save(); + + DonationNote::create(array( + 'donationId' => $donation->id, + 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage) + )); + + throw new PaymentGatewayException($errorMessage); + } + } catch (Exception $e) { + $errorMessage = $response->returnMessage ?? 'Error on processing payment'; + + $donation->status = DonationStatus::FAILED(); + $donation->save(); + + DonationNote::create(array( + 'donationId' => $donation->id, + 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage) + )); + + throw new PaymentGatewayException($errorMessage); + } + } + + /* ========== FORM RENDER ========== */ + + /** + * Function that build the donation form + * + * @param int $form_id - the form identificator + * + * @param array $args - list of additional arguments + * + * @return mixed + */ + final public static function debit_card_form($form_id, $args) { + $configs = LknPaymentEredeForGivewpHelper::get_configs('debit-3ds'); + + ob_start(); + + do_action('give_before_cc_fields', $form_id); ?> + +
+ + Informações de cartão de débito + + + +
+ + + Doação Segura por Criptografia SSL + +
+ notices->print_frontend_notice( + sprintf( + '%1$s %2$s', + esc_html__('Erro:', 'give'), + esc_html__('Doação desabilitada por falta de SSL (HTTPS).', 'give') + ) + ); + + exit; + } + ?> + + + + + + + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ +
+ +
+ +
+ + - */ -class Payment_Erede_For_Givewp_Public { - /** - * The ID of this plugin. - * - * @since 1.0.0 - * @access private - * @var string $plugin_name The ID of this plugin. - */ - private $plugin_name; - - /** - * The version of this plugin. - * - * @since 1.0.0 - * @access private - * @var string $version The current version of this plugin. - */ - private $version; - - /** - * Initialize the class and set its properties. - * - * @since 1.0.0 - * @param string $plugin_name The name of the plugin. - * @param string $version The version of this plugin. - */ - public function __construct( $plugin_name, $version ) { - $this->plugin_name = $plugin_name . '_public'; - $this->version = $version; - } - - /** - * Register the stylesheets for the public-facing side of the site. - * - * @since 1.0.0 - */ - public function enqueue_styles(): void { - /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined - * in that particular class. - * - * The Payment_Erede_For_Givewp_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ - wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/payment-erede-for-givewp-public.css', array(), $this->version, 'all' ); - } - - /** - * Register the JavaScript for the public-facing side of the site. - * - * @since 1.0.0 - */ - public function enqueue_scripts(): void { - /** - * This function is provided for demonstration purposes only. - * - * An instance of this class should be passed to the run() function - * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined - * in that particular class. - * - * The Payment_Erede_For_Givewp_Loader will then create the relationship - * between the defined hooks and the functions defined in this - * class. - */ - wp_register_script( $this->plugin_name . '_debit_3ds', plugin_dir_url( __FILE__ ) . 'js/payment-erede-for-givewp-debit-3ds.js', array('jquery'), $this->version, false ); - - if (give_is_gateway_active('lkn_erede_debit_3ds')) { - wp_enqueue_script( $this->plugin_name . '_debit_3ds'); - } - } - - public function payment_form_credit($form_id, $args): void { - load_template( - plugin_dir_path(__FILE__) . 'partials/payment-erede-for-givewp-public-display-credit.php', - true, - array( - 'form_id' => $form_id, - 'settings' => $args, - 'billing_details' => Payment_Erede_For_Givewp_Helper::get_billing_fields_opt() - ) - ); - } - - public function payment_form_debit_3ds($form_id, $args): void { - load_template( - plugin_dir_path(__FILE__) . 'partials/payment-erede-for-givewp-public-display-debit-3ds.php', - true, - array( - 'form_id' => $form_id, - 'settings' => $args, - 'billing_details' => Payment_Erede_For_Givewp_Helper::get_billing_fields_opt() - ) - ); - } -} + + */ +class LknPaymentEredeForGivewpPublic { + /** + * The ID of this plugin. + * + * @since 1.0.0 + * @access private + * @var string $plugin_name The ID of this plugin. + */ + private $plugin_name; + + /** + * The version of this plugin. + * + * @since 1.0.0 + * @access private + * @var string $version The current version of this plugin. + */ + private $version; + + /** + * Initialize the class and set its properties. + * + * @since 1.0.0 + * @param string $plugin_name The name of the plugin. + * @param string $version The version of this plugin. + */ + public function __construct( $plugin_name, $version ) { + $this->plugin_name = $plugin_name . '_public'; + $this->version = $version; + } + + /** + * Register the stylesheets for the public-facing side of the site. + * + * @since 1.0.0 + */ + public function enqueue_styles(): void { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined + * in that particular class. + * + * The Payment_Erede_For_Givewp_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/payment-erede-for-givewp-public.css', array(), $this->version, 'all' ); + } + + /** + * Register the JavaScript for the public-facing side of the site. + * + * @since 1.0.0 + */ + public function enqueue_scripts(): void { + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined + * in that particular class. + * + * The Payment_Erede_For_Givewp_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + } +} diff --git a/public/css/payment-erede-for-givewp-public.css b/Public/css/payment-erede-for-givewp-public.css similarity index 100% rename from public/css/payment-erede-for-givewp-public.css rename to Public/css/payment-erede-for-givewp-public.css diff --git a/public/index.php b/Public/index.php similarity index 100% rename from public/index.php rename to Public/index.php diff --git a/Public/js/plugin-credit-script.js b/Public/js/plugin-credit-script.js new file mode 100644 index 0000000..1b1ace5 --- /dev/null +++ b/Public/js/plugin-credit-script.js @@ -0,0 +1,344 @@ +function lknCreditSet3DSvalue() { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const language = window.navigator.language.slice(0, 2); + const height = screen.height; + const width = screen.width; + const colorDepth = window.screen.colorDepth; + const userAgent = navigator.userAgent; + const date = new Date(); + const timezoneOffset = date.getTimezoneOffset(); + form?.setAttribute('data-payment-language', language); + form?.setAttribute('data-payment-height', String(height)); + form?.setAttribute('data-payment-width', String(width)); + form?.setAttribute('data-payment-colorDepth', String(colorDepth)); + form?.setAttribute('data-payment-userAgent', userAgent); + form?.setAttribute('data-payment-date', date.toISOString()); + form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset)); +} + +// Máscara para número de cartão de crédito +function lknCreditCardMask(inputHTML) { + let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + cardNumber = cardNumber.slice(0, 16); + const cardNumberArr = cardNumber.split(''); + const resultArr = []; + + // Aplicar máscara ao número do cartão de crédito + for (let i = 0; i < cardNumberArr.length; i++) { + resultArr.push(cardNumberArr[i]); + + // Adicionar espaços a cada 4 dígitos + if ((i + 1) % 4 === 0 && i < 15) { + resultArr.push(' '); + } + } + inputHTML.target.value = resultArr.join(''); +} + +// Formatar entrada para apenas números +function lknFormatNumbers(inputHTML) { + inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos +} + +function lknCVVMask(inputHTML) { + let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + + // Limitar o CVV a 4 dígitos + if (cvv.length > 4) { + cvv = cvv.slice(0, 4); + } + inputHTML.target.value = cvv; +} +function lknNameValidation(inputHTML) { + let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços + + inputHTML.target.value = name; +} + +// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano +function lknApplyDateMask(inputHTML) { + let currentDate = new Date(); // Obter a data atual + let currentYear = currentDate.getFullYear(); + let currentMonth = currentDate.getMonth() + 1; + let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos + let maskedValue = ''; + + // Limitar o comprimento máximo do valor + value = value.slice(0, 6); + for (let i = 0; i < value.length; i++) { + if (i === 2) { + // Adicionar barra após os dois primeiros caracteres (mês) + maskedValue += ' / '; + } + + // Validar o mês (deve ser entre 01 e 12) + if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) { + maskedValue = ''; // Limpar o valor se o mês for inválido + break; + } + + // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6) + maskedValue += value[i]; + } + + // Validar o ano (deve ser igual ou posterior ao ano atual) + if (maskedValue.length === 9) { + const inputYear = parseInt(maskedValue.slice(5, 9)); + if (inputYear < currentYear) { + maskedValue = ''; // Limpar o valor se o ano for inválido + } else if (inputYear === currentYear) { + // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual + const inputMonth = parseInt(maskedValue.slice(0, 2)); + if (inputMonth < currentMonth) { + maskedValue = ''; // Limpar o valor se o mês for inválido + } + } + } + + inputHTML.target.value = maskedValue; +} +function lknSetBorderColorOninput(inputHTML) { + inputHTML.style.borderColor = '#666'; + inputHTML.setAttribute('aria-invalid', 'false'); +} +function lknSetBorderIfEmpty(elementId) { + const element = document.getElementById(elementId); + if (element && !element.value.trim()) { + element.style.borderColor = 'red'; + element.setAttribute('aria-invalid', 'true'); + } +} +function lknSetDataCard(values) { + // Obter referência para todos os campos de entrada + const cardNumElement = document.getElementById('card_number'); + const cardCVCElement = document.getElementById('card_cvc'); + const cardNameElement = document.getElementById('give-card-name-field'); + const cardExpirationElement = document.getElementById('card_expiry'); + + // Verificar se os elementos existem antes de acessar seus valores + if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) { + throw new Error('Um ou mais campos de cartão não encontrados.'); + } + + // Obter os valores dos campos de entrada + const cardNum = cardNumElement.value; + const cardCVC = cardCVCElement.value; + const cardName = cardNameElement.value; + const cardExpiration = cardExpirationElement.value; + + // Verificar se algum campo está vazio + if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') { + // Definir a borda como vermelha para os campos vazios + lknSetBorderIfEmpty('card_number'); + lknSetBorderIfEmpty('card_cvc'); + lknSetBorderIfEmpty('give-card-name-field'); + lknSetBorderIfEmpty('card_expiry'); + throw new Error('Por favor, preencha todos os campos obrigatórios.'); + } else { + // Todos os campos estão preenchidos, atribuir valores ao objeto 'values' + values.paymentCardNum = cardNum; + values.paymentCardCVC = cardCVC; + values.paymentCardName = cardName; + values.paymentCardExp = cardExpiration; + } +} +function lknCreditGet3DSvalue(values) { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const paymentLanguage = form?.getAttribute('data-payment-language'); + const paymentHeight = form?.getAttribute('data-payment-height'); + const paymentWidth = form?.getAttribute('data-payment-width'); + const paymentColorDepth = form?.getAttribute('data-payment-colorDepth'); + const paymentUserAgent = form?.getAttribute('data-payment-userAgent'); + const paymentDate = form?.getAttribute('data-payment-date'); + const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset'); + + // Verifica se as informações estão presentes antes de usá-las + if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) { + values.paymentLanguage = paymentLanguage; + values.paymentHeight = paymentHeight; + values.paymentWidth = paymentWidth; + values.paymentColorDepth = paymentColorDepth; + values.paymentUserAgent = paymentUserAgent; + values.paymentDate = paymentDate; + values.paymentTimezoneOffset = paymentTimezoneOffset; + } else { + throw new Error('Dados do 3DS não inseridos'); + } +} +const lkn_erede_credit = { + id: 'lkn_erede_credit', + async initialize() {}, + async beforeCreatePayment(values) { + lknSetDataCard(values); + lknCreditGet3DSvalue(values); + if (values.firstname === 'error') { + throw new Error('Gateway failed'); + } + return { + ...values + }; + }, + async afterCreatePayment(response) {}, + Fields() { + setTimeout(() => { + lknCreditSet3DSvalue(); // Chamar a função após o atraso de 1 segundo + }, 1000); + function isSSL() { + return window.location.protocol === 'https:'; + } + + // retorna no front as mensagens de erro + function lknPrintFrontendNotice(title, message) { + return /*#__PURE__*/React.createElement("div", { + className: "error-notice" + }, /*#__PURE__*/React.createElement("strong", null, title), " ", message); + } + if (!isSSL()) { + return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).'); + } else { + return /*#__PURE__*/React.createElement("fieldset", { + className: "give-do-validate", + id: "give_dc_fields" + }, /*#__PURE__*/React.createElement("legend", { + style: { + fontSize: 'large' + } + }, "Informa\xE7\xF5es de cart\xE3o de cr\xE9dito"), /*#__PURE__*/React.createElement("div", { + id: "give_secure_site_wrapper" + }, /*#__PURE__*/React.createElement("span", { + class: "give-icon padlock" + }), /*#__PURE__*/React.createElement("span", { + style: { + display: 'block', + padding: '20px', + textAlign: 'center' + } + }, "Doa\xE7\xE3o Segura por Criptografia SSL")), /*#__PURE__*/React.createElement("div", { + id: "give-card-number-wrap", + class: "form-row form-row-two-thirds form-row-responsive give-lkn-cielo-api-cc-field-wrap" + }, /*#__PURE__*/React.createElement("span", { + for: "card_number", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "N\xFAmero do cart\xE3o", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip hint--top hint--medium hint--bounce", + "aria-label": "Normalmente possui 16 digitos na frente do seu cart\xE3o de cr\xE9dito.", + rel: "tooltip" + }, /*#__PURE__*/React.createElement("i", { + class: "give-icon give-icon-question" + }))), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknFormatNumbers(e), lknCreditCardMask(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + autocomplete: "off", + name: "card_number", + id: "card_number", + class: "card-number give-input required", + placeholder: "N\xFAmero do cart\xE3o", + "aria-required": "true" + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-expiration-wrap", + class: "card-expiration form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap" + }, /*#__PURE__*/React.createElement("span", { + for: "give-card-expiration-field", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "Expira\xE7\xE3o", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip give-icon give-icon-question", + "data-tooltip": "A data de expira\xE7\xE3o do cart\xE3o de cr\xE9dito, geralmente na frente do cart\xE3o." + })), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknApplyDateMask(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + autocomplete: "off", + name: "card_expiry", + id: "card_expiry", + class: "card-expiry give-input required", + placeholder: "MM / AAAA", + "aria-required": "true" + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-name-wrap", + class: "form-row form-row-two-thirds form-row-responsive" + }, /*#__PURE__*/React.createElement("span", { + for: "give-card-name-field", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "Nome do t\xEDtular do cart\xE3o", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip give-icon give-icon-question", + "data-tooltip": "O nome do titular da conta do cart\xE3o de cr\xE9dito." + })), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknNameValidation(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + autocomplete: "off", + id: "give-card-name-field", + name: "card_name", + class: "card-name give-input required", + placeholder: "Nome do titular do cart\xE3o", + "aria-required": "true" + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-cvc-wrap", + class: "form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap" + }, /*#__PURE__*/React.createElement("span", { + for: "give-card-cvc-field", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "CVV", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip give-icon give-icon-question", + "data-tooltip": "S\xE3o os 3 ou 4 d\xEDgitos que est\xE3o atr\xE1s do seu cart\xE3o de cr\xE9dito." + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-cvc-field", + class: "input empty give-lkn-cielo-api-cc-field give-lkn-cielo-api-card-cvc-field" + }), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknCVVMask(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + size: "4", + maxlength: "4", + autocomplete: "off", + name: "card_cvc", + id: "card_cvc", + class: "give-input required", + placeholder: "CVV", + "aria-required": "true" + }))); + } + } +}; +window.givewp.gateways.register(lkn_erede_credit); \ No newline at end of file diff --git a/Public/js/plugin-credit-script.tsx b/Public/js/plugin-credit-script.tsx new file mode 100644 index 0000000..acd0954 --- /dev/null +++ b/Public/js/plugin-credit-script.tsx @@ -0,0 +1,319 @@ +function lknCreditSet3DSvalue() { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const language = window.navigator.language.slice(0, 2) + const height = screen.height + const width = screen.width + const colorDepth = window.screen.colorDepth + const userAgent = navigator.userAgent + const date = new Date() + const timezoneOffset = date.getTimezoneOffset() + + form?.setAttribute('data-payment-language', language); + form?.setAttribute('data-payment-height', String(height)); + form?.setAttribute('data-payment-width', String(width)); + form?.setAttribute('data-payment-colorDepth', String(colorDepth)); + form?.setAttribute('data-payment-userAgent', userAgent); + form?.setAttribute('data-payment-date', date.toISOString()); + form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset)); +} + +// Máscara para número de cartão de crédito +function lknCreditCardMask(inputHTML) { + let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + cardNumber = cardNumber.slice(0, 16); + const cardNumberArr = cardNumber.split(''); + const resultArr = []; + + // Aplicar máscara ao número do cartão de crédito + for (let i = 0; i < cardNumberArr.length; i++) { + resultArr.push(cardNumberArr[i]); + + // Adicionar espaços a cada 4 dígitos + if ((i + 1) % 4 === 0 && i < 15) { + resultArr.push(' '); + } + } + + inputHTML.target.value = resultArr.join(''); +} + +// Formatar entrada para apenas números +function lknFormatNumbers(inputHTML) { + inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos +} + +function lknCVVMask(inputHTML) { + let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + + // Limitar o CVV a 4 dígitos + if (cvv.length > 4) { + cvv = cvv.slice(0, 4); + } + + inputHTML.target.value = cvv; +} + +function lknNameValidation(inputHTML) { + let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços + + inputHTML.target.value = name; +} + +// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano +function lknApplyDateMask(inputHTML) { + let currentDate = new Date(); // Obter a data atual + let currentYear = currentDate.getFullYear(); + let currentMonth = currentDate.getMonth() + 1; + + let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos + let maskedValue = ''; + + // Limitar o comprimento máximo do valor + value = value.slice(0, 6); + + for (let i = 0; i < value.length; i++) { + if (i === 2) { + // Adicionar barra após os dois primeiros caracteres (mês) + maskedValue += ' / '; + } + + // Validar o mês (deve ser entre 01 e 12) + if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) { + maskedValue = ''; // Limpar o valor se o mês for inválido + break; + } + + // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6) + maskedValue += value[i]; + } + + // Validar o ano (deve ser igual ou posterior ao ano atual) + if (maskedValue.length === 9) { + const inputYear = parseInt(maskedValue.slice(5, 9)); + if (inputYear < currentYear) { + maskedValue = ''; // Limpar o valor se o ano for inválido + } else if (inputYear === currentYear) { + // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual + const inputMonth = parseInt(maskedValue.slice(0, 2)); + if (inputMonth < currentMonth) { + maskedValue = ''; // Limpar o valor se o mês for inválido + } + } + } + + inputHTML.target.value = maskedValue; +} + +function lknSetBorderColorOninput(inputHTML) { + inputHTML.style.borderColor = '#666'; + inputHTML.setAttribute('aria-invalid', 'false') +} + +function lknSetBorderIfEmpty(elementId) { + const element = document.getElementById(elementId); + if (element && !element.value.trim()) { + element.style.borderColor = 'red'; + element.setAttribute('aria-invalid', 'true'); + } +} + +function lknSetDataCard(values) { + // Obter referência para todos os campos de entrada + const cardNumElement = document.getElementById('card_number'); + const cardCVCElement = document.getElementById('card_cvc'); + const cardNameElement = document.getElementById('give-card-name-field'); + const cardExpirationElement = document.getElementById('card_expiry'); + + // Verificar se os elementos existem antes de acessar seus valores + if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) { + throw new Error('Um ou mais campos de cartão não encontrados.'); + } + + // Obter os valores dos campos de entrada + const cardNum = cardNumElement.value; + const cardCVC = cardCVCElement.value; + const cardName = cardNameElement.value; + const cardExpiration = cardExpirationElement.value; + + // Verificar se algum campo está vazio + if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') { + // Definir a borda como vermelha para os campos vazios + lknSetBorderIfEmpty('card_number'); + lknSetBorderIfEmpty('card_cvc'); + lknSetBorderIfEmpty('give-card-name-field'); + lknSetBorderIfEmpty('card_expiry'); + throw new Error('Por favor, preencha todos os campos obrigatórios.'); + } else { + // Todos os campos estão preenchidos, atribuir valores ao objeto 'values' + values.paymentCardNum = cardNum; + values.paymentCardCVC = cardCVC; + values.paymentCardName = cardName; + values.paymentCardExp = cardExpiration; + } +} + +function lknCreditGet3DSvalue(values) { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const paymentLanguage = form?.getAttribute('data-payment-language'); + const paymentHeight = form?.getAttribute('data-payment-height'); + const paymentWidth = form?.getAttribute('data-payment-width'); + const paymentColorDepth = form?.getAttribute('data-payment-colorDepth'); + const paymentUserAgent = form?.getAttribute('data-payment-userAgent'); + const paymentDate = form?.getAttribute('data-payment-date'); + const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset'); + + // Verifica se as informações estão presentes antes de usá-las + if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) { + values.paymentLanguage = paymentLanguage + values.paymentHeight = paymentHeight + values.paymentWidth = paymentWidth + values.paymentColorDepth = paymentColorDepth + values.paymentUserAgent = paymentUserAgent + values.paymentDate = paymentDate + values.paymentTimezoneOffset = paymentTimezoneOffset + }else { + throw new Error('Dados do 3DS não inseridos'); + } +} + +const lkn_erede_credit = { + id: 'lkn_erede_credit', + async initialize() { + }, + async beforeCreatePayment(values) { + + lknSetDataCard(values); + lknCreditGet3DSvalue(values); + + if (values.firstname === 'error') { + throw new Error('Gateway failed'); + } + + return { + ...values + }; + }, + async afterCreatePayment(response) { + }, + Fields() { + setTimeout(() => { + lknCreditSet3DSvalue(); // Chamar a função após o atraso de 1 segundo + }, 1000); + + function isSSL() { + return window.location.protocol === 'https:'; + } + + // retorna no front as mensagens de erro + function lknPrintFrontendNotice(title, message) { + return ( +
+ {title} {message} +
+ ) + } + + if (!isSSL()) { + return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).'); + } else { + return ( +
+ + Informações de cartão de crédito + +
+ + + Doação Segura por Criptografia SSL + +
+ + {/* // */} +
+ + Número do cartão + * + + + { lknFormatNumbers(e), lknCreditCardMask(e), lknSetBorderColorOninput(e.target) }} + type="text" + autocomplete="off" + name="card_number" + id="card_number" + class="card-number give-input required" + placeholder="Número do cartão" + aria-required="true" + /> +
+ + {/* // */} +
+ + Expiração + * + + + { lknApplyDateMask(e), lknSetBorderColorOninput(e.target) }} + type="text" + autocomplete="off" + name="card_expiry" + id="card_expiry" + class="card-expiry give-input required" + placeholder="MM / AAAA" + aria-required="true" + /> +
+ + {/* // */} +
+ + Nome do títular do cartão + * + + + + { lknNameValidation(e), lknSetBorderColorOninput(e.target) }} + type="text" + autocomplete="off" + id="give-card-name-field" + name="card_name" + class="card-name give-input required" + placeholder="Nome do titular do cartão" + aria-required="true" + /> +
+ + {/* // */} +
+ + CVV + * + + +
+ { lknCVVMask(e), lknSetBorderColorOninput(e.target) }} + type="text" + size="4" + maxlength="4" + autocomplete="off" + name="card_cvc" + id="card_cvc" + class="give-input required" + placeholder="CVV" + aria-required="true" + /> +
+
+ ) + } + }, +}; + +window.givewp.gateways.register(lkn_erede_credit); \ No newline at end of file diff --git a/Public/js/plugin-debit-script.js b/Public/js/plugin-debit-script.js new file mode 100644 index 0000000..29aa903 --- /dev/null +++ b/Public/js/plugin-debit-script.js @@ -0,0 +1,346 @@ +function lknSet3DSvalue() { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const language = window.navigator.language.slice(0, 2); + const height = screen.height; + const width = screen.width; + const colorDepth = window.screen.colorDepth; + const userAgent = navigator.userAgent; + const date = new Date(); + const timezoneOffset = date.getTimezoneOffset(); + form?.setAttribute('data-payment-language', language); + form?.setAttribute('data-payment-height', String(height)); + form?.setAttribute('data-payment-width', String(width)); + form?.setAttribute('data-payment-colorDepth', String(colorDepth)); + form?.setAttribute('data-payment-userAgent', userAgent); + form?.setAttribute('data-payment-date', date.toISOString()); + form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset)); +} + +// Máscara para número de cartão de débito +function lknDebitCardMask(inputHTML) { + let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + cardNumber = cardNumber.slice(0, 16); + const cardNumberArr = cardNumber.split(''); + const resultArr = []; + + // Aplicar máscara ao número do cartão de débito + for (let i = 0; i < cardNumberArr.length; i++) { + resultArr.push(cardNumberArr[i]); + + // Adicionar espaços a cada 4 dígitos + if ((i + 1) % 4 === 0 && i < 15) { + resultArr.push(' '); + } + } + inputHTML.target.value = resultArr.join(''); +} + +// Formatar entrada para apenas números +function lknFormatNumbers(inputHTML) { + inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos +} + +function lknCVVMask(inputHTML) { + let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + + // Limitar o CVV a 4 dígitos + if (cvv.length > 4) { + cvv = cvv.slice(0, 4); + } + inputHTML.target.value = cvv; +} +function lknNameValidation(inputHTML) { + let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços + + inputHTML.target.value = name; +} + +// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano +function lknApplyDateMask(inputHTML) { + let currentDate = new Date(); // Obter a data atual + let currentYear = currentDate.getFullYear(); + let currentMonth = currentDate.getMonth() + 1; + let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos + let maskedValue = ''; + + // Limitar o comprimento máximo do valor + value = value.slice(0, 6); + for (let i = 0; i < value.length; i++) { + if (i === 2) { + // Adicionar barra após os dois primeiros caracteres (mês) + maskedValue += ' / '; + } + + // Validar o mês (deve ser entre 01 e 12) + if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) { + maskedValue = ''; // Limpar o valor se o mês for inválido + break; + } + + // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6) + maskedValue += value[i]; + } + + // Validar o ano (deve ser igual ou posterior ao ano atual) + if (maskedValue.length === 9) { + const inputYear = parseInt(maskedValue.slice(5, 9)); + if (inputYear < currentYear) { + maskedValue = ''; // Limpar o valor se o ano for inválido + } else if (inputYear === currentYear) { + // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual + const inputMonth = parseInt(maskedValue.slice(0, 2)); + if (inputMonth < currentMonth) { + maskedValue = ''; // Limpar o valor se o mês for inválido + } + } + } + + inputHTML.target.value = maskedValue; +} +function lknSetBorderColorOninput(inputHTML) { + inputHTML.style.borderColor = '#666'; + inputHTML.setAttribute('aria-invalid', 'false'); +} +function lknSetBorderIfEmpty(elementId) { + const element = document.getElementById(elementId); + if (element && !element.value.trim()) { + element.style.borderColor = 'red'; + element.setAttribute('aria-invalid', 'true'); + } +} +function lknSetDataCard(values) { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + + // Obter referência para todos os campos de entrada + const cardNumElement = document.getElementById('card_number'); + const cardCVCElement = document.getElementById('card_cvc'); + const cardNameElement = document.getElementById('give-card-name-field'); + const cardExpirationElement = document.getElementById('card_expiry'); + + // Verificar se os elementos existem antes de acessar seus valores + if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) { + throw new Error('Um ou mais campos de cartão não encontrados.'); + } + + // Obter os valores dos campos de entrada + const cardNum = cardNumElement.value; + const cardCVC = cardCVCElement.value; + const cardName = cardNameElement.value; + const cardExpiration = cardExpirationElement.value; + + // Verificar se algum campo está vazio + if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') { + // Definir a borda como vermelha para os campos vazios + lknSetBorderIfEmpty('card_number'); + lknSetBorderIfEmpty('card_cvc'); + lknSetBorderIfEmpty('give-card-name-field'); + lknSetBorderIfEmpty('card_expiry'); + throw new Error('Por favor, preencha todos os campos obrigatórios.'); + } else { + // Todos os campos estão preenchidos, atribuir valores ao objeto 'values' + values.paymentCardNum = cardNum; + values.paymentCardCVC = cardCVC; + values.paymentCardName = cardName; + values.paymentCardExp = cardExpiration; + } +} +function lknGet3DSvalue(values) { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const paymentLanguage = form?.getAttribute('data-payment-language'); + const paymentHeight = form?.getAttribute('data-payment-height'); + const paymentWidth = form?.getAttribute('data-payment-width'); + const paymentColorDepth = form?.getAttribute('data-payment-colorDepth'); + const paymentUserAgent = form?.getAttribute('data-payment-userAgent'); + const paymentDate = form?.getAttribute('data-payment-date'); + const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset'); + + // Verifica se as informações estão presentes antes de usá-las + if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) { + values.paymentLanguage = paymentLanguage; + values.paymentHeight = paymentHeight; + values.paymentWidth = paymentWidth; + values.paymentColorDepth = paymentColorDepth; + values.paymentUserAgent = paymentUserAgent; + values.paymentDate = paymentDate; + values.paymentTimezoneOffset = paymentTimezoneOffset; + } else { + throw new Error('Dados do 3DS não inseridos'); + } +} +const lkn_erede_debit_3ds = { + id: 'lkn_erede_debit_3ds', + async initialize() {}, + async beforeCreatePayment(values) { + lknSetDataCard(values); + lknGet3DSvalue(values); + if (values.firstname === 'error') { + throw new Error('Gateway failed'); + } + return { + ...values + }; + }, + async afterCreatePayment(response) {}, + Fields() { + setTimeout(() => { + lknSet3DSvalue(); // Chamar a função após o atraso de 1 segundo + }, 1000); + function isSSL() { + return window.location.protocol === 'https:'; + } + + // retorna no front as mensagens de erro + function lknPrintFrontendNotice(title, message) { + return /*#__PURE__*/React.createElement("div", { + className: "error-notice" + }, /*#__PURE__*/React.createElement("strong", null, title), " ", message); + } + if (!isSSL()) { + return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).'); + } else { + return /*#__PURE__*/React.createElement("fieldset", { + className: "give-do-validate", + id: "give_dc_fields" + }, /*#__PURE__*/React.createElement("legend", { + style: { + fontSize: 'large' + } + }, "Informa\xE7\xF5es de cart\xE3o de d\xE9bito"), /*#__PURE__*/React.createElement("div", { + id: "give_secure_site_wrapper" + }, /*#__PURE__*/React.createElement("span", { + class: "give-icon padlock" + }), /*#__PURE__*/React.createElement("span", { + style: { + display: 'block', + padding: '20px', + textAlign: 'center' + } + }, "Doa\xE7\xE3o Segura por Criptografia SSL")), /*#__PURE__*/React.createElement("div", { + id: "give-card-number-wrap", + class: "form-row form-row-two-thirds form-row-responsive give-lkn-cielo-api-cc-field-wrap" + }, /*#__PURE__*/React.createElement("span", { + for: "card_number", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "N\xFAmero do cart\xE3o", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip hint--top hint--medium hint--bounce", + "aria-label": "Normalmente possui 16 digitos na frente do seu cart\xE3o de d\xE9bito.", + rel: "tooltip" + }, /*#__PURE__*/React.createElement("i", { + class: "give-icon give-icon-question" + }))), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknFormatNumbers(e), lknDebitCardMask(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + autocomplete: "off", + name: "card_number", + id: "card_number", + class: "card-number give-input required", + placeholder: "N\xFAmero do cart\xE3o", + "aria-required": "true" + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-expiration-wrap", + class: "card-expiration form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap" + }, /*#__PURE__*/React.createElement("span", { + for: "give-card-expiration-field", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "Expira\xE7\xE3o", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip give-icon give-icon-question", + "data-tooltip": "A data de expira\xE7\xE3o do cart\xE3o de d\xE9bito, geralmente na frente do cart\xE3o." + })), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknApplyDateMask(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + autocomplete: "off", + name: "card_expiry", + id: "card_expiry", + class: "card-expiry give-input required", + placeholder: "MM / AAAA", + "aria-required": "true" + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-name-wrap", + class: "form-row form-row-two-thirds form-row-responsive" + }, /*#__PURE__*/React.createElement("span", { + for: "give-card-name-field", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "Nome do t\xEDtular do cart\xE3o", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip give-icon give-icon-question", + "data-tooltip": "O nome do titular da conta do cart\xE3o de d\xE9bito." + })), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknNameValidation(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + autocomplete: "off", + id: "give-card-name-field", + name: "card_name", + class: "card-name give-input required", + placeholder: "Nome do titular do cart\xE3o", + "aria-required": "true" + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-cvc-wrap", + class: "form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap" + }, /*#__PURE__*/React.createElement("span", { + for: "give-card-cvc-field", + class: "give-label", + style: { + display: 'block', + padding: '10 0' + } + }, "CVV", /*#__PURE__*/React.createElement("span", { + class: "give-required-indicator", + style: { + color: 'red' + } + }, " *"), /*#__PURE__*/React.createElement("span", { + class: "give-tooltip give-icon give-icon-question", + "data-tooltip": "S\xE3o os 3 ou 4 d\xEDgitos que est\xE3o atr\xE1s do seu cart\xE3o de d\xE9bito." + })), /*#__PURE__*/React.createElement("div", { + id: "give-card-cvc-field", + class: "input empty give-lkn-cielo-api-cc-field give-lkn-cielo-api-card-cvc-field" + }), /*#__PURE__*/React.createElement("input", { + onInput: e => { + lknCVVMask(e), lknSetBorderColorOninput(e.target); + }, + type: "text", + size: "4", + maxlength: "4", + autocomplete: "off", + name: "card_cvc", + id: "card_cvc", + class: "give-input required", + placeholder: "CVV", + "aria-required": "true" + }))); + } + } +}; +window.givewp.gateways.register(lkn_erede_debit_3ds); \ No newline at end of file diff --git a/Public/js/plugin-debit-script.tsx b/Public/js/plugin-debit-script.tsx new file mode 100644 index 0000000..8cb2ab5 --- /dev/null +++ b/Public/js/plugin-debit-script.tsx @@ -0,0 +1,321 @@ +function lknSet3DSvalue() { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const language = window.navigator.language.slice(0, 2) + const height = screen.height + const width = screen.width + const colorDepth = window.screen.colorDepth + const userAgent = navigator.userAgent + const date = new Date() + const timezoneOffset = date.getTimezoneOffset() + + form?.setAttribute('data-payment-language', language); + form?.setAttribute('data-payment-height', String(height)); + form?.setAttribute('data-payment-width', String(width)); + form?.setAttribute('data-payment-colorDepth', String(colorDepth)); + form?.setAttribute('data-payment-userAgent', userAgent); + form?.setAttribute('data-payment-date', date.toISOString()); + form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset)); +} + +// Máscara para número de cartão de débito +function lknDebitCardMask(inputHTML) { + let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + cardNumber = cardNumber.slice(0, 16); + const cardNumberArr = cardNumber.split(''); + const resultArr = []; + + // Aplicar máscara ao número do cartão de débito + for (let i = 0; i < cardNumberArr.length; i++) { + resultArr.push(cardNumberArr[i]); + + // Adicionar espaços a cada 4 dígitos + if ((i + 1) % 4 === 0 && i < 15) { + resultArr.push(' '); + } + } + + inputHTML.target.value = resultArr.join(''); +} + +// Formatar entrada para apenas números +function lknFormatNumbers(inputHTML) { + inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos +} + +function lknCVVMask(inputHTML) { + let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos + + // Limitar o CVV a 4 dígitos + if (cvv.length > 4) { + cvv = cvv.slice(0, 4); + } + + inputHTML.target.value = cvv; +} + +function lknNameValidation(inputHTML) { + let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços + + inputHTML.target.value = name; +} + +// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano +function lknApplyDateMask(inputHTML) { + let currentDate = new Date(); // Obter a data atual + let currentYear = currentDate.getFullYear(); + let currentMonth = currentDate.getMonth() + 1; + + let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos + let maskedValue = ''; + + // Limitar o comprimento máximo do valor + value = value.slice(0, 6); + + for (let i = 0; i < value.length; i++) { + if (i === 2) { + // Adicionar barra após os dois primeiros caracteres (mês) + maskedValue += ' / '; + } + + // Validar o mês (deve ser entre 01 e 12) + if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) { + maskedValue = ''; // Limpar o valor se o mês for inválido + break; + } + + // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6) + maskedValue += value[i]; + } + + // Validar o ano (deve ser igual ou posterior ao ano atual) + if (maskedValue.length === 9) { + const inputYear = parseInt(maskedValue.slice(5, 9)); + if (inputYear < currentYear) { + maskedValue = ''; // Limpar o valor se o ano for inválido + } else if (inputYear === currentYear) { + // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual + const inputMonth = parseInt(maskedValue.slice(0, 2)); + if (inputMonth < currentMonth) { + maskedValue = ''; // Limpar o valor se o mês for inválido + } + } + } + + inputHTML.target.value = maskedValue; +} + +function lknSetBorderColorOninput(inputHTML) { + inputHTML.style.borderColor = '#666'; + inputHTML.setAttribute('aria-invalid', 'false') +} + +function lknSetBorderIfEmpty(elementId) { + const element = document.getElementById(elementId); + if (element && !element.value.trim()) { + element.style.borderColor = 'red'; + element.setAttribute('aria-invalid', 'true'); + } +} + +function lknSetDataCard(values) { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + + // Obter referência para todos os campos de entrada + const cardNumElement = document.getElementById('card_number'); + const cardCVCElement = document.getElementById('card_cvc'); + const cardNameElement = document.getElementById('give-card-name-field'); + const cardExpirationElement = document.getElementById('card_expiry'); + + // Verificar se os elementos existem antes de acessar seus valores + if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) { + throw new Error('Um ou mais campos de cartão não encontrados.'); + } + + // Obter os valores dos campos de entrada + const cardNum = cardNumElement.value; + const cardCVC = cardCVCElement.value; + const cardName = cardNameElement.value; + const cardExpiration = cardExpirationElement.value; + + // Verificar se algum campo está vazio + if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') { + // Definir a borda como vermelha para os campos vazios + lknSetBorderIfEmpty('card_number'); + lknSetBorderIfEmpty('card_cvc'); + lknSetBorderIfEmpty('give-card-name-field'); + lknSetBorderIfEmpty('card_expiry'); + throw new Error('Por favor, preencha todos os campos obrigatórios.'); + } else { + // Todos os campos estão preenchidos, atribuir valores ao objeto 'values' + values.paymentCardNum = cardNum; + values.paymentCardCVC = cardCVC; + values.paymentCardName = cardName; + values.paymentCardExp = cardExpiration; + } +} + +function lknGet3DSvalue(values) { + const form = document.querySelector('button[type="submit"]')?.closest('form'); + const paymentLanguage = form?.getAttribute('data-payment-language'); + const paymentHeight = form?.getAttribute('data-payment-height'); + const paymentWidth = form?.getAttribute('data-payment-width'); + const paymentColorDepth = form?.getAttribute('data-payment-colorDepth'); + const paymentUserAgent = form?.getAttribute('data-payment-userAgent'); + const paymentDate = form?.getAttribute('data-payment-date'); + const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset'); + + // Verifica se as informações estão presentes antes de usá-las + if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) { + values.paymentLanguage = paymentLanguage + values.paymentHeight = paymentHeight + values.paymentWidth = paymentWidth + values.paymentColorDepth = paymentColorDepth + values.paymentUserAgent = paymentUserAgent + values.paymentDate = paymentDate + values.paymentTimezoneOffset = paymentTimezoneOffset + }else { + throw new Error('Dados do 3DS não inseridos'); + } +} + +const lkn_erede_debit_3ds = { + id: 'lkn_erede_debit_3ds', + async initialize() { + }, + async beforeCreatePayment(values) { + + lknSetDataCard(values); + lknGet3DSvalue(values); + + if (values.firstname === 'error') { + throw new Error('Gateway failed'); + } + + return { + ...values + }; + }, + async afterCreatePayment(response) { + }, + Fields() { + setTimeout(() => { + lknSet3DSvalue(); // Chamar a função após o atraso de 1 segundo + }, 1000); + + function isSSL() { + return window.location.protocol === 'https:'; + } + + // retorna no front as mensagens de erro + function lknPrintFrontendNotice(title, message) { + return ( +
+ {title} {message} +
+ ) + } + + if (!isSSL()) { + return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).'); + } else { + return ( +
+ + Informações de cartão de débito + +
+ + + Doação Segura por Criptografia SSL + +
+ + {/* // */} +
+ + Número do cartão + * + + + { lknFormatNumbers(e), lknDebitCardMask(e), lknSetBorderColorOninput(e.target) }} + type="text" + autocomplete="off" + name="card_number" + id="card_number" + class="card-number give-input required" + placeholder="Número do cartão" + aria-required="true" + /> +
+ + {/* // */} +
+ + Expiração + * + + + { lknApplyDateMask(e), lknSetBorderColorOninput(e.target) }} + type="text" + autocomplete="off" + name="card_expiry" + id="card_expiry" + class="card-expiry give-input required" + placeholder="MM / AAAA" + aria-required="true" + /> +
+ + {/* // */} +
+ + Nome do títular do cartão + * + + + + { lknNameValidation(e), lknSetBorderColorOninput(e.target) }} + type="text" + autocomplete="off" + id="give-card-name-field" + name="card_name" + class="card-name give-input required" + placeholder="Nome do titular do cartão" + aria-required="true" + /> +
+ + {/* // */} +
+ + CVV + * + + +
+ { lknCVVMask(e), lknSetBorderColorOninput(e.target) }} + type="text" + size="4" + maxlength="4" + autocomplete="off" + name="card_cvc" + id="card_cvc" + class="give-input required" + placeholder="CVV" + aria-required="true" + /> +
+
+ ) + } + }, +}; + +window.givewp.gateways.register(lkn_erede_debit_3ds); \ No newline at end of file diff --git a/README.md b/README.md index aaa9042..1d3a854 100755 --- a/README.md +++ b/README.md @@ -1,51 +1,51 @@ -# payment-erede-for-givewp -Cartão de crédito e débito para GiveWP utilizando E-Rede https://www.linknacional.com.br/wordpress/givewp/ - -## Descrição - -Apresentando o plugin Payment Gateway E-Rede for GiveWP – sua solução perfeita para processar com segurança pagamentos com cartão de crédito e débito em seus esforços de arrecadação de fundos com tecnologia WordPress. Este plugin robusto amplia a funcionalidade do GiveWP, o plugin líder de gerenciamento de doações, integrando perfeitamente a API E-Rede como um método de pagamento confiável. - -Características principais: - -1. **Integração sem esforço**: Este plugin integra facilmente os poderosos recursos de processamento de pagamentos do E-Rede em seus formulários de doação GiveWP, fornecendo aos seus apoiadores uma opção de pagamento conveniente e segura. - -2. **Transações Seguras**: Garanta tranquilidade aos seus doadores com as robustas medidas de segurança do E-Rede, protegendo todas as transações e protegendo os dados confidenciais do titular do cartão. - -3. **Configuração fácil de usar**: Configurar o E-Rede como um gateway de pagamento para seus formulários GiveWP é muito fácil. Nosso assistente de configuração intuitivo orienta você durante o processo, garantindo uma integração rápida e descomplicada. - -4. **Experiência de doação transparente**: os doadores agora podem contribuir de forma integrada, escolhendo entre uma variedade de métodos de pagamento, incluindo cartões de crédito e débito. O plugin oferece uma experiência de checkout tranquila e familiar. - -Dê aos seus doadores a conveniência e segurança que eles merecem enquanto gerencia perfeitamente seus esforços de arrecadação de fundos com o plugin Payment Gateway E-Rede for GiveWP. Eleve sua experiência de doações on-line e veja suas campanhas de arrecadação de fundos prosperarem. - -**Dependências** - -O plugin Payment Gateway E-Rede for GiveWP depende do [plugin GiveWP](https://wordpress.org/plugins/give/), certifique-se de que o GiveWP esteja instalado e configurado corretamente. - -Este plugin requer uma [conta E-Rede](https://developer.userede.com.br/) ativa para processamento de pagamentos. - -**Instruções do usuário** - -1. Acesse o menu de configurações do GiveWP; - -2. Procure pela aba ‘Gateways de pagamento’; - -3. Ative a forma de pagamento com cartão de crédito ou débito para seus formulários de doação; - -4. Salvar; - -5. Acesse a aba E-Rede API - Cartão de crédito ou E-Rede API - Cartão de débito 3DS; - -6. Preencha o formulário com suas credenciais do E-Rede; - -7. Salve. - -## Instalação - -1. Carregue `payment-erede-for-givewp.zip` para o diretório `/wp-content/plugins/`; -2. Ative o plugin através do menu ‘Plugins’ do WordPress. - -## Perguntas frequentes - -### Como posso obter minhas credenciais de produção do E-Rede? - -Para obter suas credenciais de produção do E-Rede você precisará seguir [este guia](https://developer.userede.com.br/e-rede#documentacao-credenciamento). +# payment-erede-for-givewp +Cartão de crédito e débito para GiveWP utilizando E-Rede https://www.linknacional.com.br/wordpress/givewp/ + +## Descrição + +Apresentando o plugin Payment Gateway E-Rede for GiveWP – sua solução perfeita para processar com segurança pagamentos com cartão de crédito e débito em seus esforços de arrecadação de fundos com tecnologia WordPress. Este plugin robusto amplia a funcionalidade do GiveWP, o plugin líder de gerenciamento de doações, integrando perfeitamente a API E-Rede como um método de pagamento confiável. + +Características principais: + +1. **Integração sem esforço**: Este plugin integra facilmente os poderosos recursos de processamento de pagamentos do E-Rede em seus formulários de doação GiveWP, fornecendo aos seus apoiadores uma opção de pagamento conveniente e segura. + +2. **Transações Seguras**: Garanta tranquilidade aos seus doadores com as robustas medidas de segurança do E-Rede, protegendo todas as transações e protegendo os dados confidenciais do titular do cartão. + +3. **Configuração fácil de usar**: Configurar o E-Rede como um gateway de pagamento para seus formulários GiveWP é muito fácil. Nosso assistente de configuração intuitivo orienta você durante o processo, garantindo uma integração rápida e descomplicada. + +4. **Experiência de doação transparente**: os doadores agora podem contribuir de forma integrada, escolhendo entre uma variedade de métodos de pagamento, incluindo cartões de crédito e débito. O plugin oferece uma experiência de checkout tranquila e familiar. + +Dê aos seus doadores a conveniência e segurança que eles merecem enquanto gerencia perfeitamente seus esforços de arrecadação de fundos com o plugin Payment Gateway E-Rede for GiveWP. Eleve sua experiência de doações on-line e veja suas campanhas de arrecadação de fundos prosperarem. + +**Dependências** + +O plugin Payment Gateway E-Rede for GiveWP depende do [plugin GiveWP](https://wordpress.org/plugins/give/), certifique-se de que o GiveWP esteja instalado e configurado corretamente. + +Este plugin requer uma [conta E-Rede](https://developer.userede.com.br/) ativa para processamento de pagamentos. + +**Instruções do usuário** + +1. Acesse o menu de configurações do GiveWP; + +2. Procure pela aba ‘Gateways de pagamento’; + +3. Ative a forma de pagamento com cartão de crédito ou débito para seus formulários de doação; + +4. Salvar; + +5. Acesse a aba E-Rede API - Cartão de crédito ou E-Rede API - Cartão de débito 3DS; + +6. Preencha o formulário com suas credenciais do E-Rede; + +7. Salve. + +## Instalação + +1. Carregue `payment-erede-for-givewp.zip` para o diretório `/wp-content/plugins/`; +2. Ative o plugin através do menu ‘Plugins’ do WordPress. + +## Perguntas frequentes + +### Como posso obter minhas credenciais de produção do E-Rede? + +Para obter suas credenciais de produção do E-Rede você precisará seguir [este guia](https://developer.userede.com.br/e-rede#documentacao-credenciamento). diff --git a/README.txt b/README.txt index 0622d63..a7f3304 100644 --- a/README.txt +++ b/README.txt @@ -1,84 +1,90 @@ -=== Payment Gateway E-Rede for GiveWP === -Contributors: linknacional -Donate link: https://www.linknacional.com.br/wordpress/plugins/ -Tags: payment, donation, givewp, credit, debit, card -Requires at least: 5.7 -Requires PHP: 7.4 -Tested up to: 6.3 -Stable tag: 1.0.2 -License: GPLv3 or later -License URI: http://www.gnu.org/licenses/gpl-3.0.html - -Credit and debit card payment using E-Rede - -== Description == - -Introducing the Payment Gateway E-Rede for GiveWP plugin – your seamless solution for securely processing credit and debit card payments within your WordPress-powered fundraising efforts. This robust plugin extends the functionality of GiveWP, the leading donations management plugin, by seamlessly integrating E-Rede API as a trusted payment method. - -Key Features: - -1. **Effortless Integration**: This plugin effortlessly integrates E-Rede's powerful payment processing capabilities into your GiveWP donation forms, providing your supporters with a convenient and secure payment option. - -2. **Secure Transactions**: Ensure peace of mind for your donors with E-Rede's robust security measures, safeguarding every transaction and protecting sensitive cardholder data. - -3. **User-Friendly Setup**: Setting up E-Rede as a payment gateway for your GiveWP forms is a breeze. Our intuitive configuration wizard guides you through the process, ensuring quick and hassle-free integration. - -4. **Seamless Donation Experience**: Donors can now contribute seamlessly, choosing from a range of payment methods including credit and debit cards. The plugin provides a smooth and familiar checkout experience. - -Give your donors the convenience and security they deserve while seamlessly managing your fundraising efforts with the Payment Gateway E-Rede for GiveWP plugin. Elevate your online donations experience and watch your fundraising campaigns thrive. - -**Dependencies** - -Payment Gateway E-Rede for GiveWP plugin is dependent on [GiveWP plugin](https://wordpress.org/plugins/give/), please make sure GiveWP is installed and properly configured. - -This plugin requires an active [E-Rede account](https://developer.userede.com.br/) for payment processing. - -**User instructions** - -1. Go to GiveWP settings menu; - -2. Search for the 'Payment gateways' tab; - -3. Activate the credit or debit card payment method for your donation forms; - -4. Save; - -5. Go to the E-Rede API - Credit card or E-Rede API - Debit card 3DS tab; - -6. Fill the form with your E-Rede credentials; - -7. Save. - -== Installation == - -1. Upload `payment-erede-for-givewp.zip` to the `/wp-content/plugins/` directory; -2. Activate the plugin through the 'Plugins' menu in WordPress. - -== Frequently Asked Questions == - -= How can I get my E-Rede production credentials? = - -To get your E-Rede production credentials you will need to follow [this guide](https://developer.userede.com.br/e-rede#documentacao-credenciamento). - -== Screenshots == - -1. None - -== Changelog == - -= 1.0.2 = -**22/09/2023** -* Fix a bug in translation. - -= 1.0.1 = -**20/09/2023** -* Fix a bug with front-end inputs. - -= 1.0.0 = -**04/09/2023** -* Plugin launch. - -== Upgrade Notice == - -= 1.0.0 = -* Plugin launch. +=== Payment Gateway E-Rede for GiveWP === +Contributors: linknacional +Donate link: https://www.linknacional.com.br/wordpress/plugins/ +Tags: payment, donation, givewp, credit, debit, card +Requires at least: 5.7 +Requires PHP: 7.4 +Tested up to: 6.3 +Stable tag: 2.0.0 +License: GPLv3 or later +License URI: http://www.gnu.org/licenses/gpl-3.0.html + +Credit and debit card payment using E-Rede + +== Description == + +Introducing the Payment Gateway E-Rede for GiveWP plugin – your seamless solution for securely processing credit and debit card payments within your WordPress-powered fundraising efforts. This robust plugin extends the functionality of GiveWP, the leading donations management plugin, by seamlessly integrating E-Rede API as a trusted payment method. + +Key Features: + +1. **Effortless Integration**: This plugin effortlessly integrates E-Rede's powerful payment processing capabilities into your GiveWP donation forms, providing your supporters with a convenient and secure payment option. + +2. **Secure Transactions**: Ensure peace of mind for your donors with E-Rede's robust security measures, safeguarding every transaction and protecting sensitive cardholder data. + +3. **User-Friendly Setup**: Setting up E-Rede as a payment gateway for your GiveWP forms is a breeze. Our intuitive configuration wizard guides you through the process, ensuring quick and hassle-free integration. + +4. **Seamless Donation Experience**: Donors can now contribute seamlessly, choosing from a range of payment methods including credit and debit cards. The plugin provides a smooth and familiar checkout experience. + +Give your donors the convenience and security they deserve while seamlessly managing your fundraising efforts with the Payment Gateway E-Rede for GiveWP plugin. Elevate your online donations experience and watch your fundraising campaigns thrive. + +**Dependencies** + +Payment Gateway E-Rede for GiveWP plugin is dependent on [GiveWP plugin](https://wordpress.org/plugins/give/), please make sure GiveWP is installed and properly configured. + +This plugin requires an active [E-Rede account](https://developer.userede.com.br/) for payment processing. + +**User instructions** + +1. Go to GiveWP settings menu; + +2. Search for the 'Payment gateways' tab; + +3. Activate the credit or debit card payment method for your donation forms; + +4. Save; + +5. Go to the E-Rede API - Credit card or E-Rede API - Debit card 3DS tab; + +6. Fill the form with your E-Rede credentials; + +7. Save. + +== Installation == + +1. Upload `payment-erede-for-givewp.zip` to the `/wp-content/plugins/` directory; +2. Activate the plugin through the 'Plugins' menu in WordPress. + +== Frequently Asked Questions == + += How can I get my E-Rede production credentials? = + +To get your E-Rede production credentials you will need to follow [this guide](https://developer.userede.com.br/e-rede#documentacao-credenciamento). + +== Screenshots == + +1. None + +== Changelog == + += 2.0.0 = +**14/05/2024** +* Added compatibility with GiveWP 3.0.0 template. +* General plugin optimizations. +* Addition of 3DS 2.0 for credit card payments. + += 1.0.2 = +**22/09/2023** +* Fix a bug in translation. + += 1.0.1 = +**20/09/2023** +* Fix a bug with front-end inputs. + += 1.0.0 = +**04/09/2023** +* Plugin launch. + +== Upgrade Notice == + += 1.0.0 = +* Plugin launch. diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9e2f467 --- /dev/null +++ b/composer.json @@ -0,0 +1,23 @@ +{ + "name": "lkn/payment-erede-for-givewp", + "type": "project", + "license": "Proprietary", + "autoload": { + "psr-4": { + "Lkn\\PaymentEredeForGivewp\\Includes\\": "Includes/", + "Lkn\\PaymentEredeForGivewp\\Admin\\": "Admin/", + "Lkn\\PaymentEredeForGivewp\\PublicView\\": "Public/" + } + }, + "authors": [ + { + "name": "Link Nacional", + "email": "ticket@linknacional.com" + } + ], + "minimum-stability": "stable", + "require-dev": { + "phan/phan": "5.4.1" + }, + "require": {} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..31d6cbe --- /dev/null +++ b/composer.lock @@ -0,0 +1,1742 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "b3dd06a1ba5ace6fe8abbd242caeae61", + "packages": [], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.1.3", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-03-19T10:26:25+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255", + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-03-26T18:29:49+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" + }, + { + "name": "microsoft/tolerant-php-parser", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/microsoft/tolerant-php-parser.git", + "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/6a965617cf484355048ac6d2d3de7b6ec93abb16", + "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.15" + }, + "type": "library", + "autoload": { + "psr-4": { + "Microsoft\\PhpParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rob Lourens", + "email": "roblou@microsoft.com" + } + ], + "description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios", + "support": { + "issues": "https://github.com/microsoft/tolerant-php-parser/issues", + "source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.1.1" + }, + "time": "2021-07-16T21:28:12+00:00" + }, + { + "name": "netresearch/jsonmapper", + "version": "v4.4.1", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" + }, + "time": "2024-01-31T06:18:54+00:00" + }, + { + "name": "phan/phan", + "version": "5.4.1", + "source": { + "type": "git", + "url": "https://github.com/phan/phan.git", + "reference": "fef40178a952bcfcc3f69b76989dd613c3d5c759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phan/phan/zipball/fef40178a952bcfcc3f69b76989dd613c3d5c759", + "reference": "fef40178a952bcfcc3f69b76989dd613c3d5c759", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4|^2.0|^3.0", + "composer/xdebug-handler": "^2.0|^3.0", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.4", + "microsoft/tolerant-php-parser": "0.1.1", + "netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0", + "php": "^7.2.0|^8.0.0", + "sabre/event": "^5.1.3", + "symfony/console": "^3.2|^4.0|^5.0|^6.0", + "symfony/polyfill-mbstring": "^1.11.0", + "symfony/polyfill-php80": "^1.20.0", + "tysonandre/var_representation_polyfill": "^0.0.2|^0.1.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.0" + }, + "suggest": { + "ext-ast": "Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.16+ is recommended.", + "ext-iconv": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8", + "ext-igbinary": "Improves performance of polyfill when ext-ast is unavailable", + "ext-mbstring": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8", + "ext-tokenizer": "Needed for fallback/polyfill parser support and file/line-based suppressions.", + "ext-var_representation": "Suggested for converting values to strings in issue messages" + }, + "bin": [ + "phan", + "phan_client", + "tocheckstyle" + ], + "type": "project", + "autoload": { + "psr-4": { + "Phan\\": "src/Phan" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tyson Andre" + }, + { + "name": "Rasmus Lerdorf" + }, + { + "name": "Andrew S. Morrison" + } + ], + "description": "A static analyzer for PHP", + "keywords": [ + "analyzer", + "php", + "static" + ], + "support": { + "issues": "https://github.com/phan/phan/issues", + "source": "https://github.com/phan/phan/tree/5.4.1" + }, + "time": "2022-08-26T00:49:07+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "298d2febfe79d03fe714eb871d5538da55205b1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a", + "reference": "298d2febfe79d03fe714eb871d5538da55205b1a", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0" + }, + "time": "2024-04-09T21:13:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "153ae662783729388a584b4361f2545e4d841e3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + }, + "time": "2024-02-23T11:10:43+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.28.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0" + }, + "time": "2024-04-03T18:51:33+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sabre/event", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/event.git", + "reference": "d7da22897125d34d7eddf7977758191c06a74497" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", + "reference": "d7da22897125d34d7eddf7977758191c06a74497", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.17.1", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + }, + "type": "library", + "autoload": { + "files": [ + "lib/coroutine.php", + "lib/Loop/functions.php", + "lib/Promise/functions.php" + ], + "psr-4": { + "Sabre\\Event\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "sabre/event is a library for lightweight event-based programming", + "homepage": "http://sabre.io/event/", + "keywords": [ + "EventEmitter", + "async", + "coroutine", + "eventloop", + "events", + "hooks", + "plugin", + "promise", + "reactor", + "signal" + ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/event/issues", + "source": "https://github.com/fruux/sabre-event" + }, + "time": "2021-11-04T06:51:17+00:00" + }, + { + "name": "symfony/console", + "version": "v6.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "a2708a5da5c87d1d0d52937bdeac625df659e11f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/a2708a5da5c87d1d0d52937bdeac625df659e11f", + "reference": "a2708a5da5c87d1d0d52937bdeac625df659e11f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v6.4.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-03-29T19:07:53+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e", + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-19T21:51:00+00:00" + }, + { + "name": "symfony/string", + "version": "v6.4.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.4.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-02-01T13:16:41+00:00" + }, + { + "name": "tysonandre/var_representation_polyfill", + "version": "0.1.3", + "source": { + "type": "git", + "url": "https://github.com/TysonAndre/var_representation_polyfill.git", + "reference": "e9116c2c352bb0835ca428b442dde7767c11ad32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/e9116c2c352bb0835ca428b442dde7767c11ad32", + "reference": "e9116c2c352bb0835ca428b442dde7767c11ad32", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.2.0|^8.0.0" + }, + "provide": { + "ext-var_representation": "*" + }, + "require-dev": { + "phan/phan": "^5.4.1", + "phpunit/phpunit": "^8.5.0" + }, + "suggest": { + "ext-var_representation": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.1.3-dev" + } + }, + "autoload": { + "files": [ + "src/var_representation.php" + ], + "psr-4": { + "VarRepresentation\\": "src/VarRepresentation" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tyson Andre" + } + ], + "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export", + "keywords": [ + "var_export", + "var_representation" + ], + "support": { + "issues": "https://github.com/TysonAndre/var_representation_polyfill/issues", + "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.3" + }, + "time": "2022-08-31T12:59:22+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/includes/class-payment-erede-for-givewp.php b/includes/class-payment-erede-for-givewp.php deleted file mode 100644 index dd912c8..0000000 --- a/includes/class-payment-erede-for-givewp.php +++ /dev/null @@ -1,667 +0,0 @@ - - */ -class Payment_Erede_For_Givewp { - /** - * The loader that's responsible for maintaining and registering all hooks that power - * the plugin. - * - * @since 1.0.0 - * @access protected - * @var Payment_Erede_For_Givewp_Loader $loader Maintains and registers all hooks for the plugin. - */ - protected $loader; - - /** - * The unique identifier of this plugin. - * - * @since 1.0.0 - * @access protected - * @var string $plugin_name The string used to uniquely identify this plugin. - */ - protected $plugin_name; - - /** - * The current version of the plugin. - * - * @since 1.0.0 - * @access protected - * @var string $version The current version of the plugin. - */ - protected $version; - - /** - * Define the core functionality of the plugin. - * - * Set the plugin name and the plugin version that can be used throughout the plugin. - * Load the dependencies, define the locale, and set the hooks for the admin area and - * the public-facing side of the site. - * - * @since 1.0.0 - */ - public function __construct() { - if ( defined( 'PAYMENT_EREDE_FOR_GIVEWP_VERSION' ) ) { - $this->version = PAYMENT_EREDE_FOR_GIVEWP_VERSION; - } else { - $this->version = '1.0.0'; - } - $this->plugin_name = 'payment-erede-for-givewp'; - - $this->load_dependencies(); - $this->set_locale(); - $this->define_admin_hooks(); - $this->define_public_hooks(); - $this->schedule_events(); - } - - public function schedule_events() : void { - if ( ! wp_next_scheduled( 'lkn_payment_erede_cron_delete_logs' ) ) { - wp_schedule_event( time() + 604800, 'weekly', 'lkn_payment_erede_cron_delete_logs' ); - } - - if ( ! wp_next_scheduled( 'lkn_payment_erede_cron_verify_payment' ) ) { - wp_schedule_event( time() + 60, 'every_minute', 'lkn_payment_erede_cron_verify_payment' ); - } - } - - public function verify_payment() :bool { - $paymentsToVerify = give_get_option('lkn_erede_debit_3ds_payments_pending', ''); - - if (empty($paymentsToVerify)) { - $paymentsToVerify = array(); - } else { - $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true); - } - - $paymentCounter = count($paymentsToVerify); - - if ($paymentCounter > 0) { - $configs = Payment_Erede_For_Givewp_Helper::get_configs('debit-3ds'); - $authorization = base64_encode( $configs['pv'] . ':' . $configs['token'] ); - $paymentsToValidate = array(); - $logname = date('d.m.Y-H.i.s') . '-debit-3ds-verification'; - - $headers = array( - 'Authorization' => 'Basic ' . $authorization, - 'Content-Type' => 'application/json' - ); - - for ($c = 0; $c < $paymentCounter; $c++) { - $responseRaw = wp_remote_get($configs['api_url'] . '?reference=' . $paymentsToVerify[$c]['id'], array( - 'headers' => $headers - )); - - $response = json_decode(wp_remote_retrieve_body($responseRaw)); - - if ('enabled' === $configs['debug']) { - Payment_Erede_For_Givewp_Helper::log('VERIFY PAYMENT - [Raw header]: ' . var_export(wp_remote_retrieve_headers($responseRaw) . \PHP_EOL . ' [INFO]: ' . var_export($paymentsToVerify, true), true) . \PHP_EOL . ' [BODY]: ' . var_export($response, true), $logname); - } - - switch ($response->returnCode) { - case '00': - give_update_payment_status($paymentsToVerify[$c]['id'], 'publish'); - - break; - case '78': - $counter = (int) ($paymentsToVerify[$c]['count']); - $counter++; - - if ($counter > 5) { - give_update_payment_status($paymentsToVerify[$c]['id'], 'failed'); - } else { - $paymentsToValidate[] = array('id' => $paymentsToVerify[$c]['id'], 'count' => $counter); - } - - break; - - default: - give_update_payment_status($paymentsToVerify[$c]['id'], 'failed'); - - break; - } - } - - if (count($paymentsToValidate) > 0) { - $paymentsToValidate = base64_encode(json_encode($paymentsToValidate)); - - give_update_option('lkn_erede_debit_3ds_payments_pending', $paymentsToValidate); - } else { - give_update_option('lkn_erede_debit_3ds_payments_pending', ''); - } - } - - return true; - } - - /** - * Load the required dependencies for this plugin. - * - * Include the following files that make up the plugin: - * - * - Payment_Erede_For_Givewp_Loader. Orchestrates the hooks of the plugin. - * - Payment_Erede_For_Givewp_i18n. Defines internationalization functionality. - * - Payment_Erede_For_Givewp_Admin. Defines all hooks for the admin area. - * - Payment_Erede_For_Givewp_Public. Defines all hooks for the public side of the site. - * - * Create an instance of the loader which will be used to register the hooks - * with WordPress. - * - * @since 1.0.0 - * @access private - */ - private function load_dependencies(): void { - /** - * The class responsible for plugin updater - */ - include_once plugin_dir_path( __DIR__ ) . 'includes/plugin-updater/plugin-update-checker.php'; - - /** - * The class responsible for orchestrating the actions and filters of the - * core plugin. - */ - require_once plugin_dir_path( __DIR__ ) . 'includes/class-payment-erede-for-givewp-loader.php'; - - /** - * The class responsible for defining internationalization functionality - * of the plugin. - */ - require_once plugin_dir_path( __DIR__ ) . 'includes/class-payment-erede-for-givewp-i18n.php'; - - /** - * The class responsible for defining helpers functions - */ - require_once plugin_dir_path( __DIR__ ) . 'includes/class-payment-erede-for-givewp-helper.php'; - - /** - * The class responsible for defining all actions that occur in the admin area. - */ - require_once plugin_dir_path( __DIR__ ) . 'admin/class-payment-erede-for-givewp-admin.php'; - - /** - * The class responsible for defining all actions that occur in the public-facing - * side of the site. - */ - require_once plugin_dir_path( __DIR__ ) . 'public/class-payment-erede-for-givewp-public.php'; - - $this->loader = new Payment_Erede_For_Givewp_Loader(); - } - - /** - * Define the locale for this plugin for internationalization. - * - * Uses the Payment_Erede_For_Givewp_i18n class in order to set the domain and to register the hook - * with WordPress. - * - * @since 1.0.0 - * @access private - */ - private function set_locale(): void { - $plugin_i18n = new Payment_Erede_For_Givewp_i18n(); - - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); - } - - public function process_debit_3ds_api_payment($payment_data) : void { - // Set the configs values - $configs = Payment_Erede_For_Givewp_Helper::get_configs('debit-3ds'); - - // Validate nonce. - give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway'); - - // Make sure we don't have any left over errors present. - give_clear_errors(); - - // Any errors? - $errors = give_get_errors(); - - if ($errors) { - give_send_back_to_checkout('?payment-mode=' . $payment_data['post_data']['give-gateway'] . '&error-msg=Erro interno no processamento do pagamento, contate o suporte'); - - exit; - } - - // Setup the payment details. - $payment_array = array( - 'price' => $payment_data['price'], - 'give_form_title' => $payment_data['post_data']['give-form-title'], - 'give_form_id' => (int) ($payment_data['post_data']['give-form-id']), - 'give_price_id' => isset($payment_data['post_data']['give-price-id']) ? $payment_data['post_data']['give-price-id'] : '', - 'date' => $payment_data['date'], - 'user_email' => $payment_data['user_email'], - 'purchase_key' => $payment_data['purchase_key'], - 'currency' => give_get_currency($payment_data['post_data']['give-form-id'], $payment_data), - 'user_info' => $payment_data['user_info'], - 'status' => 'pending', - 'gateway' => 'lkn_erede_debit_3ds', - ); - - $headers = array( - 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ), - 'Content-Type' => 'application/json' - ); - - $currencyCode = give_get_currency($payment_data['post_data']['give-form-id'], $payment_data); - $payment_id = give_insert_payment($payment_array); - $amount = number_format($payment_data['price'], 2, '', ''); - $userAgent = $payment_data['post_data']['lkn_erede_debit_3ds_user_agent']; - $colorDepth = $payment_data['post_data']['lkn_erede_debit_3ds_device_color']; - $lang = $payment_data['post_data']['lkn_erede_debit_3ds_lang']; - $height = $payment_data['post_data']['lkn_erede_debit_3ds_device_height']; - $width = $payment_data['post_data']['lkn_erede_debit_3ds_device_width']; - $timezone = $payment_data['post_data']['lkn_erede_debit_3ds_timezone']; - $logname = date('d.m.Y-H.i.s') . '-debit-3ds'; - - $card = array(); - $splitDate = explode('/', $payment_data['post_data']['lkn_erede_debit_3ds_card_expiry']); - $card['expMonth'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[0])); - $card['expYear'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[1])); - $card['number'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_debit_3ds_card_number'])); - $card['cvv'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_debit_3ds_card_cvc'])); - $card['name'] = sanitize_text_field($payment_data['post_data']['lkn_erede_debit_3ds_card_name']); - - $body = array( - 'capture' => true, - 'kind' => 'debit', - 'reference' => $payment_id, - 'amount' => $amount, - 'cardholderName' => $card['name'], - 'cardNumber' => $card['number'], - 'expirationMonth' => $card['expMonth'], - 'expirationYear' => $card['expYear'], - 'securityCode' => $card['cvv'], - 'softDescriptor' => $configs['description'], - 'threeDSecure' => array( - 'embedded' => true, - 'onFailure' => 'decline', - 'userAgent' => $userAgent, - 'device' => array( - 'colorDepth' => $colorDepth, - 'deviceType3ds' => 'BROWSER', - 'javaEnabled' => false, - 'language' => $lang, - 'screenHeight' => $height, - 'screenWidth' => $width, - 'timeZoneOffset' => $timezone - ) - ), - 'urls' => array( - array( - 'kind' => 'threeDSecureSuccess', - 'url' => give_get_success_page_uri() - ), - array( - 'kind' => 'threeDSecureFailure', - 'url' => give_get_failed_transaction_uri() - ) - ) - ); - - $body = apply_filters('lkn_erede_debit_3ds_body', $body, $currencyCode, $payment_data); - - $response = wp_remote_post($configs['api_url'], array( - 'headers' => $headers, - 'body' => json_encode($body) - )); - - if ('enabled' === $configs['debug']) { - Payment_Erede_For_Givewp_Helper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(wp_remote_retrieve_body($response), true), $logname); - } - - $response = json_decode(wp_remote_retrieve_body($response)); - - $arrMetaData = array( - 'status' => $response->returnCode ?? '500', - 'message' => $response->returnMessage ?? 'Error on processing payment', - 'transaction_id' => $response->tid ?? '0', - 'capture' => $body['capture'] - ); - - if ('enabled' === $configs['debug']) { - $arrMetaData['log'] = $logname; - } - - give_update_payment_meta($payment_id, 'lkn_erede_response', json_encode($arrMetaData)); - - switch ($response->returnCode) { - case '200': - give_update_payment_status($payment_id, 'publish'); - - give_send_to_success_page(); - - exit; - case '220': - $paymentsToVerify = give_get_option('lkn_erede_debit_3ds_payments_pending', ''); - - if (empty($paymentsToVerify)) { - $paymentsToVerify = array(); - } else { - $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true); - } - - $paymentsToVerify[] = array('id' => $payment_id, 'count' => '0'); - $paymentsToVerify = base64_encode(json_encode($paymentsToVerify)); - give_update_option('lkn_erede_debit_3ds_payments_pending', $paymentsToVerify); - - wp_redirect($response->threeDSecure->url); - - exit; - - default: - give_update_payment_status($payment_id, 'failed'); - - wp_redirect(give_get_failed_transaction_uri()); - - exit; - } - } - - public function process_credit_api_payment($payment_data): void { - // Set the configs values - $configs = Payment_Erede_For_Givewp_Helper::get_configs('credit'); - - // Validate nonce. - give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway'); - - // Make sure we don't have any left over errors present. - give_clear_errors(); - - // Any errors? - $errors = give_get_errors(); - - if ($errors) { - give_send_back_to_checkout('?payment-mode=' . $payment_data['post_data']['give-gateway'] . '&error-msg=Erro interno no processamento do pagamento, contate o suporte'); - - exit; - } - - // Setup the payment details. - $payment_array = array( - 'price' => $payment_data['price'], - 'give_form_title' => $payment_data['post_data']['give-form-title'], - 'give_form_id' => (int) ($payment_data['post_data']['give-form-id']), - 'give_price_id' => isset($payment_data['post_data']['give-price-id']) ? $payment_data['post_data']['give-price-id'] : '', - 'date' => $payment_data['date'], - 'user_email' => $payment_data['user_email'], - 'purchase_key' => $payment_data['purchase_key'], - 'currency' => give_get_currency($payment_data['post_data']['give-form-id'], $payment_data), - 'user_info' => $payment_data['user_info'], - 'status' => 'pending', - 'gateway' => 'lkn_erede_credit', - ); - - $headers = array( - 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ), - 'Content-Type' => 'application/json' - ); - - $currencyCode = give_get_currency($payment_data['post_data']['give-form-id'], $payment_data); - $payment_id = give_insert_payment($payment_array); - $amount = number_format($payment_data['price'], 2, '', ''); - $logname = date('d.m.Y-H.i.s') . '-credit'; - - $card = array(); - $splitDate = explode('/', $payment_data['post_data']['lkn_erede_credit_card_expiry']); - $card['expMonth'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[0])); - $card['expYear'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[1])); - $card['number'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_credit_card_number'])); - $card['cvv'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_credit_card_cvc'])); - $card['name'] = sanitize_text_field($payment_data['post_data']['lkn_erede_credit_card_name']); - - $body = array( - 'capture' => true, - 'kind' => 'credit', - 'reference' => $payment_id, - 'amount' => $amount, - 'cardholderName' => $card['name'], - 'cardNumber' => $card['number'], - 'expirationMonth' => $card['expMonth'], - 'expirationYear' => $card['expYear'], - 'securityCode' => $card['cvv'], - 'softDescriptor' => $configs['description'], - 'subscription' => false, - 'origin' => 1, - 'distributorAffiliation' => 0, - 'storageCard' => '0', - 'transactionCredentials' => array( - 'credentialId' => '01' - ) - ); - - $body = apply_filters('lkn_erede_credit_body', $body, $currencyCode, $payment_data); - - $response = wp_remote_post($configs['api_url'], array( - 'headers' => $headers, - 'body' => json_encode($body) - )); - - if ('enabled' === $configs['debug']) { - Payment_Erede_For_Givewp_Helper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(wp_remote_retrieve_body($response), true), $logname); - } - - $response = json_decode(wp_remote_retrieve_body($response)); - - $arrMetaData = array( - 'status' => $response->returnCode ?? '500', - 'message' => $response->returnMessage ?? 'Error on processing payment', - 'transaction_id' => $response->tid ?? '0', - 'capture' => $body['capture'] - ); - - if ('enabled' === $configs['debug']) { - $arrMetaData['log'] = $logname; - } - - give_update_payment_meta($payment_id, 'lkn_erede_response', json_encode($arrMetaData)); - - switch ($response->returnCode) { - case '00': - give_update_payment_status($payment_id, 'publish'); - - give_send_to_success_page(); - - exit; - - default: - give_update_payment_status($payment_id, 'failed'); - - wp_redirect(give_get_failed_transaction_uri()); - - exit; - } - } - - public function define_row_meta($plugin_meta, $plugin_file) :array { - if ( ! defined(PAYMENT_EREDE_FOR_GIVEWP_BASENAME) && ! is_plugin_active(PAYMENT_EREDE_FOR_GIVEWP_BASENAME)) { - return $plugin_meta; - } - - $new_meta_links['setting'] = sprintf( - '%2$s', - admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'), - __('Settings', 'give') - ); - - return array_merge($plugin_meta, $new_meta_links); - } - - public function check_environment() : bool { - // Flag to check whether deactivate plugin or not. - $is_deactivate_plugin = false; - - // Load plugin helper functions. - if ( ! function_exists('deactivate_plugins') || ! function_exists('is_plugin_active')) { - require_once ABSPATH . '/wp-admin/includes/plugin.php'; - } - - if ( - defined('GIVE_VERSION') - && version_compare(GIVE_VERSION, PAYMENT_EREDE_FOR_GIVEWP_MIN_GIVE_VERSION, '<') - ) { - // Min. Give. plugin version. - - // Show admin notice. - add_action('admin_notices', array('Payment_Erede_For_Givewp', 'givewp_dependency_notice')); - - $is_deactivate_plugin = true; - } - - $is_give_active = defined('GIVE_PLUGIN_BASENAME') ? is_plugin_active(GIVE_PLUGIN_BASENAME) : false; - - if ( ! $is_give_active) { - add_action('admin_notices', array('Payment_Erede_For_Givewp', 'givewp_dependency_notice')); - - $is_deactivate_plugin = true; - } - - // Don't let this plugin activate. - if ($is_deactivate_plugin) { - // Deactivate plugin. - deactivate_plugins(PAYMENT_EREDE_FOR_GIVEWP_BASENAME); - - if (isset($_GET['activate'])) { - unset($_GET['activate']); - } - return false; - } - - return true; - } - - public static function givewp_dependency_notice(): void { - // Admin notice. - $message = sprintf( - '

%1$s %2$s %4$s %5$s %6$s+ %7$s.

', - __('Activation error:', ''), - __('You need to have', ''), - 'https://givewp.com', - __('Give WP', ''), - __('version', ''), - PAYMENT_EREDE_FOR_GIVEWP_MIN_GIVE_VERSION, - __('for the Payment Gateway E-Rede for GiveWP plugin to activate.', '') - ); - - echo $message; - } - - /** - * Register all of the hooks related to the admin area functionality - * of the plugin. - * - * @since 1.0.0 - * @access private - */ - private function define_admin_hooks(): void { - $plugin_admin = new Payment_Erede_For_Givewp_Admin( $this->get_plugin_name(), $this->get_version() ); - $this->loader->add_action('give_init', $this, 'updater_init'); - - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); - $this->loader->add_filter( 'give_payment_gateways', $plugin_admin, 'register_gateway' ); - - $this->loader->add_action('plugins_loaded', $this, 'check_environment', 999); - $this->loader->add_filter('plugin_action_links_' . PAYMENT_EREDE_FOR_GIVEWP_BASENAME, $this, 'define_row_meta', 10, 2); - $this->loader->add_action('lkn_payment_erede_cron_delete_logs', 'Payment_Erede_For_Givewp_Helper', 'delete_old_logs', 10, 0 ); - $this->loader->add_action('lkn_payment_erede_cron_verify_payment', $this, 'verify_payment', 10, 0 ); - - $this->loader->add_filter( 'give_get_sections_gateways', $plugin_admin, 'add_new_setting_section' ); - $this->loader->add_filter( 'give_get_settings_gateways', $plugin_admin, 'add_settings_into_section' ); - $this->loader->add_action('give_view_donation_details_billing_after', $plugin_admin, 'add_donation_details'); - - $this->loader->add_action( 'give_gateway_lkn_erede_credit', $this, 'process_credit_api_payment'); - $this->loader->add_action( 'give_gateway_lkn_erede_debit_3ds', $this, 'process_debit_3ds_api_payment'); - } - - /** - * Register all of the hooks related to the public-facing functionality - * of the plugin. - * - * @since 1.0.0 - * @access private - */ - private function define_public_hooks(): void { - $plugin_public = new Payment_Erede_For_Givewp_Public( $this->get_plugin_name(), $this->get_version() ); - - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); - $this->loader->add_action('give_lkn_erede_credit_cc_form', $plugin_public, 'payment_form_credit', 10, 3); - $this->loader->add_action('give_lkn_erede_debit_3ds_cc_form', $plugin_public, 'payment_form_debit_3ds', 10, 3); - } - - /** - * Run the loader to execute all of the hooks with WordPress. - * - * @since 1.0.0 - */ - public function run(): void { - $this->loader->run(); - } - - /** - * The name of the plugin used to uniquely identify it within the context of - * WordPress and to define internationalization functionality. - * - * @since 1.0.0 - * @return string The name of the plugin. - */ - public function get_plugin_name() { - return $this->plugin_name; - } - - /** - * The reference to the class that orchestrates the hooks with the plugin. - * - * @since 1.0.0 - * @return Payment_Erede_For_Givewp_Loader Orchestrates the hooks of the plugin. - */ - public function get_loader() { - return $this->loader; - } - - /** - * Retrieve the version number of the plugin. - * - * @since 1.0.0 - * @return string The version number of the plugin. - */ - public function get_version() { - return $this->version; - } - - public function updater_init() :object { - if (class_exists('Lkn_Puc_Plugin_UpdateChecker')) { - return new Lkn_Puc_Plugin_UpdateChecker( - 'https://api.linknacional.com.br/v2/u/?slug=payment-erede-for-givewp', - PAYMENT_EREDE_FOR_GIVEWP_FILE, - 'payment-erede-for-givewp' - ); - } else { - return null; - } - } -} diff --git a/includes/plugin-updater/Puc/Autoloader.php b/includes/plugin-updater/Puc/Autoloader.php deleted file mode 100644 index ec85114..0000000 --- a/includes/plugin-updater/Puc/Autoloader.php +++ /dev/null @@ -1,57 +0,0 @@ -rootDir = dirname(__FILE__) . '/'; - $nameParts = explode('_', __CLASS__, 3); - $this->prefix = $nameParts[0] . '_' . $nameParts[1] . '_'; - - $this->libraryDir = $this->rootDir . '../..'; - if ( !self::isPhar() ) { - $this->libraryDir = realpath($this->libraryDir); - } - $this->libraryDir = $this->libraryDir . '/'; - - spl_autoload_register([$this, 'autoload']); - } - - /** - * Determine if this file is running as part of a Phar archive. - * - * @return bool - */ - private static function isPhar() { - //Check if the current file path starts with "phar://". - static $pharProtocol = 'phar://'; - return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol); - } - - public function autoload($className) { - if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) { - /** @noinspection PhpIncludeInspection */ - include $this->libraryDir . $this->staticMap[$className]; - return; - } - - if (strpos($className, $this->prefix) === 0) { - $path = substr($className, strlen($this->prefix)); - $path = str_replace('_', '/', $path); - $path = $this->rootDir . $path . '.php'; - - if (file_exists($path)) { - /** @noinspection PhpIncludeInspection */ - include $path; - } - } - } - } - -endif; diff --git a/includes/plugin-updater/Puc/InstalledPackage.php b/includes/plugin-updater/Puc/InstalledPackage.php deleted file mode 100644 index 6fa4f75..0000000 --- a/includes/plugin-updater/Puc/InstalledPackage.php +++ /dev/null @@ -1,102 +0,0 @@ -updateChecker = $updateChecker; - } - - /** - * Get the currently installed version of the plugin or theme. - * - * @return string|null Version number. - */ - abstract public function getInstalledVersion(); - - /** - * Get the full path of the plugin or theme directory (without a trailing slash). - * - * @return string - */ - abstract public function getAbsoluteDirectoryPath(); - - /** - * Check whether a regular file exists in the package's directory. - * - * @param string $relativeFileName File name relative to the package directory. - * @return bool - */ - public function fileExists($relativeFileName) { - return is_file( - $this->getAbsoluteDirectoryPath() - . DIRECTORY_SEPARATOR - . ltrim($relativeFileName, '/\\') - ); - } - - /* ------------------------------------------------------------------- - * File header parsing - * ------------------------------------------------------------------- - */ - - /** - * Parse plugin or theme metadata from the header comment. - * - * This is basically a simplified version of the get_file_data() function from /wp-includes/functions.php. - * It's intended as a utility for subclasses that detect updates by parsing files in a VCS. - * - * @param string|null $content File contents. - * @return string[] - */ - public function getFileHeader($content) { - $content = (string)$content; - - //WordPress only looks at the first 8 KiB of the file, so we do the same. - $content = substr($content, 0, 8192); - //Normalize line endings. - $content = str_replace("\r", "\n", $content); - - $headers = $this->getHeaderNames(); - $results = []; - foreach ($headers as $field => $name) { - $success = preg_match('/^[ \t\/*#@]*' . preg_quote($name, '/') . ':(.*)$/mi', $content, $matches); - - if ( ($success === 1) && $matches[1] ) { - $value = $matches[1]; - if ( function_exists('_cleanup_header_comment') ) { - $value = _cleanup_header_comment($value); - } - $results[$field] = $value; - } else { - $results[$field] = ''; - } - } - - return $results; - } - - /** - * @return array Format: ['HeaderKey' => 'Header Name'] - */ - abstract protected function getHeaderNames(); - - /** - * Get the value of a specific plugin or theme header. - * - * @param string $headerName - * @return string Either the value of the header, or an empty string if the header doesn't exist. - */ - abstract public function getHeaderValue($headerName); - } -endif; diff --git a/includes/plugin-updater/Puc/Metadata.php b/includes/plugin-updater/Puc/Metadata.php deleted file mode 100644 index cb974d1..0000000 --- a/includes/plugin-updater/Puc/Metadata.php +++ /dev/null @@ -1,131 +0,0 @@ -validateMetadata($apiResponse); - if ( is_wp_error($valid) ) { - do_action('puc_api_error', $valid); - trigger_error($valid->get_error_message(), E_USER_NOTICE); - return false; - } - - foreach (get_object_vars($apiResponse) as $key => $value) { - $target->$key = $value; - } - - return true; - } - - /** - * No validation by default! Subclasses should check that the required fields are present. - * - * @param StdClass $apiResponse - * @return bool|WP_Error - */ - protected function validateMetadata(/** @noinspection PhpUnusedParameterInspection */ $apiResponse) { - return true; - } - - /** - * Create a new instance by copying the necessary fields from another object. - * - * @abstract - * @param StdClass|self $object The source object. - * @return self The new copy. - */ - public static function fromObject(/** @noinspection PhpUnusedParameterInspection */ $object) { - throw new LogicException('The ' . __METHOD__ . ' method must be implemented by subclasses'); - } - - /** - * Create an instance of StdClass that can later be converted back to an - * update or info container. Useful for serialization and caching, as it - * avoids the "incomplete object" problem if the cached value is loaded - * before this class. - * - * @return StdClass - */ - public function toStdClass() { - $object = new stdClass(); - $this->copyFields($this, $object); - return $object; - } - - /** - * Transform the metadata into the format used by WordPress core. - * - * @return object - */ - abstract public function toWpFormat(); - - /** - * Copy known fields from one object to another. - * - * @param StdClass|self $from - * @param StdClass|self $to - */ - protected function copyFields($from, $to) { - $fields = $this->getFieldNames(); - - if ( property_exists($from, 'slug') && !empty($from->slug) ) { - //Let plugins add extra fields without having to create subclasses. - $fields = apply_filters($this->getPrefixedFilter('retain_fields') . '-' . $from->slug, $fields); - } - - foreach ($fields as $field) { - if ( property_exists($from, $field) ) { - $to->$field = $from->$field; - } - } - } - - /** - * @return string[] - */ - protected function getFieldNames() { - return []; - } - - /** - * @param string $tag - * @return string - */ - protected function getPrefixedFilter($tag) { - return 'puc_' . $tag; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Plugin/Info.php b/includes/plugin-updater/Puc/Plugin/Info.php deleted file mode 100644 index fde1e0c..0000000 --- a/includes/plugin-updater/Puc/Plugin/Info.php +++ /dev/null @@ -1,131 +0,0 @@ -sections = (array)$instance->sections; - $instance->icons = (array)$instance->icons; - - return $instance; - } - - /** - * Very, very basic validation. - * - * @param StdClass $apiResponse - * @return bool|WP_Error - */ - protected function validateMetadata($apiResponse) { - if ( - !isset($apiResponse->name, $apiResponse->version) - || empty($apiResponse->name) - || empty($apiResponse->version) - ) { - return new WP_Error( - 'puc-invalid-metadata', - "The plugin metadata file does not contain the required 'name' and/or 'version' keys." - ); - } - return true; - } - - /** - * Transform plugin info into the format used by the native WordPress.org API - * - * @return object - */ - public function toWpFormat() { - $info = new stdClass; - - //The custom update API is built so that many fields have the same name and format - //as those returned by the native WordPress.org API. These can be assigned directly. - $sameFormat = [ - 'name', 'slug', 'version', 'requires', 'tested', 'rating', 'upgrade_notice', - 'num_ratings', 'downloaded', 'active_installs', 'homepage', 'last_updated', - 'requires_php', - ]; - foreach ($sameFormat as $field) { - if ( isset($this->$field) ) { - $info->$field = $this->$field; - } else { - $info->$field = null; - } - } - - //Other fields need to be renamed and/or transformed. - $info->download_link = $this->download_url; - $info->author = $this->getFormattedAuthor(); - $info->sections = array_merge(['description' => ''], $this->sections); - - if ( !empty($this->banners) ) { - //WP expects an array with two keys: "high" and "low". Both are optional. - //Docs: https://wordpress.org/plugins/about/faq/#banners - $info->banners = is_object($this->banners) ? get_object_vars($this->banners) : $this->banners; - $info->banners = array_intersect_key($info->banners, ['high' => true, 'low' => true]); - } - - return $info; - } - - protected function getFormattedAuthor() { - if ( !empty($this->author_homepage) ) { - /** @noinspection HtmlUnknownTarget */ - return sprintf('%s', $this->author_homepage, $this->author); - } - return $this->author; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Plugin/Package.php b/includes/plugin-updater/Puc/Plugin/Package.php deleted file mode 100644 index f51076d..0000000 --- a/includes/plugin-updater/Puc/Plugin/Package.php +++ /dev/null @@ -1,205 +0,0 @@ -pluginAbsolutePath = $pluginAbsolutePath; - $this->pluginFile = plugin_basename($this->pluginAbsolutePath); - - parent::__construct($updateChecker); - - //Clear the version number cache when something - anything - is upgraded or WP clears the update cache. - add_filter('upgrader_post_install', [$this, 'clearCachedVersion']); - add_action('delete_site_transient_update_plugins', [$this, 'clearCachedVersion']); - } - - public function getInstalledVersion() { - if ( isset($this->cachedInstalledVersion) ) { - return $this->cachedInstalledVersion; - } - - $pluginHeader = $this->getPluginHeader(); - if ( isset($pluginHeader['Version']) ) { - $this->cachedInstalledVersion = $pluginHeader['Version']; - return $pluginHeader['Version']; - } else { - //This can happen if the filename points to something that is not a plugin. - $this->updateChecker->triggerError( - sprintf( - "Can't to read the Version header for '%s'. The filename is incorrect or is not a plugin.", - $this->updateChecker->pluginFile - ), - E_USER_WARNING - ); - return null; - } - } - - /** - * Clear the cached plugin version. This method can be set up as a filter (hook) and will - * return the filter argument unmodified. - * - * @param mixed $filterArgument - * @return mixed - */ - public function clearCachedVersion($filterArgument = null) { - $this->cachedInstalledVersion = null; - return $filterArgument; - } - - public function getAbsoluteDirectoryPath() { - return dirname($this->pluginAbsolutePath); - } - - /** - * Get the value of a specific plugin or theme header. - * - * @param string $headerName - * @param string $defaultValue - * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. - */ - public function getHeaderValue($headerName, $defaultValue = '') { - $headers = $this->getPluginHeader(); - if ( isset($headers[$headerName]) && ($headers[$headerName] !== '') ) { - return $headers[$headerName]; - } - return $defaultValue; - } - - protected function getHeaderNames() { - return [ - 'Name' => 'Plugin Name', - 'PluginURI' => 'Plugin URI', - 'Version' => 'Version', - 'Description' => 'Description', - 'Author' => 'Author', - 'AuthorURI' => 'Author URI', - 'TextDomain' => 'Text Domain', - 'DomainPath' => 'Domain Path', - 'Network' => 'Network', - - //The newest WordPress version that this plugin requires or has been tested with. - //We support several different formats for compatibility with other libraries. - 'Tested WP' => 'Tested WP', - 'Requires WP' => 'Requires WP', - 'Tested up to' => 'Tested up to', - 'Requires at least' => 'Requires at least', - ]; - } - - /** - * Get the translated plugin title. - * - * @return string - */ - public function getPluginTitle() { - $title = ''; - $header = $this->getPluginHeader(); - if ( $header && !empty($header['Name']) && isset($header['TextDomain']) ) { - $title = translate($header['Name'], $header['TextDomain']); - } - return $title; - } - - /** - * Get plugin's metadata from its file header. - * - * @return array - */ - public function getPluginHeader() { - if ( !is_file($this->pluginAbsolutePath) ) { - //This can happen if the plugin filename is wrong. - $this->updateChecker->triggerError( - sprintf( - "Can't to read the plugin header for '%s'. The file does not exist.", - $this->updateChecker->pluginFile - ), - E_USER_WARNING - ); - return []; - } - - if ( !function_exists('get_plugin_data') ) { - /** @noinspection PhpIncludeInspection */ - require_once ABSPATH . '/wp-admin/includes/plugin.php'; - } - return get_plugin_data($this->pluginAbsolutePath, false, false); - } - - public function removeHooks() { - remove_filter('upgrader_post_install', [$this, 'clearCachedVersion']); - remove_action('delete_site_transient_update_plugins', [$this, 'clearCachedVersion']); - } - - /** - * Check if the plugin file is inside the mu-plugins directory. - * - * @return bool - */ - public function isMuPlugin() { - static $cachedResult = null; - - if ( $cachedResult === null ) { - if ( !defined('WPMU_PLUGIN_DIR') || !is_string(WPMU_PLUGIN_DIR) ) { - $cachedResult = false; - return $cachedResult; - } - - //Convert both paths to the canonical form before comparison. - $muPluginDir = realpath(WPMU_PLUGIN_DIR); - $pluginPath = realpath($this->pluginAbsolutePath); - //If realpath() fails, just normalize the syntax instead. - if (($muPluginDir === false) || ($pluginPath === false)) { - $muPluginDir = self::normalizePath(WPMU_PLUGIN_DIR); - $pluginPath = self::normalizePath($this->pluginAbsolutePath); - } - - $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); - } - - return $cachedResult; - } - - /** - * - * Normalize a filesystem path. Introduced in WP 3.9. - * Copying here allows use of the class on earlier versions. - * This version adapted from WP 4.8.2 (unchanged since 4.5.0) - * - * @param string $path Path to normalize. - * @return string Normalized path. - */ - public static function normalizePath($path) { - if ( function_exists('wp_normalize_path') ) { - return wp_normalize_path($path); - } - $path = str_replace('\\', '/', $path); - $path = preg_replace('|(?<=.)/+|', '/', $path); - if ( substr($path, 1, 1) === ':' ) { - $path = ucfirst($path); - } - return $path; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Plugin/Ui.php b/includes/plugin-updater/Puc/Plugin/Ui.php deleted file mode 100644 index 3625b0d..0000000 --- a/includes/plugin-updater/Puc/Plugin/Ui.php +++ /dev/null @@ -1,282 +0,0 @@ -updateChecker = $updateChecker; - $this->manualCheckErrorTransient = $this->updateChecker->getUniqueName('manual_check_errors'); - - add_action('admin_init', [$this, 'onAdminInit']); - } - - public function onAdminInit() { - if ( $this->updateChecker->userCanInstallUpdates() ) { - $this->handleManualCheck(); - - add_filter('plugin_row_meta', [$this, 'addViewDetailsLink'], 10, 3); - add_filter('plugin_row_meta', [$this, 'addCheckForUpdatesLink'], 10, 2); - add_action('all_admin_notices', [$this, 'displayManualCheckResult']); - } - } - - /** - * Add a "View Details" link to the plugin row in the "Plugins" page. By default, - * the new link will appear before the "Visit plugin site" link (if present). - * - * You can change the link text by using the "puc_view_details_link-$slug" filter. - * Returning an empty string from the filter will disable the link. - * - * You can change the position of the link using the - * "puc_view_details_link_position-$slug" filter. - * Returning 'before' or 'after' will place the link immediately before/after - * the "Visit plugin site" link. - * Returning 'append' places the link after any existing links at the time of the hook. - * Returning 'replace' replaces the "Visit plugin site" link. - * Returning anything else disables the link when there is a "Visit plugin site" link. - * - * If there is no "Visit plugin site" link 'append' is always used! - * - * @param array $pluginMeta Array of meta links. - * @param string $pluginFile - * @param array $pluginData Array of plugin header data. - * @return array - */ - public function addViewDetailsLink($pluginMeta, $pluginFile, $pluginData = []) { - if ( $this->isMyPluginFile($pluginFile) && !isset($pluginData['slug']) ) { - $linkText = apply_filters($this->updateChecker->getUniqueName('view_details_link'), __('View details')); - if ( !empty($linkText) ) { - $viewDetailsLinkPosition = 'append'; - - //Find the "Visit plugin site" link (if present). - $visitPluginSiteLinkIndex = count($pluginMeta) - 1; - if ( $pluginData['PluginURI'] ) { - $escapedPluginUri = esc_url($pluginData['PluginURI']); - foreach ($pluginMeta as $linkIndex => $existingLink) { - if ( strpos($existingLink, $escapedPluginUri) !== false ) { - $visitPluginSiteLinkIndex = $linkIndex; - $viewDetailsLinkPosition = apply_filters( - $this->updateChecker->getUniqueName('view_details_link_position'), - 'before' - ); - break; - } - } - } - - $viewDetailsLink = sprintf('%s', - esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . urlencode($this->updateChecker->slug) . - '&TB_iframe=true&width=600&height=550')), - esc_attr(sprintf(__('More information about %s'), $pluginData['Name'])), - esc_attr($pluginData['Name']), - $linkText - ); - switch ($viewDetailsLinkPosition) { - case 'before': - array_splice($pluginMeta, $visitPluginSiteLinkIndex, 0, $viewDetailsLink); - break; - case 'after': - array_splice($pluginMeta, $visitPluginSiteLinkIndex + 1, 0, $viewDetailsLink); - break; - case 'replace': - $pluginMeta[$visitPluginSiteLinkIndex] = $viewDetailsLink; - break; - case 'append': - default: - $pluginMeta[] = $viewDetailsLink; - break; - } - } - } - return $pluginMeta; - } - - /** - * Add a "Check for updates" link to the plugin row in the "Plugins" page. By default, - * the new link will appear after the "Visit plugin site" link if present, otherwise - * after the "View plugin details" link. - * - * You can change the link text by using the "puc_manual_check_link-$slug" filter. - * Returning an empty string from the filter will disable the link. - * - * @param array $pluginMeta Array of meta links. - * @param string $pluginFile - * @return array - */ - public function addCheckForUpdatesLink($pluginMeta, $pluginFile) { - if ( $this->isMyPluginFile($pluginFile) ) { - $linkUrl = wp_nonce_url( - add_query_arg( - [ - 'puc_check_for_updates' => 1, - 'puc_slug' => $this->updateChecker->slug, - ], - self_admin_url('plugins.php') - ), - 'puc_check_for_updates' - ); - - $linkText = apply_filters( - $this->updateChecker->getUniqueName('manual_check_link'), - __('Check for updates', 'plugin-update-checker') - ); - if ( !empty($linkText) ) { - /** @noinspection HtmlUnknownTarget */ - $pluginMeta[] = sprintf('%s', esc_attr($linkUrl), $linkText); - } - } - return $pluginMeta; - } - - protected function isMyPluginFile($pluginFile) { - return ($pluginFile == $this->updateChecker->pluginFile) - || (!empty($this->updateChecker->muPluginFile) && ($pluginFile == $this->updateChecker->muPluginFile)); - } - - /** - * Check for updates when the user clicks the "Check for updates" link. - * - * @see self::addCheckForUpdatesLink() - * - * @return void - */ - public function handleManualCheck() { - $shouldCheck = - isset($_GET['puc_check_for_updates'], $_GET['puc_slug']) - && $_GET['puc_slug'] == $this->updateChecker->slug - && check_admin_referer('puc_check_for_updates'); - - if ( $shouldCheck ) { - $update = $this->updateChecker->checkForUpdates(); - $status = ($update === null) ? 'no_update' : 'update_available'; - $lastRequestApiErrors = $this->updateChecker->getLastRequestApiErrors(); - - if ( ($update === null) && !empty($lastRequestApiErrors) ) { - //Some errors are not critical. For example, if PUC tries to retrieve the readme.txt - //file from GitHub and gets a 404, that's an API error, but it doesn't prevent updates - //from working. Maybe the plugin simply doesn't have a readme. - //Let's only show important errors. - $foundCriticalErrors = false; - $questionableErrorCodes = [ - 'puc-github-http-error', - 'puc-gitlab-http-error', - 'puc-bitbucket-http-error', - ]; - - foreach ($lastRequestApiErrors as $item) { - $wpError = $item['error']; - /** @var WP_Error $wpError */ - if ( !in_array($wpError->get_error_code(), $questionableErrorCodes) ) { - $foundCriticalErrors = true; - break; - } - } - - if ( $foundCriticalErrors ) { - $status = 'error'; - set_site_transient($this->manualCheckErrorTransient, $lastRequestApiErrors, 60); - } - } - - wp_redirect(add_query_arg( - [ - 'puc_update_check_result' => $status, - 'puc_slug' => $this->updateChecker->slug, - ], - self_admin_url('plugins.php') - )); - exit; - } - } - - /** - * Display the results of a manual update check. - * - * @see self::handleManualCheck() - * - * You can change the result message by using the "puc_manual_check_message-$slug" filter. - */ - public function displayManualCheckResult() { - if ( isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->updateChecker->slug) ) { - $status = strval($_GET['puc_update_check_result']); - $title = $this->updateChecker->getInstalledPackage()->getPluginTitle(); - $noticeClass = 'updated notice-success'; - $details = ''; - - if ( $status == 'no_update' ) { - $message = sprintf(_x('The %s plugin is up to date.', 'the plugin title', 'plugin-update-checker'), $title); - } else { - if ( $status == 'update_available' ) { - $message = sprintf(_x('A new version of the %s plugin is available.', 'the plugin title', 'plugin-update-checker'), $title); - } else { - if ( $status === 'error' ) { - $message = sprintf(_x('Could not determine if updates are available for %s.', 'the plugin title', 'plugin-update-checker'), $title); - $noticeClass = 'error notice-error'; - - $details = $this->formatManualCheckErrors(get_site_transient($this->manualCheckErrorTransient)); - delete_site_transient($this->manualCheckErrorTransient); - } else { - $message = sprintf(__('Unknown update checker status "%s"', 'plugin-update-checker'), htmlentities($status)); - $noticeClass = 'error notice-error'; - } - } - } - printf( - '

%s

%s
', - $noticeClass, - apply_filters($this->updateChecker->getUniqueName('manual_check_message'), $message, $status), - $details - ); - } - } - - /** - * Format the list of errors that were thrown during an update check. - * - * @param array $errors - * @return string - */ - protected function formatManualCheckErrors($errors) { - if ( empty($errors) ) { - return ''; - } - $output = ''; - - $showAsList = count($errors) > 1; - if ( $showAsList ) { - $output .= '
    '; - $formatString = '
  1. %1$s %2$s
  2. '; - } else { - $formatString = '

    %1$s %2$s

    '; - } - foreach ($errors as $item) { - $wpError = $item['error']; - /** @var WP_Error $wpError */ - $output .= sprintf( - $formatString, - $wpError->get_error_message(), - $wpError->get_error_code() - ); - } - if ( $showAsList ) { - $output .= '
'; - } - - return $output; - } - - public function removeHooks() { - remove_action('admin_init', [$this, 'onAdminInit']); - remove_filter('plugin_row_meta', [$this, 'addViewDetailsLink'], 10); - remove_filter('plugin_row_meta', [$this, 'addCheckForUpdatesLink'], 10); - remove_action('all_admin_notices', [$this, 'displayManualCheckResult']); - } - } -endif; diff --git a/includes/plugin-updater/Puc/Plugin/Update.php b/includes/plugin-updater/Puc/Plugin/Update.php deleted file mode 100644 index 165bc35..0000000 --- a/includes/plugin-updater/Puc/Plugin/Update.php +++ /dev/null @@ -1,112 +0,0 @@ -copyFields($object, $update); - return $update; - } - - /** - * @return string[] - */ - protected function getFieldNames() { - return array_merge(parent::getFieldNames(), self::$extraFields); - } - - /** - * Transform the update into the format used by WordPress native plugin API. - * - * @return object - */ - public function toWpFormat() { - $update = parent::toWpFormat(); - - $update->id = $this->id; - $update->url = $this->homepage; - $update->tested = $this->tested; - $update->requires_php = $this->requires_php; - $update->plugin = $this->filename; - - if ( !empty($this->upgrade_notice) ) { - $update->upgrade_notice = $this->upgrade_notice; - } - - if ( !empty($this->icons) && is_array($this->icons) ) { - //This should be an array with up to 4 keys: 'svg', '1x', '2x' and 'default'. - //Docs: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/#plugin-icons - $icons = array_intersect_key( - $this->icons, - ['svg' => true, '1x' => true, '2x' => true, 'default' => true] - ); - if ( !empty($icons) ) { - $update->icons = $icons; - - //It appears that the 'default' icon isn't used anywhere in WordPress 4.9, - //but lets set it just in case a future release needs it. - if ( !isset($update->icons['default']) ) { - $update->icons['default'] = current($update->icons); - } - } - } - - return $update; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Plugin/UpdateChecker.php b/includes/plugin-updater/Puc/Plugin/UpdateChecker.php deleted file mode 100644 index 2412a40..0000000 --- a/includes/plugin-updater/Puc/Plugin/UpdateChecker.php +++ /dev/null @@ -1,410 +0,0 @@ -pluginAbsolutePath = $pluginFile; - $this->pluginFile = plugin_basename($this->pluginAbsolutePath); - $this->muPluginFile = $muPluginFile; - - //If no slug is specified, use the name of the main plugin file as the slug. - //For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'. - if ( empty($slug) ) { - $slug = basename($this->pluginFile, '.php'); - } - - //Plugin slugs must be unique. - $slugCheckFilter = 'puc_is_slug_in_use-' . $slug; - $slugUsedBy = apply_filters($slugCheckFilter, false); - if ( $slugUsedBy ) { - $this->triggerError(sprintf( - 'Plugin slug "%s" is already in use by %s. Slugs must be unique.', - htmlentities($slug), - htmlentities($slugUsedBy) - ), E_USER_ERROR); - } - add_filter($slugCheckFilter, [$this, 'getAbsolutePath']); - - parent::__construct($metadataUrl, dirname($this->pluginFile), $slug, $checkPeriod, $optionName); - - //Backwards compatibility: If the plugin is a mu-plugin but no $muPluginFile is specified, assume - //it's the same as $pluginFile given that it's not in a subdirectory (WP only looks in the base dir). - if ( (strpbrk($this->pluginFile, '/\\') === false) && $this->isUnknownMuPlugin() ) { - $this->muPluginFile = $this->pluginFile; - } - - //To prevent a crash during plugin uninstallation, remove updater hooks when the user removes the plugin. - //Details: https://github.com/YahnisElsts/plugin-update-checker/issues/138#issuecomment-335590964 - add_action('uninstall_' . $this->pluginFile, [$this, 'removeHooks']); - - $this->extraUi = new Lkn_Puc_Plugin_Ui($this); - } - - /** - * Create an instance of the scheduler. - * - * @param int $checkPeriod - * @return Lkn_Puc_Scheduler - */ - protected function createScheduler($checkPeriod) { - $scheduler = new Lkn_Puc_Scheduler($this, $checkPeriod, ['load-plugins.php']); - register_deactivation_hook($this->pluginFile, [$scheduler, 'removeUpdaterCron']); - return $scheduler; - } - - /** - * Install the hooks required to run periodic update checks and inject update info - * into WP data structures. - * - * @return void - */ - protected function installHooks() { - //Override requests for plugin information - add_filter('plugins_api', [$this, 'injectInfo'], 20, 3); - - parent::installHooks(); - } - - /** - * Remove update checker hooks. - * - * The intent is to prevent a fatal error that can happen if the plugin has an uninstall - * hook. During uninstallation, WP includes the main plugin file (which creates a PUC instance), - * the uninstall hook runs, WP deletes the plugin files and then updates some transients. - * If PUC hooks are still around at this time, they could throw an error while trying to - * autoload classes from files that no longer exist. - * - * The "site_transient_{$transient}" filter is the main problem here, but let's also remove - * most other PUC hooks to be safe. - * - * @internal - */ - public function removeHooks() { - parent::removeHooks(); - $this->extraUi->removeHooks(); - $this->package->removeHooks(); - - remove_filter('plugins_api', [$this, 'injectInfo'], 20); - } - - /** - * Retrieve plugin info from the configured API endpoint. - * - * @uses wp_remote_get() - * - * @param array $queryArgs Additional query arguments to append to the request. Optional. - * @return Lkn_Puc_Plugin_Info - */ - public function requestInfo($queryArgs = []) { - list($pluginInfo, $result) = $this->requestMetadata('Lkn_Puc_Plugin_Info', $queryArgs); - - if ( $pluginInfo !== null ) { - /** @var Lkn_Puc_Plugin_Info $pluginInfo */ - $pluginInfo->filename = $this->pluginFile; - $pluginInfo->slug = $this->slug; - } - - $pluginInfo = apply_filters($this->getUniqueName('request_info_result'), $pluginInfo, $result); - return $pluginInfo; - } - - /** - * Retrieve the latest update (if any) from the configured API endpoint. - * - * @uses PluginUpdateChecker::requestInfo() - * - * @return Lkn_Puc_Update|null An instance of Plugin_Update, or NULL when no updates are available. - */ - public function requestUpdate() { - //For the sake of simplicity, this function just calls requestInfo() - //and transforms the result accordingly. - $pluginInfo = $this->requestInfo(['checking_for_updates' => '1']); - if ( $pluginInfo === null ) { - return null; - } - $update = Lkn_Puc_Plugin_Update::fromPluginInfo($pluginInfo); - - $update = $this->filterUpdateResult($update); - - return $update; - } - - /** - * Intercept plugins_api() calls that request information about our plugin and - * use the configured API endpoint to satisfy them. - * - * @see plugins_api() - * - * @param mixed $result - * @param string $action - * @param array|object $args - * @return mixed - */ - public function injectInfo($result, $action = null, $args = null) { - $relevant = ($action == 'plugin_information') && isset($args->slug) && ( - ($args->slug == $this->slug) || ($args->slug == dirname($this->pluginFile)) - ); - if ( !$relevant ) { - return $result; - } - - $pluginInfo = $this->requestInfo(); - $this->fixSupportedWordpressVersion($pluginInfo); - - $pluginInfo = apply_filters($this->getUniqueName('pre_inject_info'), $pluginInfo); - if ( $pluginInfo ) { - return $pluginInfo->toWpFormat(); - } - - return $result; - } - - protected function shouldShowUpdates() { - //No update notifications for mu-plugins unless explicitly enabled. The MU plugin file - //is usually different from the main plugin file so the update wouldn't show up properly anyway. - return !$this->isUnknownMuPlugin(); - } - - /** - * @param stdClass|null $updates - * @param stdClass $updateToAdd - * @return stdClass - */ - protected function addUpdateToList($updates, $updateToAdd) { - if ( $this->package->isMuPlugin() ) { - //WP does not support automatic update installation for mu-plugins, but we can - //still display a notice. - $updateToAdd->package = null; - } - return parent::addUpdateToList($updates, $updateToAdd); - } - - /** - * @param stdClass|null $updates - * @return stdClass|null - */ - protected function removeUpdateFromList($updates) { - $updates = parent::removeUpdateFromList($updates); - if ( !empty($this->muPluginFile) && isset($updates, $updates->response) ) { - unset($updates->response[$this->muPluginFile]); - } - return $updates; - } - - /** - * For plugins, the update array is indexed by the plugin filename relative to the "plugins" - * directory. Example: "plugin-name/plugin.php". - * - * @return string - */ - protected function getUpdateListKey() { - if ( $this->package->isMuPlugin() ) { - return $this->muPluginFile; - } - return $this->pluginFile; - } - - protected function getNoUpdateItemFields() { - return array_merge( - parent::getNoUpdateItemFields(), - [ - 'id' => $this->pluginFile, - 'slug' => $this->slug, - 'plugin' => $this->pluginFile, - 'icons' => [], - 'banners' => [], - 'banners_rtl' => [], - 'tested' => '', - 'compatibility' => new stdClass(), - ] - ); - } - - /** - * Alias for isBeingUpgraded(). - * - * @deprecated - * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. - * @return bool - */ - public function isPluginBeingUpgraded($upgrader = null) { - return $this->isBeingUpgraded($upgrader); - } - - /** - * Is there an update being installed for this plugin, right now? - * - * @param WP_Upgrader|null $upgrader - * @return bool - */ - public function isBeingUpgraded($upgrader = null) { - return $this->upgraderStatus->isPluginBeingUpgraded($this->pluginFile, $upgrader); - } - - /** - * Get the details of the currently available update, if any. - * - * If no updates are available, or if the last known update version is below or equal - * to the currently installed version, this method will return NULL. - * - * Uses cached update data. To retrieve update information straight from - * the metadata URL, call requestUpdate() instead. - * - * @return Lkn_Puc_Plugin_Update|null - */ - public function getUpdate() { - $update = parent::getUpdate(); - if ( isset($update) ) { - /** @var Lkn_Puc_Plugin_Update $update */ - $update->filename = $this->pluginFile; - } - return $update; - } - - /** - * Get the translated plugin title. - * - * @deprecated - * @return string - */ - public function getPluginTitle() { - return $this->package->getPluginTitle(); - } - - /** - * Check if the current user has the required permissions to install updates. - * - * @return bool - */ - public function userCanInstallUpdates() { - return current_user_can('update_plugins'); - } - - /** - * Check if the plugin file is inside the mu-plugins directory. - * - * @deprecated - * @return bool - */ - protected function isMuPlugin() { - return $this->package->isMuPlugin(); - } - - /** - * MU plugins are partially supported, but only when we know which file in mu-plugins - * corresponds to this plugin. - * - * @return bool - */ - protected function isUnknownMuPlugin() { - return empty($this->muPluginFile) && $this->package->isMuPlugin(); - } - - /** - * Get absolute path to the main plugin file. - * - * @return string - */ - public function getAbsolutePath() { - return $this->pluginAbsolutePath; - } - - /** - * Register a callback for filtering query arguments. - * - * The callback function should take one argument - an associative array of query arguments. - * It should return a modified array of query arguments. - * - * @uses add_filter() This method is a convenience wrapper for add_filter(). - * - * @param callable $callback - * @return void - */ - public function addQueryArgFilter($callback) { - $this->addFilter('request_info_query_args', $callback); - } - - /** - * Register a callback for filtering arguments passed to wp_remote_get(). - * - * The callback function should take one argument - an associative array of arguments - - * and return a modified array or arguments. See the WP documentation on wp_remote_get() - * for details on what arguments are available and how they work. - * - * @uses add_filter() This method is a convenience wrapper for add_filter(). - * - * @param callable $callback - * @return void - */ - public function addHttpRequestArgFilter($callback) { - $this->addFilter('request_info_options', $callback); - } - - /** - * Register a callback for filtering the plugin info retrieved from the external API. - * - * The callback function should take two arguments. If the plugin info was retrieved - * successfully, the first argument passed will be an instance of PluginInfo. Otherwise, - * it will be NULL. The second argument will be the corresponding return value of - * wp_remote_get (see WP docs for details). - * - * The callback function should return a new or modified instance of PluginInfo or NULL. - * - * @uses add_filter() This method is a convenience wrapper for add_filter(). - * - * @param callable $callback - * @return void - */ - public function addResultFilter($callback) { - $this->addFilter('request_info_result', $callback, 10, 2); - } - - /** - * Create a package instance that represents this plugin or theme. - * - * @return Lkn_Puc_InstalledPackage - */ - protected function createInstalledPackage() { - return new Lkn_Puc_Plugin_Package($this->pluginAbsolutePath, $this); - } - - /** - * @return Lkn_Puc_Plugin_Package - */ - public function getInstalledPackage() { - return $this->package; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Scheduler.php b/includes/plugin-updater/Puc/Scheduler.php deleted file mode 100644 index 74347c2..0000000 --- a/includes/plugin-updater/Puc/Scheduler.php +++ /dev/null @@ -1,254 +0,0 @@ -updateChecker = $updateChecker; - $this->checkPeriod = $checkPeriod; - - //Set up the periodic update checks - $this->cronHook = $this->updateChecker->getUniqueName('cron_check_updates'); - if ( $this->checkPeriod > 0 ) { - //Trigger the check via Cron. - //Try to use one of the default schedules if possible as it's less likely to conflict - //with other plugins and their custom schedules. - $defaultSchedules = [ - 1 => 'hourly', - 12 => 'twicedaily', - 24 => 'daily', - ]; - if ( array_key_exists($this->checkPeriod, $defaultSchedules) ) { - $scheduleName = $defaultSchedules[$this->checkPeriod]; - } else { - //Use a custom cron schedule. - $scheduleName = 'every' . $this->checkPeriod . 'hours'; - add_filter('cron_schedules', [$this, '_addCustomSchedule']); - } - - if ( !wp_next_scheduled($this->cronHook) && !defined('WP_INSTALLING') ) { - //Randomly offset the schedule to help prevent update server traffic spikes. Without this - //most checks may happen during times of day when people are most likely to install new plugins. - $firstCheckTime = time() - rand(0, max($this->checkPeriod * 3600 - 15 * 60, 1)); - $firstCheckTime = apply_filters( - $this->updateChecker->getUniqueName('first_check_time'), - $firstCheckTime - ); - wp_schedule_event($firstCheckTime, $scheduleName, $this->cronHook); - } - add_action($this->cronHook, [$this, 'maybeCheckForUpdates']); - - //In case Cron is disabled or unreliable, we also manually trigger - //the periodic checks while the user is browsing the Dashboard. - add_action( 'admin_init', [$this, 'maybeCheckForUpdates'] ); - - //Like WordPress itself, we check more often on certain pages. - /** @see wp_update_plugins */ - add_action('load-update-core.php', [$this, 'maybeCheckForUpdates']); - //"load-update.php" and "load-plugins.php" or "load-themes.php". - $this->hourlyCheckHooks = array_merge($this->hourlyCheckHooks, $hourlyHooks); - foreach ($this->hourlyCheckHooks as $hook) { - add_action($hook, [$this, 'maybeCheckForUpdates']); - } - //This hook fires after a bulk update is complete. - add_action('upgrader_process_complete', [$this, 'upgraderProcessComplete'], 11, 2); - } else { - //Periodic checks are disabled. - wp_clear_scheduled_hook($this->cronHook); - } - } - - /** - * Runs upon the WP action upgrader_process_complete. - * - * We look at the parameters to decide whether to call maybeCheckForUpdates() or not. - * We also check if the update checker has been removed by the update. - * - * @param WP_Upgrader $upgrader WP_Upgrader instance - * @param array $upgradeInfo extra information about the upgrade - */ - public function upgraderProcessComplete( - /** @noinspection PhpUnusedParameterInspection */ - $upgrader, $upgradeInfo - ) { - //Cancel all further actions if the current version of PUC has been deleted or overwritten - //by a different version during the upgrade. If we try to do anything more in that situation, - //we could trigger a fatal error by trying to autoload a deleted class. - clearstatcache(); - if ( !file_exists(__FILE__) ) { - $this->removeHooks(); - $this->updateChecker->removeHooks(); - return; - } - - //Sanity check and limitation to relevant types. - if ( - !is_array($upgradeInfo) || !isset($upgradeInfo['type'], $upgradeInfo['action']) - || 'update' !== $upgradeInfo['action'] || !in_array($upgradeInfo['type'], ['plugin', 'theme']) - ) { - return; - } - - if ( is_a($this->updateChecker, 'Lkn_Puc_Plugin_UpdateChecker') ) { - if ( 'plugin' !== $upgradeInfo['type'] || !isset($upgradeInfo['plugins']) ) { - return; - } - - //Themes pass in directory names in the information array, but plugins use the relative plugin path. - if ( !in_array( - strtolower($this->updateChecker->directoryName), - array_map('dirname', array_map('strtolower', $upgradeInfo['plugins'])) - ) ) { - return; - } - } - - $this->maybeCheckForUpdates(); - } - - /** - * Check for updates if the configured check interval has already elapsed. - * Will use a shorter check interval on certain admin pages like "Dashboard -> Updates" or when doing cron. - * - * You can override the default behaviour by using the "puc_check_now-$slug" filter. - * The filter callback will be passed three parameters: - * - Current decision. TRUE = check updates now, FALSE = don't check now. - * - Last check time as a Unix timestamp. - * - Configured check period in hours. - * Return TRUE to check for updates immediately, or FALSE to cancel. - * - * This method is declared public because it's a hook callback. Calling it directly is not recommended. - */ - public function maybeCheckForUpdates() { - if ( empty($this->checkPeriod) ) { - return; - } - - $state = $this->updateChecker->getUpdateState(); - $shouldCheck = ($state->timeSinceLastCheck() >= $this->getEffectiveCheckPeriod()); - - //Let plugin authors substitute their own algorithm. - $shouldCheck = apply_filters( - $this->updateChecker->getUniqueName('check_now'), - $shouldCheck, - $state->getLastCheck(), - $this->checkPeriod - ); - - if ( $shouldCheck ) { - $this->updateChecker->checkForUpdates(); - } - } - - /** - * Calculate the actual check period based on the current status and environment. - * - * @return int Check period in seconds. - */ - protected function getEffectiveCheckPeriod() { - $currentFilter = current_filter(); - if ( in_array($currentFilter, ['load-update-core.php', 'upgrader_process_complete']) ) { - //Check more often when the user visits "Dashboard -> Updates" or does a bulk update. - $period = 60; - } else { - if ( in_array($currentFilter, $this->hourlyCheckHooks) ) { - //Also check more often on /wp-admin/update.php and the "Plugins" or "Themes" page. - $period = 3600; - } else { - if ( $this->throttleRedundantChecks && ($this->updateChecker->getUpdate() !== null) ) { - //Check less frequently if it's already known that an update is available. - $period = $this->throttledCheckPeriod * 3600; - } else { - if ( defined('DOING_CRON') && constant('DOING_CRON') ) { - //WordPress cron schedules are not exact, so lets do an update check even - //if slightly less than $checkPeriod hours have elapsed since the last check. - $cronFuzziness = 20 * 60; - $period = $this->checkPeriod * 3600 - $cronFuzziness; - } else { - $period = $this->checkPeriod * 3600; - } - } - } - } - - return $period; - } - - /** - * Add our custom schedule to the array of Cron schedules used by WP. - * - * @param array $schedules - * @return array - */ - public function _addCustomSchedule($schedules) { - if ( $this->checkPeriod && ($this->checkPeriod > 0) ) { - $scheduleName = 'every' . $this->checkPeriod . 'hours'; - $schedules[$scheduleName] = [ - 'interval' => $this->checkPeriod * 3600, - 'display' => sprintf('Every %d hours', $this->checkPeriod), - ]; - } - return $schedules; - } - - /** - * Remove the scheduled cron event that the library uses to check for updates. - * - * @return void - */ - public function removeUpdaterCron() { - wp_clear_scheduled_hook($this->cronHook); - } - - /** - * Get the name of the update checker's WP-cron hook. Mostly useful for debugging. - * - * @return string - */ - public function getCronHookName() { - return $this->cronHook; - } - - /** - * Remove most hooks added by the scheduler. - */ - public function removeHooks() { - remove_filter('cron_schedules', [$this, '_addCustomSchedule']); - remove_action('admin_init', [$this, 'maybeCheckForUpdates']); - remove_action('load-update-core.php', [$this, 'maybeCheckForUpdates']); - - if ( $this->cronHook !== null ) { - remove_action($this->cronHook, [$this, 'maybeCheckForUpdates']); - } - if ( !empty($this->hourlyCheckHooks) ) { - foreach ($this->hourlyCheckHooks as $hook) { - remove_action($hook, [$this, 'maybeCheckForUpdates']); - } - } - } - } - -endif; diff --git a/includes/plugin-updater/Puc/StateStore.php b/includes/plugin-updater/Puc/StateStore.php deleted file mode 100644 index 5300832..0000000 --- a/includes/plugin-updater/Puc/StateStore.php +++ /dev/null @@ -1,220 +0,0 @@ -optionName = $optionName; - } - - /** - * Get time elapsed since the last update check. - * - * If there are no recorded update checks, this method returns a large arbitrary number - * (i.e. time since the Unix epoch). - * - * @return int Elapsed time in seconds. - */ - public function timeSinceLastCheck() { - $this->lazyLoad(); - return time() - $this->lastCheck; - } - - /** - * @return int - */ - public function getLastCheck() { - $this->lazyLoad(); - return $this->lastCheck; - } - - /** - * Set the time of the last update check to the current timestamp. - * - * @return $this - */ - public function setLastCheckToNow() { - $this->lazyLoad(); - $this->lastCheck = time(); - return $this; - } - - /** - * @return null|Lkn_Puc_Update - */ - public function getUpdate() { - $this->lazyLoad(); - return $this->update; - } - - /** - * @param Lkn_Puc_Update|null $update - * @return $this - */ - public function setUpdate(Lkn_Puc_Update $update = null) { - $this->lazyLoad(); - $this->update = $update; - return $this; - } - - /** - * @return string - */ - public function getCheckedVersion() { - $this->lazyLoad(); - return $this->checkedVersion; - } - - /** - * @param string $version - * @return $this - */ - public function setCheckedVersion($version) { - $this->lazyLoad(); - $this->checkedVersion = strval($version); - return $this; - } - - /** - * Get translation updates. - * - * @return array - */ - public function getTranslations() { - $this->lazyLoad(); - if ( isset($this->update, $this->update->translations) ) { - return $this->update->translations; - } - return []; - } - - /** - * Set translation updates. - * - * @param array $translationUpdates - */ - public function setTranslations($translationUpdates) { - $this->lazyLoad(); - if ( isset($this->update) ) { - $this->update->translations = $translationUpdates; - $this->save(); - } - } - - /** - * Saves the updated state of the plugin on the database - */ - public function save() { - $state = new stdClass(); - - $state->lastCheck = $this->lastCheck; - $state->checkedVersion = $this->checkedVersion; - - if ( isset($this->update)) { - $state->update = $this->update->toStdClass(); - - $updateClass = get_class($this->update); - $state->updateClass = $updateClass; - $prefix = $this->getLibPrefix(); - if ( Lkn_Puc_Utils::startsWith($updateClass, $prefix) ) { - $state->updateBaseClass = substr($updateClass, strlen($prefix)); - } - } - - update_site_option($this->optionName, $state); - $this->isLoaded = true; - } - - /** - * Checks if the database already has a state - * - * @return $this - */ - public function lazyLoad() { - if ( !$this->isLoaded ) { - $this->load(); - } - return $this; - } - - /** - * Load the state version - */ - protected function load() { - $this->isLoaded = true; - - $state = get_site_option($this->optionName, null); - - if ( !is_object($state) ) { - $this->lastCheck = 0; - $this->checkedVersion = ''; - $this->update = null; - return; - } - - $this->lastCheck = intval(Lkn_Puc_Utils::get($state, 'lastCheck', 0)); - $this->checkedVersion = Lkn_Puc_Utils::get($state, 'checkedVersion', ''); - $this->update = null; - - if ( isset($state->update) ) { - //This mess is due to the fact that the want the update class from this version - //of the library, not the version that saved the update. - - $updateClass = null; - if ( isset($state->updateBaseClass) ) { - $updateClass = $this->getLibPrefix() . $state->updateBaseClass; - } else { - if ( isset($state->updateClass) && class_exists($state->updateClass) ) { - $updateClass = $state->updateClass; - } - } - - if ( $updateClass !== null ) { - $this->update = call_user_func([$updateClass, 'fromObject'], $state->update); - } - } - } - - /** - * Delete the option name from database - */ - public function delete() { - delete_site_option($this->optionName); - - $this->lastCheck = 0; - $this->checkedVersion = ''; - $this->update = null; - } - - private function getLibPrefix() { - $parts = explode('_', __CLASS__, 3); - return $parts[0] . '_' . $parts[1] . '_'; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Update.php b/includes/plugin-updater/Puc/Update.php deleted file mode 100644 index c8ad6ba..0000000 --- a/includes/plugin-updater/Puc/Update.php +++ /dev/null @@ -1,37 +0,0 @@ -slug = $this->slug; - $update->new_version = $this->version; - $update->package = $this->download_url; - - return $update; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/UpdateChecker.php b/includes/plugin-updater/Puc/UpdateChecker.php deleted file mode 100644 index d0c6b10..0000000 --- a/includes/plugin-updater/Puc/UpdateChecker.php +++ /dev/null @@ -1,949 +0,0 @@ -debugMode = (bool)(constant('WP_DEBUG')); - $this->metadataUrl = $metadataUrl; - $this->directoryName = $directoryName; - $this->slug = !empty($slug) ? $slug : $this->directoryName; - - $this->optionName = $optionName; - if ( empty($this->optionName) ) { - //BC: Initially the library only supported plugin updates and didn't use type prefixes - //in the option name. Lets use the same prefix-less name when possible. - if ( $this->filterSuffix === '' ) { - $this->optionName = 'external_updates-' . $this->slug; - } else { - $this->optionName = $this->getUniqueName('external_updates'); - } - } - - $this->package = $this->createInstalledPackage(); - $this->scheduler = $this->createScheduler($checkPeriod); - $this->upgraderStatus = new Lkn_Puc_UpgraderStatus(); - $this->updateState = new Lkn_Puc_StateStore($this->optionName); - - if ( did_action('init') ) { - $this->loadTextDomain(); - } else { - add_action('init', [$this, 'loadTextDomain']); - } - - $this->installHooks(); - } - - /** - * @internal - */ - public function loadTextDomain() { - //We're not using load_plugin_textdomain() or its siblings because figuring out where - //the library is located (plugin, mu-plugin, theme, custom wp-content paths) is messy. - $domain = 'plugin-update-checker'; - $locale = apply_filters( - 'plugin_locale', - (is_admin() && function_exists('get_user_locale')) ? get_user_locale() : get_locale(), - $domain - ); - - $moFile = $domain . '-' . $locale . '.mo'; - $path = realpath(dirname(__FILE__) . '/../languages'); - - if ($path && file_exists($path)) { - load_textdomain($domain, $path . '/' . $moFile); - } - } - - protected function installHooks() { - //Insert our update info into the update array maintained by WP. - add_filter('site_transient_' . $this->updateTransient, [$this, 'injectUpdate']); - - //Insert translation updates into the update list. - add_filter('site_transient_' . $this->updateTransient, [$this, 'injectTranslationUpdates']); - - //Clear translation updates when WP clears the update cache. - //This needs to be done directly because the library doesn't actually remove obsolete plugin updates, - //it just hides them (see getUpdate()). We can't do that with translations - too much disk I/O. - add_action( - 'delete_site_transient_' . $this->updateTransient, - [$this, 'clearCachedTranslationUpdates'] - ); - - //Rename the update directory to be the same as the existing directory. - if ( $this->directoryName !== '.' ) { - add_filter('upgrader_source_selection', [$this, 'fixDirectoryName'], 10, 3); - } - - //Allow HTTP requests to the metadata URL even if it's on a local host. - add_filter('http_request_host_is_external', [$this, 'allowMetadataHost'], 10, 2); - } - - /** - * Remove hooks that were added by this update checker instance. - */ - public function removeHooks() { - remove_filter('site_transient_' . $this->updateTransient, [$this, 'injectUpdate']); - remove_filter('site_transient_' . $this->updateTransient, [$this, 'injectTranslationUpdates']); - remove_action( - 'delete_site_transient_' . $this->updateTransient, - [$this, 'clearCachedTranslationUpdates'] - ); - - remove_filter('upgrader_source_selection', [$this, 'fixDirectoryName'], 10); - remove_filter('http_request_host_is_external', [$this, 'allowMetadataHost'], 10); - - remove_action('init', [$this, 'loadTextDomain']); - - if ( $this->scheduler ) { - $this->scheduler->removeHooks(); - } - } - - /** - * Check if the current user has the required permissions to install updates. - * - * @return bool - */ - abstract public function userCanInstallUpdates(); - - /** - * Explicitly allow HTTP requests to the metadata URL. - * - * WordPress has a security feature where the HTTP API will reject all requests that are sent to - * another site hosted on the same server as the current site (IP match), a local host, or a local - * IP, unless the host exactly matches the current site. - * - * This feature is opt-in (at least in WP 4.4). Apparently some people enable it. - * - * That can be a problem when you're developing your plugin and you decide to host the update information - * on the same server as your test site. Update requests will mysteriously fail. - * - * We fix that by adding an exception for the metadata host. - * - * @param bool $allow - * @param string $host - * @return bool - */ - public function allowMetadataHost($allow, $host) { - if ( $this->cachedMetadataHost === 0 ) { - $this->cachedMetadataHost = parse_url($this->metadataUrl, PHP_URL_HOST); - } - - if ( is_string($this->cachedMetadataHost) && (strtolower($host) === strtolower($this->cachedMetadataHost)) ) { - return true; - } - return $allow; - } - - /** - * Create a package instance that represents this plugin or theme. - * - * @return Lkn_Puc_InstalledPackage - */ - abstract protected function createInstalledPackage(); - - /** - * @return Lkn_Puc_InstalledPackage - */ - public function getInstalledPackage() { - return $this->package; - } - - /** - * Create an instance of the scheduler. - * - * This is implemented as a method to make it possible for plugins to subclass the update checker - * and substitute their own scheduler. - * - * @param int $checkPeriod - * @return Lkn_Puc_Scheduler - */ - abstract protected function createScheduler($checkPeriod); - - /** - * Check for updates. The results are stored in the DB option specified in $optionName. - * - * @return Lkn_Puc_Update|null - */ - public function checkForUpdates() { - $installedVersion = $this->getInstalledVersion(); - //Fail silently if we can't find the plugin/theme or read its header. - if ( $installedVersion === null ) { - $this->triggerError( - sprintf('Skipping update check for %s - installed version unknown.', $this->slug), - E_USER_WARNING - ); - return null; - } - - //Start collecting API errors. - $this->lastRequestApiErrors = []; - add_action('puc_api_error', [$this, 'collectApiErrors'], 10, 4); - - $state = $this->updateState; - $state->setLastCheckToNow() - ->setCheckedVersion($installedVersion) - ->save(); //Save before checking in case something goes wrong - - $state->setUpdate($this->requestUpdate()); - $state->save(); - - //Stop collecting API errors. - remove_action('puc_api_error', [$this, 'collectApiErrors'], 10); - - return $this->getUpdate(); - } - - /** - * Load the update checker state from the DB. - * - * @return Lkn_Puc_StateStore - */ - public function getUpdateState() { - return $this->updateState->lazyLoad(); - } - - /** - * Reset update checker state - i.e. last check time, cached update data and so on. - * - * Call this when your plugin is being uninstalled, or if you want to - * clear the update cache. - */ - public function resetUpdateState() { - $this->updateState->delete(); - } - - /** - * Get the details of the currently available update, if any. - * - * If no updates are available, or if the last known update version is below or equal - * to the currently installed version, this method will return NULL. - * - * Uses cached update data. To retrieve update information straight from - * the metadata URL, call requestUpdate() instead. - * - * @return Lkn_Puc_Update|null - */ - public function getUpdate() { - $update = $this->updateState->getUpdate(); - - //Is there an update available? - if ( isset($update) ) { - //Check if the update is actually newer than the currently installed version. - $installedVersion = $this->getInstalledVersion(); - if ( ($installedVersion !== null) && version_compare($update->version, $installedVersion, '>') ) { - return $update; - } - } - return null; - } - - /** - * Retrieve the latest update (if any) from the configured API endpoint. - * - * Subclasses should run the update through filterUpdateResult before returning it. - * - * @return Lkn_Puc_Update An instance of Update, or NULL when no updates are available. - */ - abstract public function requestUpdate(); - - /** - * Filter the result of a requestUpdate() call. - * - * @param Lkn_Puc_Update|null $update - * @param array|WP_Error|null $httpResult The value returned by wp_remote_get(), if any. - * @return Lkn_Puc_Update - */ - protected function filterUpdateResult($update, $httpResult = null) { - //Let plugins/themes modify the update. - $update = apply_filters($this->getUniqueName('request_update_result'), $update, $httpResult); - - $this->fixSupportedWordpressVersion($update); - - if ( isset($update, $update->translations) ) { - //Keep only those translation updates that apply to this site. - $update->translations = $this->filterApplicableTranslations($update->translations); - } - - return $update; - } - - /** - * The "Tested up to" field in the plugin metadata is supposed to be in the form of "major.minor", - * while WordPress core's list_plugin_updates() expects the $update->tested field to be an exact - * version, e.g. "major.minor.patch", to say it's compatible. In other case it shows - * "Compatibility: Unknown". - * The function mimics how wordpress.org API crafts the "tested" field out of "Tested up to". - * - * @param Lkn_Puc_Metadata|null $update - */ - protected function fixSupportedWordpressVersion(Lkn_Puc_Metadata $update = null) { - if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) { - return; - } - - $actualWpVersions = []; - - $wpVersion = $GLOBALS['wp_version']; - - if ( function_exists('get_core_updates') ) { - $coreUpdates = get_core_updates(); - if ( is_array($coreUpdates) ) { - foreach ($coreUpdates as $coreUpdate) { - if ( isset($coreUpdate->current) ) { - $actualWpVersions[] = $coreUpdate->current; - } - } - } - } - - $actualWpVersions[] = $wpVersion; - - $actualWpPatchNumber = null; - foreach ($actualWpVersions as $version) { - if ( preg_match('/^(?P\d++\.\d++)(?:\.(?P\d++))?/', $version, $versionParts) ) { - if ( $versionParts['majorMinor'] === $update->tested ) { - $patch = isset($versionParts['patch']) ? intval($versionParts['patch']) : 0; - if ( $actualWpPatchNumber === null ) { - $actualWpPatchNumber = $patch; - } else { - $actualWpPatchNumber = max($actualWpPatchNumber, $patch); - } - } - } - } - if ( $actualWpPatchNumber === null ) { - $actualWpPatchNumber = 999; - } - - if ( $actualWpPatchNumber > 0 ) { - $update->tested .= '.' . $actualWpPatchNumber; - } - } - - /** - * Get the currently installed version of the plugin or theme. - * - * @return string|null Version number. - */ - public function getInstalledVersion() { - return $this->package->getInstalledVersion(); - } - - /** - * Get the full path of the plugin or theme directory. - * - * @return string - */ - public function getAbsoluteDirectoryPath() { - return $this->package->getAbsoluteDirectoryPath(); - } - - /** - * Trigger a PHP error, but only when $debugMode is enabled. - * - * @param string $message - * @param int $errorType - */ - public function triggerError($message, $errorType) { - if ( $this->isDebugModeEnabled() ) { - trigger_error($message, $errorType); - } - } - - /** - * @return bool - */ - protected function isDebugModeEnabled() { - if ( $this->debugMode === null ) { - $this->debugMode = (bool)(constant('WP_DEBUG')); - } - return $this->debugMode; - } - - /** - * Get the full name of an update checker filter, action or DB entry. - * - * This method adds the "puc_" prefix and the "-$slug" suffix to the filter name. - * For example, "pre_inject_update" becomes "puc_pre_inject_update-plugin-slug". - * - * @param string $baseTag - * @return string - */ - public function getUniqueName($baseTag) { - $name = 'puc_' . $baseTag; - if ( $this->filterSuffix !== '' ) { - $name .= '_' . $this->filterSuffix; - } - return $name . '-' . $this->slug; - } - - /** - * Store API errors that are generated when checking for updates. - * - * @internal - * @param WP_Error $error - * @param array|null $httpResponse - * @param string|null $url - * @param string|null $slug - */ - public function collectApiErrors($error, $httpResponse = null, $url = null, $slug = null) { - if ( isset($slug) && ($slug !== $this->slug) ) { - return; - } - - $this->lastRequestApiErrors[] = [ - 'error' => $error, - 'httpResponse' => $httpResponse, - 'url' => $url, - ]; - } - - /** - * @return array - */ - public function getLastRequestApiErrors() { - return $this->lastRequestApiErrors; - } - - /* ------------------------------------------------------------------- - * PUC filters and filter utilities - * ------------------------------------------------------------------- - */ - - /** - * Register a callback for one of the update checker filters. - * - * Identical to add_filter(), except it automatically adds the "puc_" prefix - * and the "-$slug" suffix to the filter name. For example, "request_info_result" - * becomes "puc_request_info_result-your_plugin_slug". - * - * @param string $tag - * @param callable $callback - * @param int $priority - * @param int $acceptedArgs - */ - public function addFilter($tag, $callback, $priority = 10, $acceptedArgs = 1) { - add_filter($this->getUniqueName($tag), $callback, $priority, $acceptedArgs); - } - - /* ------------------------------------------------------------------- - * Inject updates - * ------------------------------------------------------------------- - */ - - /** - * Insert the latest update (if any) into the update list maintained by WP. - * - * @param stdClass $updates Update list. - * @return stdClass Modified update list. - */ - public function injectUpdate($updates) { - //Is there an update to insert? - $update = $this->getUpdate(); - - if ( !$this->shouldShowUpdates() ) { - $update = null; - } - - if ( !empty($update) ) { - //Let plugins update is passed to WordPress. - $updates = $this->addUpdateToList($updates, $update->toWpFormat()); - } else { - //Clean up any stale update info. - $updates = $this->removeUpdateFromList($updates); - //Add a placeholder item to the "no_update" list to enable auto-update support. - //If we don't do this, the option to enable automatic updates will only show up - //when an update is available. - $updates = $this->addNoUpdateItem($updates); - } - - return $updates; - } - - /** - * @param stdClass|null $updates - * @param stdClass|array $updateToAdd - * @return stdClass - */ - protected function addUpdateToList($updates, $updateToAdd) { - if ( !is_object($updates) ) { - $updates = new stdClass(); - $updates->response = []; - } - - $updates->response[$this->getUpdateListKey()] = $updateToAdd; - return $updates; - } - - /** - * @param stdClass|null $updates - * @return stdClass|null - */ - protected function removeUpdateFromList($updates) { - if ( isset($updates, $updates->response) ) { - unset($updates->response[$this->getUpdateListKey()]); - } - return $updates; - } - - /** - * See this post for more information: - * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/ - * - * @param stdClass|null $updates - * @return stdClass - */ - protected function addNoUpdateItem($updates) { - if ( !is_object($updates) ) { - $updates = new stdClass(); - $updates->response = []; - $updates->no_update = []; - } else { - if ( !isset($updates->no_update) ) { - $updates->no_update = []; - } - } - - $updates->no_update[$this->getUpdateListKey()] = (object) $this->getNoUpdateItemFields(); - - return $updates; - } - - /** - * Subclasses should override this method to add fields that are specific to plugins or themes. - * @return array - */ - protected function getNoUpdateItemFields() { - return [ - 'new_version' => $this->getInstalledVersion(), - 'url' => '', - 'package' => '', - 'requires_php' => '', - ]; - } - - /** - * Get the key that will be used when adding updates to the update list that's maintained - * by the WordPress core. The list is always an associative array, but the key is different - * for plugins and themes. - * - * @return string - */ - abstract protected function getUpdateListKey(); - - /** - * Should we show available updates? - * - * Usually the answer is "yes", but there are exceptions. For example, WordPress doesn't - * support automatic updates installation for mu-plugins, so PUC usually won't show update - * notifications in that case. See the plugin-specific subclass for details. - * - * Note: This method only applies to updates that are displayed (or not) in the WordPress - * admin. It doesn't affect APIs like requestUpdate and getUpdate. - * - * @return bool - */ - protected function shouldShowUpdates() { - return true; - } - - /* ------------------------------------------------------------------- - * JSON-based update API - * ------------------------------------------------------------------- - */ - - /** - * Retrieve plugin or theme metadata from the JSON document at $this->metadataUrl. - * - * @param string $metaClass Parse the JSON as an instance of this class. It must have a static fromJson method. - * @param array $queryArgs Additional query arguments. - * @return array [Lkn_Puc_Metadata|null, array|WP_Error] A metadata instance and the value returned by wp_remote_get(). - */ - protected function requestMetadata($metaClass, $queryArgs = []) { - //Query args to append to the URL. - $queryArgs = array_merge( - [ - 'installed_version' => strval($this->getInstalledVersion()), - 'php' => phpversion(), - 'locale' => get_locale(), - 's' => '4823a0e58074af39154f19e3de1f7443', - ], - $queryArgs - ); - - //Various options for the wp_remote_get() call. - $options = [ - 'timeout' => 10, //seconds - 'headers' => [ - 'Accept' => 'application/json', - ], - ]; - - //The metadata file should be at 'http://your-api.com/url/here/$slug/info.json' - $url = $this->metadataUrl; - if ( !empty($queryArgs) ) { - $url = add_query_arg($queryArgs, $url); - } - - $result = wp_remote_get($url, $options); - - //Try to parse the response - $status = $this->validateApiResponse($result); - $metadata = null; - if ( !is_wp_error($status) ) { - if ( version_compare(PHP_VERSION, '5.3', '>=') && (strpos($metaClass, '\\') === false) ) { - $metaClass = __NAMESPACE__ . '\\' . $metaClass; - } - $metadata = call_user_func([$metaClass, 'fromJson'], $result['body']); - } else { - do_action('puc_api_error', $status, $result, $url, $this->slug); - $this->triggerError( - sprintf('The URL %s does not point to a valid metadata file. ', $url) - . $status->get_error_message(), - E_USER_WARNING - ); - } - - return [$metadata, $result]; - } - - /** - * Check if $result is a successful update API response. - * - * @param array|WP_Error $result - * @return true|WP_Error - */ - protected function validateApiResponse($result) { - if ( is_wp_error($result) ) { /** @var WP_Error $result */ - return new WP_Error($result->get_error_code(), 'WP HTTP Error: ' . $result->get_error_message()); - } - - if ( !isset($result['response']['code']) ) { - return new WP_Error( - 'puc_no_response_code', - 'wp_remote_get() returned an unexpected result.' - ); - } - - if ( $result['response']['code'] !== 200 ) { - return new WP_Error( - 'puc_unexpected_response_code', - 'HTTP response code is ' . $result['response']['code'] . ' (expected: 200)' - ); - } - - if ( empty($result['body']) ) { - return new WP_Error('puc_empty_response', 'The metadata file appears to be empty.'); - } - - return true; - } - - /* ------------------------------------------------------------------- - * Language packs / Translation updates - * ------------------------------------------------------------------- - */ - - /** - * Filter a list of translation updates and return a new list that contains only updates - * that apply to the current site. - * - * @param array $translations - * @return array - */ - protected function filterApplicableTranslations($translations) { - $languages = array_flip(array_values(get_available_languages())); - $installedTranslations = $this->getInstalledTranslations(); - - $applicableTranslations = []; - foreach ($translations as $translation) { - //Does it match one of the available core languages? - $isApplicable = array_key_exists($translation->language, $languages); - //Is it more recent than an already-installed translation? - if ( isset($installedTranslations[$translation->language]) ) { - $updateTimestamp = strtotime($translation->updated); - $installedTimestamp = strtotime($installedTranslations[$translation->language]['PO-Revision-Date']); - $isApplicable = $updateTimestamp > $installedTimestamp; - } - - if ( $isApplicable ) { - $applicableTranslations[] = $translation; - } - } - - return $applicableTranslations; - } - - /** - * Get a list of installed translations for this plugin or theme. - * - * @return array - */ - protected function getInstalledTranslations() { - if ( !function_exists('wp_get_installed_translations') ) { - return []; - } - $installedTranslations = wp_get_installed_translations($this->translationType . 's'); - if ( isset($installedTranslations[$this->directoryName]) ) { - $installedTranslations = $installedTranslations[$this->directoryName]; - } else { - $installedTranslations = []; - } - return $installedTranslations; - } - - /** - * Insert translation updates into the list maintained by WordPress. - * - * @param stdClass $updates - * @return stdClass - */ - public function injectTranslationUpdates($updates) { - $translationUpdates = $this->getTranslationUpdates(); - if ( empty($translationUpdates) ) { - return $updates; - } - - //Being defensive. - if ( !is_object($updates) ) { - $updates = new stdClass(); - } - if ( !isset($updates->translations) ) { - $updates->translations = []; - } - - //In case there's a name collision with a plugin or theme hosted on wordpress.org, - //remove any preexisting updates that match our thing. - $updates->translations = array_values(array_filter( - $updates->translations, - [$this, 'isNotMyTranslation'] - )); - - //Add our updates to the list. - foreach ($translationUpdates as $update) { - $convertedUpdate = array_merge( - [ - 'type' => $this->translationType, - 'slug' => $this->directoryName, - 'autoupdate' => 0, - //AFAICT, WordPress doesn't actually use the "version" field for anything. - //But lets make sure it's there, just in case. - 'version' => isset($update->version) ? $update->version : ('1.' . strtotime($update->updated)), - ], - (array)$update - ); - - $updates->translations[] = $convertedUpdate; - } - - return $updates; - } - - /** - * Get a list of available translation updates. - * - * This method will return an empty array if there are no updates. - * Uses cached update data. - * - * @return array - */ - public function getTranslationUpdates() { - return $this->updateState->getTranslations(); - } - - /** - * Remove all cached translation updates. - * - * @see wp_clean_update_cache - */ - public function clearCachedTranslationUpdates() { - $this->updateState->setTranslations([]); - } - - /** - * Filter callback. Keeps only translations that *don't* match this plugin or theme. - * - * @param array $translation - * @return bool - */ - protected function isNotMyTranslation($translation) { - $isMatch = isset($translation['type'], $translation['slug']) - && ($translation['type'] === $this->translationType) - && ($translation['slug'] === $this->directoryName); - - return !$isMatch; - } - - /* ------------------------------------------------------------------- - * Fix directory name when installing updates - * ------------------------------------------------------------------- - */ - - /** - * Rename the update directory to match the existing plugin/theme directory. - * - * When WordPress installs a plugin or theme update, it assumes that the ZIP file will contain - * exactly one directory, and that the directory name will be the same as the directory where - * the plugin or theme is currently installed. - * - * GitHub and other repositories provide ZIP downloads, but they often use directory names like - * "project-branch" or "project-tag-hash". We need to change the name to the actual plugin folder. - * - * This is a hook callback. Don't call it from a plugin. - * - * @access protected - * - * @param string $source The directory to copy to /wp-content/plugins or /wp-content/themes. Usually a subdirectory of $remoteSource. - * @param string $remoteSource WordPress has extracted the update to this directory. - * @param WP_Upgrader $upgrader - * @return string|WP_Error - */ - public function fixDirectoryName($source, $remoteSource, $upgrader) { - global $wp_filesystem; - /** @var WP_Filesystem_Base $wp_filesystem */ - - //Basic sanity checks. - if ( !isset($source, $remoteSource, $upgrader, $upgrader->skin, $wp_filesystem) ) { - return $source; - } - - //If WordPress is upgrading anything other than our plugin/theme, leave the directory name unchanged. - if ( !$this->isBeingUpgraded($upgrader) ) { - return $source; - } - - //Rename the source to match the existing directory. - $correctedSource = trailingslashit($remoteSource) . $this->directoryName . '/'; - if ( $source !== $correctedSource ) { - //The update archive should contain a single directory that contains the rest of plugin/theme files. - //Otherwise, WordPress will try to copy the entire working directory ($source == $remoteSource). - //We can't rename $remoteSource because that would break WordPress code that cleans up temporary files - //after update. - if ( $this->isBadDirectoryStructure($remoteSource) ) { - return new WP_Error( - 'puc-incorrect-directory-structure', - sprintf( - 'The directory structure of the update is incorrect. All files should be inside ' . - 'a directory named %s, not at the root of the ZIP archive.', - htmlentities($this->slug) - ) - ); - } - - /** @var WP_Upgrader_Skin $upgrader ->skin */ - $upgrader->skin->feedback(sprintf( - 'Renaming %s to %s…', - '' . basename($source) . '', - '' . $this->directoryName . '' - )); - - if ( $wp_filesystem->move($source, $correctedSource, true) ) { - $upgrader->skin->feedback('Directory successfully renamed.'); - return $correctedSource; - } else { - return new WP_Error( - 'puc-rename-failed', - 'Unable to rename the update to match the existing directory.' - ); - } - } - - return $source; - } - - /** - * Is there an update being installed right now, for this plugin or theme? - * - * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. - * @return bool - */ - abstract public function isBeingUpgraded($upgrader = null); - - /** - * Check for incorrect update directory structure. An update must contain a single directory, - * all other files should be inside that directory. - * - * @param string $remoteSource Directory path. - * @return bool - */ - protected function isBadDirectoryStructure($remoteSource) { - global $wp_filesystem; - /** @var WP_Filesystem_Base $wp_filesystem */ - - $sourceFiles = $wp_filesystem->dirlist($remoteSource); - if ( is_array($sourceFiles) ) { - $sourceFiles = array_keys($sourceFiles); - $firstFilePath = trailingslashit($remoteSource) . $sourceFiles[0]; - return (count($sourceFiles) > 1) || (!$wp_filesystem->is_dir($firstFilePath)); - } - - //Assume it's fine. - return false; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/UpgraderStatus.php b/includes/plugin-updater/Puc/UpgraderStatus.php deleted file mode 100644 index 2b7153f..0000000 --- a/includes/plugin-updater/Puc/UpgraderStatus.php +++ /dev/null @@ -1,176 +0,0 @@ -isBeingUpgraded('plugin', $pluginFile, $upgrader); - } - - /** - * Check if a specific theme or plugin is being upgraded. - * - * @param string $type - * @param string $id - * @param Plugin_Upgrader|WP_Upgrader|null $upgrader - * @return bool - */ - protected function isBeingUpgraded($type, $id, $upgrader = null) { - if ( isset($upgrader) ) { - list($currentType, $currentId) = $this->getThingBeingUpgradedBy($upgrader); - if ( $currentType !== null ) { - $this->currentType = $currentType; - $this->currentId = $currentId; - } - } - return ($this->currentType === $type) && ($this->currentId === $id); - } - - /** - * Figure out which theme or plugin is being upgraded by a WP_Upgrader instance. - * - * Returns an array with two items. The first item is the type of the thing that's being - * upgraded: "plugin" or "theme". The second item is either the plugin basename or - * the theme directory name. If we can't determine what the upgrader is doing, both items - * will be NULL. - * - * Examples: - * ['plugin', 'plugin-dir-name/plugin.php'] - * ['theme', 'theme-dir-name'] - * - * @param Plugin_Upgrader|WP_Upgrader $upgrader - * @return array - */ - private function getThingBeingUpgradedBy($upgrader) { - if ( !isset($upgrader, $upgrader->skin) ) { - return [null, null]; - } - - //Figure out which plugin or theme is being upgraded. - $pluginFile = null; - - $skin = $upgrader->skin; - if ( $skin instanceof Plugin_Upgrader_Skin ) { - if ( isset($skin->plugin) && is_string($skin->plugin) && ($skin->plugin !== '') ) { - $pluginFile = $skin->plugin; - } - } elseif ( isset($skin->plugin_info) && is_array($skin->plugin_info) ) { - //This case is tricky because Bulk_Plugin_Upgrader_Skin (etc) doesn't actually store the plugin - //filename anywhere. Instead, it has the plugin headers in $plugin_info. So the best we can - //do is compare those headers to the headers of installed plugins. - $pluginFile = $this->identifyPluginByHeaders($skin->plugin_info); - } - - if ( $pluginFile !== null ) { - return ['plugin', $pluginFile]; - } - return [null, null]; - } - - /** - * Identify an installed plugin based on its headers. - * - * @param array $searchHeaders The plugin file header to look for. - * @return string|null Plugin basename ("foo/bar.php"), or NULL if we can't identify the plugin. - */ - private function identifyPluginByHeaders($searchHeaders) { - if ( !function_exists('get_plugins') ) { - /** @noinspection PhpIncludeInspection */ - require_once ABSPATH . '/wp-admin/includes/plugin.php'; - } - - $installedPlugins = get_plugins(); - $matches = []; - foreach ($installedPlugins as $pluginBasename => $headers) { - $diff1 = array_diff_assoc($headers, $searchHeaders); - $diff2 = array_diff_assoc($searchHeaders, $headers); - if ( empty($diff1) && empty($diff2) ) { - $matches[] = $pluginBasename; - } - } - - //It's possible (though very unlikely) that there could be two plugins with identical - //headers. In that case, we can't unambiguously identify the plugin that's being upgraded. - if ( count($matches) !== 1 ) { - return null; - } - - return reset($matches); - } - - /** - * @access private - * - * @param mixed $input - * @param array $hookExtra - * @return mixed Returns $input unaltered. - */ - public function setUpgradedThing($input, $hookExtra) { - if ( !empty($hookExtra['plugin']) && is_string($hookExtra['plugin']) ) { - $this->currentId = $hookExtra['plugin']; - $this->currentType = 'plugin'; - } else { - $this->currentType = null; - $this->currentId = null; - } - return $input; - } - - /** - * @access private - * - * @param array $options - * @return array - */ - public function setUpgradedPluginFromOptions($options) { - if ( isset($options['hook_extra']['plugin']) && is_string($options['hook_extra']['plugin']) ) { - $this->currentType = 'plugin'; - $this->currentId = $options['hook_extra']['plugin']; - } else { - $this->currentType = null; - $this->currentId = null; - } - return $options; - } - - /** - * @access private - * - * @param mixed $input - * @return mixed Returns $input unaltered. - */ - public function clearUpgradedThing($input = null) { - $this->currentId = null; - $this->currentType = null; - return $input; - } - } - -endif; diff --git a/includes/plugin-updater/Puc/Utils.php b/includes/plugin-updater/Puc/Utils.php deleted file mode 100644 index faed21f..0000000 --- a/includes/plugin-updater/Puc/Utils.php +++ /dev/null @@ -1,71 +0,0 @@ -$node) ) { - $currentValue = $currentValue->$node; - } else { - return $default; - } - } - } - - return $currentValue; - } - - /** - * Get the first array element that is not empty. - * - * @param array $values - * @param mixed|null $default Returns this value if there are no non-empty elements. - * @return mixed|null - */ - public static function findNotEmpty($values, $default = null) { - if ( empty($values) ) { - return $default; - } - - foreach ($values as $value) { - if ( !empty($value) ) { - return $value; - } - } - - return $default; - } - - /** - * Check if the input string starts with the specified prefix. - * - * @param string $input - * @param string $prefix - * @return bool - */ - public static function startsWith($input, $prefix) { - $length = strlen($prefix); - return (substr($input, 0, $length) === $prefix); - } - } - -endif; diff --git a/includes/plugin-updater/languages/plugin-update-checker-ca.mo b/includes/plugin-updater/languages/plugin-update-checker-ca.mo deleted file mode 100644 index 59645fa..0000000 Binary files a/includes/plugin-updater/languages/plugin-update-checker-ca.mo and /dev/null differ diff --git a/includes/plugin-updater/languages/plugin-update-checker-ca.po b/includes/plugin-updater/languages/plugin-update-checker-ca.po deleted file mode 100644 index 36f3ad7..0000000 --- a/includes/plugin-updater/languages/plugin-update-checker-ca.po +++ /dev/null @@ -1,48 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: plugin-update-checker\n" -"POT-Creation-Date: 2017-11-24 17:02+0200\n" -"PO-Revision-Date: 2019-09-25 18:15+0200\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.3\n" -"X-Poedit-Basepath: ..\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" -"Last-Translator: \n" -"Language: ca\n" -"X-Poedit-SearchPath-0: .\n" - -#: Puc/v4p3/Plugin/UpdateChecker.php:395 -msgid "Check for updates" -msgstr "Comprova si hi ha actualitzacions" - -#: Puc/v4p3/Plugin/UpdateChecker.php:548 -#, php-format -msgctxt "the plugin title" -msgid "The %s plugin is up to date." -msgstr "L’extensió %s està actualitzada." - -#: Puc/v4p3/Plugin/UpdateChecker.php:550 -#, php-format -msgctxt "the plugin title" -msgid "A new version of the %s plugin is available." -msgstr "Una nova versió de l’extensió %s està disponible." - -#: Puc/v4p3/Plugin/UpdateChecker.php:552 -#, php-format -msgctxt "the plugin title" -msgid "Could not determine if updates are available for %s." -msgstr "No s’ha pogut determinar si hi ha actualitzacions per a %s." - -#: Puc/v4p3/Plugin/UpdateChecker.php:558 -#, php-format -msgid "Unknown update checker status \"%s\"" -msgstr "Estat del comprovador d’actualitzacions desconegut \"%s\"" - -#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 -msgid "There is no changelog available." -msgstr "No hi ha cap registre de canvis disponible." diff --git a/includes/plugin-updater/languages/plugin-update-checker-pt_BR.mo b/includes/plugin-updater/languages/plugin-update-checker-pt_BR.mo deleted file mode 100644 index d1c0f28..0000000 Binary files a/includes/plugin-updater/languages/plugin-update-checker-pt_BR.mo and /dev/null differ diff --git a/includes/plugin-updater/languages/plugin-update-checker-pt_BR.po b/includes/plugin-updater/languages/plugin-update-checker-pt_BR.po deleted file mode 100644 index 70a0f62..0000000 --- a/includes/plugin-updater/languages/plugin-update-checker-pt_BR.po +++ /dev/null @@ -1,48 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: plugin-update-checker\n" -"POT-Creation-Date: 2017-05-19 15:41-0300\n" -"PO-Revision-Date: 2017-05-19 15:42-0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: pt_BR\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.8\n" -"X-Poedit-Basepath: ..\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-KeywordsList: __;_e;_x;_x:1,2c\n" -"X-Poedit-SearchPath-0: .\n" - -#: Puc/v4p1/Plugin/UpdateChecker.php:358 -msgid "Check for updates" -msgstr "Verificar Atualizações" - -#: Puc/v4p1/Plugin/UpdateChecker.php:401 Puc/v4p1/Plugin/UpdateChecker.php:406 -#, php-format -msgctxt "the plugin title" -msgid "The %s plugin is up to date." -msgstr "O plugin %s já está na sua versão mais recente." - -#: Puc/v4p1/Plugin/UpdateChecker.php:408 -#, php-format -msgctxt "the plugin title" -msgid "A new version of the %s plugin is available." -msgstr "Há uma nova versão para o plugin %s disponível para download." - -#: Puc/v4p1/Plugin/UpdateChecker.php:410 -#, php-format -msgid "Unknown update checker status \"%s\"" -msgstr "Status \"%s\" desconhecido." - -#: Puc/v4p1/Vcs/PluginUpdateChecker.php:83 -msgid "There is no changelog available." -msgstr "Não há um changelog disponível." - -#~ msgid "The %s plugin is up to date." -#~ msgstr "O plugin %s já está na sua versão mais recente." - -#~ msgid "A new version of the %s plugin is available." -#~ msgstr "Há uma nova versão para o plugin %s disponível para download." diff --git a/includes/plugin-updater/languages/plugin-update-checker.pot b/includes/plugin-updater/languages/plugin-update-checker.pot deleted file mode 100644 index 99cc24c..0000000 --- a/includes/plugin-updater/languages/plugin-update-checker.pot +++ /dev/null @@ -1,49 +0,0 @@ -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: plugin-update-checker\n" -"POT-Creation-Date: 2020-08-08 14:36+0300\n" -"PO-Revision-Date: 2016-01-10 20:59+0100\n" -"Last-Translator: Tamás András Horváth \n" -"Language-Team: \n" -"Language: en_US\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.4\n" -"X-Poedit-Basepath: ..\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" -"X-Poedit-SearchPath-0: .\n" - -#: Puc/v4p11/Plugin/Ui.php:128 -msgid "Check for updates" -msgstr "" - -#: Puc/v4p11/Plugin/Ui.php:213 -#, php-format -msgctxt "the plugin title" -msgid "The %s plugin is up to date." -msgstr "" - -#: Puc/v4p11/Plugin/Ui.php:215 -#, php-format -msgctxt "the plugin title" -msgid "A new version of the %s plugin is available." -msgstr "" - -#: Puc/v4p11/Plugin/Ui.php:217 -#, php-format -msgctxt "the plugin title" -msgid "Could not determine if updates are available for %s." -msgstr "" - -#: Puc/v4p11/Plugin/Ui.php:223 -#, php-format -msgid "Unknown update checker status \"%s\"" -msgstr "" - -#: Puc/v4p11/Vcs/PluginUpdateChecker.php:98 -msgid "There is no changelog available." -msgstr "" diff --git a/includes/plugin-updater/license.txt b/includes/plugin-updater/license.txt deleted file mode 100644 index be948f6..0000000 --- a/includes/plugin-updater/license.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2017 Jānis Elsts - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/includes/plugin-updater/load-puc.php b/includes/plugin-updater/load-puc.php deleted file mode 100644 index 50ebff7..0000000 --- a/includes/plugin-updater/load-puc.php +++ /dev/null @@ -1,6 +0,0 @@ -=0.10.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", - "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", - "dev": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", - "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", - "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", - "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", - "is-shared-array-buffer": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/builtins": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", - "dev": true, - "dependencies": { - "semver": "^7.0.0" - } - }, - "node_modules/builtins/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/confusing-browser-globals": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", - "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/es-abstract": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", - "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.1", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "es-set-tostringtag": "^2.0.1", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.1", - "get-symbol-description": "^1.0.0", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", - "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "safe-array-concat": "^1.0.0", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.47.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", - "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "^8.47.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-config-airbnb-base": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", - "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", - "dev": true, - "dependencies": { - "confusing-browser-globals": "^1.0.10", - "object.assign": "^4.1.2", - "object.entries": "^1.1.5", - "semver": "^6.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "peerDependencies": { - "eslint": "^7.32.0 || ^8.2.0", - "eslint-plugin-import": "^2.25.2" - } - }, - "node_modules/eslint-config-standard": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", - "integrity": "sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "eslint": "^8.0.1", - "eslint-plugin-import": "^2.25.2", - "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", - "eslint-plugin-promise": "^6.0.0" - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-module-utils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", - "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", - "dev": true, - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-es": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", - "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", - "dev": true, - "dependencies": { - "eslint-utils": "^2.0.0", - "regexpp": "^3.0.0" - }, - "engines": { - "node": ">=8.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=4.19.1" - } - }, - "node_modules/eslint-plugin-es/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.28.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", - "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", - "dev": true, - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.findlastindex": "^1.2.2", - "array.prototype.flat": "^1.3.1", - "array.prototype.flatmap": "^1.3.1", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.8.0", - "has": "^1.0.3", - "is-core-module": "^2.13.0", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.6", - "object.groupby": "^1.0.0", - "object.values": "^1.1.6", - "semver": "^6.3.1", - "tsconfig-paths": "^3.14.2" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-n": { - "version": "15.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", - "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", - "dev": true, - "dependencies": { - "builtins": "^5.0.1", - "eslint-plugin-es": "^4.1.0", - "eslint-utils": "^3.0.0", - "ignore": "^5.1.1", - "is-core-module": "^2.11.0", - "minimatch": "^3.1.2", - "resolve": "^1.22.1", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=12.22.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=7.0.0" - } - }, - "node_modules/eslint-plugin-n/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-plugin-promise": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", - "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.21.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", - "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globalthis": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", - "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, - "dependencies": { - "which-typed-array": "^1.1.11" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.entries": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", - "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.fromentries": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", - "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.groupby": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", - "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.21.2", - "get-intrinsic": "^1.2.1" - } - }, - "node_modules/object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", - "dev": true, - "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/resolve": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", - "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", - "dev": true, - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-array-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", - "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "has-symbols": "^1.0.3", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/safe-regex-test": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", - "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", - "dev": true, - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typed-array-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", - "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/typed-array-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", - "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/typed-array-length": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", - "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} +{ + "name": "docker-php-dev-container", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "docker-php-dev-container", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "eslint": "^8.34.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.6.1", + "eslint-plugin-promise": "^6.1.1" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.7.0.tgz", + "integrity": "sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.47.0.tgz", + "integrity": "sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/builtins/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dev": true, + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/es-abstract": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.47.0", + "@humanwhocodes/config-array": "^0.11.10", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" + } + }, + "node_modules/eslint-config-standard": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", + "integrity": "sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-promise": "^6.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.8.0", + "has": "^1.0.3", + "is-core-module": "^2.13.0", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", + "object.values": "^1.1.6", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-n": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", + "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", + "dev": true, + "dependencies": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.11.0", + "minimatch": "^3.1.2", + "resolve": "^1.22.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", + "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.21.2", + "get-intrinsic": "^1.2.1" + } + }, + "node_modules/object.values": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve": { + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/tsconfig-paths": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json index 0227e24..18449b7 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,33 @@ -{ - "name": "docker-php-dev-container", - "version": "1.0.0", - "description": "This repository provides a development environment for WHMCS or WordPress", - "repository": { - "type": "git", - "url": "git+https://github.com/srbrunoferreira/docker-php-dev-container.git" - }, - "scripts": { - "lint": "eslint --fix --ext .js ./" - }, - "keywords": [ - "WordPress", - "WHMCS", - "plugin", - "Dev Container", - "VS Code" - ], - "author": "Bruno Ferreira ", - "license": "MIT", - "bugs": { - "url": "https://github.com/srbrunoferreira/docker-php-dev-container/issues" - }, - "homepage": "https://github.com/srbrunoferreira/docker-php-dev-container#readme", - "devDependencies": { - "eslint": "^8.34.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-n": "^15.6.1", - "eslint-plugin-promise": "^6.1.1" - } +{ + "name": "docker-php-dev-container", + "version": "1.0.0", + "description": "This repository provides a development environment for WHMCS or WordPress", + "repository": { + "type": "git", + "url": "git+https://github.com/srbrunoferreira/docker-php-dev-container.git" + }, + "scripts": { + "lint": "eslint --fix --ext .js ./" + }, + "keywords": [ + "WordPress", + "WHMCS", + "plugin", + "Dev Container", + "VS Code" + ], + "author": "Bruno Ferreira ", + "license": "MIT", + "bugs": { + "url": "https://github.com/srbrunoferreira/docker-php-dev-container/issues" + }, + "homepage": "https://github.com/srbrunoferreira/docker-php-dev-container#readme", + "devDependencies": { + "eslint": "^8.34.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.6.1", + "eslint-plugin-promise": "^6.1.1" + } } \ No newline at end of file diff --git a/payment-erede-for-givewp.php b/payment-erede-for-givewp.php index 6d03621..ff99132 100644 --- a/payment-erede-for-givewp.php +++ b/payment-erede-for-givewp.php @@ -1,85 +1,95 @@ -run(); -} -run_payment_erede_for_givewp(); +run(); +} +run_payment_erede_for_givewp(); diff --git a/public/js/payment-erede-for-givewp-debit-3ds.js b/public/js/payment-erede-for-givewp-debit-3ds.js deleted file mode 100644 index 4230db9..0000000 --- a/public/js/payment-erede-for-givewp-debit-3ds.js +++ /dev/null @@ -1,99 +0,0 @@ -/* eslint-disable no-undef */ -(function ($) { - 'use strict' - - $(window).on('load', () => lknLoadEredeDebit3DS()) - - function lknLoadEredeDebit3DS () { - const iframe = document.getElementsByName('give-embed-form')[0] - const giveForm = $('.give-form') - - if (iframe) { - lknSetInputsEredeDebit3DS('iframe') - const gatewayList = iframe.contentDocument.getElementById('give-gateway-radio-list') - if (gatewayList) { - gatewayList.addEventListener('click', () => lknSetInputsEredeDebit3DS('iframe')) - } - } else if (giveForm.length) { - lknSetInputsEredeDebit3DS('legacy') - const gatewayList = $('#give-gateway-radio-list') - if (gatewayList.length) { - gatewayList.on('click', () => lknSetInputsEredeDebit3DS('legacy')) - } - } - } - - function lknSetInputsEredeDebit3DS (typeForm, count = 0) { - count++ - - const iframe = document.getElementsByName('give-embed-form')[0] - - const language = window.navigator.language.slice(0, 2) - const height = screen.height - const width = screen.width - const colorDepth = window.screen.colorDepth - const userAgent = navigator.userAgent - const date = new Date() - const timezoneOffset = date.getTimezoneOffset() - - if (typeForm === 'iframe') { - const userAgentInput = iframe.contentDocument.getElementsByName('lkn_erede_debit_3ds_user_agent')[0] - const deviceColorInput = iframe.contentDocument.getElementsByName('lkn_erede_debit_3ds_device_color')[0] - const langInput = iframe.contentDocument.getElementsByName('lkn_erede_debit_3ds_lang')[0] - const heightInput = iframe.contentDocument.getElementsByName('lkn_erede_debit_3ds_device_height')[0] - const widthInput = iframe.contentDocument.getElementsByName('lkn_erede_debit_3ds_device_width')[0] - const timezoneInput = iframe.contentDocument.getElementsByName('lkn_erede_debit_3ds_timezone')[0] - - if ( - userAgentInput && - deviceColorInput && - langInput && - heightInput && - widthInput && - timezoneInput - ) { - userAgentInput.value = userAgent - deviceColorInput.value = colorDepth - langInput.value = language - heightInput.value = height - widthInput.value = width - timezoneInput.value = timezoneOffset - - return true - } - } else { - const userAgentInput = $('[name="lkn_erede_debit_3ds_user_agent"]') - const deviceColorInput = $('[name="lkn_erede_debit_3ds_device_color"]') - const langInput = $('[name="lkn_erede_debit_3ds_lang"]') - const heightInput = $('[name="lkn_erede_debit_3ds_device_height"]') - const widthInput = $('[name="lkn_erede_debit_3ds_device_width"]') - const timezoneInput = $('[name="lkn_erede_debit_3ds_timezone"]') - - if ( - userAgentInput.length && - deviceColorInput.length && - langInput.length && - heightInput.length && - widthInput.length && - timezoneInput.length - ) { - userAgentInput.attr('value', userAgent) - deviceColorInput.attr('value', colorDepth) - langInput.attr('value', language) - heightInput.attr('value', height) - widthInput.attr('value', width) - timezoneInput.attr('value', timezoneOffset) - - return true - } - } - - // Only run 4 times - if (count > 4) { - return false - } - - // Run again if inputs are not found - setTimeout(() => lknSetInputsEredeDebit3DS(typeForm, count), 1000) - } -})(jQuery) diff --git a/public/partials/payment-erede-for-givewp-public-display-credit.php b/public/partials/payment-erede-for-givewp-public-display-credit.php deleted file mode 100644 index 8e44ab6..0000000 --- a/public/partials/payment-erede-for-givewp-public-display-credit.php +++ /dev/null @@ -1,139 +0,0 @@ - - - - -
- - Informações de cartão de crédito - - - -
- - - Doação Segura por Criptografia SSL - -
- notices->print_frontend_notice( - sprintf( - '%1$s %2$s', - esc_html__('Erro:', 'give'), - esc_html__('Doação desabilitada por falta de SSL (HTTPS).', 'give') - ) - ); - - exit; - } -?> - -
- - -
- - -
- - -
- - -
- - -
- - -
- -
- -
- -
\ No newline at end of file diff --git a/public/partials/payment-erede-for-givewp-public-display-debit-3ds.php b/public/partials/payment-erede-for-givewp-public-display-debit-3ds.php deleted file mode 100644 index 84e6a85..0000000 --- a/public/partials/payment-erede-for-givewp-public-display-debit-3ds.php +++ /dev/null @@ -1,146 +0,0 @@ - - - - -
- - Informações de cartão de débito - - - -
- - - Doação Segura por Criptografia SSL - -
- notices->print_frontend_notice( - sprintf( - '%1$s %2$s', - esc_html__('Erro:', 'give'), - esc_html__('Doação desabilitada por falta de SSL (HTTPS).', 'give') - ) - ); - - exit; - } -?> - - - - - - - - -
- - -
- - -
- - -
- - -
- - -
- - -
- -
- -
- -
\ No newline at end of file diff --git a/uninstall.php b/uninstall.php index 39cae83..cd62983 100644 --- a/uninstall.php +++ b/uninstall.php @@ -1,47 +1,47 @@ - 0) { - for ($c = 0; $c < count($lkn_erede_opt); $c++) { - give_delete_option($lkn_erede_opt[$c]); - } + 0) { + for ($c = 0; $c < count($lkn_erede_opt); $c++) { + give_delete_option($lkn_erede_opt[$c]); + } } \ No newline at end of file