Browse Source

frontend and backend

main
Sergio Álvarez 4 months ago
parent
commit
dde65761e5
Signed by: salvarez
GPG Key ID: 622780889DFDBDA5
  1. 14
      .drone.yml
  2. 1
      .gitignore
  3. 1
      README.md
  4. 22
      backend/.env
  5. 10
      backend/.gitignore
  6. 17
      backend/bin/console
  7. 77
      backend/composer.json
  8. 3360
      backend/composer.lock
  9. 6
      backend/config/bundles.php
  10. 19
      backend/config/packages/cache.yaml
  11. 26
      backend/config/packages/framework.yaml
  12. 12
      backend/config/packages/routing.yaml
  13. 5
      backend/config/preload.php
  14. 7
      backend/config/routes.yaml
  15. 7
      backend/config/routes/annotations.yaml
  16. 4
      backend/config/routes/framework.yaml
  17. 41
      backend/config/services.yaml
  18. 11
      backend/public/index.php
  19. 0
      backend/src/Controller/.gitignore
  20. 19
      backend/src/Controller/DencodeController.php
  21. 20
      backend/src/Controller/ErrorController.php
  22. 55
      backend/src/Controller/PregController.php
  23. 29
      backend/src/Entity/PregDTO.php
  24. 24
      backend/src/Entity/PregResponse.php
  25. 13
      backend/src/Kernel.php
  26. 17
      backend/src/Resource/Flags.php
  27. 16
      backend/src/Resource/Functions.php
  28. 98
      backend/src/Service/Preg.php
  29. 84
      backend/src/Service/PregFunction.php
  30. 49
      backend/src/Service/PregMatch.php
  31. 28
      backend/src/Service/PregMatchAll.php
  32. 38
      backend/src/Service/PregQuote.php
  33. 41
      backend/src/Service/PregReplace.php
  34. 49
      backend/src/Service/PregSplit.php
  35. 193
      backend/symfony.lock
  36. 20
      docker/Dockerfile
  37. 2
      docker/README.md
  38. 33
      docker/docker-compose.yml
  39. 1
      docker/redis.conf
  40. 0
      docker/zz-custom-php.ini
  41. 9
      docker/zz-custom-phpfpm.conf
  42. 19
      docker/zz-default-nginx.conf
  43. 1
      frontend/.env
  44. 23
      frontend/.gitignore
  45. 70
      frontend/README.md
  46. 32254
      frontend/package-lock.json
  47. 45
      frontend/package.json
  48. BIN
      frontend/public/favicon.ico
  49. BIN
      frontend/public/img/android-chrome-192x192.png
  50. BIN
      frontend/public/img/android-chrome-512x512.png
  51. BIN
      frontend/public/img/apple-touch-icon.png
  52. 9
      frontend/public/img/browserconfig.xml
  53. BIN
      frontend/public/img/favicon-16x16.png
  54. BIN
      frontend/public/img/favicon-32x32.png
  55. BIN
      frontend/public/img/favicon.ico
  56. BIN
      frontend/public/img/mstile-150x150.png
  57. 142
      frontend/public/img/safari-pinned-tab.svg
  58. 19
      frontend/public/img/site.webmanifest
  59. 43
      frontend/public/index.html
  60. 25
      frontend/public/manifest.json
  61. 3
      frontend/public/robots.txt
  62. 178
      frontend/src/App.js
  63. 16
      frontend/src/Footer.js
  64. 53
      frontend/src/Header.js
  65. 35
      frontend/src/_bootswatch.scss
  66. 69
      frontend/src/_variables.scss
  67. 11
      frontend/src/index.js
  68. 43
      frontend/src/index.scss
  69. 19
      frontend/src/preg/Code.js
  70. 29
      frontend/src/preg/Fields.js
  71. 102
      frontend/src/preg/Help.js
  72. 55
      frontend/src/preg/Opts.js
  73. 70
      frontend/src/preg/Output.js
  74. 18
      frontend/src/preg/Return.js
  75. 20
      frontend/src/preg/Tabs.js

14
.drone.yml

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
kind: pipeline
type: docker
name: default
steps:
- name: backend
image: composer
commands:
- cd backend && composer install
- name: frontend
image: node
commands:
- cd frontend && npm install

1
.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
.idea/

1
README.md

@ -0,0 +1 @@ @@ -0,0 +1 @@
`cd docker`

22
backend/.env

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
REDIS_HOST=xrges-redis
REDIS_PORT=6379
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=8ffa51f664399110f3cdc2ffa39e9705
###< symfony/framework-bundle ###

10
backend/.gitignore vendored

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

