50
  $   ˆÑÐÏ814Îa–äY>” ”¾R( 	Å ‚fãM)‹FÿÍ .    ‹      Õ˜ÝoÚ0ÀßûWxyØq Ÿ!S•†ÖRÔ2mÓ4E&6‰Eg¶)¥ý1%«€µÂ‹´'î.G|¿»øãì¿ëÝvGß‡WàÓèæ¿|¼îw�Õ€ðk³aoÔ+´lÇ…ðj`+‘²8‡p>ŸÛó¦ÍxGw0‘YÚ‚BrIKlGþÒ?!«_àK*SôsL› ÈfRPL¼µ 1Ë$Çš“ŒÙ‰°#Æ
5 f‘h‘®½[0¥cX,dÂò&ÄTÈF�¢)Š‰PV.”�äÒ‡å¨*¨ñÇ/–ñ¹µÇ¢†\%�W!-Eø2(¥qÞ±$+¬À§Y�:¤Ë§(ŸÚ1�X ¥²cýèwo*?(“å¿�„“IÇúÐí.n;—V0@ñ!ÚîsSú\#!AÆ0�P‚w:ß—Î÷ôi÷{¥O�ˆˆÓBR–o\¡B¬¢F,R¬mE�ðªWé‚ÿ–•Ùj2†—wWƒQ¯W¦/_±‰îVÖ
†ˆ«º‚å$’Œ/4uÂû|,Š‹µ
4§q"­ €Øêù†DÌòiÎæy5*Ï[³ Íc»XP+ØÈÕp_Äç9ž×pÜ†ÛžsÞv Øâ:Ÿ‘äQV)FßFû)*&\ûä`†7£XØ*|¢Éµd¤À9ø‹zm!BÉQ.&Œgh9ÙÅª$[Œ&¸šŠóz.ÆÒ'M£E3ÍúŠ‡ÕbTRl#ß˜çÕÈ!ˆÔ¥d‚ m×H ¶Æ±†xVLpÛg5rd¨Ð¥dfãhÕH�ª�[#hÑÃ©íÖÈ€É¯ÑkÙL%êœÕQŠ„Þ0žegv»FŠ1Š5C)™™Ó5®M4Ëf«>¤Ä¨ªfv¼«‘�´ \TÅG�sCõa)#–e,/a^Xþ»Ù%$š.O¹º>/Mf˜Nfš°^¥ÚÕR†a±ˆ�âCÕVµý,­†sÚp›À99÷Ü=çøZ;Ã0¤9•aXö†UÍDaNìúºÃJì€˜é÷V^y»õ½�W7P>,oÈ~ì˜’>„    F   !ˆl–ßi~””†»%�À¶¦-ÿ�þ_‘¬Ü„u�•æåüÿÌ„eÖßoÑ_�uÐb&=LyZËcõÀÏ ?÷     !# frozen_string_literal: true

# = uri/generic.rb
#
# Author:: Akira Yamada <akira@ruby-lang.org>
# License:: You can redistribute it and/or modify it under the same term as Ruby.
#
# See URI for general documentation
#

require_relative 'common'
autoload :IPSocket, 'socket'
autoload :IPAddr, 'ipaddr'

module URI

  #
  # Base class for all URI classes.
  # Implements generic URI syntax as per RFC 2396.
  #
  class Generic
    include URI

    #
    # A Default port of nil for URI::Generic.
    #
    DEFAULT_PORT = nil

    #
    # Returns default port.
    #
    def self.default_port
      self::DEFAULT_PORT
    end

    #
    # Returns default port.
    #
    def default_port
      self.class.default_port
    end

    #
    # An Array of the available components for URI::Generic.
    #
    COMPONENT = [
      :scheme,
      :userinfo, :host, :port, :registry,
      :path, :opaque,
      :query,
      :fragment
    ].freeze

    #
    # Components of the URI in the order.
    #
    def self.component
      self::COMPONENT
    end

    USE_REGISTRY = false # :nodoc:

    def self.use_registry # :nodoc:
      self::USE_REGISTRY
    end

    #
    # == Synopsis
    #
    # See ::new.
    #
    # == Description
    #
    # At first, tries to create a new URI::Generic instance using
    # URI::Generic::build. But, if exception URI::InvalidComponentError is raised,
    # then it does URI::Escape.escape all URI components and tries again.
    #
    def self.build2(args)
      begin
        return self.build(args)
      rescue InvalidComponentError
        if args.kind_of?(Array)
          return self.build(args.collect{|x|
            if x.is_a?(String)
              DEFAULT_PARSER.escape(x)
            else
              x
            end
          })
        elsif args.kind_of?(Hash)
          tmp = {}
          args.each do |key, value|
            tmp[key] = if value
                DEFAULT_PARSER.escape(value)
              else
                value
              end
          end
          return self.build(tmp)
        end
      end
    end

    #
    # == Synopsis
    #
    # See ::new.
    #
    # == Description
    #
    # Creates a new URI::Generic instance from components of URI::Generic
    # with check.  Components are: scheme, userinfo, host, port, registry, path,
    # opaque, query, and fragment. You can provide arguments either by an Array or a Hash.
    # See ::new for hash keys to use or for order of array items.
    #
    def self.build(args)
      if args.kind_of?(Array) &&
          args.size == ::URI::Generic::COMPONENT.size
        tmp = args.dup
      elsif args.kind_of?(Hash)
        tmp = ::URI::Generic::COMPONENT.collect do |c|
          if args.include?(c)
            args[c]
          else
            nil
          end
        end
      else
        component = self.class.component rescue ::URI::Generic::COMPONENT
        raise ArgumentError,
        "expected Array of or Hash of components of #{self.class} (#{component.join(', ')})"
      end

      tmp << nil
      tmp << true
      return self.new(*tmp)
    end

    #
    # == Args
    #
    # +scheme+