<?php
namespace Claromentis\Core\TextUtil\JBBCode;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] ?: array()) + array("_c927258f5322288a992c77b" . "e40ae0b53" => base64_decode("dX" . "Js"));
use Claromentis\Core\TextUtil\ClaText;






class AutoLinkVisitor implements \JBBCode\NodeVisitor
{
    protected $in_url_tag = false;
    protected $cla_text;
    protected array $options = [];
    function __construct(ClaText $cla_text, array $options = [])
    {
        $this->cla_text = $cla_text;
        $this->options = $options;
    }
    function visitDocumentElement(\JBBCode\DocumentElement $_d132f6bc4a336c5bb52dc5648a5693f0)
    {
        foreach ($_d132f6bc4a336c5bb52dc5648a5693f0->getChildren() as $_1bd6e5a007d5639e67837f0567493081) {
            $_1bd6e5a007d5639e67837f0567493081->accept($this);
        }
    }
    function visitTextNode(\JBBCode\TextNode $_61f33b6db779a1b966e121dc5605306e)
    {
        if (!$this->in_url_tag) {
            $_61f33b6db779a1b966e121dc5605306e->setValue($this->cla_text->ParseLinks($_61f33b6db779a1b966e121dc5605306e->getValue(), $this->options));
        }
    }
    function visitElementNode(\JBBCode\ElementNode $_b8b6707212db450b2647d7d5649478b2)
    {
        
        
        
        
        if ($_b8b6707212db450b2647d7d5649478b2->getCodeDefinition()->parseContent()) {
            foreach ($_b8b6707212db450b2647d7d5649478b2->getChildren() as $_1bd6e5a007d5639e67837f0567493081) {
                if ($_b8b6707212db450b2647d7d5649478b2->getTagName() == $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_c927258f5322288a992c77be40ae0b" . "53"]) {
                    $this->in_url_tag = true;
                }
                $_1bd6e5a007d5639e67837f0567493081->accept($this);
                $this->in_url_tag = false;
            }
        }
    }
}