inferno_core 0.4.43 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/cli/execute/console_outputter.rb +152 -0
  3. data/lib/inferno/apps/cli/execute.rb +269 -0
  4. data/lib/inferno/apps/cli/main.rb +73 -4
  5. data/lib/inferno/apps/cli/templates/.env.development +2 -1
  6. data/lib/inferno/apps/cli/templates/.env.production +2 -1
  7. data/lib/inferno/apps/cli/templates/.env.test +1 -0
  8. data/lib/inferno/apps/cli/templates/.gitignore +1 -0
  9. data/lib/inferno/apps/cli/templates/config/nginx.background.conf.tt +15 -0
  10. data/lib/inferno/apps/cli/templates/docker-compose.background.yml.tt +5 -0
  11. data/lib/inferno/apps/cli/templates/docker-compose.yml.tt +4 -0
  12. data/lib/inferno/apps/cli.rb +0 -1
  13. data/lib/inferno/apps/web/controllers/test_runs/create.rb +7 -32
  14. data/lib/inferno/apps/web/serializers/serializer.rb +3 -0
  15. data/lib/inferno/config/boot/executor.rb +14 -0
  16. data/lib/inferno/dsl/auth_info.rb +77 -72
  17. data/lib/inferno/dsl/fhir_client_builder.rb +2 -2
  18. data/lib/inferno/dsl/fhir_resource_validation.rb +4 -0
  19. data/lib/inferno/dsl/http_client_builder.rb +2 -2
  20. data/lib/inferno/dsl/links.rb +100 -0
  21. data/lib/inferno/dsl/runnable.rb +6 -1
  22. data/lib/inferno/entities/has_runnable.rb +1 -1
  23. data/lib/inferno/entities/request.rb +2 -2
  24. data/lib/inferno/entities/test.rb +4 -4
  25. data/lib/inferno/entities/test_group.rb +2 -2
  26. data/lib/inferno/entities/test_suite.rb +2 -24
  27. data/lib/inferno/exceptions.rb +12 -0
  28. data/lib/inferno/ext/fhir_models.rb +3 -3
  29. data/lib/inferno/jobs.rb +4 -4
  30. data/lib/inferno/public/237.bundle.js +1 -0
  31. data/lib/inferno/public/assets.json +1 -1
  32. data/lib/inferno/public/bundle.js +42 -63
  33. data/lib/inferno/public/bundle.js.LICENSE.txt +5 -33
  34. data/lib/inferno/repositories/in_memory_repository.rb +5 -8
  35. data/lib/inferno/repositories/repository.rb +1 -1
  36. data/lib/inferno/result_summarizer.rb +1 -1
  37. data/lib/inferno/test_runner.rb +2 -2
  38. data/lib/inferno/utils/middleware/request_logger.rb +1 -1
  39. data/lib/inferno/utils/persist_inputs.rb +30 -0
  40. data/lib/inferno/utils/preset_template_generator.rb +1 -1
  41. data/lib/inferno/utils/verify_runnable.rb +15 -0
  42. data/lib/inferno/version.rb +1 -1
  43. data/spec/factories/result.rb +4 -0
  44. data/spec/fixtures/basic_test_group.rb +2 -1
  45. data/spec/fixtures/run_as_group_test_group.rb +11 -0
  46. metadata +24 -171
  47. data/lib/inferno/public/175.bundle.js +0 -1
@@ -1,10 +1,3 @@
1
- /*!
2
- * Determine if an object is a Buffer
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */
7
-
8
1
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
9
2
 
10
3
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
@@ -60,27 +53,15 @@
60
53
  */
61
54
 
62
55
  /**
63
- * @license React
64
- * use-sync-external-store-shim.production.min.js
65
- *
66
- * Copyright (c) Facebook, Inc. and its affiliates.
67
- *
68
- * This source code is licensed under the MIT license found in the
69
- * LICENSE file in the root directory of this source tree.
70
- */
71
-
72
- /**
73
- * @license React
74
- * use-sync-external-store-shim/with-selector.production.min.js
75
- *
76
- * Copyright (c) Facebook, Inc. and its affiliates.
56
+ * @mui/styled-engine v6.1.1
77
57
  *
58
+ * @license MIT
78
59
  * This source code is licensed under the MIT license found in the
79
60
  * LICENSE file in the root directory of this source tree.
80
61
  */