17
backend/bin/console

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
return new Application($kernel);
};

77
backend/composer.json

@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.0.2",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/annotations": "^1.13",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^1.2",
"symfony/console": "6.0.*",
"symfony/dotenv": "6.0.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "6.0.*",
"symfony/property-access": "6.0.*",
"symfony/property-info": "6.0.*",
"symfony/runtime": "6.0.*",
"symfony/serializer": "6.0.*",
"symfony/yaml": "6.0.*"
},
"require-dev": {
"symfony/maker-bundle": "^1.36"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"symfony/flex": true,
"symfony/runtime": true
},
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.0.*"
}
}
}

3360
backend/composer.lock generated

File diff suppressed because it is too large Load Diff

6
backend/config/bundles.php

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
];

19
backend/config/packages/cache.yaml

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null

26
backend/config/packages/framework.yaml

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
http_method_override: false
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
#esi: true
#fragments: true
php_errors:
log: true
error_controller: App\Controller\ErrorController::show
when@test:
framework:
test: true
session:
storage_factory_id: session.storage.factory.mock_file

12
backend/config/packages/routing.yaml

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
framework:
router:
utf8: true
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
when@prod:
framework:
router:
strict_requirements: null

5
backend/config/preload.php

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<?php
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}

7
backend/config/routes.yaml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
controllers:
resource: ../src/Controller/
type: annotation
kernel:
resource: ../src/Kernel.php
type: annotation

7
backend/config/routes/annotations.yaml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
controllers:
resource: ../../src/Controller/
type: annotation
kernel:
resource: ../../src/Kernel.php
type: annotation

4
backend/config/routes/framework.yaml

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
when@dev:
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error

41
backend/config/services.yaml

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
Redis:
# you can also use \RedisArray, \RedisCluster or \Predis\Client classes
class: Redis
calls:
- connect:
- '%env(REDIS_HOST)%'
- '%env(int:REDIS_PORT)%'
# uncomment the following if your Redis server requires a password
# - auth:
# - '%env(REDIS_PASSWORD)%'
logger:
class: Symfony\Component\HttpKernel\Log\Logger
arguments: [ 'info', 'php://stdout' ]

11
backend/public/index.php

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return static function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};

0
backend/src/Controller/.gitignore vendored

19
backend/src/Controller/DencodeController.php

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DencodeController extends AbstractController
{
#[Route('/api/dencode', name: 'api_dencode', methods: "GET")]
public function index(): Response
{
return $this->json([
'message' => 'Welcome to your new controller!',
'path' => 'src/Controller/DencodeController.php',
]);
}
}

20
backend/src/Controller/ErrorController.php

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
/**
* Exceptions will end here.
*/
class ErrorController extends AbstractController
{
public function show(\Throwable $exception): Response
{
//return $this->json(['fatal' => sprintf('%s: %s [%s:%d]', $exception::class, $exception->getMessage(), basename($exception->getFile()), $exception->getLine())]);
return $this->json(['fatal' => sprintf('%s: %s', $exception::class, $exception->getMessage())]);
}
}

55
backend/src/Controller/PregController.php

@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace App\Controller;
use App\Entity\PregDTO;
use App\Service\Preg;
use Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\SerializerInterface;
/**
* PREGs controller.
*/
class PregController extends AbstractController
{
private const STORE_KEY = 'xrg.es2022:%s';
private const STORE_TTL = 60*60*24*7;
#[Route('/api/preg', name: 'api_preg_post', methods: ["POST"])]
public function index(Request $request, SerializerInterface $serializer, \Redis $redis): Response
{
$dto = $serializer->deserialize($request->getContent(), PregDTO::class, 'json');
if ($dto->pattern === '') {
throw new Exception('Empty regular expression');
}
$preg = new Preg($dto);
$result = $preg->exec();
$key = $preg->getHash();
$redis->setex(sprintf(self::STORE_KEY, $key), self::STORE_TTL, $serializer->serialize($dto, 'json'));
return $this->json(array_merge((array)$result, ['hash' => $key]));
}
#[Route('/api/preg', name: 'api_preg_hash', methods: ["GET"])]
public function hash(Request $request, \Redis $redis): Response
{
$json = $redis->get(sprintf(self::STORE_KEY, $request->query->get('hash')));
if ($json === false) {
throw new NotFoundHttpException('Key not found.');
}
return JsonResponse::fromJsonString($json);
}
}

