32
  J   ˆl–Ãa¾”ªi?u8 ¸Û71hß�þ\ qÀ³ÈP´èÅüÿÌƒl¹Ë_“I|¥ŽõHºl=$¤�zTÖ™	ÊÉ      import * as Types from '#shared/graphql/types.ts';

import gql from 'graphql-tag';
import * as VueApolloComposable from '@vue/apollo-composable/compat';
import * as VueCompositionApi from 'vue';
export type ReactiveFunction<TParam> = () => TParam;

export const ProductAboutDocument = gql`
    query productAbout {
  productAbout
}
    `;
export function useProductAboutQuery(options: VueApolloComposable.UseQueryOptions<Types.ProductAboutQuery, Types.ProductAboutQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>> = {}) {
  return VueApolloComposable.useQuery<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>(ProductAboutDocument, {}, options);
}
export function useProductAboutLazyQuery(options: VueApolloComposable.UseQueryOptions<Types.ProductAboutQuery, Types.ProductAboutQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>> = {}) {
  return VueApolloComposable.useLazyQuery<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>(ProductAboutDocument, {}, options);
}
export type ProductAboutQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<Types.ProductAboutQuery, Types.ProductAboutQueryVariables>;     ˆÆÅÌ498ÄÊÉ ò    ‹      µT]oÚ0}ï¯ðü°7r!-­Ô:Ù:‚4Ô¤Ú¦išLlˆU'Žl·´ýõs0¨YûÐº—øÞ›Ÿsî�MÞ$“Aöe:D³ëMo>¤£Â€OÇ€$Kü‹“ ÛŽ1Â…µõ9Àz½ÖÇ�Ò+ÈfPØRž€±Zä6`–áøˆ4µø‘‚SæVD¬°’Ç£Šñ¤–Ô�5‚ñpìÖnO´,)ƒJ1þ½TìNrïi­¤T�KÁ+æVHiÀ;¾HÀs8VØÒ’…b��šÞfv“t±Ð„:&¶@÷TŠUa«jQ®�Ñy„Aäª2°�´ºVb‰•6Â_GƒÉ7‡[4_Ç„¢Bóe„ß¢ñÅ$ºÄñ˜–œ Ý�¹ö˜”‹œ~±œÏ=x.žo˜xLÂM®Em…ªž¡à,¶­æJšš:¯}ç Ðm”‡°ßuƒæ?5cz9Ž³d4ó-aÍÏê^gŽ8žRír”Ís«ôãÖ g{[-L}±KÑV¾«Ââ¡Ú‹üÏ–?Ø¶çìs¶×íüj”¦AéÎÖ.jë|!,ì†§�^¯ž¡îéy¿�ÐàY^ý«ƒ¥’Œë¶‡Csîz�ó¦í­ä5œüzø—ÂöüØÜü-ö†›�	(       ˆ¿�þ^}µœp,Æ2·d ÿŸÍƒ_wÌÂÊÉ •    # Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/

require 'puma'

module PlaywrightNative
  # Serves the app from this process, so the server shares the example's database
  #   connection and sees its uncommitted records.
  module AppServer
    # Counts the requests in progress, so an example ends only once the server is done with
    #   it, and keeps the first error of the app for the example.
    class Middleware
      attr_reader :error

      def initialize(app)
        @app      = app
        @requests = Concurrent::AtomicFixnum.new
      end

      def call(env)
        @requests.increment
        @app.call(env)
      rescue => e
        @error ||= e
        raise
      ensure
        @requests.decrement
      end

      def idle?
        @requests.value.zero?
      end

      def take_error
        error.tap { @error = nil }
      end
    end

    def self.url
      "https://#{PLAYWRIGHT_APP_HOSTNAME}:#{PLAYWRIGHT_APP_PORT}"
    end

    def self.start
      return if @middleware

      authority = Localhost::Authority.new(PLAYWRIGHT_APP_HOSTNAME, issuer: nil)
      authority.save

      @middleware = Middleware.new(Rails.application)

      server = Puma::Server.new(@middleware, nil, min_threads: 0, max_threads: 16, log_writer: Puma::LogWriter.null)
      server.binder.parse(["ssl://0.0.0.0:#{PLAYWRIGHT_APP_PORT}?key=#{authority.key_path}&cert=#{authority.certificate_path}"])
      server.run
    end

    def self.finish_example
      Timeout.timeout(PLAYWRIGHT_TIMEOUT) { sleep 0.01 until @middleware.idle? }

      error = @middleware.take_error
      raise error if error
    end
  end
end

RSpec.configure do |config|
  config.before(:each, type: :playwright) do
    PlaywrightNative::AppServer.start

    Setting.set('http_type', 'https')
    Setting.set('fqdn', "#{PLAYWRIGHT_APP_HOSTNAME}:#{PLAYWRIGHT_APP_PORT}")
  end