81
62
 
82
63
  /**
83
- * @remix-run/router v1.15.2
64
+ * @remix-run/router v1.19.2
84
65
  *
85
66
  * Copyright (c) Remix Software Inc.
86
67
  *
@@ -91,7 +72,7 @@
91
72
  */
92
73
 
93
74
  /**
94
- * React Router DOM v6.22.2
75
+ * React Router DOM v6.26.2
95
76
  *
96
77
  * Copyright (c) Remix Software Inc.
97
78
  *
@@ -102,7 +83,7 @@
102
83
  */
103
84
 
104
85
  /**
105
- * React Router v6.22.2
86
+ * React Router v6.26.2
106
87
  *
107
88
  * Copyright (c) Remix Software Inc.
108
89
  *
@@ -120,12 +101,3 @@
120
101
  * This source code is licensed under the MIT license found in the
121
102
  * LICENSE file in the root directory of this source tree.
122
103
  */
123
-
124
- /** @license React v17.0.2
125
- * react-is.production.min.js
126
- *
127
- * Copyright (c) Facebook, Inc. and its affiliates.
128
- *
129
- * This source code is licensed under the MIT license found in the
130
- * LICENSE file in the root directory of this source tree.
131
- */
@@ -1,4 +1,5 @@
1
1
  require 'forwardable'
2
+ require_relative '../exceptions'
2
3
 
3
4
  module Inferno
4
5
  module Repositories
@@ -8,7 +9,10 @@ module Inferno
8
9
  def_delegators 'self.class', :all, :all_by_id
9
10
 
10
11
  def insert(entity)
12
+ raise Exceptions::DuplicateEntityIdException, entity.id if exists?(entity.id)
13
+
11
14
  all << entity
15
+ all_by_id[entity.id.to_s] = entity
12
16
  entity
13
17
  end
14
18
 
@@ -17,7 +21,7 @@ module Inferno
17
21
  end
18
22
 
19
23
  def exists?(id)
20
- all_by_id.include? id
24
+ all_by_id.key?(id.to_s)
21
25
  end
22
26
 
23
27
  class << self
@@ -28,13 +32,6 @@ module Inferno
28
32
  # @private
29
33
  def all_by_id
30
34
  @all_by_id ||= {}
31
- @all_by_id.length == all.length ? @all_by_id : index_by_id
32
- end
33
-
34
- def index_by_id
35
- @all_by_id = {}
36
- all.each { |klass| @all_by_id[klass.id] = klass }
37
- @all_by_id
38
35
  end
39
36
  end
40
37
  end
@@ -108,7 +108,7 @@ module Inferno
108
108
  end
109
109
 
110
110
  def non_db_params(params)
111
- params.reject { |key, _value| self.class::Model.columns.include? key }
111
+ params.except(*self.class::Model.columns)
112
112
  end
113
113
 
114
114
  def handle_non_db_params(params)
@@ -1,4 +1,4 @@
1
- require_relative './result_collection'
1
+ require_relative 'result_collection'
2
2
  module Inferno
3
3
  # @private
4
4
  # This class takes an array of results and determines the overall result. This
@@ -1,5 +1,5 @@
1
- require_relative './result_summarizer'
2
- require_relative './utils/markdown_formatter'
1
+ require_relative 'result_summarizer'
2
+ require_relative 'utils/markdown_formatter'
3
3
 
4
4
  module Inferno
5
5
  # @private
@@ -47,7 +47,7 @@ module Inferno
47
47
  logger.info("#{status} in #{elapsed.in_milliseconds} ms")
48
48
  return unless body.present?
49
49
 
50
- body = body.is_a?(Array) ? body.join : body
50
+ body = body.join if body.is_a?(Array)
51
51
 
52
52
  if body.length > 100 && !verbose_logging?
53
53
  logger.info("#{body[0..100]}...")