29
backend/src/Entity/PregDTO.php

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use App\Resource\Functions;
/**
* Basic data comming from form.
*/
class PregDTO
{
public function __construct(
public readonly Functions $method,
public readonly string $pattern,
public readonly string $replacement,
public readonly string $subject,
public readonly bool $PREG_OFFSET_CAPTURE,
public readonly bool $PREG_SET_ORDER,
public readonly bool $PREG_SPLIT_DELIM_CAPTURE,
public readonly bool $PREG_SPLIT_NO_EMPTY,
public readonly bool $PREG_SPLIT_OFFSET_CAPTURE,
public readonly bool $PREG_UNMATCHED_AS_NULL,
public readonly ?int $offset,
public readonly ?int $limit,
public readonly ?string $delimiter
) {}
}

24
backend/src/Entity/PregResponse.php

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace App\Entity;
use Exception;
/**
* Data returned to web interface. Will be converted to JSON most likely.
*/
class PregResponse
{
public function __construct(
public readonly mixed $dump,
public readonly string $code,
public readonly ?string $returnType,
public readonly ?string $returnValue,
) {
if (preg_last_error() !== PREG_NO_ERROR) {
throw new Exception('preg_last_error() = '. preg_last_error_msg());
}
}
}

13
backend/src/Kernel.php

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class Kernel extends BaseKernel
{
use MicroKernelTrait;
}

17
backend/src/Resource/Flags.php

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace App\Resource;
/**
* Implemented PREG flags.
*/
enum Flags {
case PREG_OFFSET_CAPTURE;
case PREG_SET_ORDER;
case PREG_SPLIT_DELIM_CAPTURE;
case PREG_SPLIT_NO_EMPTY;
case PREG_SPLIT_OFFSET_CAPTURE;
case PREG_UNMATCHED_AS_NULL;
}

16
backend/src/Resource/Functions.php

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace App\Resource;
/**
* Implemented PREG functions.
*/
enum Functions: string {
case Match = 'preg_match';
case MatchAll = 'preg_match_all';
case Split = 'preg_split';
case Replace = 'preg_replace';
case Quote = 'preg_quote';
}

98
backend/src/Service/Preg.php

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregResponse;
use App\Entity\PregDTO;
class Preg
{
private string $hash;
public function __construct(private readonly PregDTO $dto)
{
$this->hash = base_convert(substr(hash('sha256', serialize($this->dto)), 0, 10), 16, 36);
}
public function exec(): PregResponse
{
//if ($this->dto->pattern === '') {
// return new PregResponse();
//}
$cn = 'App\Service\Preg'.$this->dto->method->name;
return (new $cn($this->dto))->exec();
}
protected function exec_preg_match(): array
{
$ret = @preg_match($this->dto->pattern, $this->dto->subject, $matches, $this->flags, $this->dto->offset);
$error = $this->last_error();
return array_merge($this->result($ret), [
"dump" => $error?: $matches,
"error" => (bool)$error,
"code" => $this->syntax()
]);
}
protected function exec_preg_match_all(): array
{
$ret = @preg_match_all($this->pattern, $this->subject, $matches, $this->flags, $this->offset);
$error = $this->last_error();
return array_merge($this->result($ret), [
"dump" => $error?: $matches,
"error" => (bool)$error,
"code" => $this->syntax()
]);
}
protected function exec_preg_split()
{
$ret = @preg_split($this->pattern, $this->subject, $this->limit, $this->flags);
$error = $this->last_error();
return array_merge($this->result($ret), [
"dump" => $error?: $ret,
"error" => (bool)$error,
"code" => $this->syntax()
]);
}
protected function exec_preg_replace()
{
$ret = @preg_replace($this->pattern, $this->replacement, $this->subject, $this->limit);
$error = $this->last_error();
return array_merge($this->result($ret), [
"dump" => $error?: $ret,
"error" => (bool)$error,
"code" => $this->syntax()
]);
}
protected function exec_preg_quote()
{
$ret = @preg_quote($this->pattern, $this->delimeter);
$error = $this->last_error();
return array_merge($this->result($ret), [
"dump" => $error?: $ret,
"error" => (bool)$error,
"code" => $this->syntax()
]);
}
public function getHash(): string
{
return $this->hash;
}
}