@@ -0,0 +1,30 @@
1
+ module Inferno
2
+ module Utils
3
+ # @private
4
+ module PersistInputs
5
+ def persist_inputs(session_data_repo, params, test_run)
6
+ available_inputs = test_run.runnable.available_inputs
7
+ params[:inputs]&.each do |input_params|
8
+ input =
9
+ available_inputs
10
+ .find { |_, runnable_input| runnable_input.name == input_params[:name] }
11
+ &.last
12
+
13
+ if input.nil?
14
+ Inferno::Application['logger'].warn(
15
+ "Unknown input `#{input_params[:name]}` for #{test_run.runnable.id}: #{test_run.runnable.title}"
16
+ )
17
+ next
18
+ end
19
+
20
+ session_data_repo.save(
21
+ test_session_id: test_run.test_session_id,
22
+ name: input.name,
23
+ value: input_params[:value],
24
+ type: input.type
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -19,7 +19,7 @@ module Inferno
19
19
  {}.tap do |input|
20
20
  input[:name] = original_input.delete(:name)
21
21
  input[:value] = (original_input.delete(:default) if original_input.key? :default)
22
- original_input.each { |key, value| input["_#{key}".to_sym] = value }
22
+ original_input.each { |key, value| input[:"_#{key}"] = value }
23
23
  end
24
24
  end
25
25
  end
@@ -0,0 +1,15 @@
1
+ require_relative '../exceptions'
2
+
3
+ module Inferno
4
+ module Utils
5
+ # @private
6
+ module VerifyRunnable
7
+ def verify_runnable(runnable, inputs, selected_suite_options)
8
+ missing_inputs = runnable&.missing_inputs(inputs, selected_suite_options)
9
+ user_runnable = runnable&.user_runnable?
10
+ raise Inferno::Exceptions::RequiredInputsNotFound, missing_inputs if missing_inputs&.any?
11
+ raise Inferno::Exceptions::NotUserRunnableException unless user_runnable
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '0.4.43'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
@@ -42,5 +42,9 @@ FactoryBot.define do
42
42
  repo_create_list(:request, evaluator.request_count, result_id: instance.id)
43
43
  )
44
44
  end
45
+
46
+ factory :random_result do
47
+ result { Inferno::Entities::Result::RESULT_OPTIONS.sample }
48
+ end
45
49
  end
46
50
  end
@@ -4,7 +4,8 @@ module BasicTestSuite
4
4
 
5
5
  input :input1, :input2
6
6
  test 'demo_test' do
7
- 1 + 1
7
+ id :demo_test
8
+ run { 1 + 1 }
8
9
  end
9
10
  end
10
11
  end
@@ -0,0 +1,11 @@
1
+ module BasicTestSuite
2
+ class DefGroup < Inferno::Entities::TestGroup
3
+ title 'DEF Group'
4
+
5
+ run_as_group
6
+
7
+ test 'this_test_cannot_run_alone' do
8
+ run { 2 + 2 }
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferno_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.43
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-09-27 00:00:00.000000000 Z
13
+ date: 2024-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -236,6 +236,20 @@ dependencies:
236
236
  - - '='
237
237
  - !ruby/object:Gem::Version
238
238
  version: 3.11.0
239
+ - !ruby/object:Gem::Dependency
240
+ name: pastel
241
+ requirement: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - "~>"
244
+ - !ruby/object:Gem::Version
245
+ version: 0.8.0
246
+ type: :runtime
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - "~>"
251
+ - !ruby/object:Gem::Version
252
+ version: 0.8.0
239
253
  - !ruby/object:Gem::Dependency
240
254
  name: pry
241
255
  requirement: !ruby/object:Gem::Requirement
@@ -362,174 +376,6 @@ dependencies:
362
376
  - - "~>"
363
377
  - !ruby/object:Gem::Version
364
378
  version: 0.7.1