84
backend/src/Service/PregFunction.php

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregDTO;
use App\Entity\PregResponse;
use App\Resource\Flags;
/**
* Base class for all Preg* methods.
*/
abstract class PregFunction
{
/**
* Build on construction to pass the flags to each preg function.
*/
protected int $flags = 0;
/**
* Flag list as string for future representation, based on $flags.
*/
protected array $flagsStr = [];
/**
* Available flags for each function.
* @var array<Flags>
*/
protected array $availableFlags = [];
abstract public function exec(): PregResponse;
abstract protected function syntax(): string;
public function __construct(protected readonly PregDTO $dto)
{
foreach ($this->availableFlags as $flag) {
if ($this->dto->{$flag->name}) {
$this->flags |= \constant($flag->name);
$this->flagsStr[] = $flag->name;
}
}
}
protected function result(mixed $ret): array
{
$gettype = \gettype($ret);
$return = [$gettype];
if (\in_array($gettype, ["boolean", "integer", "NULL"])) {
$return[] = json_encode($ret);
} elseif ($gettype === 'string') {
$return[] = "len(". mb_strlen($ret). ")";
} elseif ($gettype === 'array') {
$return[] = "count(". count($ret). ")";
}
return $return;
}
/**
* Can be used to remove some parts from the syntax() output.
* @see syntax()
*/
protected function syntaxCleanup(string $code): string
{
return str_replace(
['?&gt;', '&lt;?php&nbsp;', '&nbsp;', '<code>', '</code>'],
['', '', ' ', '', ''],
highlight_string('<?php '. $code .' ?'.'>', true)
);
}
protected function cropString(string $str, int $len = 50, bool $quote = true, string $longText = '$subject'): string
{
if (mb_strlen($str, "utf-8") < $len) {
return $quote? '"'. addslashes($str) .'"': $str;
}
return $longText;
//return str_replace(["\r", "\n"], ['\r', '\n'], addslashes(mb_substr($str, 0, $len, "utf-8")). "...");
}
}

49
backend/src/Service/PregMatch.php

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregResponse;
use App\Resource\Flags;
/**
* Handler form preg_match() function.
* @see preg_match()
*/
class PregMatch extends PregFunction
{
protected array $availableFlags = [Flags::PREG_OFFSET_CAPTURE, Flags::PREG_UNMATCHED_AS_NULL];
public function exec(): PregResponse
{
$ret = preg_match($this->dto->pattern, $this->dto->subject, $matches, $this->flags, $this->dto->offset ?? 0);
return new PregResponse(
$matches,
$this->syntax(),
...$this->result($ret)
);
}
protected function syntax(): string
{
$method = $this->dto->method->value;
$args = [$method .'("'. $this->dto->pattern.'"'];
$args[] = $this->cropString($this->dto->subject);
$args[] = '$matches';
if (\count($this->flagsStr)) {
$args[] = implode(' | ', $this->flagsStr);
}
if (!\is_null($this->dto->offset)) {
$args[] = (!\count($this->flagsStr)? 'null, ': ''). $this->dto->offset;
}
$code = implode(", ", $args). ");";
return $this->syntaxCleanup($code);
}
}

28
backend/src/Service/PregMatchAll.php

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregResponse;
use App\Resource\Flags;
/**
* Handler form preg_match_all() function. This handler is very similar to PregMatch, same syntax.
* @see preg_match_all()
*/
class PregMatchAll extends PregMatch
{
protected array $availableFlags = [Flags::PREG_SET_ORDER, Flags::PREG_OFFSET_CAPTURE, Flags::PREG_UNMATCHED_AS_NULL];
public function exec(): PregResponse
{
$ret = preg_match_all($this->dto->pattern, $this->dto->subject, $matches, $this->flags, $this->dto->offset ?? 0);
return new PregResponse(
$matches,
$this->syntax(),
...$this->result($ret)
);
}
}

38
backend/src/Service/PregQuote.php

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregResponse;
/**
* Handler form preg_quote() function.
* @see preg_quote()
*/
class PregQuote extends PregFunction
{
public function exec(): PregResponse
{
$ret = preg_quote($this->dto->pattern, $this->dto->delimiter);
return new PregResponse(
$ret,
$this->syntax(),
...$this->result($ret)
);
}
protected function syntax(): string
{
$args = [$this->dto->method->value .'("'. $this->dto->pattern.'"'];
if (!\is_null($this->dto->delimiter) && $this->dto->delimiter !== '') {
$args[] = $this->cropString($this->dto->delimiter);
}
$code = implode(", ", $args). ");";
return $this->syntaxCleanup($code);
}
}

41
backend/src/Service/PregReplace.php

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregResponse;
/**
* Handler form preg_replace() function.
* @see preg_replace()
*/
class PregReplace extends PregFunction
{
public function exec(): PregResponse
{
$ret = preg_replace($this->dto->pattern, $this->dto->replacement, $this->dto->subject, $this->dto->limit ?? -1);
return new PregResponse(
$ret,
$this->syntax(),
...$this->result($ret)
);
}
protected function syntax(): string
{
$args = [$this->dto->method->value .'("'. $this->dto->pattern.'"'];
$args[] = $this->cropString($this->dto->replacement, longText: '$replacement');
$args[] = $this->cropString($this->dto->subject);
if (!\is_null($this->dto->limit)) {
$args[] = $this->dto->limit;
}
$code = implode(", ", $args). ");";
return $this->syntaxCleanup($code);
}
}

49
backend/src/Service/PregSplit.php

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace App\Service;
use App\Entity\PregResponse;
use App\Resource\Flags;
/**
* Handler form preg_split() function.
* @see preg_split()
*/
class PregSplit extends PregFunction
{
protected array $availableFlags = [Flags::PREG_SPLIT_NO_EMPTY, Flags::PREG_SPLIT_DELIM_CAPTURE, Flags::PREG_SPLIT_OFFSET_CAPTURE];
public function exec(): PregResponse
{
$ret = preg_split($this->dto->pattern, $this->dto->subject, $this->dto->limit ?? -1, $this->flags);
return new PregResponse(
$ret,
$this->syntax(),
...$this->result($ret)
);
}
protected function syntax(): string
{
$method = $this->dto->method->value;
$args = [$method .'("'. $this->dto->pattern.'"'];
$args[] = $this->cropString($this->dto->subject);
if (!\is_null($this->dto->limit)) {
$args[] = $this->dto->limit;
}
if (\count($this->flagsStr)) {
$args[] = (\is_null($this->dto->limit)? 'null, ': ''). implode(' | ', $this->flagsStr);
}
$code = implode(", ", $args). ");";
return $this->syntaxCleanup($code);
}
}

193
backend/symfony.lock

@ -0,0 +1,193 @@ @@ -0,0 +1,193 @@
{
"doctrine/annotations": {
"version": "1.13",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "a2759dd6123694c8d901d0ec80006e044c2e6457"
},
"files": [
"config/routes/annotations.yaml"
]
},
"doctrine/inflector": {
"version": "2.0.4"
},
"doctrine/lexer": {
"version": "1.2.1"
},
"nikic/php-parser": {
"version": "v4.13.2"
},
"phpdocumentor/reflection-common": {
"version": "2.2.0"
},
"phpdocumentor/reflection-docblock": {
"version": "5.3.0"
},
"phpdocumentor/type-resolver": {
"version": "1.5.1"
},
"phpstan/phpdoc-parser": {
"version": "1.2.0"
},
"psr/cache": {
"version": "3.0.0"
},
"psr/container": {
"version": "2.0.2"
},
"psr/event-dispatcher": {
"version": "1.0.0"
},
"psr/log": {
"version": "3.0.0"
},
"symfony/cache": {
"version": "v6.0.1"
},
"symfony/cache-contracts": {
"version": "v3.0.0"
},
"symfony/config": {
"version": "v6.0.0"
},
"symfony/console": {
"version": "6.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.3",
"ref": "da0c8be8157600ad34f10ff0c9cc91232522e047"
},
"files": [
"bin/console"
]
},
"symfony/dependency-injection": {
"version": "v6.0.1"
},
"symfony/deprecation-contracts": {
"version": "v3.0.0"
},
"symfony/dotenv": {
"version": "v6.0.1"
},
"symfony/error-handler": {
"version": "v6.0.1"
},
"symfony/event-dispatcher": {
"version": "v6.0.1"
},
"symfony/event-dispatcher-contracts": {
"version": "v3.0.0"
},
"symfony/filesystem": {
"version": "v6.0.0"
},
"symfony/finder": {
"version": "v6.0.0"
},
"symfony/flex": {
"version": "2.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "c0eeb50665f0f77226616b6038a9b06c03752d8e"
},
"files": [
".env"
]
},
"symfony/framework-bundle": {
"version": "6.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.4",
"ref": "d4131812e20853626928e73d3effef44014944c0"
},
"files": [
"config/packages/cache.yaml",
"config/packages/framework.yaml",
"config/preload.php",
"config/routes/framework.yaml",
"config/services.yaml",
"public/index.php",
"src/Controller/.gitignore",
"src/Kernel.php"
]
},
"symfony/http-foundation": {
"version": "v6.0.1"
},
"symfony/http-kernel": {
"version": "v6.0.1"
},
"symfony/maker-bundle": {
"version": "1.36",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
}
},
"symfony/polyfill-intl-grapheme": {
"version": "v1.23.1"
},
"symfony/polyfill-intl-normalizer": {
"version": "v1.23.0"
},
"symfony/polyfill-mbstring": {
"version": "v1.23.1"
},
"symfony/polyfill-php81": {
"version": "v1.23.0"
},
"symfony/property-access": {
"version": "v6.0.0"
},
"symfony/property-info": {
"version": "v6.0.0"
},
"symfony/routing": {
"version": "6.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "6.0",
"ref": "ab9ad892b7bba7ac584f6dc2ccdb659d358c63c5"
},
"files": [
"config/packages/routing.yaml",
"config/routes.yaml"
]
},
"symfony/runtime": {
"version": "v6.0.0"
},
"symfony/serializer": {
"version": "v6.0.1"
},
"symfony/service-contracts": {
"version": "v3.0.0"
},
"symfony/string": {
"version": "v6.0.1"
},
"symfony/var-dumper": {
"version": "v6.0.1"
},
"symfony/var-exporter": {
"version": "v6.0.0"
},
"symfony/yaml": {
"version": "v6.0.1"
},
"webmozart/assert": {
"version": "1.10.0"
}
}