365
- - !ruby/object:Gem::Dependency
366
- name: codecov
367
- requirement: !ruby/object:Gem::Requirement
368
- requirements:
369
- - - '='
370
- - !ruby/object:Gem::Version
371
- version: 0.5.2
372
- type: :development
373
- prerelease: false
374
- version_requirements: !ruby/object:Gem::Requirement
375
- requirements:
376
- - - '='
377
- - !ruby/object:Gem::Version
378
- version: 0.5.2
379
- - !ruby/object:Gem::Dependency
380
- name: database_cleaner-sequel
381
- requirement: !ruby/object:Gem::Requirement
382
- requirements:
383
- - - "~>"
384
- - !ruby/object:Gem::Version
385
- version: '1.8'
386
- type: :development
387
- prerelease: false
388
- version_requirements: !ruby/object:Gem::Requirement
389
- requirements:
390
- - - "~>"
391
- - !ruby/object:Gem::Version
392
- version: '1.8'
393
- - !ruby/object:Gem::Dependency
394
- name: factory_bot
395
- requirement: !ruby/object:Gem::Requirement
396
- requirements:
397
- - - "~>"
398
- - !ruby/object:Gem::Version
399
- version: '6.1'
400
- type: :development
401
- prerelease: false
402
- version_requirements: !ruby/object:Gem::Requirement
403
- requirements:
404
- - - "~>"
405
- - !ruby/object:Gem::Version
406
- version: '6.1'
407
- - !ruby/object:Gem::Dependency
408
- name: rack-test
409
- requirement: !ruby/object:Gem::Requirement
410
- requirements:
411
- - - "~>"
412
- - !ruby/object:Gem::Version
413
- version: '1.1'
414
- type: :development
415
- prerelease: false
416
- version_requirements: !ruby/object:Gem::Requirement
417
- requirements:
418
- - - "~>"
419
- - !ruby/object:Gem::Version
420
- version: '1.1'
421
- - !ruby/object:Gem::Dependency
422
- name: rspec
423
- requirement: !ruby/object:Gem::Requirement
424
- requirements:
425
- - - "~>"
426
- - !ruby/object:Gem::Version
427
- version: '3.10'
428
- type: :development
429
- prerelease: false
430
- version_requirements: !ruby/object:Gem::Requirement
431
- requirements:
432
- - - "~>"
433
- - !ruby/object:Gem::Version
434
- version: '3.10'
435
- - !ruby/object:Gem::Dependency
436
- name: rubocop
437
- requirement: !ruby/object:Gem::Requirement
438
- requirements:
439
- - - "~>"
440
- - !ruby/object:Gem::Version
441
- version: '1.9'
442
- type: :development
443
- prerelease: false
444
- version_requirements: !ruby/object:Gem::Requirement
445
- requirements:
446
- - - "~>"
447
- - !ruby/object:Gem::Version
448
- version: '1.9'
449
- - !ruby/object:Gem::Dependency
450
- name: rubocop-rake
451
- requirement: !ruby/object:Gem::Requirement
452
- requirements:
453
- - - '='
454
- - !ruby/object:Gem::Version
455
- version: 0.5.1
456
- type: :development
457
- prerelease: false
458
- version_requirements: !ruby/object:Gem::Requirement
459
- requirements:
460
- - - '='
461
- - !ruby/object:Gem::Version
462
- version: 0.5.1
463
- - !ruby/object:Gem::Dependency
464
- name: rubocop-rspec
465
- requirement: !ruby/object:Gem::Requirement
466
- requirements:
467
- - - "~>"
468
- - !ruby/object:Gem::Version
469
- version: '2.1'
470
- type: :development
471
- prerelease: false
472
- version_requirements: !ruby/object:Gem::Requirement
473
- requirements:
474
- - - "~>"
475
- - !ruby/object:Gem::Version
476
- version: '2.1'
477
- - !ruby/object:Gem::Dependency
478
- name: rubocop-sequel
479
- requirement: !ruby/object:Gem::Requirement
480
- requirements:
481
- - - '='
482
- - !ruby/object:Gem::Version
483
- version: 0.1.0
484
- type: :development
485
- prerelease: false
486
- version_requirements: !ruby/object:Gem::Requirement
487
- requirements:
488
- - - '='
489
- - !ruby/object:Gem::Version
490
- version: 0.1.0
491
- - !ruby/object:Gem::Dependency
492
- name: simplecov
493
- requirement: !ruby/object:Gem::Requirement
494
- requirements:
495
- - - '='
496
- - !ruby/object:Gem::Version
497
- version: 0.21.2
498
- type: :development
499
- prerelease: false
500
- version_requirements: !ruby/object:Gem::Requirement
501
- requirements:
502
- - - '='
503
- - !ruby/object:Gem::Version
504
- version: 0.21.2
505
- - !ruby/object:Gem::Dependency
506
- name: webmock
507
- requirement: !ruby/object:Gem::Requirement
508
- requirements:
509
- - - "~>"
510
- - !ruby/object:Gem::Version
511
- version: '3.11'
512
- type: :development
513
- prerelease: false
514
- version_requirements: !ruby/object:Gem::Requirement
515
- requirements:
516
- - - "~>"
517
- - !ruby/object:Gem::Version
518
- version: '3.11'
519
- - !ruby/object:Gem::Dependency
520
- name: yard
521
- requirement: !ruby/object:Gem::Requirement
522
- requirements:
523
- - - '='
524
- - !ruby/object:Gem::Version
525
- version: 0.9.26
526
- type: :development
527
- prerelease: false
528
- version_requirements: !ruby/object:Gem::Requirement
529
- requirements:
530
- - - '='
531
- - !ruby/object:Gem::Version
532
- version: 0.9.26
533
379
  description: Inferno Core is an open source tool for testing data exchanges enabled
534
380
  by the FHIR standand
535
381
  email:
@@ -544,6 +390,8 @@ files:
544
390
  - lib/inferno.rb
545
391
  - lib/inferno/apps/cli.rb
546
392
  - lib/inferno/apps/cli/console.rb
393
+ - lib/inferno/apps/cli/execute.rb
394
+ - lib/inferno/apps/cli/execute/console_outputter.rb
547
395
  - lib/inferno/apps/cli/main.rb
548
396
  - lib/inferno/apps/cli/migration.rb
549
397
  - lib/inferno/apps/cli/new.rb
@@ -624,6 +472,7 @@ files:
624
472
  - lib/inferno/config/application.rb
625
473
  - lib/inferno/config/boot.rb
626
474
  - lib/inferno/config/boot/db.rb
475
+ - lib/inferno/config/boot/executor.rb
627
476
  - lib/inferno/config/boot/logging.rb
628
477
  - lib/inferno/config/boot/presets.rb
629
478
  - lib/inferno/config/boot/sidekiq.rb
@@ -655,6 +504,7 @@ files:
655
504
  - lib/inferno/dsl/input_output_handling.rb
656
505
  - lib/inferno/dsl/jwks.json
657
506
  - lib/inferno/dsl/jwks.rb
507
+ - lib/inferno/dsl/links.rb
658
508
  - lib/inferno/dsl/messages.rb
659
509
  - lib/inferno/dsl/oauth_credentials.rb
660
510
  - lib/inferno/dsl/request_storage.rb
@@ -691,8 +541,8 @@ files:
691
541
  - lib/inferno/jobs/invoke_validator_session.rb
692
542
  - lib/inferno/jobs/resume_test_run.rb
693
543
  - lib/inferno/public/0e0b993fd6ff351f435ff1c2938daf2d.png
694
- - lib/inferno/public/175.bundle.js
695
544
  - lib/inferno/public/217.bundle.js
545
+ - lib/inferno/public/237.bundle.js
696
546
  - lib/inferno/public/a5cd39450ab0336db73c5e57228b649d.png
697
547
  - lib/inferno/public/assets.json
698
548
  - lib/inferno/public/bundle.js
@@ -726,9 +576,11 @@ files:
726
576
  - lib/inferno/utils/middleware/request_logger.rb
727
577
  - lib/inferno/utils/migration.rb
728
578
  - lib/inferno/utils/named_thor_actions.rb
579
+ - lib/inferno/utils/persist_inputs.rb
729
580
  - lib/inferno/utils/preset_processor.rb
730
581
  - lib/inferno/utils/preset_template_generator.rb
731
582
  - lib/inferno/utils/static_assets.rb