20
docker/Dockerfile

@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
# syntax=docker/dockerfile:1
FROM php:8.1-fpm
FROM php:8.1-fpm-buster
RUN apt update && apt install -y git wget
# https://github.com/mlocati/docker-php-extension-installer
# https://github.com/mlocati/docker-php-extension-installer#special-requirements
RUN curl -sSLf -o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions
@ -13,25 +14,18 @@ RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/main/web/ins @@ -13,25 +14,18 @@ RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/main/web/ins
chmod +x composer.phar && \
mv composer.phar /usr/local/bin/composer
RUN wget https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar && \
chmod +x pickle.phar && \
mv pickle.phar /usr/local/bin/pickle
RUN wget https://get.symfony.com/cli/installer -O - | bash && \
mv /root/.symfony/bin/symfony /usr/local/bin/symfony
RUN install-php-extensions apcu intl opcache redis timezonedb
#RUN apt-get update && apt-get install -y \
# libfreetype6-dev \
# libjpeg62-turbo-dev \
# libpng-dev \
# && docker-php-ext-configure gd --with-freetype --with-jpeg \
# && docker-php-ext-install -j$(nproc) gd
RUN apt clean autoclean && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists/*
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
RUN chown -R www-data:www-data /var/www
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY zz-custom.ini "$PHP_INI_DIR/conf.d/"
COPY zz-custom-php.ini "$PHP_INI_DIR/conf.d/"
COPY zz-custom-phpfpm.conf /usr/local/etc/php-fpm.d/zz-docker.conf

2
docker/README.md

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
```
docker build -t php_symfony --progress=plain .
docker run --rm --name phptest php_symfony
docker run --rm --name phptest -v $(pwd):/var/www/html --user 1000:1000 php_symfony
docker exec -it phptest bash
```

33
docker/docker-compose.yml

@ -1,8 +1,31 @@ @@ -1,8 +1,31 @@
version: '3.8'
services:
php:
build: .
restart: unless-stopped
volumes:
- ..:/var/www/html
xrges-nginx:
image: nginx:latest
restart: unless-stopped
ports:
- "8086:80"
volumes:
- ../frontend/build:/var/www/frontend
- ./zz-default-nginx.conf:/etc/nginx/conf.d/default.conf
links:
- xrges-php
xrges-php:
build: .
restart: unless-stopped
volumes:
- ../backend:/var/www/backend
xrges-redis:
image: redis:latest
restart: unless-stopped
volumes:
- ../home/redis:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
networks:
default:
name: xrges-network

1
docker/redis.conf

@ -0,0 +1 @@ @@ -0,0 +1 @@
save 60 1

0
docker/zz-custom.ini → docker/zz-custom-php.ini

9
docker/zz-custom-phpfpm.conf

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
; cat /usr/local/etc/php-fpm.d/zz-docker.conf
[global]
daemonize = no
[www]
listen = 9000
; /dev/stdout -> /proc/self/fd/1
access.log = /proc/self/fd/1

19
docker/zz-default-nginx.conf

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
limit_req_zone $binary_remote_addr zone=rlimit:10m rate=10r/s;
server {
access_log /proc/self/fd/1;
error_log /proc/self/fd/2;
index index.html index.php;
root /var/www/frontend;
location /api {
include fastcgi_params;
fastcgi_pass xrges-php:9000;
fastcgi_param SCRIPT_FILENAME /var/www/backend/public/index.php;
limit_req zone=rlimit burst=5 nodelay;
}
}

1
frontend/.env

@ -0,0 +1 @@ @@ -0,0 +1 @@
#REACT_APP_DEV=1

23
frontend/.gitignore vendored

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

70
frontend/README.md

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

32254
frontend/package-lock.json generated

File diff suppressed because it is too large Load Diff

45
frontend/package.json

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"axiom": "^0.1.6",
"axios": "^0.24.0",
"bootstrap": "^5.1.3",
"react": "^17.0.2",
"react-bootstrap": "^2.0.4",
"react-copy-to-clipboard": "^5.0.4",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-scripts": "5.0.0",
"sass": "^1.45.1",
"web-vitals": "^2.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

BIN
frontend/public/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
frontend/public/img/android-chrome-192x192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
frontend/public/img/android-chrome-512x512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
frontend/public/img/apple-touch-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

9
frontend/public/img/browserconfig.xml

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/img/icons/mstile-150x150.png"/>
<TileColor>#5755d9</TileColor>
</tile>
</msapplication>
</browserconfig>

BIN
frontend/public/img/favicon-16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

BIN
frontend/public/img/favicon-32x32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

BIN
frontend/public/img/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
frontend/public/img/mstile-150x150.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

142
frontend/public/img/safari-pinned-tab.svg

@ -0,0 +1,142 @@ @@ -0,0 +1,142 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M990 10225 c-142 -35 -194 -56 -289 -120 -73 -49 -121 -92 -166 -151
-40 -51 -96 -159 -88 -168 3 -3 2 -6 -4 -6 -5 0 -10 -6 -11 -12 0 -7 -7 -42
-15 -78 -14 -62 -16 -241 -3 -330 3 -19 8 -56 11 -82 3 -27 8 -72 11 -100 4
-29 8 -73 10 -98 3 -25 6 -58 8 -75 2 -16 7 -59 11 -95 3 -36 8 -76 11 -90 2
-14 7 -56 10 -95 3 -38 7 -81 10 -95 2 -14 7 -50 9 -80 3 -30 7 -71 10 -90 2
-19 7 -57 10 -85 5 -54 12 -115 21 -185 6 -47 12 -101 19 -185 2 -27 4 -50 5
-50 3 0 7 -38 15 -120 3 -38 8 -83 10 -100 12 -93 22 -178 31 -270 2 -27 7
-70 10 -95 4 -25 7 -58 9 -75 1 -16 5 -52 9 -80 13 -108 19 -161 22 -195 2
-19 5 -53 8 -75 3 -22 8 -68 11 -102 3 -34 8 -72 10 -85 3 -21 10 -80 21 -185
6 -61 12 -121 19 -173 10 -89 26 -227 30 -270 8 -71 24 -220 30 -272 7 -57 14
-117 20 -178 3 -30 7 -68 9 -85 2 -16 6 -59 10 -95 4 -36 9 -76 11 -90 4 -22
9 -70 20 -185 4 -38 14 -120 20 -165 3 -19 7 -62 10 -95 8 -86 14 -126 21
-136 3 -5 0 -9 -6 -9 -6 0 -8 -5 -4 -11 4 -7 9 -26 11 -43 7 -58 13 -111 18
-161 7 -71 12 -123 19 -175 3 -25 8 -65 10 -90 3 -25 10 -88 16 -140 6 -52 13
-117 15 -145 3 -27 7 -61 10 -74 4 -23 14 -120 20 -201 2 -19 4 -35 5 -35 2 0
8 -50 14 -120 2 -27 5 -50 6 -50 2 0 12 -107 11 -127 0 -10 3 -18 7 -18 4 0 7
-19 7 -42 0 -42 11 -164 20 -223 6 -39 16 -130 21 -180 2 -22 6 -58 9 -80 9
-69 15 -128 20 -185 2 -30 5 -55 5 -55 1 0 3 -18 5 -40 2 -22 7 -60 10 -85 3
-25 8 -63 10 -85 17 -166 24 -227 31 -255 3 -14 7 -37 10 -53 2 -15 11 -41 19
-57 9 -17 13 -30 10 -30 -3 0 0 -10 7 -22 7 -13 13 -25 13 -28 3 -15 41 -85
48 -88 4 -2 7 -10 7 -18 0 -8 5 -14 10 -14 6 0 10 -4 10 -10 0 -25 117 -136
205 -194 72 -48 643 -336 666 -336 5 0 9 -4 9 -10 0 -5 6 -10 12 -10 7 0 85
-36 173 -79 88 -43 279 -137 425 -209 367 -180 875 -429 1057 -519 84 -41 156
-75 160 -76 4 0 13 -5 18 -9 9 -8 194 -100 205 -103 3 0 127 -61 275 -134 313
-154 348 -169 455 -188 48 -9 207 -10 250 -1 19 4 49 10 65 14 17 3 37 8 45
11 8 4 17 7 20 8 27 9 61 25 160 73 63 31 117 56 120 57 23 6 487 241 492 249
4 6 8 8 8 4 0 -3 63 25 140 63 78 38 144 69 148 69 5 0 14 6 21 12 6 7 15 13
19 13 4 1 132 63 284 138 153 75 288 142 300 147 13 6 30 14 38 20 8 5 155 78
325 161 1001 490 1219 598 1223 610 2 5 10 9 17 9 7 0 27 12 45 28 145 125
218 232 260 383 19 68 25 122 35 274 2 33 4 60 5 60 3 0 7 36 15 115 6 70 9
99 20 190 2 19 5 54 7 77 2 24 7 43 11 43 4 0 3 8 -2 19 -6 10 -7 21 -4 25 4
4 8 17 9 29 1 12 4 49 8 82 4 33 9 80 12 105 2 25 6 61 10 81 3 20 7 60 9 90
6 73 15 163 20 188 2 12 7 49 10 84 4 34 8 82 11 107 3 25 7 65 9 90 2 25 5
45 6 45 1 0 3 14 4 30 5 68 15 172 20 205 5 34 11 92 20 195 3 28 7 64 10 80
7 41 16 122 20 170 2 22 6 58 9 80 2 22 8 67 11 100 3 33 8 85 12 115 3 30 6
70 7 87 0 18 3 33 6 33 3 0 6 17 6 38 3 79 9 122 18 122 5 0 3 6 -3 13 -6 8
-9 16 -6 18 5 6 12 47 20 134 17 168 25 245 30 275 3 23 6 48 20 175 7 72 14
135 20 175 2 19 7 67 10 105 3 39 8 84 11 100 3 17 7 53 9 80 2 28 7 75 10
105 4 30 8 69 10 85 2 17 4 30 5 30 0 0 3 23 5 50 2 28 7 79 11 115 4 36 8 74
9 85 1 11 5 43 8 70 12 94 19 160 23 200 6 66 13 127 20 185 10 87 12 111 18
180 3 36 8 74 10 85 2 11 7 54 11 95 4 41 9 82 10 91 2 9 6 52 10 95 3 43 8
90 10 104 3 14 7 48 10 75 3 28 8 68 10 90 15 125 23 203 30 280 2 28 7 68 10
90 3 22 8 67 10 100 2 33 5 60 6 60 0 0 2 11 3 25 2 14 6 50 10 80 3 30 9 82
12 115 3 33 7 71 9 85 3 14 7 54 11 90 3 36 7 72 9 80 2 8 6 49 10 90 4 41 9
93 12 115 2 22 6 56 8 75 3 33 10 97 20 180 25 220 24 280 -8 416 -8 33 -73
160 -103 201 -32 44 -130 141 -163 163 -13 8 -29 20 -35 25 -18 17 -147 73
-211 92 -57 17 -247 18 -4140 19 -3361 2 -4090 0 -4135 -11z m4265 -2664 c-8
-43 -14 -74 -20 -101 -3 -14 -10 -51 -15 -82 -6 -32 -13 -70 -16 -85 -3 -16
-7 -39 -9 -53 -2 -14 -4 -25 -5 -25 -1 0 -3 -9 -5 -20 -2 -11 -7 -36 -11 -55
-4 -19 -8 -44 -10 -55 -1 -11 -9 -56 -18 -100 -9 -44 -16 -80 -16 -81 0 -1
132 -1 293 -2 275 0 389 -5 447 -17 83 -17 84 -17 155 -40 33 -10 71 -26 85
-35 14 -10 35 -20 46 -24 12 -4 51 -35 87 -69 63 -59 111 -134 121 -188 3 -13
5 -24 6 -24 4 0 9 -47 11 -100 1 -55 -8 -115 -45 -325 -7 -41 -12 -78 -9 -82
2 -5 -1 -8 -7 -8 -6 0 -9 -4 -6 -9 3 -5 1 -33 -4 -62 -6 -30 -13 -69 -16 -88
-3 -18 -8 -43 -10 -55 -9 -41 -24 -139 -29 -181 -2 -16 -4 -30 -5 -30 -3 0 -8
-26 -14 -79 -3 -22 -10 -62 -15 -90 -6 -28 -12 -62 -15 -76 -11 -70 -19 -117
-22 -135 -3 -11 -7 -36 -10 -55 -3 -19 -7 -46 -10 -60 -3 -14 -6 -34 -8 -45
-2 -11 -6 -34 -10 -51 l-7 -32 -325 0 -326 0 6 32 c3 17 8 42 11 56 9 42 13
63 24 125 6 33 14 74 17 90 3 17 7 39 9 50 1 11 3 20 4 20 1 0 4 14 6 30 2 17