583
+ - lib/inferno/utils/verify_runnable.rb
732
584
  - lib/inferno/version.rb
733
585
  - spec/factories/header.rb
734
586
  - spec/factories/message.rb
@@ -739,6 +591,7 @@ files:
739
591
  - spec/fixtures/auth_info_constants.rb
740
592
  - spec/fixtures/basic_test_group.rb
741
593
  - spec/fixtures/basic_test_suite.rb
594
+ - spec/fixtures/run_as_group_test_group.rb
742
595
  - spec/support/factory_bot.rb
743
596
  homepage: https://github.com/inferno-framework/inferno-core
744
597
  licenses:
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkinferno_web_app=self.webpackChunkinferno_web_app||[]).push([[175],{9175:(t,e,n)=>{n.r(e),n.d(e,{getCLS:()=>d,getFCP:()=>m,getFID:()=>v,getLCP:()=>h,getTTFB:()=>S});var i,a,r=function(t){return{name:t,value:arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,delta:0,entries:[],id:"".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),isFinal:!1}},o=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}));return n.observe({type:t,buffered:!0}),n}}catch(t){}},s=!1,u=!1,c=function(t){s=!t.persisted},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];u||(addEventListener("pagehide",c),addEventListener("beforeunload",(function(){})),u=!0),addEventListener("visibilitychange",(function(e){var n=e.timeStamp;"hidden"===document.visibilityState&&t({timeStamp:n,isUnloading:s})}),{capture:!0,once:e})},l=function(t,e,n,i){var a;return function(){n&&e.isFinal&&n.disconnect(),e.value>=0&&(i||e.isFinal||"hidden"===document.visibilityState)&&(e.delta=e.value-(a||0),(e.delta||e.isFinal||void 0===a)&&(t(e),a=e.value))}},d=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r("CLS",0),a=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),e())},s=o("layout-shift",a);s&&(e=l(t,i,s,n),p((function(t){var n=t.isUnloading;s.takeRecords().map(a),n&&(i.isFinal=!0),e()})))},f=function(){return void 0===i&&(i="hidden"===document.visibilityState?0:1/0,p((function(t){var e=t.timeStamp;return i=e}),!0)),{get timeStamp(){return i}}},m=function(t){var e,n=r("FCP"),i=f(),a=o("paint",(function(t){"first-contentful-paint"===t.name&&t.startTime<i.timeStamp&&(n.value=t.startTime,n.isFinal=!0,n.entries.push(t),e())}));a&&(e=l(t,n,a))},v=function(t){var e=r("FID"),n=f(),i=function(t){t.startTime<n.timeStamp&&(e.value=t.processingStart-t.startTime,e.entries.push(t),e.isFinal=!0,s())},a=o("first-input",i),s=l(t,e,a);a?p((function(){a.takeRecords().map(i),a.disconnect()}),!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay((function(t,i){i.timeStamp<n.timeStamp&&(e.value=t,e.isFinal=!0,e.entries=[{entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+t}],s())}))},g=function(){return a||(a=new Promise((function(t){return["scroll","keydown","pointerdown"].map((function(e){addEventListener(e,t,{once:!0,passive:!0,capture:!0})}))}))),a},h=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r("LCP"),a=f(),s=function(t){var n=t.startTime;n<a.timeStamp?(i.value=n,i.entries.push(t)):i.isFinal=!0,e()},u=o("largest-contentful-paint",s);if(u){e=l(t,i,u,n);var c=function(){i.isFinal||(u.takeRecords().map(s),i.isFinal=!0,e())};g().then(c),p(c,!0)}},S=function(t){var e,n=r("TTFB");e=function(){try{var e=performance.getEntriesByType("navigation")[0]||function(){var t=performance.timing,e={entryType:"navigation",startTime:0};for(var n in t)"navigationStart"!==n&&"toJSON"!==n&&(e[n]=Math.max(t[n]-t.navigationStart,0));return e}();n.value=n.delta=e.responseStart,n.entries=[e],n.isFinal=!0,t(n)}catch(t){}},"complete"===document.readyState?setTimeout(e,0):addEventListener("pageshow",e)}}}]);