FV Flowplayer Video Player - Version 7.5.29.7210

Version Description

  • 2022/09/20 =

  • AWS SDK update and size reduction

  • Full-featured YouTube player (moved in from FV Player Pro)

  • HLS.js - upgrade to 1.2.3 to fix playback on iOS 16

  • iPhone - avoid accidental drag of on-screen home button when in fullscreen

  • Seek back/forward button on controlbar - allowing for DVR live streams

  • SiteGround Security - putting track.php on their exclusions list

  • Bugfix - Dash.js Safari autoplay fix

  • Bugfix - fixing missing "no play" icon

  • Bugfix - Preloading - fix player not appearing when using 100% width and height, assuming 16:9 aspect ratio

  • Bugfix - Volume control appearing for iOS 16 where it's not possible to control volume using JavaScript

Download this release

Release Info

Developer FolioVision
Plugin Icon 128x128 FV Flowplayer Video Player
Version 7.5.29.7210
Comparing to
See all releases

Code changes from version 7.5.26.7210 to 7.5.29.7210

composer.json CHANGED
@@ -8,489 +8,15 @@
8
  "mockery/mockery": "^1.3.3"
9
  },
10
  "require": {
11
- "aws/aws-sdk-php": "^3.149"
12
  },
13
  "scripts": {
14
- "post-update-cmd": [
15
- "echo Removing unnecessary AWS files:",
16
- "rm -rf vendor/aws/aws-sdk-php/src/ACMPCA",
17
- "rm -rf vendor/aws/aws-sdk-php/src/AccessAnalyzer",
18
- "rm -rf vendor/aws/aws-sdk-php/src/Acm",
19
- "rm -rf vendor/aws/aws-sdk-php/src/AlexaForBusiness",
20
- "rm -rf vendor/aws/aws-sdk-php/src/Amplify",
21
- "rm -rf vendor/aws/aws-sdk-php/src/ApiGatewayManagementApi",
22
- "rm -rf vendor/aws/aws-sdk-php/src/ApiGatewayV2",
23
- "rm -rf vendor/aws/aws-sdk-php/src/AppConfig",
24
- "rm -rf vendor/aws/aws-sdk-php/src/AppMesh",
25
- "rm -rf vendor/aws/aws-sdk-php/src/AppSync",
26
- "rm -rf vendor/aws/aws-sdk-php/src/ApplicationAutoScaling",
27
- "rm -rf vendor/aws/aws-sdk-php/src/ApplicationDiscoveryService",
28
- "rm -rf vendor/aws/aws-sdk-php/src/ApplicationInsights",
29
- "rm -rf vendor/aws/aws-sdk-php/src/Appstream",
30
- "rm -rf vendor/aws/aws-sdk-php/src/Athena",
31
- "rm -rf vendor/aws/aws-sdk-php/src/AugmentedAIRuntime",
32
- "rm -rf vendor/aws/aws-sdk-php/src/AutoScaling",
33
- "rm -rf vendor/aws/aws-sdk-php/src/AutoScalingPlans",
34
- "rm -rf vendor/aws/aws-sdk-php/src/Backup",
35
- "rm -rf vendor/aws/aws-sdk-php/src/Batch",
36
- "rm -rf vendor/aws/aws-sdk-php/src/Braket",
37
- "rm -rf vendor/aws/aws-sdk-php/src/Budgets",
38
- "rm -rf vendor/aws/aws-sdk-php/src/Chime",
39
- "rm -rf vendor/aws/aws-sdk-php/src/Cloud9",
40
- "rm -rf vendor/aws/aws-sdk-php/src/CloudDirectory",
41
- "rm -rf vendor/aws/aws-sdk-php/src/CloudFormation",
42
- "rm -rf vendor/aws/aws-sdk-php/src/CloudHSMV2",
43
- "rm -rf vendor/aws/aws-sdk-php/src/CloudHsm",
44
- "rm -rf vendor/aws/aws-sdk-php/src/CloudSearch",
45
- "rm -rf vendor/aws/aws-sdk-php/src/CloudSearchDomain",
46
- "rm -rf vendor/aws/aws-sdk-php/src/CloudTrail",
47
- "rm -rf vendor/aws/aws-sdk-php/src/CloudWatch",
48
- "rm -rf vendor/aws/aws-sdk-php/src/CloudWatchEvents",
49
- "rm -rf vendor/aws/aws-sdk-php/src/CloudWatchLogs",
50
- "rm -rf vendor/aws/aws-sdk-php/src/CodeArtifact",
51
- "rm -rf vendor/aws/aws-sdk-php/src/CodeBuild",
52
- "rm -rf vendor/aws/aws-sdk-php/src/CodeCommit",
53
- "rm -rf vendor/aws/aws-sdk-php/src/CodeDeploy",
54
- "rm -rf vendor/aws/aws-sdk-php/src/CodeGuruProfiler",
55
- "rm -rf vendor/aws/aws-sdk-php/src/CodeGuruReviewer",
56
- "rm -rf vendor/aws/aws-sdk-php/src/CodePipeline",
57
- "rm -rf vendor/aws/aws-sdk-php/src/CodeStar",
58
- "rm -rf vendor/aws/aws-sdk-php/src/CodeStarNotifications",
59
- "rm -rf vendor/aws/aws-sdk-php/src/CodeStarconnections",
60
- "rm -rf vendor/aws/aws-sdk-php/src/CognitoIdentity",
61
- "rm -rf vendor/aws/aws-sdk-php/src/CognitoIdentityProvider",
62
- "rm -rf vendor/aws/aws-sdk-php/src/CognitoSync",
63
- "rm -rf vendor/aws/aws-sdk-php/src/Comprehend",
64
- "rm -rf vendor/aws/aws-sdk-php/src/ComprehendMedical",
65
- "rm -rf vendor/aws/aws-sdk-php/src/ComputeOptimizer",
66
- "rm -rf vendor/aws/aws-sdk-php/src/Connect",
67
- "rm -rf vendor/aws/aws-sdk-php/src/ConnectParticipant",
68
- "rm -rf vendor/aws/aws-sdk-php/src/CostExplorer",
69
- "rm -rf vendor/aws/aws-sdk-php/src/CostandUsageReportService",
70
- "rm -rf vendor/aws/aws-sdk-php/src/Crypto",
71
- "rm -rf vendor/aws/aws-sdk-php/src/DAX",
72
- "rm -rf vendor/aws/aws-sdk-php/src/DLM",
73
- "rm -rf vendor/aws/aws-sdk-php/src/DataExchange",
74
- "rm -rf vendor/aws/aws-sdk-php/src/DataSync",
75
- "rm -rf vendor/aws/aws-sdk-php/src/DatabaseMigrationService",
76
- "rm -rf vendor/aws/aws-sdk-php/src/Detective",
77
- "rm -rf vendor/aws/aws-sdk-php/src/DeviceFarm",
78
- "rm -rf vendor/aws/aws-sdk-php/src/DocDB",
79
- "rm -rf vendor/aws/aws-sdk-php/src/DynamoDb",
80
- "rm -rf vendor/aws/aws-sdk-php/src/DynamoDbStreams",
81
- "rm -rf vendor/aws/aws-sdk-php/src/EBS",
82
- "rm -rf vendor/aws/aws-sdk-php/src/EC2InstanceConnect",
83
- "rm -rf vendor/aws/aws-sdk-php/src/EKS",
84
- "rm -rf vendor/aws/aws-sdk-php/src/Ec2",
85
- "rm -rf vendor/aws/aws-sdk-php/src/Ecr",
86
- "rm -rf vendor/aws/aws-sdk-php/src/Ecs",
87
- "rm -rf vendor/aws/aws-sdk-php/src/Efs",
88
- "rm -rf vendor/aws/aws-sdk-php/src/ElastiCache",
89
- "rm -rf vendor/aws/aws-sdk-php/src/ElasticBeanstalk",
90
- "rm -rf vendor/aws/aws-sdk-php/src/ElasticInference",
91
- "rm -rf vendor/aws/aws-sdk-php/src/ElasticLoadBalancing",
92
- "rm -rf vendor/aws/aws-sdk-php/src/ElasticLoadBalancingV2",
93
- "rm -rf vendor/aws/aws-sdk-php/src/ElasticTranscoder",
94
- "rm -rf vendor/aws/aws-sdk-php/src/ElasticsearchService",
95
- "rm -rf vendor/aws/aws-sdk-php/src/Emr",
96
- "rm -rf vendor/aws/aws-sdk-php/src/EventBridge",
97
- "rm -rf vendor/aws/aws-sdk-php/src/FMS",
98
- "rm -rf vendor/aws/aws-sdk-php/src/FSx",
99
- "rm -rf vendor/aws/aws-sdk-php/src/ForecastQueryService",
100
- "rm -rf vendor/aws/aws-sdk-php/src/ForecastService",
101
- "rm -rf vendor/aws/aws-sdk-php/src/FraudDetector",
102
- "rm -rf vendor/aws/aws-sdk-php/src/GameLift",
103
- "rm -rf vendor/aws/aws-sdk-php/src/GlobalAccelerator",
104
- "rm -rf vendor/aws/aws-sdk-php/src/Glue",
105
- "rm -rf vendor/aws/aws-sdk-php/src/Greengrass",
106
- "rm -rf vendor/aws/aws-sdk-php/src/GroundStation",
107
- "rm -rf vendor/aws/aws-sdk-php/src/GuardDuty",
108
- "rm -rf vendor/aws/aws-sdk-php/src/Health",
109
- "rm -rf vendor/aws/aws-sdk-php/src/Honeycode",
110
- "rm -rf vendor/aws/aws-sdk-php/src/IVS",
111
- "rm -rf vendor/aws/aws-sdk-php/src/ImportExport",
112
- "rm -rf vendor/aws/aws-sdk-php/src/IoT1ClickDevicesService",
113
- "rm -rf vendor/aws/aws-sdk-php/src/IoT1ClickProjects",
114
- "rm -rf vendor/aws/aws-sdk-php/src/IoTAnalytics",
115
- "rm -rf vendor/aws/aws-sdk-php/src/IoTEvents",
116
- "rm -rf vendor/aws/aws-sdk-php/src/IoTEventsData",
117
- "rm -rf vendor/aws/aws-sdk-php/src/IoTJobsDataPlane",
118
- "rm -rf vendor/aws/aws-sdk-php/src/IoTSecureTunneling",
119
- "rm -rf vendor/aws/aws-sdk-php/src/IoTSiteWise",
120
- "rm -rf vendor/aws/aws-sdk-php/src/IoTThingsGraph",
121
- "rm -rf vendor/aws/aws-sdk-php/src/Kafka",
122
- "rm -rf vendor/aws/aws-sdk-php/src/Kinesis",
123
- "rm -rf vendor/aws/aws-sdk-php/src/KinesisAnalytics",
124
- "rm -rf vendor/aws/aws-sdk-php/src/KinesisAnalyticsV2",
125
- "rm -rf vendor/aws/aws-sdk-php/src/KinesisVideo",
126
- "rm -rf vendor/aws/aws-sdk-php/src/KinesisVideoArchivedMedia",
127
- "rm -rf vendor/aws/aws-sdk-php/src/KinesisVideoMedia",
128
- "rm -rf vendor/aws/aws-sdk-php/src/KinesisVideoSignalingChannels",
129
- "rm -rf vendor/aws/aws-sdk-php/src/Kms",
130
- "rm -rf vendor/aws/aws-sdk-php/src/LakeFormation",
131
- "rm -rf vendor/aws/aws-sdk-php/src/Lambda",
132
- "rm -rf vendor/aws/aws-sdk-php/src/LexModelBuildingService",
133
- "rm -rf vendor/aws/aws-sdk-php/src/LexRuntimeService",
134
- "rm -rf vendor/aws/aws-sdk-php/src/LicenseManager",
135
- "rm -rf vendor/aws/aws-sdk-php/src/Lightsail",
136
- "rm -rf vendor/aws/aws-sdk-php/src/MQ",
137
- "rm -rf vendor/aws/aws-sdk-php/src/MTurk",
138
- "rm -rf vendor/aws/aws-sdk-php/src/MachineLearning",
139
- "rm -rf vendor/aws/aws-sdk-php/src/Macie",
140
- "rm -rf vendor/aws/aws-sdk-php/src/Macie2",
141
- "rm -rf vendor/aws/aws-sdk-php/src/ManagedBlockchain",
142
- "rm -rf vendor/aws/aws-sdk-php/src/MarketplaceCatalog",
143
- "rm -rf vendor/aws/aws-sdk-php/src/MarketplaceCommerceAnalytics",
144
- "rm -rf vendor/aws/aws-sdk-php/src/MarketplaceEntitlementService",
145
- "rm -rf vendor/aws/aws-sdk-php/src/MarketplaceMetering",
146
- "rm -rf vendor/aws/aws-sdk-php/src/MediaConnect",
147
- "rm -rf vendor/aws/aws-sdk-php/src/MediaConvert",
148
- "rm -rf vendor/aws/aws-sdk-php/src/MediaLive",
149
- "rm -rf vendor/aws/aws-sdk-php/src/MediaPackage",
150
- "rm -rf vendor/aws/aws-sdk-php/src/MediaPackageVod",
151
- "rm -rf vendor/aws/aws-sdk-php/src/MediaStore",
152
- "rm -rf vendor/aws/aws-sdk-php/src/MediaStoreData",
153
- "rm -rf vendor/aws/aws-sdk-php/src/MediaTailor",
154
- "rm -rf vendor/aws/aws-sdk-php/src/MigrationHub",
155
- "rm -rf vendor/aws/aws-sdk-php/src/MigrationHubConfig",
156
- "rm -rf vendor/aws/aws-sdk-php/src/Mobile",
157
- "rm -rf vendor/aws/aws-sdk-php/src/Neptune",
158
- "rm -rf vendor/aws/aws-sdk-php/src/NetworkManager",
159
- "rm -rf vendor/aws/aws-sdk-php/src/OpsWorks",
160
- "rm -rf vendor/aws/aws-sdk-php/src/OpsWorksCM",
161
- "rm -rf vendor/aws/aws-sdk-php/src/Organizations",
162
- "rm -rf vendor/aws/aws-sdk-php/src/Outposts",
163
- "rm -rf vendor/aws/aws-sdk-php/src/PI",
164
- "rm -rf vendor/aws/aws-sdk-php/src/Personalize",
165
- "rm -rf vendor/aws/aws-sdk-php/src/PersonalizeEvents",
166
- "rm -rf vendor/aws/aws-sdk-php/src/PersonalizeRuntime",
167
- "rm -rf vendor/aws/aws-sdk-php/src/Pinpoint",
168
- "rm -rf vendor/aws/aws-sdk-php/src/PinpointEmail",
169
- "rm -rf vendor/aws/aws-sdk-php/src/PinpointSMSVoice",
170
- "rm -rf vendor/aws/aws-sdk-php/src/Polly",
171
- "rm -rf vendor/aws/aws-sdk-php/src/Pricing",
172
- "rm -rf vendor/aws/aws-sdk-php/src/QLDB",
173
- "rm -rf vendor/aws/aws-sdk-php/src/QLDBSession",
174
- "rm -rf vendor/aws/aws-sdk-php/src/QuickSight",
175
- "rm -rf vendor/aws/aws-sdk-php/src/RAM",
176
- "rm -rf vendor/aws/aws-sdk-php/src/RDSDataService",
177
- "rm -rf vendor/aws/aws-sdk-php/src/Rds",
178
- "rm -rf vendor/aws/aws-sdk-php/src/Redshift",
179
- "rm -rf vendor/aws/aws-sdk-php/src/Rekognition",
180
- "rm -rf vendor/aws/aws-sdk-php/src/ResourceGroups",
181
- "rm -rf vendor/aws/aws-sdk-php/src/ResourceGroupsTaggingAPI",
182
- "rm -rf vendor/aws/aws-sdk-php/src/RoboMaker",
183
- "rm -rf vendor/aws/aws-sdk-php/src/Route53",
184
- "rm -rf vendor/aws/aws-sdk-php/src/Route53Domains",
185
- "rm -rf vendor/aws/aws-sdk-php/src/Route53Resolver",
186
- "rm -rf vendor/aws/aws-sdk-php/src/S3Control",
187
- "rm -rf vendor/aws/aws-sdk-php/src/SSO",
188
- "rm -rf vendor/aws/aws-sdk-php/src/SSOOIDC",
189
- "rm -rf vendor/aws/aws-sdk-php/src/SageMaker",
190
- "rm -rf vendor/aws/aws-sdk-php/src/SageMakerRuntime",
191
- "rm -rf vendor/aws/aws-sdk-php/src/SavingsPlans",
192
- "rm -rf vendor/aws/aws-sdk-php/src/Schemas",
193
- "rm -rf vendor/aws/aws-sdk-php/src/SecretsManager",
194
- "rm -rf vendor/aws/aws-sdk-php/src/SecurityHub",
195
- "rm -rf vendor/aws/aws-sdk-php/src/ServerlessApplicationRepository",
196
- "rm -rf vendor/aws/aws-sdk-php/src/ServiceCatalog",
197
- "rm -rf vendor/aws/aws-sdk-php/src/ServiceDiscovery",
198
- "rm -rf vendor/aws/aws-sdk-php/src/ServiceQuotas",
199
- "rm -rf vendor/aws/aws-sdk-php/src/Ses",
200
- "rm -rf vendor/aws/aws-sdk-php/src/SesV2",
201
- "rm -rf vendor/aws/aws-sdk-php/src/Sfn",
202
- "rm -rf vendor/aws/aws-sdk-php/src/Shield",
203
- "rm -rf vendor/aws/aws-sdk-php/src/Sms",
204
- "rm -rf vendor/aws/aws-sdk-php/src/SnowBall",
205
- "rm -rf vendor/aws/aws-sdk-php/src/Sns",
206
- "rm -rf vendor/aws/aws-sdk-php/src/Sqs",
207
- "rm -rf vendor/aws/aws-sdk-php/src/Ssm",
208
- "rm -rf vendor/aws/aws-sdk-php/src/Sts",
209
- "rm -rf vendor/aws/aws-sdk-php/src/Swf",
210
- "rm -rf vendor/aws/aws-sdk-php/src/Synthetics",
211
- "rm -rf vendor/aws/aws-sdk-php/src/Textract",
212
- "rm -rf vendor/aws/aws-sdk-php/src/TranscribeService",
213
- "rm -rf vendor/aws/aws-sdk-php/src/Transfer",
214
- "rm -rf vendor/aws/aws-sdk-php/src/Translate",
215
- "rm -rf vendor/aws/aws-sdk-php/src/WAFV2",
216
- "rm -rf vendor/aws/aws-sdk-php/src/Waf",
217
- "rm -rf vendor/aws/aws-sdk-php/src/WafRegional",
218
- "rm -rf vendor/aws/aws-sdk-php/src/WorkDocs",
219
- "rm -rf vendor/aws/aws-sdk-php/src/WorkLink",
220
- "rm -rf vendor/aws/aws-sdk-php/src/WorkMail",
221
- "rm -rf vendor/aws/aws-sdk-php/src/WorkMailMessageFlow",
222
- "rm -rf vendor/aws/aws-sdk-php/src/XRay",
223
- "rm -rf vendor/aws/aws-sdk-php/src/data/accessanalyzer",
224
- "rm -rf vendor/aws/aws-sdk-php/src/data/acm-pca",
225
- "rm -rf vendor/aws/aws-sdk-php/src/data/acm",
226
- "rm -rf vendor/aws/aws-sdk-php/src/data/alexaforbusiness",
227
- "rm -rf vendor/aws/aws-sdk-php/src/data/amp",
228
- "rm -rf vendor/aws/aws-sdk-php/src/data/amplify",
229
- "rm -rf vendor/aws/aws-sdk-php/src/data/amplifybackend",
230
- "rm -rf vendor/aws/aws-sdk-php/src/data/apigateway",
231
- "rm -rf vendor/aws/aws-sdk-php/src/data/apigatewaymanagementapi",
232
- "rm -rf vendor/aws/aws-sdk-php/src/data/apigatewayv2",
233
- "rm -rf vendor/aws/aws-sdk-php/src/data/appconfig",
234
- "rm -rf vendor/aws/aws-sdk-php/src/data/appintegrations",
235
- "rm -rf vendor/aws/aws-sdk-php/src/data/applicationcostprofiler",
236
- "rm -rf vendor/aws/aws-sdk-php/src/data/apprunner",
237
- "rm -rf vendor/aws/aws-sdk-php/src/data/application-autoscaling",
238
- "rm -rf vendor/aws/aws-sdk-php/src/data/application-insights",
239
- "rm -rf vendor/aws/aws-sdk-php/src/data/appmesh",
240
- "rm -rf vendor/aws/aws-sdk-php/src/data/appstream",
241
- "rm -rf vendor/aws/aws-sdk-php/src/data/appsync",
242
- "rm -rf vendor/aws/aws-sdk-php/src/data/athena",
243
- "rm -rf vendor/aws/aws-sdk-php/src/data/auditmanager",
244
- "rm -rf vendor/aws/aws-sdk-php/src/data/autoscaling-plans",
245
- "rm -rf vendor/aws/aws-sdk-php/src/data/autoscaling",
246
- "rm -rf vendor/aws/aws-sdk-php/src/data/backup",
247
- "rm -rf vendor/aws/aws-sdk-php/src/data/batch",
248
- "rm -rf vendor/aws/aws-sdk-php/src/data/braket",
249
- "rm -rf vendor/aws/aws-sdk-php/src/data/budgets",
250
- "rm -rf vendor/aws/aws-sdk-php/src/data/ce",
251
- "rm -rf vendor/aws/aws-sdk-php/src/data/chime",
252
- "rm -rf vendor/aws/aws-sdk-php/src/data/chime-sdk-identity",
253
- "rm -rf vendor/aws/aws-sdk-php/src/data/chime-sdk-messaging",
254
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloud9",
255
- "rm -rf vendor/aws/aws-sdk-php/src/data/clouddirectory",
256
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloudformation",
257
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloudhsm",
258
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloudhsmv2",
259
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloudsearch",
260
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloudsearchdomain",
261
- "rm -rf vendor/aws/aws-sdk-php/src/data/cloudtrail",
262
- "rm -rf vendor/aws/aws-sdk-php/src/data/codeartifact",
263
- "rm -rf vendor/aws/aws-sdk-php/src/data/codebuild",
264
- "rm -rf vendor/aws/aws-sdk-php/src/data/codecommit",
265
- "rm -rf vendor/aws/aws-sdk-php/src/data/codedeploy",
266
- "rm -rf vendor/aws/aws-sdk-php/src/data/codeguru-reviewer",
267
- "rm -rf vendor/aws/aws-sdk-php/src/data/codeguruprofiler",
268
- "rm -rf vendor/aws/aws-sdk-php/src/data/codepipeline",
269
- "rm -rf vendor/aws/aws-sdk-php/src/data/codestar-connections",
270
- "rm -rf vendor/aws/aws-sdk-php/src/data/codestar-notifications",
271
- "rm -rf vendor/aws/aws-sdk-php/src/data/codestar",
272
- "rm -rf vendor/aws/aws-sdk-php/src/data/cognito-identity",
273
- "rm -rf vendor/aws/aws-sdk-php/src/data/cognito-idp",
274
- "rm -rf vendor/aws/aws-sdk-php/src/data/cognito-sync",
275
- "rm -rf vendor/aws/aws-sdk-php/src/data/comprehend",
276
- "rm -rf vendor/aws/aws-sdk-php/src/data/comprehendmedical",
277
- "rm -rf vendor/aws/aws-sdk-php/src/data/compute-optimizer",
278
- "rm -rf vendor/aws/aws-sdk-php/src/data/connect",
279
- "rm -rf vendor/aws/aws-sdk-php/src/data/connect-contact-lens",
280
- "rm -rf vendor/aws/aws-sdk-php/src/data/connectparticipant",
281
- "rm -rf vendor/aws/aws-sdk-php/src/data/cur",
282
- "rm -rf vendor/aws/aws-sdk-php/src/data/customer-profiles",
283
- "rm -rf vendor/aws/aws-sdk-php/src/data/data.iot",
284
- "rm -rf vendor/aws/aws-sdk-php/src/data/databrew",
285
- "rm -rf vendor/aws/aws-sdk-php/src/data/dataexchange",
286
- "rm -rf vendor/aws/aws-sdk-php/src/data/datapipeline",
287
- "rm -rf vendor/aws/aws-sdk-php/src/data/datasync",
288
- "rm -rf vendor/aws/aws-sdk-php/src/data/dax",
289
- "rm -rf vendor/aws/aws-sdk-php/src/data/detective",
290
- "rm -rf vendor/aws/aws-sdk-php/src/data/devicefarm",
291
- "rm -rf vendor/aws/aws-sdk-php/src/data/devops-guru",
292
- "rm -rf vendor/aws/aws-sdk-php/src/data/directconnect",
293
- "rm -rf vendor/aws/aws-sdk-php/src/data/discovery",
294
- "rm -rf vendor/aws/aws-sdk-php/src/data/dlm",
295
- "rm -rf vendor/aws/aws-sdk-php/src/data/dms",
296
- "rm -rf vendor/aws/aws-sdk-php/src/data/docdb",
297
- "rm -rf vendor/aws/aws-sdk-php/src/data/ds",
298
- "rm -rf vendor/aws/aws-sdk-php/src/data/dynamodb",
299
- "rm -rf vendor/aws/aws-sdk-php/src/data/ebs",
300
- "rm -rf vendor/aws/aws-sdk-php/src/data/ec2-instance-connect",
301
- "rm -rf vendor/aws/aws-sdk-php/src/data/ec2",
302
- "rm -rf vendor/aws/aws-sdk-php/src/data/ecr",
303
- "rm -rf vendor/aws/aws-sdk-php/src/data/ecr-public",
304
- "rm -rf vendor/aws/aws-sdk-php/src/data/ecs",
305
- "rm -rf vendor/aws/aws-sdk-php/src/data/eks",
306
- "rm -rf vendor/aws/aws-sdk-php/src/data/elastic-inference",
307
- "rm -rf vendor/aws/aws-sdk-php/src/data/elasticache",
308
- "rm -rf vendor/aws/aws-sdk-php/src/data/elasticbeanstalk",
309
- "rm -rf vendor/aws/aws-sdk-php/src/data/elasticfilesystem",
310
- "rm -rf vendor/aws/aws-sdk-php/src/data/elasticloadbalancing",
311
- "rm -rf vendor/aws/aws-sdk-php/src/data/elasticloadbalancingv2",
312
- "rm -rf vendor/aws/aws-sdk-php/src/data/elasticmapreduce",
313
- "rm -rf vendor/aws/aws-sdk-php/src/data/elastictranscoder",
314
- "rm -rf vendor/aws/aws-sdk-php/src/data/email",
315
- "rm -rf vendor/aws/aws-sdk-php/src/data/emr-containers",
316
- "rm -rf vendor/aws/aws-sdk-php/src/data/entitlement.marketplace",
317
- "rm -rf vendor/aws/aws-sdk-php/src/data/es",
318
- "rm -rf vendor/aws/aws-sdk-php/src/data/eventbridge",
319
- "rm -rf vendor/aws/aws-sdk-php/src/data/events",
320
- "rm -rf vendor/aws/aws-sdk-php/src/data/finspace",
321
- "rm -rf vendor/aws/aws-sdk-php/src/data/finspace-data",
322
- "rm -rf vendor/aws/aws-sdk-php/src/data/firehose",
323
- "rm -rf vendor/aws/aws-sdk-php/src/data/fis",
324
- "rm -rf vendor/aws/aws-sdk-php/src/data/fms",
325
- "rm -rf vendor/aws/aws-sdk-php/src/data/forecast",
326
- "rm -rf vendor/aws/aws-sdk-php/src/data/forecastquery",
327
- "rm -rf vendor/aws/aws-sdk-php/src/data/frauddetector",
328
- "rm -rf vendor/aws/aws-sdk-php/src/data/fsx",
329
- "rm -rf vendor/aws/aws-sdk-php/src/data/gamelift",
330
- "rm -rf vendor/aws/aws-sdk-php/src/data/glacier",
331
- "rm -rf vendor/aws/aws-sdk-php/src/data/globalaccelerator",
332
- "rm -rf vendor/aws/aws-sdk-php/src/data/glue",
333
- "rm -rf vendor/aws/aws-sdk-php/src/data/greengrass",
334
- "rm -rf vendor/aws/aws-sdk-php/src/data/greengrassv2",
335
- "rm -rf vendor/aws/aws-sdk-php/src/data/groundstation",
336
- "rm -rf vendor/aws/aws-sdk-php/src/data/guardduty",
337
- "rm -rf vendor/aws/aws-sdk-php/src/data/health",
338
- "rm -rf vendor/aws/aws-sdk-php/src/data/healthlake",
339
- "rm -rf vendor/aws/aws-sdk-php/src/data/honeycode",
340
- "rm -rf vendor/aws/aws-sdk-php/src/data/iam",
341
- "rm -rf vendor/aws/aws-sdk-php/src/data/imagebuilder",
342
- "rm -rf vendor/aws/aws-sdk-php/src/data/importexport",
343
- "rm -rf vendor/aws/aws-sdk-php/src/data/inspector",
344
- "rm -rf vendor/aws/aws-sdk-php/src/data/iot-jobs-data",
345
- "rm -rf vendor/aws/aws-sdk-php/src/data/iot",
346
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotdeviceadvisor",
347
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotfleethub",
348
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotwireless",
349
- "rm -rf vendor/aws/aws-sdk-php/src/data/iot1click-devices",
350
- "rm -rf vendor/aws/aws-sdk-php/src/data/iot1click-projects",
351
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotanalytics",
352
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotevents-data",
353
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotevents",
354
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotsecuretunneling",
355
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotsitewise",
356
- "rm -rf vendor/aws/aws-sdk-php/src/data/iotthingsgraph",
357
- "rm -rf vendor/aws/aws-sdk-php/src/data/ivs",
358
- "rm -rf vendor/aws/aws-sdk-php/src/data/kafka",
359
- "rm -rf vendor/aws/aws-sdk-php/src/data/kendra",
360
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesis-video-archived-media",
361
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesis-video-media",
362
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesis-video-signaling",
363
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesis",
364
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesisanalytics",
365
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesisanalyticsv2",
366
- "rm -rf vendor/aws/aws-sdk-php/src/data/kinesisvideo",
367
- "rm -rf vendor/aws/aws-sdk-php/src/data/kms",
368
- "rm -rf vendor/aws/aws-sdk-php/src/data/lakeformation",
369
- "rm -rf vendor/aws/aws-sdk-php/src/data/lambda",
370
- "rm -rf vendor/aws/aws-sdk-php/src/data/lex-models",
371
- "rm -rf vendor/aws/aws-sdk-php/src/data/license-manager",
372
- "rm -rf vendor/aws/aws-sdk-php/src/data/lightsail",
373
- "rm -rf vendor/aws/aws-sdk-php/src/data/location",
374
- "rm -rf vendor/aws/aws-sdk-php/src/data/logs",
375
- "rm -rf vendor/aws/aws-sdk-php/src/data/lookoutequipment",
376
- "rm -rf vendor/aws/aws-sdk-php/src/data/lookoutmetrics",
377
- "rm -rf vendor/aws/aws-sdk-php/src/data/lookoutvision",
378
- "rm -rf vendor/aws/aws-sdk-php/src/data/machinelearning",
379
- "rm -rf vendor/aws/aws-sdk-php/src/data/macie",
380
- "rm -rf vendor/aws/aws-sdk-php/src/data/macie2",
381
- "rm -rf vendor/aws/aws-sdk-php/src/data/managedblockchain",
382
- "rm -rf vendor/aws/aws-sdk-php/src/data/marketplace-catalog",
383
- "rm -rf vendor/aws/aws-sdk-php/src/data/marketplacecommerceanalytics",
384
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediaconnect",
385
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediaconvert",
386
- "rm -rf vendor/aws/aws-sdk-php/src/data/medialive",
387
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediapackage-vod",
388
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediapackage",
389
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediastore-data",
390
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediastore",
391
- "rm -rf vendor/aws/aws-sdk-php/src/data/mediatailor",
392
- "rm -rf vendor/aws/aws-sdk-php/src/data/metering.marketplace",
393
- "rm -rf vendor/aws/aws-sdk-php/src/data/mgh",
394
- "rm -rf vendor/aws/aws-sdk-php/src/data/mgn",
395
- "rm -rf vendor/aws/aws-sdk-php/src/data/migrationhub-config",
396
- "rm -rf vendor/aws/aws-sdk-php/src/data/mobile",
397
- "rm -rf vendor/aws/aws-sdk-php/src/data/models.lex.v2",
398
- "rm -rf vendor/aws/aws-sdk-php/src/data/monitoring",
399
- "rm -rf vendor/aws/aws-sdk-php/src/data/mq",
400
- "rm -rf vendor/aws/aws-sdk-php/src/data/mturk-requester",
401
- "rm -rf vendor/aws/aws-sdk-php/src/data/mwaa",
402
- "rm -rf vendor/aws/aws-sdk-php/src/data/neptune",
403
- "rm -rf vendor/aws/aws-sdk-php/src/data/network-firewall",
404
- "rm -rf vendor/aws/aws-sdk-php/src/data/networkmanager",
405
- "rm -rf vendor/aws/aws-sdk-php/src/data/nimble",
406
- "rm -rf vendor/aws/aws-sdk-php/src/data/opsworks",
407
- "rm -rf vendor/aws/aws-sdk-php/src/data/opsworkscm",
408
- "rm -rf vendor/aws/aws-sdk-php/src/data/organizations",
409
- "rm -rf vendor/aws/aws-sdk-php/src/data/outposts",
410
- "rm -rf vendor/aws/aws-sdk-php/src/data/personalize-events",
411
- "rm -rf vendor/aws/aws-sdk-php/src/data/personalize-runtime",
412
- "rm -rf vendor/aws/aws-sdk-php/src/data/personalize",
413
- "rm -rf vendor/aws/aws-sdk-php/src/data/pi",
414
- "rm -rf vendor/aws/aws-sdk-php/src/data/pinpoint-email",
415
- "rm -rf vendor/aws/aws-sdk-php/src/data/pinpoint",
416
- "rm -rf vendor/aws/aws-sdk-php/src/data/polly",
417
- "rm -rf vendor/aws/aws-sdk-php/src/data/pricing",
418
- "rm -rf vendor/aws/aws-sdk-php/src/data/proton",
419
- "rm -rf vendor/aws/aws-sdk-php/src/data/qldb-session",
420
- "rm -rf vendor/aws/aws-sdk-php/src/data/qldb",
421
- "rm -rf vendor/aws/aws-sdk-php/src/data/quicksight",
422
- "rm -rf vendor/aws/aws-sdk-php/src/data/ram",
423
- "rm -rf vendor/aws/aws-sdk-php/src/data/rds-data",
424
- "rm -rf vendor/aws/aws-sdk-php/src/data/rds",
425
- "rm -rf vendor/aws/aws-sdk-php/src/data/redshift",
426
- "rm -rf vendor/aws/aws-sdk-php/src/data/rekognition",
427
- "rm -rf vendor/aws/aws-sdk-php/src/data/resource-groups",
428
- "rm -rf vendor/aws/aws-sdk-php/src/data/resourcegroupstaggingapi",
429
- "rm -rf vendor/aws/aws-sdk-php/src/data/robomaker",
430
- "rm -rf vendor/aws/aws-sdk-php/src/data/route53",
431
- "rm -rf vendor/aws/aws-sdk-php/src/data/route53-recovery-cluster",
432
- "rm -rf vendor/aws/aws-sdk-php/src/data/route53-recovery-control-config",
433
- "rm -rf vendor/aws/aws-sdk-php/src/data/route53-recovery-readiness",
434
- "rm -rf vendor/aws/aws-sdk-php/src/data/route53domains",
435
- "rm -rf vendor/aws/aws-sdk-php/src/data/route53resolver",
436
- "rm -rf vendor/aws/aws-sdk-php/src/data/runtime.lex",
437
- "rm -rf vendor/aws/aws-sdk-php/src/data/runtime.lex.v2",
438
- "rm -rf vendor/aws/aws-sdk-php/src/data/runtime.sagemaker",
439
- "rm -rf vendor/aws/aws-sdk-php/src/data/s3control",
440
- "rm -rf vendor/aws/aws-sdk-php/src/data/s3outposts",
441
- "rm -rf vendor/aws/aws-sdk-php/src/data/sagemaker-a2i-runtime",
442
- "rm -rf vendor/aws/aws-sdk-php/src/data/sagemaker-edge",
443
- "rm -rf vendor/aws/aws-sdk-php/src/data/sagemaker-featurestore-runtime",
444
- "rm -rf vendor/aws/aws-sdk-php/src/data/sagemaker",
445
- "rm -rf vendor/aws/aws-sdk-php/src/data/savingsplans",
446
- "rm -rf vendor/aws/aws-sdk-php/src/data/schemas",
447
- "rm -rf vendor/aws/aws-sdk-php/src/data/secretsmanager",
448
- "rm -rf vendor/aws/aws-sdk-php/src/data/securityhub",
449
- "rm -rf vendor/aws/aws-sdk-php/src/data/serverlessrepo",
450
- "rm -rf vendor/aws/aws-sdk-php/src/data/service-quotas",
451
- "rm -rf vendor/aws/aws-sdk-php/src/data/servicecatalog",
452
- "rm -rf vendor/aws/aws-sdk-php/src/data/servicecatalog-appregistry",
453
- "rm -rf vendor/aws/aws-sdk-php/src/data/servicediscovery",
454
- "rm -rf vendor/aws/aws-sdk-php/src/data/sesv2",
455
- "rm -rf vendor/aws/aws-sdk-php/src/data/shield",
456
- "rm -rf vendor/aws/aws-sdk-php/src/data/signer",
457
- "rm -rf vendor/aws/aws-sdk-php/src/data/sms-voice",
458
- "rm -rf vendor/aws/aws-sdk-php/src/data/sms",
459
- "rm -rf vendor/aws/aws-sdk-php/src/data/snowball",
460
- "rm -rf vendor/aws/aws-sdk-php/src/data/snow-device-management",
461
- "rm -rf vendor/aws/aws-sdk-php/src/data/sns",
462
- "rm -rf vendor/aws/aws-sdk-php/src/data/sqs",
463
- "rm -rf vendor/aws/aws-sdk-php/src/data/ssm",
464
- "rm -rf vendor/aws/aws-sdk-php/src/data/ssm-contacts",
465
- "rm -rf vendor/aws/aws-sdk-php/src/data/ssm-incidents",
466
- "rm -rf vendor/aws/aws-sdk-php/src/data/sso-oidc",
467
- "rm -rf vendor/aws/aws-sdk-php/src/data/sso",
468
- "rm -rf vendor/aws/aws-sdk-php/src/data/states",
469
- "rm -rf vendor/aws/aws-sdk-php/src/data/storagegateway",
470
- "rm -rf vendor/aws/aws-sdk-php/src/data/streams.dynamodb",
471
- "rm -rf vendor/aws/aws-sdk-php/src/data/sts",
472
- "rm -rf vendor/aws/aws-sdk-php/src/data/support",
473
- "rm -rf vendor/aws/aws-sdk-php/src/data/swf",
474
- "rm -rf vendor/aws/aws-sdk-php/src/data/synthetics",
475
- "rm -rf vendor/aws/aws-sdk-php/src/data/textract",
476
- "rm -rf vendor/aws/aws-sdk-php/src/data/timestream-query",
477
- "rm -rf vendor/aws/aws-sdk-php/src/data/timestream-write",
478
- "rm -rf vendor/aws/aws-sdk-php/src/data/transcribe",
479
- "rm -rf vendor/aws/aws-sdk-php/src/data/transfer",
480
- "rm -rf vendor/aws/aws-sdk-php/src/data/translate",
481
- "rm -rf vendor/aws/aws-sdk-php/src/data/waf-regional",
482
- "rm -rf vendor/aws/aws-sdk-php/src/data/waf",
483
- "rm -rf vendor/aws/aws-sdk-php/src/data/wafv2",
484
- "rm -rf vendor/aws/aws-sdk-php/src/data/workdocs",
485
- "rm -rf vendor/aws/aws-sdk-php/src/data/worklink",
486
- "rm -rf vendor/aws/aws-sdk-php/src/data/workmail",
487
- "rm -rf vendor/aws/aws-sdk-php/src/data/workmailmessageflow",
488
- "rm -rf vendor/aws/aws-sdk-php/src/data/workspaces",
489
- "rm -rf vendor/aws/aws-sdk-php/src/data/xray",
490
- "rm -rf vendor/aws/aws-sdk-php/src/imagebuilder",
491
- "rm -rf vendor/aws/aws-sdk-php/src/kendra",
492
- "rm -rf vendor/aws/aws-sdk-php/src/signer",
493
- "echo Unnecessary AWS files removed!"
494
  ]
495
  }
496
  }
8
  "mockery/mockery": "^1.3.3"
9
  },
10
  "require": {
11
+ "aws/aws-sdk-php": "^3.235"
12
  },
13
  "scripts": {
14
+ "pre-autoload-dump": "Aws\\Script\\Composer\\Composer::removeUnusedServices"
15
+ },
16
+ "extra": {
17
+ "aws/aws-sdk-php": [
18
+ "S3",
19
+ "CloudFront"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ]
21
  }
22
  }
composer.lock CHANGED
@@ -1,10 +1,10 @@
1
  {
2
  "_readme": [
3
  "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "content-hash": "e7c77b375c7b7ba397eddd4a1888e57b",
8
  "packages": [
9
  {
10
  "name": "aws/aws-crt-php",
@@ -50,20 +50,24 @@
50
  "crt",
51
  "sdk"
52
  ],
 
 
 
 
53
  "time": "2021-09-03T22:57:30+00:00"
54
  },
55
  {
56
  "name": "aws/aws-sdk-php",
57
- "version": "3.229.1",
58
  "source": {
59
  "type": "git",
60
  "url": "https://github.com/aws/aws-sdk-php.git",
61
- "reference": "5cffc0b16d1f33029628586313e9cf140f18b06d"
62
  },
63
  "dist": {
64
  "type": "zip",
65
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5cffc0b16d1f33029628586313e9cf140f18b06d",
66
- "reference": "5cffc0b16d1f33029628586313e9cf140f18b06d",
67
  "shasum": ""
68
  },
69
  "require": {
@@ -81,6 +85,7 @@
81
  "andrewsville/php-token-reflection": "^1.4",
82
  "aws/aws-php-sns-message-validator": "~1.0",
83
  "behat/behat": "~3.0",
 
84
  "doctrine/cache": "~1.4",
85
  "ext-dom": "*",
86
  "ext-openssl": "*",
@@ -136,20 +141,25 @@
136
  "s3",
137
  "sdk"
138
  ],
139
- "time": "2022-06-30T18:16:30+00:00"
 
 
 
 
 
140
  },
141
  {
142
  "name": "guzzlehttp/guzzle",
143
- "version": "7.4.5",
144
  "source": {
145
  "type": "git",
146
  "url": "https://github.com/guzzle/guzzle.git",
147
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82"
148
  },
149
  "dist": {
150
  "type": "zip",
151
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
152
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
153
  "shasum": ""
154
  },
155
  "require": {
@@ -164,10 +174,10 @@
164
  "psr/http-client-implementation": "1.0"
165
  },
166
  "require-dev": {
167
- "bamarni/composer-bin-plugin": "^1.4.1",
168
  "ext-curl": "*",
169
  "php-http/client-integration-tests": "^3.0",
170
- "phpunit/phpunit": "^8.5.5 || ^9.3.5",
171
  "psr/log": "^1.1 || ^2.0 || ^3.0"
172
  },
173
  "suggest": {
@@ -177,8 +187,12 @@
177
  },
178
  "type": "library",
179
  "extra": {
 
 
 
 
180
  "branch-alias": {
181
- "dev-master": "7.4-dev"
182
  }
183
  },
184
  "autoload": {
@@ -242,20 +256,38 @@
242
  "rest",
243
  "web service"
244
  ],
245
- "time": "2022-06-20T22:16:13+00:00"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  },
247
  {
248
  "name": "guzzlehttp/promises",
249
- "version": "1.5.1",
250
  "source": {
251
  "type": "git",
252
  "url": "https://github.com/guzzle/promises.git",
253
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
254
  },
255
  "dist": {
256
  "type": "zip",
257
- "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
258
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
259
  "shasum": ""
260
  },
261
  "require": {
@@ -308,20 +340,38 @@
308
  "keywords": [
309
  "promise"
310
  ],
311
- "time": "2021-10-22T20:56:57+00:00"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  },
313
  {
314
  "name": "guzzlehttp/psr7",
315
- "version": "2.4.0",
316
  "source": {
317
  "type": "git",
318
  "url": "https://github.com/guzzle/psr7.git",
319
- "reference": "13388f00956b1503577598873fffb5ae994b5737"
320
  },
321
  "dist": {
322
  "type": "zip",
323
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737",
324
- "reference": "13388f00956b1503577598873fffb5ae994b5737",
325
  "shasum": ""
326
  },
327
  "require": {
@@ -335,15 +385,19 @@
335
  "psr/http-message-implementation": "1.0"
336
  },
337
  "require-dev": {
338
- "bamarni/composer-bin-plugin": "^1.4.1",
339
  "http-interop/http-factory-tests": "^0.9",
340
- "phpunit/phpunit": "^8.5.8 || ^9.3.10"
341
  },
342
  "suggest": {
343
  "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
344
  },
345
  "type": "library",
346
  "extra": {
 
 
 
 
347
  "branch-alias": {
348
  "dev-master": "2.4-dev"
349
  }
@@ -405,7 +459,25 @@
405
  "uri",
406
  "url"
407
  ],
408
- "time": "2022-06-20T21:43:11+00:00"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  },
410
  {
411
  "name": "mtdowling/jmespath.php",
@@ -462,6 +534,10 @@
462
  "json",
463
  "jsonpath"
464
  ],
 
 
 
 
465
  "time": "2021-06-14T00:11:39+00:00"
466
  },
467
  {
@@ -511,6 +587,9 @@
511
  "psr",
512
  "psr-18"
513
  ],
 
 
 
514
  "time": "2020-06-29T06:28:15+00:00"
515
  },
516
  {
@@ -563,6 +642,9 @@
563
  "request",
564
  "response"
565
  ],
 
 
 
566
  "time": "2019-04-30T12:38:16+00:00"
567
  },
568
  {
@@ -613,6 +695,9 @@
613
  "request",
614
  "response"
615
  ],
 
 
 
616
  "time": "2016-08-06T14:39:51+00:00"
617
  },
618
  {
@@ -653,6 +738,10 @@
653
  }
654
  ],
655
  "description": "A polyfill for getallheaders.",
 
 
 
 
656
  "time": "2019-03-08T08:55:37+00:00"
657
  },
658
  {
@@ -703,6 +792,23 @@
703
  ],
704
  "description": "A generic function and convention to trigger deprecation notices",
705
  "homepage": "https://symfony.com",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  "time": "2022-01-02T09:53:40+00:00"
707
  },
708
  {
@@ -769,6 +875,23 @@
769
  "portable",
770
  "shim"
771
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  "time": "2022-05-24T11:49:31+00:00"
773
  }
774
  ],
@@ -818,20 +941,24 @@
818
  "keywords": [
819
  "test"
820
  ],
 
 
 
 
821
  "time": "2020-07-09T08:09:16+00:00"
822
  },
823
  {
824
  "name": "mockery/mockery",
825
- "version": "1.3.5",
826
  "source": {
827
  "type": "git",
828
  "url": "https://github.com/mockery/mockery.git",
829
- "reference": "472fa8ca4e55483d55ee1e73c963718c4393791d"
830
  },
831
  "dist": {
832
  "type": "zip",
833
- "url": "https://api.github.com/repos/mockery/mockery/zipball/472fa8ca4e55483d55ee1e73c963718c4393791d",
834
- "reference": "472fa8ca4e55483d55ee1e73c963718c4393791d",
835
  "shasum": ""
836
  },
837
  "require": {
@@ -883,7 +1010,11 @@
883
  "test double",
884
  "testing"
885
  ],
886
- "time": "2021-09-13T15:33:03+00:00"
 
 
 
 
887
  }
888
  ],
889
  "aliases": [],
@@ -895,5 +1026,6 @@
895
  "platform-dev": [],
896
  "platform-overrides": {
897
  "php": "7.2.5"
898
- }
 
899
  }
1
  {
2
  "_readme": [
3
  "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
+ "content-hash": "b3f82a1255e39ac3fef44bdb34c167a5",
8
  "packages": [
9
  {
10
  "name": "aws/aws-crt-php",
50
  "crt",
51
  "sdk"
52
  ],
53
+ "support": {
54
+ "issues": "https://github.com/awslabs/aws-crt-php/issues",
55
+ "source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.2"
56
+ },
57
  "time": "2021-09-03T22:57:30+00:00"
58
  },
59
  {
60
  "name": "aws/aws-sdk-php",
61
+ "version": "3.235.4",
62
  "source": {
63
  "type": "git",
64
  "url": "https://github.com/aws/aws-sdk-php.git",
65
+ "reference": "4adc3ba34f1666c13a2a35894e225bd47e8af7c4"
66
  },
67
  "dist": {
68
  "type": "zip",
69
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4adc3ba34f1666c13a2a35894e225bd47e8af7c4",
70
+ "reference": "4adc3ba34f1666c13a2a35894e225bd47e8af7c4",
71
  "shasum": ""
72
  },
73
  "require": {
85
  "andrewsville/php-token-reflection": "^1.4",
86
  "aws/aws-php-sns-message-validator": "~1.0",
87
  "behat/behat": "~3.0",
88
+ "composer/composer": "^1.10.22",
89
  "doctrine/cache": "~1.4",
90
  "ext-dom": "*",
91
  "ext-openssl": "*",
141
  "s3",
142
  "sdk"
143
  ],
144
+ "support": {
145
+ "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
146
+ "issues": "https://github.com/aws/aws-sdk-php/issues",
147
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.235.4"
148
+ },
149
+ "time": "2022-09-08T18:49:27+00:00"
150
  },
151
  {
152
  "name": "guzzlehttp/guzzle",
153
+ "version": "7.5.0",
154
  "source": {
155
  "type": "git",
156
  "url": "https://github.com/guzzle/guzzle.git",
157
+ "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba"
158
  },
159
  "dist": {
160
  "type": "zip",
161
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba",
162
+ "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba",
163
  "shasum": ""
164
  },
165
  "require": {
174
  "psr/http-client-implementation": "1.0"
175
  },
176
  "require-dev": {
177
+ "bamarni/composer-bin-plugin": "^1.8.1",
178
  "ext-curl": "*",
179
  "php-http/client-integration-tests": "^3.0",
180
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23",
181
  "psr/log": "^1.1 || ^2.0 || ^3.0"
182
  },
183
  "suggest": {
187
  },
188
  "type": "library",
189
  "extra": {
190
+ "bamarni-bin": {
191
+ "bin-links": true,
192
+ "forward-command": false
193
+ },
194
  "branch-alias": {
195
+ "dev-master": "7.5-dev"
196
  }
197
  },
198
  "autoload": {
256
  "rest",
257
  "web service"
258
  ],
259
+ "support": {
260
+ "issues": "https://github.com/guzzle/guzzle/issues",
261
+ "source": "https://github.com/guzzle/guzzle/tree/7.5.0"
262
+ },
263
+ "funding": [
264
+ {
265
+ "url": "https://github.com/GrahamCampbell",
266
+ "type": "github"
267
+ },
268
+ {
269
+ "url": "https://github.com/Nyholm",
270
+ "type": "github"
271
+ },
272
+ {
273
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
274
+ "type": "tidelift"
275
+ }
276
+ ],
277
+ "time": "2022-08-28T15:39:27+00:00"
278
  },
279
  {
280
  "name": "guzzlehttp/promises",
281
+ "version": "1.5.2",
282
  "source": {
283
  "type": "git",
284
  "url": "https://github.com/guzzle/promises.git",
285
+ "reference": "b94b2807d85443f9719887892882d0329d1e2598"
286
  },
287
  "dist": {
288
  "type": "zip",
289
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598",
290
+ "reference": "b94b2807d85443f9719887892882d0329d1e2598",
291
  "shasum": ""
292
  },
293
  "require": {
340
  "keywords": [
341
  "promise"
342
  ],
343
+ "support": {
344
+ "issues": "https://github.com/guzzle/promises/issues",
345
+ "source": "https://github.com/guzzle/promises/tree/1.5.2"
346
+ },
347
+ "funding": [
348
+ {
349
+ "url": "https://github.com/GrahamCampbell",
350
+ "type": "github"
351
+ },
352
+ {
353
+ "url": "https://github.com/Nyholm",
354
+ "type": "github"
355
+ },
356
+ {
357
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
358
+ "type": "tidelift"
359
+ }
360
+ ],
361
+ "time": "2022-08-28T14:55:35+00:00"
362
  },
363
  {
364
  "name": "guzzlehttp/psr7",
365
+ "version": "2.4.1",
366
  "source": {
367
  "type": "git",
368
  "url": "https://github.com/guzzle/psr7.git",
369
+ "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379"
370
  },
371
  "dist": {
372
  "type": "zip",
373
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379",
374
+ "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379",
375
  "shasum": ""
376
  },
377
  "require": {
385
  "psr/http-message-implementation": "1.0"
386
  },
387
  "require-dev": {
388
+ "bamarni/composer-bin-plugin": "^1.8.1",
389
  "http-interop/http-factory-tests": "^0.9",
390
+ "phpunit/phpunit": "^8.5.29 || ^9.5.23"
391
  },
392
  "suggest": {
393
  "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
394
  },
395
  "type": "library",
396
  "extra": {
397
+ "bamarni-bin": {
398
+ "bin-links": true,
399
+ "forward-command": false
400
+ },
401
  "branch-alias": {
402
  "dev-master": "2.4-dev"
403
  }
459
  "uri",
460
  "url"
461
  ],
462
+ "support": {
463
+ "issues": "https://github.com/guzzle/psr7/issues",
464
+ "source": "https://github.com/guzzle/psr7/tree/2.4.1"
465
+ },
466
+ "funding": [
467
+ {
468
+ "url": "https://github.com/GrahamCampbell",
469
+ "type": "github"
470
+ },
471
+ {
472
+ "url": "https://github.com/Nyholm",
473
+ "type": "github"
474
+ },
475
+ {
476
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
477
+ "type": "tidelift"
478
+ }
479
+ ],
480
+ "time": "2022-08-28T14:45:39+00:00"
481
  },
482
  {
483
  "name": "mtdowling/jmespath.php",
534
  "json",
535
  "jsonpath"
536
  ],
537
+ "support": {
538
+ "issues": "https://github.com/jmespath/jmespath.php/issues",
539
+ "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1"
540
+ },
541
  "time": "2021-06-14T00:11:39+00:00"
542
  },
543
  {
587
  "psr",
588
  "psr-18"
589
  ],
590
+ "support": {
591
+ "source": "https://github.com/php-fig/http-client/tree/master"
592
+ },
593
  "time": "2020-06-29T06:28:15+00:00"
594
  },
595
  {
642
  "request",
643
  "response"
644
  ],
645
+ "support": {
646
+ "source": "https://github.com/php-fig/http-factory/tree/master"
647
+ },
648
  "time": "2019-04-30T12:38:16+00:00"
649
  },
650
  {
695
  "request",
696
  "response"
697
  ],
698
+ "support": {
699
+ "source": "https://github.com/php-fig/http-message/tree/master"
700
+ },
701
  "time": "2016-08-06T14:39:51+00:00"
702
  },
703
  {
738
  }
739
  ],
740
  "description": "A polyfill for getallheaders.",
741
+ "support": {
742
+ "issues": "https://github.com/ralouphie/getallheaders/issues",
743
+ "source": "https://github.com/ralouphie/getallheaders/tree/develop"
744
+ },
745
  "time": "2019-03-08T08:55:37+00:00"
746
  },
747
  {
792
  ],
793
  "description": "A generic function and convention to trigger deprecation notices",
794
  "homepage": "https://symfony.com",
795
+ "support": {
796
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
797
+ },
798
+ "funding": [
799
+ {
800
+ "url": "https://symfony.com/sponsor",
801
+ "type": "custom"
802
+ },
803
+ {
804
+ "url": "https://github.com/fabpot",
805
+ "type": "github"
806
+ },
807
+ {
808
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
809
+ "type": "tidelift"
810
+ }
811
+ ],
812
  "time": "2022-01-02T09:53:40+00:00"
813
  },
814
  {
875
  "portable",
876
  "shim"
877
  ],
878
+ "support": {
879
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
880
+ },
881
+ "funding": [
882
+ {
883
+ "url": "https://symfony.com/sponsor",
884
+ "type": "custom"
885
+ },
886
+ {
887
+ "url": "https://github.com/fabpot",
888
+ "type": "github"
889
+ },
890
+ {
891
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
892
+ "type": "tidelift"
893
+ }
894
+ ],
895
  "time": "2022-05-24T11:49:31+00:00"
896
  }
897
  ],
941
  "keywords": [
942
  "test"
943
  ],
944
+ "support": {
945
+ "issues": "https://github.com/hamcrest/hamcrest-php/issues",
946
+ "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1"
947
+ },
948
  "time": "2020-07-09T08:09:16+00:00"
949
  },
950
  {
951
  "name": "mockery/mockery",
952
+ "version": "1.3.6",
953
  "source": {
954
  "type": "git",
955
  "url": "https://github.com/mockery/mockery.git",
956
+ "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0"
957
  },
958
  "dist": {
959
  "type": "zip",
960
+ "url": "https://api.github.com/repos/mockery/mockery/zipball/dc206df4fa314a50bbb81cf72239a305c5bbd5c0",
961
+ "reference": "dc206df4fa314a50bbb81cf72239a305c5bbd5c0",
962
  "shasum": ""
963
  },
964
  "require": {
1010
  "test double",
1011
  "testing"
1012
  ],
1013
+ "support": {
1014
+ "issues": "https://github.com/mockery/mockery/issues",
1015
+ "source": "https://github.com/mockery/mockery/tree/1.3.6"
1016
+ },
1017
+ "time": "2022-09-07T15:05:49+00:00"
1018
  }
1019
  ],
1020
  "aliases": [],
1026
  "platform-dev": [],
1027
  "platform-overrides": {
1028
  "php": "7.2.5"
1029
+ },
1030
+ "plugin-api-version": "2.1.0"
1031
  }
controller/editor.php CHANGED
@@ -232,16 +232,13 @@ function fv_wp_flowplayer_featured_image($post_id) {
232
 
233
  $post = get_post($post_id);
234
 
235
- // We only allow each player to set the Featured Image once, so that user can still removed it
236
- $featured_image_players = get_post_meta($post_id, '_fv_player_featured_image_players', true);
237
- if( !is_array($featured_image_players) ) {
238
- $featured_image_players = array();
239
- }
240
 
241
- // Same as above, only this time it's for the legacy [fvplayer src="..." splash="..."] shortcodes
242
- $featured_image_splash_urls = get_post_meta($post_id, '_fv_player_featured_image_splash_urls', true);
243
- if( !is_array($featured_image_splash_urls) ) {
244
- $featured_image_splash_urls = array();
245
  }
246
 
247
  $thumbnail_id = false;
@@ -267,12 +264,8 @@ function fv_wp_flowplayer_featured_image($post_id) {
267
 
268
  if( preg_match_all('/(?:splash=\\\?")([^"]*.(?:jpg|gif|png))/', $search_context, $splash_images) ) { // parse splash="..." in post content
269
  foreach($splash_images[1] as $src ) {
270
- if(!in_array($src, $featured_image_splash_urls)) { // check if we already set this splash once
271
  $url = $src;
272
- $featured_image_splash_urls[] = $url;
273
-
274
- update_post_meta($post_id, '_fv_player_featured_image_splash_urls', $featured_image_splash_urls);
275
-
276
  break;
277
  }
278
  }
@@ -282,12 +275,6 @@ function fv_wp_flowplayer_featured_image($post_id) {
282
  global $FV_Player_Db;
283
 
284
  foreach( $ids[1] as $player_id ) {
285
-
286
- // Did this player already set the Featured Image? If so, do not set it again
287
- if( in_array($player_id, $featured_image_players) ) {
288
- continue;
289
- }
290
-
291
  $atts = $FV_Player_Db->getPlayerAttsFromDb( array( 'id' => $player_id ) );
292
 
293
  if( !empty($atts['caption']) ) {
@@ -303,9 +290,6 @@ function fv_wp_flowplayer_featured_image($post_id) {
303
 
304
  // If we found splash attachmend ID or URL remember that this player has set the Featured Image
305
  if($splash_attachment_id || $url) {
306
- $featured_image_players[] = $player_id;
307
- update_post_meta($post_id, '_fv_player_featured_image_players', $featured_image_players);
308
-
309
  break;
310
  }
311
  }
@@ -338,6 +322,7 @@ function fv_wp_flowplayer_featured_image($post_id) {
338
  }
339
 
340
  if( $thumbnail_id ) { // set post thumbnail if we have thumbnail id
 
341
  set_post_thumbnail( $post_id, $thumbnail_id );
342
  }
343
  }
232
 
233
  $post = get_post($post_id);
234
 
235
+ // Delete old meta
236
+ delete_post_meta($post_id, '_fv_player_featured_image_players');
237
+ delete_post_meta($post_id, '_fv_player_featured_image_splash_urls');
 
 
238
 
239
+ // We allow featured image to be set only once for each post
240
+ if( get_post_meta($post_id, '_fv_player_featured_image_set', true) ) {
241
+ return;
 
242
  }
243
 
244
  $thumbnail_id = false;
264
 
265
  if( preg_match_all('/(?:splash=\\\?")([^"]*.(?:jpg|gif|png))/', $search_context, $splash_images) ) { // parse splash="..." in post content
266
  foreach($splash_images[1] as $src ) {
267
+ if( !empty($src) ) {
268
  $url = $src;
 
 
 
 
269
  break;
270
  }
271
  }
275
  global $FV_Player_Db;
276
 
277
  foreach( $ids[1] as $player_id ) {
 
 
 
 
 
 
278
  $atts = $FV_Player_Db->getPlayerAttsFromDb( array( 'id' => $player_id ) );
279
 
280
  if( !empty($atts['caption']) ) {
290
 
291
  // If we found splash attachmend ID or URL remember that this player has set the Featured Image
292
  if($splash_attachment_id || $url) {
 
 
 
293
  break;
294
  }
295
  }
322
  }
323
 
324
  if( $thumbnail_id ) { // set post thumbnail if we have thumbnail id
325
+ update_post_meta($post_id, '_fv_player_featured_image_set', $thumbnail_id);
326
  set_post_thumbnail( $post_id, $thumbnail_id );
327
  }
328
  }
controller/frontend.php CHANGED
@@ -109,6 +109,8 @@ function fv_flowplayer_get_js_translations() {
109
  'audio_button' => __('AUD', 'fv-wordpress-flowplayer'),
110
  'audio_menu' => __('Audio', 'fv-wordpress-flowplayer'),
111
  'iphone_swipe_up_location_bar' => __('To enjoy fullscreen swipe up to hide location bar.', 'fv-wordpress-flowplayer'),
 
 
112
  );
113
 
114
  return $aStrings;
@@ -413,6 +415,7 @@ function flowplayer_prepare_scripts() {
413
  if( $val = $fv_fp->_get_option('mobile_native_fullscreen') ) $aConf['mobile_native_fullscreen'] = $val;
414
  if( $val = $fv_fp->_get_option('mobile_force_fullscreen') ) $aConf['mobile_force_fullscreen'] = $val;
415
  if( $val = $fv_fp->_get_option('mobile_alternative_fullscreen') ) $aConf['mobile_alternative_fullscreen'] = $val;
 
416
 
417
  if ( $fv_fp->_get_option('video_position_save_enable') ) {
418
  $aConf['video_position_save_enable'] = $fv_fp->_get_option('video_position_save_enable');
@@ -432,16 +435,24 @@ function flowplayer_prepare_scripts() {
432
  }
433
 
434
  if( $fv_fp->should_force_load_js() || $fv_fp->load_hlsjs ) {
435
- wp_enqueue_script( 'flowplayer-hlsjs', flowplayer::get_plugin_url().'/flowplayer/hls.min.js', array('flowplayer'), '1.1.3', true );
436
  }
437
- $aConf['script_hls_js'] = flowplayer::get_plugin_url().'/flowplayer/hls.min.js?ver=1.1.3';
438
 
439
  if( $fv_fp->should_force_load_js() || $fv_fp->load_dash ) {
440
  wp_enqueue_script( 'flowplayer-dash', flowplayer::get_plugin_url().'/flowplayer/flowplayer.dashjs.min.js', array('flowplayer'), $fv_wp_flowplayer_ver, true );
441
  }
442
  $aConf['script_dash_js'] = flowplayer::get_plugin_url().'/flowplayer/flowplayer.dashjs.min.js?ver='.$fv_wp_flowplayer_ver;
443
  $aConf['script_dash_js_version'] = '2.7';
444
-
 
 
 
 
 
 
 
 
445
  if( $fv_fp->_get_option('googleanalytics') ) {
446
  $aConf['fvanalytics'] = $fv_fp->_get_option('googleanalytics');
447
  }
@@ -759,7 +770,7 @@ function fv_player_js_loader_load() {
759
  require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';
760
  $filesystem = new WP_Filesystem_Direct( new StdClass() );
761
 
762
- $js = $filesystem->get_contents( dirname(__FILE__).'/../flowplayer/fv-player-loader.babel.js' );
763
 
764
  // remove /* comments */
765
  $js = preg_replace( '~/\*[\s\S]*?\*/~m', '', $js );
@@ -831,4 +842,21 @@ function fv_player_wp_rocket_used_css( $safelist ) {
831
  $safelist[] = '/wp-content/plugins/fv-wordpress-flowplayer*';
832
  $safelist[] = '/wp-content/plugins/fv-player-*';
833
  return $safelist;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
  }
109
  'audio_button' => __('AUD', 'fv-wordpress-flowplayer'),
110
  'audio_menu' => __('Audio', 'fv-wordpress-flowplayer'),
111
  'iphone_swipe_up_location_bar' => __('To enjoy fullscreen swipe up to hide location bar.', 'fv-wordpress-flowplayer'),
112
+ 'invalid_youtube' => __('Invalid Youtube video ID.', 'fv-player-pro'),
113
+ 'video_loaded' => __('Video loaded, click to play.', 'fv-player-pro'),
114
  );
115
 
116
  return $aStrings;
415
  if( $val = $fv_fp->_get_option('mobile_native_fullscreen') ) $aConf['mobile_native_fullscreen'] = $val;
416
  if( $val = $fv_fp->_get_option('mobile_force_fullscreen') ) $aConf['mobile_force_fullscreen'] = $val;
417
  if( $val = $fv_fp->_get_option('mobile_alternative_fullscreen') ) $aConf['mobile_alternative_fullscreen'] = $val;
418
+ $aConf['mobile_landscape_fullscreen'] = true;
419
 
420
  if ( $fv_fp->_get_option('video_position_save_enable') ) {
421
  $aConf['video_position_save_enable'] = $fv_fp->_get_option('video_position_save_enable');
435
  }
436
 
437
  if( $fv_fp->should_force_load_js() || $fv_fp->load_hlsjs ) {
438
+ wp_enqueue_script( 'flowplayer-hlsjs', flowplayer::get_plugin_url().'/flowplayer/hls.min.js', array('flowplayer'), '1.2.3', true );
439
  }
440
+ $aConf['script_hls_js'] = flowplayer::get_plugin_url().'/flowplayer/hls.min.js?ver=1.2.3';
441
 
442
  if( $fv_fp->should_force_load_js() || $fv_fp->load_dash ) {
443
  wp_enqueue_script( 'flowplayer-dash', flowplayer::get_plugin_url().'/flowplayer/flowplayer.dashjs.min.js', array('flowplayer'), $fv_wp_flowplayer_ver, true );
444
  }
445
  $aConf['script_dash_js'] = flowplayer::get_plugin_url().'/flowplayer/flowplayer.dashjs.min.js?ver='.$fv_wp_flowplayer_ver;
446
  $aConf['script_dash_js_version'] = '2.7';
447
+
448
+ if( $fv_fp->should_force_load_js() || FV_Player_YouTube()->bYoutube || did_action('fv_player_extensions_admin_load_assets') ) {
449
+ $youtube_js = 'fv-player-youtube.min.js';
450
+
451
+ if( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) $youtube_js = 'fv-player-youtube.dev.js';
452
+
453
+ wp_enqueue_script( 'fv-player-youtube', flowplayer::get_plugin_url().'/flowplayer/' . $youtube_js , array('flowplayer'), $fv_wp_flowplayer_ver, true );
454
+ }
455
+
456
  if( $fv_fp->_get_option('googleanalytics') ) {
457
  $aConf['fvanalytics'] = $fv_fp->_get_option('googleanalytics');
458
  }
770
  require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';
771
  $filesystem = new WP_Filesystem_Direct( new StdClass() );
772
 
773
+ $js = $filesystem->get_contents( dirname(__FILE__).'/../flowplayer/fv-player-loader.min.js' );
774
 
775
  // remove /* comments */
776
  $js = preg_replace( '~/\*[\s\S]*?\*/~m', '', $js );
842
  $safelist[] = '/wp-content/plugins/fv-wordpress-flowplayer*';
843
  $safelist[] = '/wp-content/plugins/fv-player-*';
844
  return $safelist;
845
+ }
846
+
847
+
848
+ /*
849
+ * SiteGround Security "Lock and Protect System Folders" exclusion
850
+ *
851
+ * The plugins normally blocks direct PHP calls in wp-content folder, we allow track.php requests for FV Player tracking this way
852
+ * Unfortunately it uses simple rule like <Files track.php> so we cannot include the folder name.
853
+ */
854
+ add_filter( 'sgs_whitelist_wp_content' , 'fv_player_sgs_whitelist_wp_content' );
855
+
856
+ function fv_player_sgs_whitelist_wp_content( $exclusions ) {
857
+ global $fv_fp;
858
+ if( $fv_fp->_get_option('video_stats_enable') ) {
859
+ $exclusions[] = 'track.php';
860
+ }
861
+ return $exclusions;
862
  }
css/admin.css CHANGED
@@ -4,7 +4,8 @@
4
  #content .flowplayer.is-mouseover.is-ready:not(.is-audio) .fv-player-video-checker small,
5
  .flowplayer.is-mouseover.is-ready:not(.is-audio) .fv-player-video-checker small,
6
  #content .flowplayer.is-ready.is-paused:not(.is-audio) .fv-player-video-checker small,
7
- .flowplayer.is-ready.is-paused:not(.is-audio) .fv-player-video-checker small { top: 3em }
 
8
  #content .flowplayer .fv-player-video-checker.is-open small,
9
  .flowplayer .fv-player-video-checker.is-open small,
10
  #content .flowplayer.has-video-checker .fv-player-video-checker.is-open small,
4
  #content .flowplayer.is-mouseover.is-ready:not(.is-audio) .fv-player-video-checker small,
5
  .flowplayer.is-mouseover.is-ready:not(.is-audio) .fv-player-video-checker small,
6
  #content .flowplayer.is-ready.is-paused:not(.is-audio) .fv-player-video-checker small,
7
+ .flowplayer.is-ready.is-paused:not(.is-audio) .fv-player-video-checker small,
8
+ .flowplayer.is-error:not(.is-audio) .fv-player-video-checker small { top: 3em }
9
  #content .flowplayer .fv-player-video-checker.is-open small,
10
  .flowplayer .fv-player-video-checker.is-open small,
11
  #content .flowplayer.has-video-checker .fv-player-video-checker.is-open small,
css/flowplayer.css CHANGED
@@ -350,7 +350,7 @@
350
  zoom: 1 !important;
351
  width: 100%;
352
  display: inline-block; }
353
- .flowplayer .fp-hidden {
354
  display: none; }
355
  .flowplayer .fp-shown {
356
  display: block !important; }
@@ -1107,7 +1107,7 @@
1107
  .flowplayer.is-small .fp-captions p{font-size:14px !important;line-height:20px !important}
1108
 
1109
  .flowplayer.is-tiny .fp-captions{line-height:12px !important; bottom: .2em}
1110
- .flowplayer.is-tiny.is-mouseover .fp-captions, .flowplayer.is-tiny.is-paused .fp-captions {bottom: 3em}
1111
  .flowplayer.is-tiny .fp-captions p{font-size:11px !important;line-height:18px !important;-webkit-text-shadow:0 0 2px #666;-moz-text-shadow:0 0 2px #666;text-shadow:0 0 2px #666}
1112
  /* Fullscreen captions on large screens */
1113
  @media (min-width: 64.063em) {
@@ -1168,6 +1168,9 @@
1168
  /*this might be needed some day: .flowplayer .fp-waiting em { opacity: 1 !important; } */
1169
  .flowplayer.is-fullscreen .fp-player{background-color:#000}
1170
 
 
 
 
1171
 
1172
  /* error icon */
1173
  .is-error.flowplayer .fp-player:before {
@@ -2372,3 +2375,34 @@ body.fv_flowplayer_tabs_hide .fv_flowplayer_tabs_content > div.fv_flowplayer_tab
2372
  width: 100%;
2373
  max-width: 100%;
2374
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  zoom: 1 !important;
351
  width: 100%;
352
  display: inline-block; }
353
+ .flowplayer .fp-hidden, .flowplayer strong.fp-hidden {
354
  display: none; }
355
  .flowplayer .fp-shown {
356
  display: block !important; }
1107
  .flowplayer.is-small .fp-captions p{font-size:14px !important;line-height:20px !important}
1108
 
1109
  .flowplayer.is-tiny .fp-captions{line-height:12px !important; bottom: .2em}
1110
+ .flowplayer.is-tiny.is-mouseover .fp-captions, .flowplayer.is-tiny.is-paused .fp-captions {bottom: 4em}
1111
  .flowplayer.is-tiny .fp-captions p{font-size:11px !important;line-height:18px !important;-webkit-text-shadow:0 0 2px #666;-moz-text-shadow:0 0 2px #666;text-shadow:0 0 2px #666}
1112
  /* Fullscreen captions on large screens */
1113
  @media (min-width: 64.063em) {
1168
  /*this might be needed some day: .flowplayer .fp-waiting em { opacity: 1 !important; } */
1169
  .flowplayer.is-fullscreen .fp-player{background-color:#000}
1170
 
1171
+ .flowplayer.is-fullscreen .fp-controls {
1172
+ bottom: env(safe-area-inset-bottom)
1173
+ }
1174
 
1175
  /* error icon */
1176
  .is-error.flowplayer .fp-player:before {
2375
  width: 100%;
2376
  max-width: 100%;
2377
  }
2378
+
2379
+ .flowplayer.is-youtube {
2380
+ background-size: cover;
2381
+ }
2382
+ .flowplayer.is-youtube .fp-chromecast{
2383
+ display: none;
2384
+ }
2385
+ .flowplayer.is-youtube .fp-splash,
2386
+ .flowplayer.is-youtube .fp-player .fp-splash { /* for mobile loading */
2387
+ object-fit: cover;
2388
+ }
2389
+ .flowplayer.is-loading.is-youtube .fp-ui, .flowplayer.is-ready.is-youtube .fp-ui {
2390
+ pointer-events: none;
2391
+ }
2392
+ .flowplayer.is-touch.is-ready.is-youtube .fp-ui {
2393
+ pointer-events: auto;
2394
+ }
2395
+ /* todo: this needs to be disabled for mobile */
2396
+ .flowplayer.is-youtube .fp-pause {
2397
+ display: none;
2398
+ }
2399
+ .flowplayer.is-loading.is-youtube .fp-ui div, .flowplayer.is-loading.is-youtube .fp-ui a, .flowplayer.is-ready.is-youtube .fp-ui div, .flowplayer.is-ready.is-youtube .fp-ui a {
2400
+ pointer-events: auto;
2401
+ }
2402
+ .flowplayer.is-ready.is-youtube.is-cva .fp-ui {
2403
+ pointer-events: auto;
2404
+ }
2405
+ iframe#youtube.fp-engine {
2406
+ height: 100%;
2407
+ width: 100%;
2408
+ }
css/img/no-play-white.svg CHANGED
@@ -1,3 +1,3 @@
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 640 640" width="128" height="128"><defs><path d="M619.54 319.18C619.54 484.05 485.69 617.91 320.82 617.91C155.95 617.91 22.09 484.05 22.09 319.18C22.09 154.31 155.95 20.46 320.82 20.46C485.69 20.46 619.54 154.31 619.54 319.18Z" id="a1kyPCZmWY"></path><path d="M90.2 520.29L520.29 90.2L550.62 120.53L120.53 550.62L90.2 520.29Z" id="a1eG6Iy9mS"></path></defs><g><g><g><use xlink:href="#a1kyPCZmWY" opacity="1" fill="#1e89ad" fill-opacity="0"></use><g><use xlink:href="#a1kyPCZmWY" opacity="1" fill-opacity="0" stroke="#ffffff" stroke-width="36" stroke-opacity="1"></use></g></g><g><use xlink:href="#a1eG6Iy9mS" opacity="1" fill="#ffffff" fill-opacity="0.99"></use></g></g></g></svg>
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 640 640" width="128" height="128"><defs><path d="M619.54 319.18C619.54 484.05 485.69 617.91 320.82 617.91C155.95 617.91 22.09 484.05 22.09 319.18C22.09 154.31 155.95 20.46 320.82 20.46C485.69 20.46 619.54 154.31 619.54 319.18Z" id="a1kyPCZmWY"></path><path d="M90.2 520.29L520.29 90.2L550.62 120.53L120.53 550.62L90.2 520.29Z" id="a1eG6Iy9mS"></path></defs><g><g><g><use xlink:href="#a1kyPCZmWY" opacity="1" fill="#1e89ad" fill-opacity="0"></use><g><use xlink:href="#a1kyPCZmWY" opacity="1" fill-opacity="0" stroke="#ffffff" stroke-width="36" stroke-opacity="1"></use></g></g><g><use xlink:href="#a1eG6Iy9mS" opacity="1" fill="#ffffff" fill-opacity="0.99"></use></g></g></g></svg>
css/license.css CHANGED
@@ -112,7 +112,7 @@ div.green { background-color: #e0ffe0; border-color: #88AA88; }
112
  .amazon-s3-first .fv_fp_amazon_remove { display: none; }
113
  .form-table2 td p { line-height: 20px; }
114
  .meta-box-sortables input[type=text] { width: 100%; }
115
- #wpfp_options .meta-box-sortables input.button-primary, #wpfp_options .meta-box-sortables input.button { margin-top: 16px }
116
  #wpfp_options input.button.no-margin { margin-top: 0px }
117
  .meta-box-sortables input.small, .meta-box-sortables select.small { width: 16%; }
118
  .meta-box-sortables input.medium { width: 50%; }
@@ -207,4 +207,19 @@ td.aligntop > label { margin-top:4px; }
207
  }
208
  #fv_flowplayer_video_intelligence img {
209
  width: 95%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
112
  .amazon-s3-first .fv_fp_amazon_remove { display: none; }
113
  .form-table2 td p { line-height: 20px; }
114
  .meta-box-sortables input[type=text] { width: 100%; }
115
+ #wpfp_options .meta-box-sortables input.button-primary, #wpfp_options .meta-box-sortables input.button, #wpfp_options .meta-box-sortables a.button { margin-top: 16px }
116
  #wpfp_options input.button.no-margin { margin-top: 0px }
117
  .meta-box-sortables input.small, .meta-box-sortables select.small { width: 16%; }
118
  .meta-box-sortables input.medium { width: 50%; }
207
  }
208
  #fv_flowplayer_video_intelligence img {
209
  width: 95%;
210
+ }
211
+
212
+ #dashboard-widgets #fv_flowplayer_usage h3 {
213
+ font-size: 1.3em;
214
+ }
215
+ #fv_flowplayer_usage .usage-section {
216
+ width: 48%;
217
+ float: left;
218
+ margin-bottom: 2em;
219
+ margin-right: 2%;
220
+ list-style-type: none;
221
+ display: inline-block;
222
+ }
223
+ #fv_flowplayer_usage .usage-section:nth-child(2n+1) {
224
+ clear: both;
225
  }
flowplayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: FV Player
4
  Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
  Description: Formerly FV WordPress Flowplayer. Supports MP4, HLS, MPEG-DASH, WebM and OGV. Advanced features such as overlay ads or popups. Uses Flowplayer 7.2.8.
6
- Version: 7.5.26.7210
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -27,8 +27,8 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
27
  */
28
 
29
  global $fv_wp_flowplayer_ver;
30
- $fv_wp_flowplayer_ver = '7.5.26.7210';
31
- $fv_wp_flowplayer_core_ver = '7.2.10';
32
  include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
33
  if( file_exists( dirname( __FILE__ ) . '/includes/module.php' ) ) {
34
  include_once( dirname( __FILE__ ) . '/includes/module.php' );
@@ -113,6 +113,8 @@ include_once(dirname( __FILE__ ). '/models/migration-wizard.php');
113
 
114
  include_once(dirname( __FILE__ ) . '/models/stats.php');
115
 
 
 
116
  add_action('plugins_loaded', 'fv_player_bunny_stream_include' );
117
 
118
  if( !function_exists( 'fv_player_bunny_stream_include' ) && version_compare(PHP_VERSION, '5.2.17') >= 0 ) {
3
  Plugin Name: FV Player
4
  Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
  Description: Formerly FV WordPress Flowplayer. Supports MP4, HLS, MPEG-DASH, WebM and OGV. Advanced features such as overlay ads or popups. Uses Flowplayer 7.2.8.
6
+ Version: 7.5.29.7210
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
27
  */
28
 
29
  global $fv_wp_flowplayer_ver;
30
+ $fv_wp_flowplayer_ver = '7.5.29.7210';
31
+ $fv_wp_flowplayer_core_ver = '7.2.11';
32
  include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
33
  if( file_exists( dirname( __FILE__ ) . '/includes/module.php' ) ) {
34
  include_once( dirname( __FILE__ ) . '/includes/module.php' );
113
 
114
  include_once(dirname( __FILE__ ) . '/models/stats.php');
115
 
116
+ include_once(dirname( __FILE__ ) . '/models/youtube.php');
117
+
118
  add_action('plugins_loaded', 'fv_player_bunny_stream_include' );
119
 
120
  if( !function_exists( 'fv_player_bunny_stream_include' ) && version_compare(PHP_VERSION, '5.2.17') >= 0 ) {
flowplayer/flowplayer.dashjs.min.js CHANGED
@@ -536,7 +536,7 @@
536
  }
537
  }
538
  break;
539
- // When the autoplay is not allowed on macOS Safari 13/14
540
  // This event takes 4 seconds to arrive, but calling what's below too soon won't play the video
541
  case "PLAYBACK_STALLED":
542
  if( safariAutoplayFix ) {
@@ -545,6 +545,7 @@
545
  console.log('FV Player: Safari autoplay of Dash video recovery');
546
  player.mute(true, true);
547
  videoTag.autoplay = true;
 
548
  player.play();
549
 
550
  }
536
  }
537
  }
538
  break;
539
+ // When the autoplay is not allowed on macOS Safari 13/14/15
540
  // This event takes 4 seconds to arrive, but calling what's below too soon won't play the video
541
  case "PLAYBACK_STALLED":
542
  if( safariAutoplayFix ) {
545
  console.log('FV Player: Safari autoplay of Dash video recovery');
546
  player.mute(true, true);
547
  videoTag.autoplay = true;
548
+ player.paused = true;
549
  player.play();
550
 
551
  }
flowplayer/fv-player-loader.babel.js DELETED
@@ -1,307 +0,0 @@
1
- "use strict";
2
-
3
- /* Warning: only use /* comments here! */
4
- (function () {
5
- /* forEach for IE 11: https://rimdev.io/foreach-for-ie-11/ */
6
- if (window.NodeList && !NodeList.prototype.forEach) {
7
- NodeList.prototype.forEach = Array.prototype.forEach;
8
- }
9
-
10
- if (window.HTMLCollection && !HTMLCollection.prototype.forEach) {
11
- HTMLCollection.prototype.forEach = Array.prototype.forEach;
12
- }
13
-
14
- var filter = document.createElement('div');
15
- filter.innerHTML = '<svg class="fp-filters" xmlns="https://www.w3.org/2000/svg" viewBox="0 0 0 0"><defs><filter id="f1" x="-20%" y="-20%" width="200%" height="200%"><feOffset result="offOut" in="SourceAlpha" dx="0" dy="0" /><feColorMatrix result="matrixOut" in="offOut" type="matrix" values="0.3 0 0 0 0 0 0.3 0 0 0 0 0 0.3 0 0 0 0 0 0.4 0" /><feGaussianBlur result="blurOut" in="matrixOut" stdDeviation="4" /><feBlend in="SourceGraphic" in2="blurOut" mode="normal" /></filter></defs></svg>';
16
- filter.style.width = 0;
17
- filter.style.height = 0;
18
- filter.style.overflow = 'hidden';
19
- filter.style.position = 'absolute', filter.style.margin = 0;
20
- filter.style.padding = 0;
21
- document.body.appendChild(filter);
22
- Array.prototype.filter.call(document.getElementsByClassName('flowplayer'), function (player) {
23
- player.className = player.className.replace(/\bno-svg\b/g, '');
24
- /* remove admin JavaScript warning */
25
-
26
- var admin_js_warning = player.querySelector('.fvfp_admin_error');
27
-
28
- if (admin_js_warning) {
29
- admin_js_warning.parentNode.removeChild(admin_js_warning);
30
- }
31
-
32
- /* remove preload animation if it's there - not there for audio player */
33
- var preload = player.querySelector('.fp-preload');
34
- if( preload ) {
35
- preload.style.display = 'none';
36
- }
37
- });
38
- })();
39
-
40
- var FV_Player_JS_Loader_Compatibility_Checker = /*#__PURE__*/function () {
41
- function FV_Player_JS_Loader_Compatibility_Checker(options) {
42
- this.passiveSupported = false;
43
-
44
- this._checkPassiveOption(this);
45
-
46
- this.options = this.passiveSupported ? options : false;
47
- }
48
- /**
49
- * Initializes browser check for addEventListener passive option.
50
- *
51
- * @link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
52
- * @private
53
- *
54
- * @param self Instance of this object.
55
- * @returns {boolean}
56
- */
57
-
58
-
59
- var _proto = FV_Player_JS_Loader_Compatibility_Checker.prototype;
60
-
61
- _proto._checkPassiveOption = function _checkPassiveOption(self) {
62
- try {
63
- var options = {
64
- /* This function will be called when the browser attempts to access the passive property. */
65
- get passive() {
66
- self.passiveSupported = true;
67
- return false;
68
- }
69
-
70
- };
71
- window.addEventListener('test', null, options);
72
- window.removeEventListener('test', null, options);
73
- } catch (err) {
74
- self.passiveSupported = false;
75
- }
76
- };
77
-
78
- return FV_Player_JS_Loader_Compatibility_Checker;
79
- }();
80
-
81
- var FV_Player_JS_Loader = /*#__PURE__*/function () {
82
- function FV_Player_JS_Loader(triggerEvents, browser) {
83
- this.attrName = 'data-fv-player-loader-src';
84
- this.browser = browser;
85
- this.options = this.browser.options;
86
- this.triggerEvents = triggerEvents;
87
- this.userEventListener = this.triggerListener.bind(this);
88
- }
89
- /**
90
- * Initializes the LazyLoad Scripts handler.
91
- */
92
-
93
-
94
- var _proto2 = FV_Player_JS_Loader.prototype;
95
-
96
- _proto2.init = function init() {
97
- this._addEventListener(this);
98
- }
99
- /**
100
- * Resets the handler.
101
- */
102
- ;
103
-
104
- _proto2.reset = function reset() {
105
- this._removeEventListener(this);
106
- }
107
- /**
108
- * Adds a listener for each of the configured user interactivity event type. When an even is triggered, it invokes
109
- * the triggerListener() method.
110
- *
111
- * @private
112
- *
113
- * @param self Instance of this object.
114
- */
115
- ;
116
-
117
- _proto2._addEventListener = function _addEventListener(self) {
118
- this.triggerEvents.forEach(function (eventName) {
119
- return window.addEventListener(eventName, self.userEventListener, self.options);
120
- });
121
- }
122
- /**
123
- * Removes the listener for each of the configured user interactivity event type.
124
- *
125
- * @private
126
- *
127
- * @param self Instance of this object.
128
- */
129
- ;
130
-
131
- _proto2._removeEventListener = function _removeEventListener(self) {
132
- this.triggerEvents.forEach(function (eventName) {
133
- return window.removeEventListener(eventName, self.userEventListener, self.options);
134
- });
135
- }
136
- /**
137
- * Loads the script's src from the data attribute, which will then trigger the browser to request and
138
- * load the script.
139
- */
140
- ;
141
-
142
- _proto2._loadScriptSrc = function _loadScriptSrc() {
143
- var _this = this;
144
-
145
- var scripts = document.querySelectorAll("script[" + this.attrName + "]");
146
- window.FV_Player_JS_Loader_scripts_total = 0;
147
- window.FV_Player_JS_Loader_scripts_loaded = 0;
148
- scripts.forEach(function (elem) {
149
- var scriptSrc = elem.getAttribute(_this.attrName);
150
- elem.setAttribute('src', scriptSrc);
151
- elem.removeAttribute(_this.attrName);
152
- window.FV_Player_JS_Loader_scripts_total++;
153
-
154
- elem.onload = function () {
155
- window.FV_Player_JS_Loader_scripts_loaded++;
156
- };
157
- });
158
- this.reset();
159
- }
160
- /**
161
- * Window event listener - when triggered, invokes the load script src handler and then resets.
162
- */
163
- ;
164
-
165
- _proto2.triggerListener = function triggerListener() {
166
- /* Show the preload indicator once again */
167
- Array.prototype.filter.call(document.getElementsByClassName('flowplayer'), function (player) {
168
- if( player.getAttribute('data-error') ) {
169
- return;
170
- }
171
-
172
- var preload = player.querySelector('.fp-preload');
173
-
174
- if (preload) {
175
- preload.style.display = 'block';
176
- }
177
- });
178
- /* Not sure when, but sometimes the flowplayer script is not ready */
179
-
180
- if (window.flowplayer) {
181
- this._loadScriptSrc();
182
- } else {
183
- var that = this,
184
- wait_for_flowplayer = setInterval(function () {
185
- if (window.flowplayer) {
186
- that._loadScriptSrc();
187
-
188
- clearInterval(wait_for_flowplayer);
189
- }
190
- }, 100);
191
- }
192
-
193
- this._removeEventListener(this);
194
- };
195
-
196
- FV_Player_JS_Loader.run = function run() {
197
- var browser = new FV_Player_JS_Loader_Compatibility_Checker({
198
- passive: true
199
- });
200
- var instance = new FV_Player_JS_Loader(['keydown', 'mouseover', 'touchmove', 'touchstart', 'wheel'], browser);
201
- instance.init();
202
- /* if using Video Link, load it all right away */
203
-
204
- if (location.hash.match(/fvp_/)) {
205
- instance.triggerListener();
206
- return;
207
- }
208
- /* iOS specific block https://stackoverflow.com/questions/9038625/detect-if-device-is-ios */
209
-
210
-
211
- function iOS() {
212
- return navigator.platform.match(/iPad|iPhone|iPod/)
213
- /* iPad on iOS 13 detection */
214
- || navigator.userAgent.indexOf("Mac") !== -1 && "ontouchend" in document;
215
- }
216
-
217
- if (iOS()) {
218
- var load_if_any_player_visible = function load_if_any_player_visible() {
219
- var is_any_player_visible = false;
220
- /* if part of any player visible? */
221
-
222
- /* TODO: What about playlist item thumbs? */
223
-
224
- document.querySelectorAll('.flowplayer').forEach(function (el) {
225
- var rect = el.getBoundingClientRect();
226
-
227
- if (rect.top >= -el.offsetHeight && rect.left >= -el.offsetWidth && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) + el.offsetHeight && rect.right <= (window.innerWidth || document.documentElement.clientWidth) + el.offsetWidth) {
228
- is_any_player_visible = true;
229
- }
230
- });
231
- console.log('FV Player: Visible?', is_any_player_visible);
232
-
233
- if (is_any_player_visible) {
234
- instance.triggerListener();
235
- }
236
-
237
- return is_any_player_visible;
238
- };
239
- /* Load FV Player scripts instantly if any player is visible */
240
-
241
-
242
- var was_visible = load_if_any_player_visible();
243
- /* Try again once styles are loaded */
244
-
245
- if (!was_visible) {
246
- /* ...or when Safari restores the scroll position */
247
- var load_on_scroll = function load_on_scroll() {
248
- this.removeEventListener('scroll', load_on_scroll);
249
- load_if_any_player_visible();
250
- };
251
-
252
- /* once everything is loaded */
253
- window.addEventListener('load', load_if_any_player_visible);
254
- window.addEventListener('scroll', load_on_scroll);
255
- }
256
-
257
- return;
258
- }
259
- /* If the first click was on player, play it */
260
-
261
-
262
- var first_click_done = false;
263
- document.addEventListener('mousedown', function (e) {
264
- if (first_click_done) return;
265
- first_click_done = true;
266
- var playlist_item = false;
267
- var path = e.path || e.composedPath && e.composedPath();
268
- path.forEach(function (el) {
269
- /* store playlist item for later use */
270
- if (el.getAttribute && el.getAttribute('data-item')) {
271
- playlist_item = el;
272
- }
273
-
274
- if (el.className && el.className.match(/\b(flowplayer|fp-playlist-external)\b/)) {
275
- /* Players with autoplay should stop */
276
- document.querySelectorAll('[data-fvautoplay]').forEach(function (player) {
277
- player.removeAttribute('data-fvautoplay');
278
- });
279
- /* VAST should not autoplay */
280
-
281
- if (window.fv_vast_conf) {
282
- window.fv_vast_conf.autoplay = false;
283
- }
284
- /* TODO: Perhaps video link should not be parsed or it should be done here */
285
-
286
- /* was it lightbox? */
287
-
288
-
289
- if (el.className.match(/lightbox-starter/)) {
290
- /* was it playlist thumb? */
291
- } else if (el.className.match(/\bfp-playlist-external\b/)) {
292
- console.log('First click on playlist');
293
- var player = document.getElementById(el.getAttribute('rel'));
294
- player.setAttribute('data-fvautoplay', Array.prototype.indexOf.call(el.children, playlist_item));
295
- } else {
296
- console.log('First click on player');
297
- el.setAttribute('data-fvautoplay', 0);
298
- }
299
- }
300
- });
301
- }, false);
302
- };
303
-
304
- return FV_Player_JS_Loader;
305
- }();
306
-
307
- FV_Player_JS_Loader.run();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
flowplayer/fv-player-loader.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}!function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.HTMLCollection&&!HTMLCollection.prototype.forEach&&(HTMLCollection.prototype.forEach=Array.prototype.forEach);var e=document.createElement("div");e.innerHTML='<svg class="fp-filters" xmlns="https://www.w3.org/2000/svg" viewBox="0 0 0 0"><defs><filter id="f1" x="-20%" y="-20%" width="200%" height="200%"><feOffset result="offOut" in="SourceAlpha" dx="0" dy="0" /><feColorMatrix result="matrixOut" in="offOut" type="matrix" values="0.3 0 0 0 0 0 0.3 0 0 0 0 0 0.3 0 0 0 0 0 0.4 0" /><feGaussianBlur result="blurOut" in="matrixOut" stdDeviation="4" /><feBlend in="SourceGraphic" in2="blurOut" mode="normal" /></filter></defs></svg>',e.style.width=0,e.style.height=0,e.style.overflow="hidden",e.style.position="absolute",e.style.margin=0,e.style.padding=0,document.body.appendChild(e),Array.prototype.filter.call(document.getElementsByClassName("flowplayer"),function(e){e.className=e.className.replace(/\bno-svg\b/g,"");var t=e.querySelector(".fvfp_admin_error"),t=(t&&t.parentNode.removeChild(t),e.querySelector(".fp-preload"));t&&(t.style.display="none")})}();var FV_Player_JS_Loader_Compatibility_Checker=function(){function t(e){_classCallCheck(this,t),this.passiveSupported=!1,this._checkPassiveOption(this),this.options=!!this.passiveSupported&&e}return _createClass(t,[{key:"_checkPassiveOption",value:function(t){try{var e={get passive(){return!(t.passiveSupported=!0)}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t.passiveSupported=!1}}}]),t}(),FV_Player_JS_Loader=function(){function i(e,t){_classCallCheck(this,i),this.attrName="data-fv-player-loader-src",this.browser=t,this.options=this.browser.options,this.triggerEvents=e,this.userEventListener=this.triggerListener.bind(this)}return _createClass(i,[{key:"init",value:function(){this._addEventListener(this)}},{key:"reset",value:function(){this._removeEventListener(this)}},{key:"_addEventListener",value:function(t){this.triggerEvents.forEach(function(e){return window.addEventListener(e,t.userEventListener,t.options)})}},{key:"_removeEventListener",value:function(t){this.triggerEvents.forEach(function(e){return window.removeEventListener(e,t.userEventListener,t.options)})}},{key:"_loadScriptSrc",value:function(){var r=this,e=document.querySelectorAll("script[".concat(this.attrName,"]"));window.FV_Player_JS_Loader_scripts_total=0,window.FV_Player_JS_Loader_scripts_loaded=0,e.forEach(function(e){var t=e.getAttribute(r.attrName);e.setAttribute("src",t),e.removeAttribute(r.attrName),window.FV_Player_JS_Loader_scripts_total++,e.onload=function(){window.FV_Player_JS_Loader_scripts_loaded++}}),this.reset()}},{key:"triggerListener",value:function(){var e,t;Array.prototype.filter.call(document.getElementsByClassName("flowplayer"),function(e){e.getAttribute("data-error")||(e=e.querySelector(".fp-preload"))&&(e.style.display="block")}),window.flowplayer?this._loadScriptSrc():(e=this,t=setInterval(function(){window.flowplayer&&(e._loadScriptSrc(),clearInterval(t))},100)),this._removeEventListener(this)}}],[{key:"run",value:function(){var t,e,r,o=new i(["keydown","mouseover","touchmove","touchstart","wheel"],new FV_Player_JS_Loader_Compatibility_Checker({passive:!0}));o.init(),location.hash.match(/fvp_/)?o.triggerListener():navigator.platform.match(/iPad|iPhone|iPod/)||-1!==navigator.userAgent.indexOf("Mac")&&"ontouchend"in document?(t=function(){var r=!1;return document.querySelectorAll(".flowplayer").forEach(function(e){var t=e.getBoundingClientRect();t.top>=-e.offsetHeight&&t.left>=-e.offsetWidth&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)+e.offsetHeight&&t.right<=(window.innerWidth||document.documentElement.clientWidth)+e.offsetWidth&&(r=!0)}),console.log("FV Player: Visible?",r),r&&o.triggerListener(),r})()||(e=function e(){this.removeEventListener("scroll",e),t()},window.addEventListener("load",t),window.addEventListener("scroll",e)):(r=!1,document.addEventListener("mousedown",function(e){var t;r||(t=!(r=!0),(e.path||e.composedPath&&e.composedPath()).forEach(function(e){e.getAttribute&&e.getAttribute("data-item")&&(t=e),e.className&&e.className.match(/\b(flowplayer|fp-playlist-external)\b/)&&(document.querySelectorAll("[data-fvautoplay]").forEach(function(e){e.removeAttribute("data-fvautoplay")}),window.fv_vast_conf&&(window.fv_vast_conf.autoplay=!1),e.className.match(/lightbox-starter/)||(e.className.match(/\bfp-playlist-external\b/)?(console.log("First click on playlist"),document.getElementById(e.getAttribute("rel")).setAttribute("data-fvautoplay",Array.prototype.indexOf.call(e.children,t))):(console.log("First click on player"),e.setAttribute("data-fvautoplay",0))))}))},!1))}}]),i}();FV_Player_JS_Loader.run();
flowplayer/fv-player-youtube.dev.js ADDED
@@ -0,0 +1,1003 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*global YT, fv_player_log, fv_player_track */
2
+
3
+ /*
4
+ * Moved in from FV Player Pro
5
+ * For full comit history check foliovision/fv-player-pro/blob/517cb6ef122e507f6ba7744e591b3825a643abe4/beta/js/youtube.module.js
6
+ */
7
+
8
+ if( fv_flowplayer_conf.youtube ) {
9
+ var tag = document.createElement('script');
10
+ tag.src = "https://www.youtube.com/iframe_api";
11
+ document.body.appendChild(tag);
12
+ }
13
+
14
+
15
+
16
+
17
+ if( typeof(flowplayer) != "undefined" ) {
18
+
19
+ function fv_player_pro_youtube_get_video_id( src ) {
20
+ if( aMatch = src.match(/(?:\?|&)v=([a-zA-Z0-9_\-]+)(?:\?|$|&)/) ){
21
+ return aMatch[1];
22
+ }
23
+ if( aMatch = src.match(/youtu.be\/([a-zA-Z0-9_\-]+)(?:\?|$|&)/) ){
24
+ return aMatch[1];
25
+ }
26
+ if( aMatch = src.match(/embed\/([a-zA-Z0-9_\-]+)(?:\?|$|&)/) ){
27
+ return aMatch[1];
28
+ }
29
+ return false;
30
+ }
31
+
32
+ function fv_player_pro_youtube_addRemovableEventListener( player, eventName, cb ) {
33
+ var callbackName = 'youtubeCallbackFunction' + Math.random().toString(36).substr(2, 7);
34
+ window[callbackName] = cb;
35
+ player.addEventListener(eventName, callbackName);
36
+
37
+ return function () {
38
+ window[callbackName] = function () {}; // make the callback inactive
39
+ if( typeof(player.removeEventListener) != "undefined" ) {
40
+ player.removeEventListener(eventName, callbackName);
41
+ }
42
+ };
43
+ }
44
+
45
+ function fv_player_pro_youtube_onReady(e) {
46
+ //console.log('fv_player_pro_youtube_onReady');
47
+ var root = jQuery(e.target.getIframe()).closest('.flowplayer');
48
+ root.removeClass('is-loading');
49
+
50
+ var api = root.data('flowplayer');
51
+ api.loading = false;
52
+ api.trigger('yt-ready');
53
+
54
+ // signal to the other players that 1MB YouTube API base.js has loaded
55
+ jQuery(document).trigger('fv-player-yt-api-loaded');
56
+ }
57
+
58
+
59
+ function fv_player_pro_youtube_onStateChange(e) {
60
+ //console.log('fv_player_pro_youtube_onStateChange',e.data);
61
+
62
+ var root = jQuery(e.target.getIframe()).parents('.flowplayer');
63
+ switch (e.data) {
64
+ case -1:
65
+ jQuery('.fp-splash',root).css('pointer-events','');
66
+ root.addClass('is-loading');
67
+ break;
68
+ case YT.PlayerState.PLAYING:
69
+ var api = root.data('flowplayer');
70
+ api.load();
71
+ break;
72
+ case YT.PlayerState.BUFFERING:
73
+ root.addClass('is-loading');
74
+ // todo: put in placeholder splash screen as this event occurs if you use Video Link targetting a playlist item, but most of the time it triggers in onStateChange() already
75
+ break;
76
+ }
77
+ }
78
+
79
+
80
+ function fv_player_pro_youtube_onError(e) {
81
+ var root = jQuery(e.target.getIframe()).parents('.flowplayer');
82
+ var player = root.data('flowplayer');
83
+
84
+ // this is a copy of onError as we need to execute it for mobile preloaded player somehow...
85
+ fv_player_log('FV Player Youtube onError for preloaded player',e);
86
+
87
+ var src = player.video.index > 0 ? player.conf.playlist[player.video.index].sources[0].src : player.conf.clip.sources[0].src;
88
+
89
+ fv_player_track( player, false, "Video " + (root.hasClass('is-cva')?'Ad ':'') + "error", "YouTube video removed", src );
90
+
91
+
92
+ setTimeout( function() {
93
+ root.removeClass('is-splash'); // we only do this for the preloaded player
94
+
95
+ player.loading = false; // we need to reset this to make sure user can pick another video in playlist
96
+ root.removeClass('is-loading'); // same as above
97
+
98
+ if( player.conf.clip.sources.length > 1 ) {
99
+
100
+ player.youtube.destroy();
101
+ player.youtube = false;
102
+ jQuery('.fvyoutube-engine',root).remove();
103
+ jQuery('.fv-pf-yt-temp2',root).remove();
104
+ jQuery(root).removeClass('is-ytios11');
105
+
106
+ jQuery('.fp-ui',root).css('background-image','');
107
+ jQuery('.fp-ui',root).append('<div class="wpfp_custom_popup fp-notice-load" style="height: 100%"><div class="wpfp_custom_popup_content">' + fv_flowplayer_translations.video_loaded + '</div></div>'); // we show this so that we can capture the user click
108
+
109
+ var i = player.video.index;
110
+ jQuery('.fp-notice-load').one( 'click', function(e) {
111
+ jQuery('.fp-notice-load',root).remove();
112
+
113
+ //var api = jQuery(root).data('flowplayer');
114
+ player.trigger('error', [ player, { code: 4, video: player.video } ] );
115
+ } );
116
+
117
+ } else {
118
+ player.paused = false; // we need to make sure it's not paused which happens in case of autoadvance
119
+ root.removeClass('is-paused'); // same as above
120
+
121
+ player.ready = true; // we need to set this otherwise further clicks will make the video load again
122
+ player.bind('load', function() {
123
+ player.ready = false; // we need to set this otherwise playlist advance won't trigger all the events properly
124
+ });
125
+
126
+ setTimeout( function() {
127
+ player.next(); // todo fix for mobile
128
+ }, 1000 );
129
+ }
130
+
131
+ });
132
+
133
+ }
134
+
135
+
136
+ function fv_player_pro_youtube_is_mobile() {
137
+ // Include Safari (which means iPad too)
138
+ return !flowplayer.support.firstframe || flowplayer.support.android || flowplayer.support.iOS || flowplayer.support.browser.safari;
139
+ }
140
+
141
+ function fv_player_pro_youtube_is_old_android() {
142
+ return flowplayer.support.android && flowplayer.support.android.version < 4.4;
143
+ }
144
+
145
+ function fv_player_pro_youtube_player_vars( video_id, root, events ) {
146
+ var vars = {
147
+ videoId: video_id,
148
+ width: root.width,
149
+ height: root.height,
150
+ playerVars: {
151
+ // seems we need this for mobile load, otherwise onReady calls playVideo()
152
+ // but now we had to exclude Safari (which means iPad too) from it
153
+ autoplay: !flowplayer.support.browser.safari,
154
+ controls: !jQuery(root).hasClass('no-controlbar') && fv_player_pro_youtube_is_old_android() ? 1 : 0, // todo: no interface if it's a video ad!
155
+ disablekb: 1,
156
+ enablejsapi: 1,
157
+ fs: 0,
158
+ html5: 1,
159
+ iv_load_policy: 3,
160
+ loop: 0, //T.loop,
161
+ modestbranding: 1,
162
+ origin: ( document.location.protocol == "https:" ) ? "https://" : "http://" + flowplayer.conf.hostname,
163
+ playsinline: 1,
164
+ rel: 0,
165
+ showinfo: 0,
166
+ showsearch: 0,
167
+ start: 0,
168
+ t0: 1,
169
+ widget_referrer: window ? window.location.href : null // help with YouTube tracking
170
+ }
171
+ }
172
+
173
+ if( !fv_flowplayer_conf.youtube_cookies ) {
174
+ vars.host = 'https://www.youtube-nocookie.com';
175
+ }
176
+
177
+ if( events ) {
178
+ vars.events = events;
179
+ }
180
+ return vars;
181
+ }
182
+
183
+
184
+ function fv_player_pro_youtube_preload(that, api) {
185
+ var root = jQuery(that);
186
+ if( !api ) api = root.data('flowplayer');
187
+
188
+ if( api && api.conf.item && api.conf.item.sources[0].type == 'video/youtube' || api && api.conf.clip && api.conf.clip.sources[0].type == 'video/youtube' ) { // exp: not sury why api.conf.clip sometimes fails?!
189
+ if( api.loading == true || api.youtube || api.video.index ) return; // don' preload if it's already loading, if YouTube API already exists or if it's about to advanced to some other playlist item in case that this function was triggered by ajaxComplete as Vimeo loading Ajax has succeeded
190
+
191
+ //if( root.find('.fake-video') ) return; // don't preload if FV Player VAST has decided to put in bogus video tag for the video ad
192
+
193
+ api.loading = true;
194
+ root.addClass('is-loading');
195
+
196
+ var common = flowplayer.common,
197
+ video_id = api.conf.item ? fv_player_pro_youtube_get_video_id(api.conf.item.sources[0].src) : fv_player_pro_youtube_get_video_id(api.conf.clip.sources[0].src); // exp: not sury why api.conf.clip sometimes fails?!
198
+
199
+ common.removeNode(common.findDirect("video", root)[0] || common.find(".fp-player > video", root)[0]);
200
+ var wrapperTag = common.createElement("div");
201
+ wrapperTag.className = 'fp-engine fvyoutube-engine';
202
+ common.prepend(common.find(".fp-player", root)[0], wrapperTag);
203
+
204
+ //console.log('new YT preload'); // probably shouldn't happen when used in lightbox
205
+
206
+ // this is the event which lets the player load YouTube
207
+ jQuery(document).one('fv-player-yt-api-loaded', function() {
208
+
209
+ // only one player can enter the loading phase
210
+ if( ( typeof(YT) == "undefined" || typeof(YT.Player) == "undefined" ) && window.fv_player_pro_yt_loading ) {
211
+ return;
212
+ }
213
+
214
+ window.fv_player_pro_yt_loading = true;
215
+
216
+ var intLoad = setInterval( function() {
217
+ // somehow the loading indicator disappears, so we put it back
218
+ api.loading = true;
219
+ root.addClass('is-loading');
220
+
221
+ if( typeof(YT) == "undefined" || typeof(YT.Player) == "undefined" ) {
222
+ return;
223
+ }
224
+
225
+ clearInterval(intLoad);
226
+
227
+ api.youtube = new YT.Player(
228
+ wrapperTag,
229
+ fv_player_pro_youtube_player_vars(video_id, root)
230
+ );
231
+
232
+ jQuery('.fp-engine.fvyoutube-engine',root)[0].allowFullscreen = false;
233
+
234
+
235
+
236
+ // splash needs to cover the iframe
237
+ var splash = jQuery('.fp-splash',root);
238
+ jQuery('.fp-ui',root).before( splash );
239
+ splash.css('pointer-events','none');
240
+
241
+ jQuery('.fp-ui',root).before('<div class="fv-pf-yt-temp2"></div>');
242
+ if( flowplayer.support.iOS && flowplayer.support.iOS.version > 11 ) {
243
+ jQuery(root).addClass('is-ytios11');
244
+ jQuery(root).find('.fv-pf-yt-temp2').on('click', function(){
245
+ api.toggle();
246
+ });
247
+ }
248
+
249
+ api.fv_yt_onReady = fv_player_pro_youtube_addRemovableEventListener(api.youtube,'onReady',fv_player_pro_youtube_onReady);
250
+ api.fv_yt_onStateChange = fv_player_pro_youtube_addRemovableEventListener(api.youtube,'onStateChange',fv_player_pro_youtube_onStateChange);
251
+ api.fv_yt_onError = fv_player_pro_youtube_addRemovableEventListener(api.youtube,'onError',fv_player_pro_youtube_onError);
252
+
253
+ }, 50 );
254
+ });
255
+
256
+ if( !window.fv_player_pro_yt_load ) {
257
+ window.fv_player_pro_yt_load = true;
258
+ jQuery(document).trigger('fv-player-yt-api-loaded');
259
+ }
260
+
261
+ }
262
+ }
263
+
264
+
265
+ (function () {
266
+
267
+ var engineImpl = function(player, root) {
268
+
269
+ function getVideoDeatils( youtube ) {
270
+ var quality = youtube.getPlaybackQuality();
271
+
272
+ var output = {
273
+ seekable: true,
274
+ src: youtube.getVideoUrl()
275
+ };
276
+ output.duration = youtube.getDuration();
277
+ if( quality && typeof(aResolutions[quality]) != "undefined" ) {
278
+ output.width = aResolutions[quality].width;
279
+ output.height = aResolutions[quality].height;
280
+ output.quality = quality;
281
+ output.qualityLabel = aQuality.qualityLabels[quality];
282
+ output.bitrate = aResolutions[quality].bitrate;
283
+ }
284
+
285
+ if( typeof(youtube.getVideoData) == 'function' ){
286
+ var details = youtube.getVideoData();
287
+ if( details.title ) {
288
+ output.fv_title = 'YouTube: '+details.title+' ('+details.video_id+')';
289
+ }
290
+ }
291
+
292
+ return output;
293
+ }
294
+
295
+
296
+ function onError(e) {
297
+ fv_player_log('FV Player Youtube onError',e);
298
+
299
+ var src = player.video.index > 0 ? player.conf.playlist[player.video.index].sources[0].src : player.conf.clip.sources[0].src;
300
+
301
+ fv_player_track( player, false, "Video " + (root.hasClass('is-cva')?'Ad ':'') + "error", "YouTube video removed", src );
302
+
303
+ // Unfortunately the player had to enter the ready state to get this far
304
+ // So we act as if it's the splash state - means no controls
305
+ root.addClass('is-splash');
306
+
307
+ // If it's not a playlist or there are other sources trigger error
308
+ // In case of other sources FV Player Alternative Sources will play the other source
309
+ if( player.conf.playlist.length == 0 || player.conf.clip.sources.length > 1 ) {
310
+ player.trigger('error', [ player, { code: 4, video: player.video } ] );
311
+
312
+ } else {
313
+ setTimeout( function() {
314
+ player.loading = false; // we need to reset this to make sure user can pick another video in playlist
315
+ root.removeClass('is-loading'); // same as above
316
+
317
+ player.paused = false; // we need to make sure it's not paused which happens in case of autoadvance
318
+ root.removeClass('is-paused'); // same as above
319
+
320
+ player.ready = true; // we need to set this otherwise further clicks will make the video load again
321
+ player.bind('load', function() {
322
+ player.ready = false; // we need to set this otherwise playlist advance won't trigger all the events properly
323
+ });
324
+
325
+ setTimeout( function() {
326
+ player.next();
327
+ }, 5000 );
328
+
329
+ });
330
+ }
331
+
332
+ }
333
+
334
+
335
+ function onApiChange(e) {
336
+ player.one('ready progress', function() { // exp: primary issue here is that the event fires multiple times for each video. And also Flowplayer won't remove the subtitles button/menu when you switch videos
337
+
338
+ if( youtube.getOptions().indexOf('captions') > -1 ) {
339
+
340
+ if( player.video.subtitles ) {
341
+ youtube.unloadModule("captions");
342
+ return;
343
+ }
344
+
345
+ var objCurrent = youtube.getOption('captions','track');
346
+ var aSubtitles = youtube.getOption('captions','tracklist');
347
+ if( aSubtitles == 0 ){
348
+ youtube.loadModule("captions");
349
+ return;
350
+ }
351
+
352
+ youtube.setOption('captions','fontSize', 1 );
353
+
354
+ // core FP createUIElements()
355
+ var common = flowplayer.common;
356
+ var bean = flowplayer.bean;
357
+ wrap = common.find('.fp-captions', root)[0];
358
+ var wrap = common.find('.fp-subtitle', root)[0];
359
+ wrap = wrap || common.appendTo(common.createElement('div', {'class': 'fp-captions'}), common.find('.fp-player', root)[0]);
360
+ Array.prototype.forEach.call(wrap.children, common.removeNode);
361
+
362
+ // core FP createSubtitleControl()
363
+ var subtitleControl = root.find('.fp-cc')[0] || common.createElement('strong', { className: 'fp-cc' }, 'CC');
364
+ var subtitleMenu = root.find('.fp-subtitle-menu')[0] || common.createElement('div', {className: 'fp-menu fp-subtitle-menu'}, '<strong>Closed Captions</strong>');
365
+
366
+ common.find('a', subtitleMenu).forEach(common.removeNode);
367
+ subtitleMenu.appendChild(common.createElement('a', {'data-yt-subtitle-index': -1}, 'No subtitles')); // exp: not using data-subtitle-index, but data-yt-subtitle-index to avoid code in core FP lib/ext/subtitle.js
368
+
369
+ ( aSubtitles || []).forEach(function(st, i) { // customized to read from above parsed YouTube subtitles
370
+ var item = common.createElement('a', {'data-yt-subtitle-index': i}, st.displayName);
371
+ if( objCurrent && objCurrent.languageCode && objCurrent.languageCode == st.languageCode) {
372
+ jQuery(item).addClass('fp-selected');
373
+ }
374
+ subtitleMenu.appendChild(item);
375
+ });
376
+ common.find('.fp-ui', root)[0].appendChild(subtitleMenu);
377
+ common.find('.fp-controls', root)[0].appendChild(subtitleControl);
378
+
379
+ root.find('.fp-cc').removeClass('fp-hidden');
380
+
381
+ jQuery(document).on('click', '.fp-subtitle-menu a', function(e) {
382
+ e.preventDefault();
383
+
384
+ jQuery('a[data-yt-subtitle-index]').removeClass('fp-selected');
385
+ jQuery(this).addClass('fp-selected');
386
+
387
+ if( aSubtitles[jQuery(this).data('yt-subtitle-index')] ) {
388
+ youtube.setOption('captions','track',{"languageCode": aSubtitles[jQuery(this).data('yt-subtitle-index')].languageCode});
389
+ } else {
390
+ youtube.unloadModule("captions");
391
+ }
392
+
393
+ });
394
+
395
+ }
396
+ });
397
+ }
398
+
399
+
400
+ function onReady(e) {
401
+ // YouTube doesn't tell us if it's a live stream
402
+ // but it seems when you check the duration in this moment
403
+ // it gives 0 on live streams
404
+ var duration = youtube.getDuration();
405
+ if( duration == 0 ) {
406
+ player.live = true;
407
+ jQuery(root).addClass('is-live');
408
+
409
+ // TODO: Problem is that when you use this in playlist
410
+ // the next video will also behave like a live stream
411
+ // but it appears to be a problem with Flowplayer in general
412
+ }
413
+
414
+ var a = jQuery.extend( loadVideo, getVideoDeatils(youtube) );
415
+
416
+ if( !player.ready ) {
417
+
418
+ // we init YouTube muted to allow muted autoplay
419
+ // we need to do this before we trigger ready event as there we might need to mute the video for custom start time
420
+ player.mute(true,true); // mute, but don't remember it!
421
+ youtube.playVideo();
422
+ // look for youtube_unmute_attempted to see what happens next
423
+
424
+ // TODO: Shouldn't this trigger on YT.PlayerState.PLAYING - if so, do we need this onReady at all?
425
+ // workaround for iPad "QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota." http://stackoverflow.com/questions/14555347/html5-localstorage-error-with-safari-quota-exceeded-err-dom-exception-22-an
426
+ try {
427
+ player.one( 'ready', function() {
428
+ player.trigger( "resume", [player] ); // not sure why but Flowplayer HTML5 engine triggers resume event once the video starts to play
429
+ });
430
+ player.trigger('ready', [player, a] );
431
+ } catch(e) {} // bug: the seeking doesn't work!
432
+ }
433
+
434
+ player.ready = true;
435
+
436
+ if( isMobile ) {
437
+ jQuery('.fp-ui',root).hide();
438
+ }
439
+
440
+ if( flowplayer.support.iOS.version < 11 || flowplayer.support.android.version < 5 ) { // tested on Android 6
441
+ root.find('.fp-speed').hide();
442
+
443
+ player.YTErrorTimeout = setTimeout( function() {
444
+ if( !player.error && youtube.getPlayerState() == -1 ) { // exp: the onError event sometimes won't fire :( (Safari 11 most of the time)
445
+ player.trigger('error', [ player, { code: 4, video: player.video } ] );
446
+ }
447
+ }, 1000 );
448
+ }
449
+ }
450
+
451
+
452
+ function onStateChange(e) {//console.log('onStateChange '+e.data+' '+ ( e.target ? jQuery('.flowplayer').index(jQuery(e.target.getIframe()).parents('.flowplayer')) : false ) );
453
+ if( !isMobile && root.find('.fv-fp-no-picture.is-active').length == 0 ) jQuery('.fvyoutube-engine',root).show();
454
+
455
+ switch (e.data) {
456
+ case -1: // exp: means "unstarted", runs for playlist item change
457
+ jQuery('.fp-splash',root).css('pointer-events',''); // exp: for random playlist autoplay
458
+ //player.ready = false; // todo: causes ready event on playlist advance - should it be there?
459
+
460
+ // we need to set the status properly, what if the VAST ad loads before YouTube engine does, it must be able to resume the video
461
+ player.playing = false;
462
+ player.paused = true;
463
+ break;
464
+
465
+ case YT.PlayerState.BUFFERING: // 3, seems to me we don't need this at all
466
+ if( typeof(youtube.getCurrentTime) == "function") {
467
+ player.trigger('seek', [player, youtube.getCurrentTime()] );
468
+ }
469
+ break;
470
+
471
+ case YT.PlayerState.CUED: // 5
472
+ root.removeClass('is-loading');
473
+ root.addClass('is-paused');
474
+ player.loading = false; // exp: without this the core Flowplayer will think the player is still loading and wont' allow iphone users to click the playlist thumbs more than twice
475
+
476
+ if( !flowplayer.support.firstframe ) { // todo: this whole part doesn't make sense anymore, as .fv-pf-yt-temp is no more, but it should be
477
+ var playlist_item = jQuery('[rel='+root.attr('id')+'] span').eq(player.video.index);
478
+ jQuery('.fv-pf-yt-temp',root).css('background-image', playlist_item.css('background-image') );
479
+ if( !flowplayer.support.dataload ) jQuery('.fp-ui',root).hide(); // exp: hide the UI so that the iframe can be clicked into on iPad
480
+ jQuery('.fv-pf-yt-temp',root).show();
481
+ jQuery('.fv-pf-yt-temp-play',root).show();
482
+ }
483
+
484
+ break;
485
+
486
+ case YT.PlayerState.ENDED: // 0
487
+ player.playing = false;
488
+
489
+ // todo: end time is missing 1 second
490
+ clearInterval(intUIUpdate);
491
+ intUIUpdate = false;
492
+
493
+ player.trigger( "pause", [player] ); // not sure why but Flowplayer HTML5 engine triggers pause event before the video finishes
494
+ player.trigger( "finish", [player] );
495
+
496
+ if( !isMobile ) jQuery('.fvyoutube-engine',root).hide(); // todo: should only work on end of playlist exp: once this triggers on iPad 7.0.3, you can't show it again?
497
+
498
+ jQuery('.fv-pf-yt-temp2',root).show();
499
+ jQuery('.fp-ui',root).show();
500
+ break;
501
+
502
+ case YT.PlayerState.PAUSED: // 2
503
+
504
+ // Was it paused because of unmuting?
505
+ if( player.youtube_unmute_attempted === 1 ) {
506
+ player.youtube_unmute_attempted = 2;
507
+ fv_player_log('FV FP YouTube: Volume restore failed.');
508
+
509
+ player.mute(true,true); // mute, but don't remember it!
510
+ youtube.playVideo();
511
+
512
+ jQuery('body').one('click', function() {
513
+ if( player && player.ready ) {
514
+ fv_player_log('FV FP YouTube: Volume restore on click.');
515
+
516
+ player.volume(player.volumeLevel); // unmute
517
+ }
518
+ });
519
+ return;
520
+ }
521
+
522
+ if( player.seeking ) {
523
+ youtube.playVideo();
524
+ return;
525
+ }
526
+
527
+ clearInterval(intUIUpdate);
528
+ intUIUpdate = false;
529
+ player.trigger( "pause", [player] );
530
+ break;
531
+
532
+ case YT.PlayerState.PLAYING: // 1
533
+ triggerVideoInfoUpdate();
534
+ onReady();
535
+ triggerUIUpdate();
536
+ if( isMobile ) {
537
+ var ui = jQuery('.fp-ui',root);
538
+ ui.show();
539
+ jQuery('.fp-splash',root).css('pointer-events',''); // iPad iOS 7 couldn't pause video after it started
540
+ if( !jQuery(root).hasClass('no-controlbar') && fv_player_pro_youtube_is_old_android() || flowplayer.support.iOS && flowplayer.support.iOS.version < 10 ) {
541
+ ui.hide();
542
+ }
543
+ }
544
+ if( player.seeking ) {
545
+ player.seeking = false;
546
+
547
+ // todo: stop progress event perhaps
548
+ if( typeof(youtube.getCurrentTime) == "function") {
549
+ player.trigger('seek', [player, youtube.getCurrentTime()] );
550
+ }
551
+ }
552
+
553
+ if( player.paused ) {
554
+ player.trigger( "resume", [player] );
555
+ }
556
+
557
+ // Without this delay we cannot be sure the youtube.isMuted() reports properly in playlists
558
+ player.one('progress', function() {
559
+ if( !player.youtube_unmute_attempted && youtube.isMuted() ) {
560
+ fv_player_log('FV FP YouTube: Trying to restore volume to '+player.volumeLevel);
561
+
562
+ player.volume(player.volumeLevel); // unmute
563
+
564
+ // used to try to unmute the video once paused due to "unmuting failed and the element was paused instead because the user didn't interact with the document before."
565
+ player.youtube_unmute_attempted = 1;
566
+ // But it has to pause quickly, what if user paused the video?
567
+ setTimeout( function() {
568
+ player.youtube_unmute_attempted = false;
569
+ }, 500 );
570
+ }
571
+ } );
572
+
573
+ break;
574
+
575
+ }
576
+
577
+ }
578
+
579
+
580
+ function triggerUIUpdate() {
581
+ var P_previous = false;
582
+ if( intUIUpdate ) return;
583
+ intUIUpdate = setInterval(function () {
584
+ if( typeof(youtube) == "undefined" || typeof(youtube.getCurrentTime) == "undefined" ){
585
+ return;
586
+ }
587
+
588
+ var P = youtube.getCurrentTime();
589
+
590
+ if( isMobile ) { // YouTube sometimes doesn't fire the event to signal that the seeking was finished on iPad
591
+ if( typeof(player.seeking) != "undefined" && player.seeking && P_previous && P_previous < P ) {
592
+ //player.seeking = false;
593
+ player.trigger('seek', [player] );
594
+ }
595
+ P_previous = P;
596
+ }
597
+
598
+ var time = player.video.time = (P > 0) ? P : 0;
599
+
600
+ // for some YouTube Live streams we might get the current time of even
601
+ // 500 days! If we pass that to progress event below, it would result
602
+ // in checking the cuepoints for too long and stalling the browser:
603
+ // https://github.com/flowplayer/flowplayer/blob/d5b70e7a40518582287d9b73aa76ea568c948816/lib/ext/cuepoint.js#L24-L31
604
+ // So we start from 0 here!
605
+ //
606
+ // TODO: What about FV Player Pro custom start time?
607
+ if( player.live ) {
608
+ if( live_stream_start_time == 0 ) {
609
+ live_stream_start_time = time;
610
+ }
611
+ time = time - live_stream_start_time;
612
+ }
613
+
614
+ player.trigger("progress", [player, time] );
615
+ var buffer = youtube.getVideoLoadedFraction() * player.video.duration + 0.5;
616
+ if( buffer < player.video.duration && !player.video.buffered) {
617
+ player.video.buffer = buffer;
618
+ player.trigger("buffer", [player, player.video.buffer ] );
619
+ } else if (!player.video.buffered) {
620
+ player.video.buffered = true;
621
+ player.trigger("buffer", [player, player.video.buffer ] ).trigger("buffered", [player]);
622
+ }
623
+
624
+ }, 250);
625
+
626
+ }
627
+
628
+
629
+ function triggerVideoInfoUpdate() {
630
+ //if( engine.playing ) return;
631
+ //engine.playing = true;
632
+
633
+ jQuery.extend(player.video, getVideoDeatils(youtube) );
634
+ }
635
+
636
+
637
+ var aResolutions = {
638
+ 'small': { width: 320, height: 240, bitrate: 64 },
639
+ 'medium': { width: 640, height: 360, bitrate: 512 },
640
+ 'large': { width: 854, height: 480, bitrate: 640 },
641
+ 'hd720': { width: 1280, height: 720, bitrate: 2000 },
642
+ 'hd1080': { width: 1920, height: 1080, bitrate: 4000 }
643
+ },
644
+ aQuality = {
645
+ bitrates: false,
646
+ defaultQuality: "default",
647
+ activeClass: "active",
648
+ qualityLabels: {
649
+ medium: 'medium',
650
+ large: 'large',
651
+ 'hd720': 'hd'
652
+ }
653
+ },
654
+ bean = flowplayer.bean,
655
+ common = flowplayer.common,
656
+ intUIUpdate = false,
657
+ isMobile = fv_player_pro_youtube_is_mobile(),
658
+ loadVideo,
659
+ root = jQuery(root),
660
+ videoTag,
661
+ youtube,
662
+ live_stream_start_time = 0;
663
+
664
+ var engine = {
665
+ engineName: engineImpl.engineName,
666
+
667
+ load: function (video) {
668
+ loadVideo = video;
669
+ live_stream_start_time = 0;
670
+
671
+ var video_id = fv_player_pro_youtube_get_video_id(video.src);
672
+ if( !video_id ){
673
+ root.find('.fp-ui').append('<div class="fp-message"><h2>' + fv_flowplayer_translations.invalid_youtube + '</h2></div>');
674
+ root.addClass('is-error').removeClass('is-loading');
675
+ // todo: trigger error event in a normal way?
676
+ return;
677
+ }
678
+
679
+ var is_playlist = jQuery('[rel='+jQuery(root).attr('id')+']').find('.is-active').length; // exp: ugly way of detecign if the playback was initiated via playlist clik
680
+
681
+ if( youtube ) {//console.log('YT already loaded');
682
+ if( !flowplayer.support.dataload && !flowplayer.support.inlineVideo ) { // exp: for old iOS
683
+ youtube.cueVideoById( video_id, 0, 'default' );
684
+ } else {//console.log('y 2');
685
+ youtube.loadVideoById( video_id, 0, 'default' );
686
+ }
687
+
688
+ } else if( player.youtube && player.youtube.getIframe() ) { // youtube and its iframe exists - was not destroyed
689
+ //console.log('YT preloaded',player.youtube.getIframe());
690
+ youtube = player.youtube;
691
+
692
+ // this removes the start-up event listeners
693
+ player.fv_yt_onReady();
694
+ player.fv_yt_onStateChange();
695
+ player.fv_yt_onError();
696
+
697
+ youtube.addEventListener('onReady',onReady);
698
+ youtube.addEventListener('onStateChange',onStateChange);
699
+ youtube.addEventListener('onError',onError);
700
+ youtube.addEventListener('onApiChange',onApiChange);
701
+
702
+ // exp: these have to be triggered by hand, as due to some reason the above attached events don't catch onReady nor onStateChange
703
+ onReady();
704
+ onStateChange( { data: 1 } );
705
+ onApiChange();
706
+
707
+ if( !flowplayer.support.dataload && !flowplayer.support.inlineVideo ) { // exp: for old iOS
708
+ youtube.cueVideoById( video_id, 0, 'default' );
709
+
710
+ // exp: we just changed the video to something else, so we need to let it process it
711
+ setTimeout( function() {
712
+ onReady();
713
+ },100); // todo: find some better way!
714
+ } else {
715
+ youtube.loadVideoById( video_id, 0, 'default' );
716
+ }
717
+
718
+ } else {//console.log('YT not yet loaded');
719
+ common.removeNode(common.findDirect("video", root)[0] || common.find(".fp-player > video", root)[0]);
720
+ var wrapperTag = common.createElement("div");
721
+ wrapperTag.className = 'fp-engine fvyoutube-engine';
722
+ common.prepend(common.find(".fp-player", root)[0], wrapperTag);
723
+
724
+ var intLoad = setInterval( function() {
725
+ if( typeof(YT) == "undefined" || typeof(YT.Player) == "undefined" ) {
726
+ //console.log('YT not awaken yet!');
727
+ return;
728
+ }
729
+
730
+ clearInterval(intLoad);
731
+
732
+ youtube = new YT.Player(
733
+ wrapperTag,
734
+ fv_player_pro_youtube_player_vars(video_id, root, {
735
+ onReady: onReady,
736
+ onStateChange: onStateChange,
737
+ onError: onError,
738
+ onApiChange: onApiChange,
739
+ })
740
+ );
741
+
742
+ var iframe = jQuery('.fp-engine.fvyoutube-engine',root);
743
+ iframe[0].allowFullscreen = false;
744
+ /* in Chrome it's possible to double click the video entery YouTube fullscreen that way. Cancelling the event won't help, so here is a pseudo-fix */
745
+ iframe.on("webkitfullscreenchange", function(e) {
746
+ if (document.webkitCancelFullScreen) {
747
+ document.webkitCancelFullScreen();
748
+ }
749
+ return false;
750
+ });
751
+ }, 5 );
752
+ }
753
+
754
+ // exp: only needed if we decide not to use standard player for iPad etc.
755
+ // copy of original Flowplayer variable declarations
756
+ var FS_ENTER = "fullscreen",
757
+ FS_EXIT = "fullscreen-exit",
758
+ FS_SUPPORT = flowplayer.support.fullscreen,
759
+ ua = navigator.userAgent.toLowerCase(),
760
+ IS_SAFARI = /(safari)[ \/]([\w.]+)/.exec(ua) && !/(chrome)[ \/]([\w.]+)/.exec(ua),
761
+ win = window,
762
+ scrollX,
763
+ scrollY;
764
+
765
+ // copy of original Flowplayer function
766
+ player.fullscreen = function(flag) {
767
+ var wrapper = jQuery(root).find('.fp-player')[0];
768
+
769
+ if (player.disabled) return;
770
+
771
+ if (flag === undefined) flag = !player.isFullscreen;
772
+
773
+ if (flag) {
774
+ scrollY = win.scrollY;
775
+ scrollX = win.scrollX;
776
+ }
777
+
778
+ if (FS_SUPPORT) {
779
+
780
+ if (flag) {
781
+ ['requestFullScreen', 'webkitRequestFullScreen', 'mozRequestFullScreen', 'msRequestFullscreen'].forEach(function(fName) {
782
+ if (typeof wrapper[fName] === 'function') {
783
+ wrapper[fName](Element.ALLOW_KEYBOARD_INPUT);
784
+ if (fName === 'webkitRequestFullScreen' && !document.webkitFullscreenElement) { // Element.ALLOW_KEYBOARD_INPUT not allowed
785
+ wrapper[fName]();
786
+ }
787
+ return false;
788
+ }
789
+ });
790
+
791
+ } else {
792
+ ['exitFullscreen', 'webkitCancelFullScreen', 'mozCancelFullScreen', 'msExitFullscreen'].forEach(function(fName) {
793
+ if (typeof document[fName] === 'function') {
794
+ document[fName]();
795
+ }
796
+ });
797
+ }
798
+
799
+ } else {
800
+ player.trigger(flag ? FS_ENTER : FS_EXIT, [player]);
801
+ }
802
+
803
+ return player;
804
+ };
805
+
806
+ player.on('fullscreen-exit', function() {
807
+ win.scrollTo(scrollX, scrollY);
808
+ });
809
+ },
810
+
811
+ mute: function(flag) {
812
+ if( typeof(youtube) == "undefined" ) return;
813
+ player.muted = !!flag;
814
+ if( flag ) youtube.mute(); else youtube.unMute();
815
+ player.trigger('mute', [player, flag]);
816
+ },
817
+
818
+ pause: function () {
819
+ clearInterval(player.YTErrorTimeout);
820
+ youtube.pauseVideo();
821
+ },
822
+
823
+ pick: function (sources) {
824
+ var i, source;
825
+ for (i = 0; i < sources.length; i = i + 1) {
826
+ source = sources[i];
827
+ if( source.src.match(/(youtube\.com|youtube-nocookie\.com|youtu\.be)/) ) {
828
+ if(source.src.match(/\/shorts\//)) {
829
+ source.src = source.src.replace('/shorts/', '/watch?v=') // replace shorts with /watch?v=
830
+ }
831
+
832
+ return source;
833
+ }
834
+ }
835
+ },
836
+
837
+ resume: function () {
838
+ if( player.finished ) {
839
+ //videoTag.currentTime = 0;
840
+ }
841
+ if( typeof(youtube.playVideo) != "undefined" ) {
842
+ youtube.playVideo();
843
+ }
844
+ },
845
+
846
+ seek: function (time) {
847
+ youtube.seekTo(time, true);
848
+ player.seeking = true;
849
+ loadVideo.currentTime = time;
850
+ triggerUIUpdate();
851
+ },
852
+
853
+ speed: function (val) {
854
+ youtube.setPlaybackRate( parseFloat(val) );
855
+ player.trigger('speed', [player, val]);
856
+ },
857
+
858
+ stop: function() {
859
+ youtube.stopVideo();
860
+ },
861
+
862
+ unload: function () { // todo: using youtube.stopVideo breaks things, no good experience with youtube.destroy either
863
+ //engine.playing = false;
864
+
865
+ clearInterval(intUIUpdate);
866
+
867
+ if( !fv_player_pro_youtube_is_mobile() ) {
868
+ youtube.destroy();
869
+ } else {//console.log('YT mobile unload');
870
+ youtube.stopVideo(); // exp. engine.youtube is somehow undefined here?
871
+ }
872
+ player.youtube_unmute_attempted = false;
873
+
874
+ //player.trigger("unload", [engine.player]);
875
+
876
+ player.one( 'load', function(e,api) {
877
+ if( !fv_player_pro_youtube_is_mobile() || api.engine.engineName == 'fvyoutube' ) return;
878
+
879
+ clearInterval(intUIUpdate);
880
+ youtube.destroy();
881
+ player.youtube = false;
882
+
883
+ jQuery('.fvyoutube-engine',root).remove();
884
+ jQuery('.fv-pf-yt-temp2',root).remove();
885
+ jQuery(root).removeClass('is-ytios11');
886
+
887
+ // exp: if the next video is not YouTube, iPad will have issues loading it as there was no video element on the page previously
888
+ //e.preventDefault();
889
+ /*jQuery('.fp-ui',root).css('background-image','');
890
+ jQuery(root).removeClass('is-loading');
891
+ jQuery(root).removeClass('is-mouseover');
892
+ jQuery(root).addClass('is-mouseout');
893
+ jQuery('.fp-ui',root).append('<div class="wpfp_custom_popup fp-notice-load" style="height: 100%"><div class="wpfp_custom_popup_content">' + fv_flowplayer_translations.video_loaded + '</div></div>'); // we show this so that we can capture the user click
894
+
895
+ api.loading = false;
896
+
897
+ var i = api.video.index;
898
+ jQuery('.fp-notice-load').one( 'click', function(e) {
899
+ jQuery('.fp-notice-load',root).remove();
900
+
901
+ var api = jQuery(root).data('flowplayer');
902
+ api.loading = false;
903
+ api.error = false;
904
+ api.play(i);
905
+ } );*/
906
+
907
+ });
908
+
909
+ if( !flowplayer.support.firstframe ) { // prevent playback of the next video on iOS 9 and so on
910
+ player.one( 'ready', function(e,api) {
911
+ api.stop();
912
+ });
913
+ }
914
+ },
915
+
916
+ volume: function (level) {
917
+ if( typeof(youtube.setVolume) == "function" ) {
918
+ if( level > 0 ) player.mute(false);
919
+ player.volumeLevel = level;
920
+ youtube.setVolume( level * 100 );
921
+ player.trigger("volume", [player, level]);
922
+ }
923
+ },
924
+
925
+ };
926
+
927
+ // When the lightbox is closing or switching frames we need to get rid of YouTube as fancyBox moves the player HTML when closing,
928
+ // which means that the iframe content loads again and YouTube video starts playing.
929
+ jQuery(document).on('afterClose.fb beforeLoad.fb', function() {
930
+ if( youtube && (player.lightbox_visible && !player.lightbox_visible()) && (player.is_in_lightbox && player.is_in_lightbox()) ) {
931
+ // Using player.unload() won't work as the player is not in the splash state
932
+ player.trigger("unload", [player]);
933
+
934
+ youtube.destroy();
935
+ youtube = false;
936
+ }
937
+ });
938
+
939
+ return engine;
940
+ };
941
+
942
+ engineImpl.engineName = 'fvyoutube';
943
+ engineImpl.canPlay = function (type) {
944
+ return /video\/youtube/i.test(type);
945
+ };
946
+ flowplayer.engines.push(engineImpl);
947
+
948
+ flowplayer( function(api,root) {
949
+ if( jQuery(root).hasClass('lightboxed') ) return;
950
+ if( fv_player_pro_youtube_is_mobile() ) fv_player_pro_youtube_preload(root,api);
951
+ });
952
+
953
+ jQuery(document).ready( function() {
954
+ if( fv_player_pro_youtube_is_mobile() ) { // in Flowplayer 7 Andoird and iOS thinks it can autoplay
955
+ jQuery(document).on( 'afterShow.fb', function() {
956
+ jQuery('.fancybox-slide--current .flowplayer').each( function() {
957
+ fv_player_pro_youtube_preload(this); // todo: fix if you are opening the lightbox the second time
958
+ })
959
+ });
960
+ }
961
+ });
962
+
963
+ }());
964
+
965
+ }
966
+
967
+
968
+
969
+
970
+ /*
971
+ * YouTube has a limited set of speed settings available and we need to handle special case when a playlist of YouTube, MP4 is started by clicking the 2nd item (MP4)
972
+ */
973
+ if (typeof (flowplayer) !== 'undefined'){
974
+ flowplayer(function(api, root) {
975
+ api.on('ready beforeseek', function() {
976
+ if( api.engine.engineName == 'fvyoutube' ) {
977
+ if( typeof(api.youtube) !== 'undefined' && typeof(api.youtube.getAvailablePlaybackRates) == "function" ) {
978
+ api.conf.backupSpeeds = api.conf.speeds;
979
+ api.conf.speeds = api.youtube.getAvailablePlaybackRates();
980
+ }
981
+ } else {
982
+ if( api.youtube ) { // what happens if you play a vdeo which is not YouTube and the YouTube API is still up, needed for mobile
983
+ api.youtube.destroy();
984
+ api.youtube = false;
985
+ jQuery('.fp-ui',root).css('background-image','');
986
+ jQuery('.fvyoutube-engine',root).remove();
987
+ jQuery('.fv-pf-yt-temp2',root).remove();
988
+ jQuery(root).removeClass('is-ytios11');
989
+ }
990
+
991
+ if(typeof(api.conf.backupSpeeds) !== 'undefined'){
992
+ api.conf.speeds = api.conf.backupSpeeds;
993
+ }
994
+ }
995
+ })
996
+
997
+ // buddyboss-theme - prevent adding div to player root
998
+ if( typeof(jQuery.fn.fitVids) != 'undefined' ) {
999
+ jQuery(root).addClass('fitvidsignore');
1000
+ }
1001
+
1002
+ })
1003
+ }
flowplayer/fv-player-youtube.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var tag,fv_player_pro_youtube_get_video_id,fv_player_pro_youtube_addRemovableEventListener,fv_player_pro_youtube_onReady,fv_player_pro_youtube_onStateChange,fv_player_pro_youtube_onError,fv_player_pro_youtube_is_mobile,fv_player_pro_youtube_is_old_android,fv_player_pro_youtube_player_vars,fv_player_pro_youtube_preload;fv_flowplayer_conf.youtube&&((tag=document.createElement("script")).src="https://www.youtube.com/iframe_api",document.body.appendChild(tag)),"undefined"!=typeof flowplayer&&(fv_player_pro_youtube_get_video_id=function(e){return((aMatch=e.match(/(?:\?|&)v=([a-zA-Z0-9_\-]+)(?:\?|$|&)/))||(aMatch=e.match(/youtu.be\/([a-zA-Z0-9_\-]+)(?:\?|$|&)/))||!!(aMatch=e.match(/embed\/([a-zA-Z0-9_\-]+)(?:\?|$|&)/)))&&aMatch[1]},fv_player_pro_youtube_addRemovableEventListener=function(e,o,t){var r="youtubeCallbackFunction"+Math.random().toString(36).substr(2,7);return window[r]=t,e.addEventListener(o,r),function(){window[r]=function(){},void 0!==e.removeEventListener&&e.removeEventListener(o,r)}},fv_player_pro_youtube_onReady=function(e){e=jQuery(e.target.getIframe()).closest(".flowplayer"),e.removeClass("is-loading"),e=e.data("flowplayer");e.loading=!1,e.trigger("yt-ready"),jQuery(document).trigger("fv-player-yt-api-loaded")},fv_player_pro_youtube_onStateChange=function(e){var o=jQuery(e.target.getIframe()).parents(".flowplayer");switch(e.data){case-1:jQuery(".fp-splash",o).css("pointer-events",""),o.addClass("is-loading");break;case YT.PlayerState.PLAYING:o.data("flowplayer").load();break;case YT.PlayerState.BUFFERING:o.addClass("is-loading")}},fv_player_pro_youtube_onError=function(e){var o=jQuery(e.target.getIframe()).parents(".flowplayer"),t=o.data("flowplayer"),e=(fv_player_log("FV Player Youtube onError for preloaded player",e),(0<t.video.index?t.conf.playlist[t.video.index]:t.conf.clip).sources[0].src);fv_player_track(t,!1,"Video "+(o.hasClass("is-cva")?"Ad ":"")+"error","YouTube video removed",e),setTimeout(function(){o.removeClass("is-splash"),t.loading=!1,o.removeClass("is-loading"),1<t.conf.clip.sources.length?(t.youtube.destroy(),t.youtube=!1,jQuery(".fvyoutube-engine",o).remove(),jQuery(".fv-pf-yt-temp2",o).remove(),jQuery(o).removeClass("is-ytios11"),jQuery(".fp-ui",o).css("background-image",""),jQuery(".fp-ui",o).append('<div class="wpfp_custom_popup fp-notice-load" style="height: 100%"><div class="wpfp_custom_popup_content">'+fv_flowplayer_translations.video_loaded+"</div></div>"),t.video.index,jQuery(".fp-notice-load").one("click",function(e){jQuery(".fp-notice-load",o).remove(),t.trigger("error",[t,{code:4,video:t.video}])})):(t.paused=!1,o.removeClass("is-paused"),t.ready=!0,t.bind("load",function(){t.ready=!1}),setTimeout(function(){t.next()},1e3))})},fv_player_pro_youtube_is_mobile=function(){return!flowplayer.support.firstframe||flowplayer.support.android||flowplayer.support.iOS||flowplayer.support.browser.safari},fv_player_pro_youtube_is_old_android=function(){return flowplayer.support.android&&flowplayer.support.android.version<4.4},fv_player_pro_youtube_player_vars=function(e,o,t){e={videoId:e,width:o.width,height:o.height,playerVars:{autoplay:!flowplayer.support.browser.safari,controls:!jQuery(o).hasClass("no-controlbar")&&fv_player_pro_youtube_is_old_android()?1:0,disablekb:1,enablejsapi:1,fs:0,html5:1,iv_load_policy:3,loop:0,modestbranding:1,origin:"https:"==document.location.protocol?"https://":"http://"+flowplayer.conf.hostname,playsinline:1,rel:0,showinfo:0,showsearch:0,start:0,t0:1,widget_referrer:window?window.location.href:null}};return fv_flowplayer_conf.youtube_cookies||(e.host="https://www.youtube-nocookie.com"),t&&(e.events=t),e},fv_player_pro_youtube_preload=function(e,t){var r,a,i=jQuery(e);!((t=t||i.data("flowplayer"))&&t.conf.item&&"video/youtube"==t.conf.item.sources[0].type||t&&t.conf.clip&&"video/youtube"==t.conf.clip.sources[0].type)||1==t.loading||t.youtube||t.video.index||(t.loading=!0,i.addClass("is-loading"),e=flowplayer.common,r=t.conf.item?fv_player_pro_youtube_get_video_id(t.conf.item.sources[0].src):fv_player_pro_youtube_get_video_id(t.conf.clip.sources[0].src),e.removeNode(e.findDirect("video",i)[0]||e.find(".fp-player > video",i)[0]),(a=e.createElement("div")).className="fp-engine fvyoutube-engine",e.prepend(e.find(".fp-player",i)[0],a),jQuery(document).one("fv-player-yt-api-loaded",function(){var o;("undefined"==typeof YT||void 0===YT.Player)&&window.fv_player_pro_yt_loading||(window.fv_player_pro_yt_loading=!0,o=setInterval(function(){var e;t.loading=!0,i.addClass("is-loading"),"undefined"!=typeof YT&&void 0!==YT.Player&&(clearInterval(o),t.youtube=new YT.Player(a,fv_player_pro_youtube_player_vars(r,i)),jQuery(".fp-engine.fvyoutube-engine",i)[0].allowFullscreen=!1,e=jQuery(".fp-splash",i),jQuery(".fp-ui",i).before(e),e.css("pointer-events","none"),jQuery(".fp-ui",i).before('<div class="fv-pf-yt-temp2"></div>'),flowplayer.support.iOS&&11<flowplayer.support.iOS.version&&(jQuery(i).addClass("is-ytios11"),jQuery(i).find(".fv-pf-yt-temp2").on("click",function(){t.toggle()})),t.fv_yt_onReady=fv_player_pro_youtube_addRemovableEventListener(t.youtube,"onReady",fv_player_pro_youtube_onReady),t.fv_yt_onStateChange=fv_player_pro_youtube_addRemovableEventListener(t.youtube,"onStateChange",fv_player_pro_youtube_onStateChange),t.fv_yt_onError=fv_player_pro_youtube_addRemovableEventListener(t.youtube,"onError",fv_player_pro_youtube_onError))},50))}),window.fv_player_pro_yt_load||(window.fv_player_pro_yt_load=!0,jQuery(document).trigger("fv-player-yt-api-loaded")))},function(){function o(l,d){function t(e){var o=e.getPlaybackQuality(),t={seekable:!0,src:e.getVideoUrl()};return t.duration=e.getDuration(),o&&void 0!==a[o]&&(t.width=a[o].width,t.height=a[o].height,t.quality=o,t.qualityLabel=i.qualityLabels[o],t.bitrate=a[o].bitrate),"function"==typeof e.getVideoData&&(o=e.getVideoData()).title&&(t.fv_title="YouTube: "+o.title+" ("+o.video_id+")"),t}function s(e){fv_player_log("FV Player Youtube onError",e);e=(0<l.video.index?l.conf.playlist[l.video.index]:l.conf.clip).sources[0].src;fv_player_track(l,!1,"Video "+(d.hasClass("is-cva")?"Ad ":"")+"error","YouTube video removed",e),d.addClass("is-splash"),0==l.conf.playlist.length||1<l.conf.clip.sources.length?l.trigger("error",[l,{code:4,video:l.video}]):setTimeout(function(){l.loading=!1,d.removeClass("is-loading"),l.paused=!1,d.removeClass("is-paused"),l.ready=!0,l.bind("load",function(){l.ready=!1}),setTimeout(function(){l.next()},5e3)})}function p(e){l.one("ready progress",function(){var t,o,r,e,a;-1<v.getOptions().indexOf("captions")&&(l.video.subtitles?v.unloadModule("captions"):(t=v.getOption("captions","track"),0==(o=v.getOption("captions","tracklist"))?v.loadModule("captions"):(v.setOption("captions","fontSize",1),r=flowplayer.common,flowplayer.bean,e=r.find(".fp-captions",d)[0],e=(e=r.find(".fp-subtitle",d)[0])||r.appendTo(r.createElement("div",{class:"fp-captions"}),r.find(".fp-player",d)[0]),Array.prototype.forEach.call(e.children,r.removeNode),e=d.find(".fp-cc")[0]||r.createElement("strong",{className:"fp-cc"},"CC"),a=d.find(".fp-subtitle-menu")[0]||r.createElement("div",{className:"fp-menu fp-subtitle-menu"},"<strong>Closed Captions</strong>"),r.find("a",a).forEach(r.removeNode),a.appendChild(r.createElement("a",{"data-yt-subtitle-index":-1},"No subtitles")),(o||[]).forEach(function(e,o){o=r.createElement("a",{"data-yt-subtitle-index":o},e.displayName);t&&t.languageCode&&t.languageCode==e.languageCode&&jQuery(o).addClass("fp-selected"),a.appendChild(o)}),r.find(".fp-ui",d)[0].appendChild(a),r.find(".fp-controls",d)[0].appendChild(e),d.find(".fp-cc").removeClass("fp-hidden"),jQuery(document).on("click",".fp-subtitle-menu a",function(e){e.preventDefault(),jQuery("a[data-yt-subtitle-index]").removeClass("fp-selected"),jQuery(this).addClass("fp-selected"),o[jQuery(this).data("yt-subtitle-index")]?v.setOption("captions","track",{languageCode:o[jQuery(this).data("yt-subtitle-index")].languageCode}):v.unloadModule("captions")}))))})}function f(e){0==v.getDuration()&&(l.live=!0,jQuery(d).addClass("is-live"));var o=jQuery.extend(c,t(v));if(!l.ready){l.mute(!0,!0),v.playVideo();try{l.one("ready",function(){l.trigger("resume",[l])}),l.trigger("ready",[l,o])}catch(e){}}l.ready=!0,u&&jQuery(".fp-ui",d).hide(),(flowplayer.support.iOS.version<11||flowplayer.support.android.version<5)&&(d.find(".fp-speed").hide(),l.YTErrorTimeout=setTimeout(function(){l.error||-1!=v.getPlayerState()||l.trigger("error",[l,{code:4,video:l.video}])},1e3))}function y(e){switch(u||0!=d.find(".fv-fp-no-picture.is-active").length||jQuery(".fvyoutube-engine",d).show(),e.data){case-1:jQuery(".fp-splash",d).css("pointer-events",""),l.playing=!1,l.paused=!0;break;case YT.PlayerState.BUFFERING:"function"==typeof v.getCurrentTime&&l.trigger("seek",[l,v.getCurrentTime()]);break;case YT.PlayerState.CUED:d.removeClass("is-loading"),d.addClass("is-paused"),l.loading=!1,flowplayer.support.firstframe||(o=jQuery("[rel="+d.attr("id")+"] span").eq(l.video.index),jQuery(".fv-pf-yt-temp",d).css("background-image",o.css("background-image")),flowplayer.support.dataload||jQuery(".fp-ui",d).hide(),jQuery(".fv-pf-yt-temp",d).show(),jQuery(".fv-pf-yt-temp-play",d).show());break;case YT.PlayerState.ENDED:l.playing=!1,clearInterval(n),n=!1,l.trigger("pause",[l]),l.trigger("finish",[l]),u||jQuery(".fvyoutube-engine",d).hide(),jQuery(".fv-pf-yt-temp2",d).show(),jQuery(".fp-ui",d).show();break;case YT.PlayerState.PAUSED:if(1===l.youtube_unmute_attempted)return l.youtube_unmute_attempted=2,fv_player_log("FV FP YouTube: Volume restore failed."),l.mute(!0,!0),v.playVideo(),void jQuery("body").one("click",function(){l&&l.ready&&(fv_player_log("FV FP YouTube: Volume restore on click."),l.volume(l.volumeLevel))});if(l.seeking)return void v.playVideo();clearInterval(n),n=!1,l.trigger("pause",[l]);break;case YT.PlayerState.PLAYING:var o;jQuery.extend(l.video,t(v)),f(),r(),u&&((o=jQuery(".fp-ui",d)).show(),jQuery(".fp-splash",d).css("pointer-events",""),(!jQuery(d).hasClass("no-controlbar")&&fv_player_pro_youtube_is_old_android()||flowplayer.support.iOS&&flowplayer.support.iOS.version<10)&&o.hide()),l.seeking&&(l.seeking=!1,"function"==typeof v.getCurrentTime&&l.trigger("seek",[l,v.getCurrentTime()])),l.paused&&l.trigger("resume",[l]),l.one("progress",function(){!l.youtube_unmute_attempted&&v.isMuted()&&(fv_player_log("FV FP YouTube: Trying to restore volume to "+l.volumeLevel),l.volume(l.volumeLevel),l.youtube_unmute_attempted=1,setTimeout(function(){l.youtube_unmute_attempted=!1},500))})}}function r(){var o=!1;n=n||setInterval(function(){var e;void 0!==v&&void 0!==v.getCurrentTime&&(e=v.getCurrentTime(),u&&(void 0!==l.seeking&&l.seeking&&o&&o<e&&l.trigger("seek",[l]),o=e),e=l.video.time=0<e?e:0,l.live&&(e-=g=0==g?e:g),l.trigger("progress",[l,e]),(e=v.getVideoLoadedFraction()*l.video.duration+.5)<l.video.duration&&!l.video.buffered?(l.video.buffer=e,l.trigger("buffer",[l,l.video.buffer])):l.video.buffered||(l.video.buffered=!0,l.trigger("buffer",[l,l.video.buffer]).trigger("buffered",[l])))},250)}var c,v,a={small:{width:320,height:240,bitrate:64},medium:{width:640,height:360,bitrate:512},large:{width:854,height:480,bitrate:640},hd720:{width:1280,height:720,bitrate:2e3},hd1080:{width:1920,height:1080,bitrate:4e3}},i={bitrates:!1,defaultQuality:"default",activeClass:"active",qualityLabels:{medium:"medium",large:"large",hd720:"hd"}},_=(flowplayer.bean,flowplayer.common),n=!1,u=fv_player_pro_youtube_is_mobile(),d=jQuery(d),g=0,e={engineName:o.engineName,load:function(e){g=0;var o=fv_player_pro_youtube_get_video_id((c=e).src);if(!o)return d.find(".fp-ui").append('<div class="fp-message"><h2>'+fv_flowplayer_translations.invalid_youtube+"</h2></div>"),void d.addClass("is-error").removeClass("is-loading");jQuery("[rel="+jQuery(d).attr("id")+"]").find(".is-active").length,v?flowplayer.support.dataload||flowplayer.support.inlineVideo?v.loadVideoById(o,0,"default"):v.cueVideoById(o,0,"default"):l.youtube&&l.youtube.getIframe()?(v=l.youtube,l.fv_yt_onReady(),l.fv_yt_onStateChange(),l.fv_yt_onError(),v.addEventListener("onReady",f),v.addEventListener("onStateChange",y),v.addEventListener("onError",s),v.addEventListener("onApiChange",p),f(),y({data:1}),p(),flowplayer.support.dataload||flowplayer.support.inlineVideo?v.loadVideoById(o,0,"default"):(v.cueVideoById(o,0,"default"),setTimeout(function(){f()},100))):(_.removeNode(_.findDirect("video",d)[0]||_.find(".fp-player > video",d)[0]),(t=_.createElement("div")).className="fp-engine fvyoutube-engine",_.prepend(_.find(".fp-player",d)[0],t),r=setInterval(function(){var e;"undefined"!=typeof YT&&void 0!==YT.Player&&(clearInterval(r),v=new YT.Player(t,fv_player_pro_youtube_player_vars(o,d,{onReady:f,onStateChange:y,onError:s,onApiChange:p})),(e=jQuery(".fp-engine.fvyoutube-engine",d))[0].allowFullscreen=!1,e.on("webkitfullscreenchange",function(e){return document.webkitCancelFullScreen&&document.webkitCancelFullScreen(),!1}))},5));var t,r,a,i,n=flowplayer.support.fullscreen,e=navigator.userAgent.toLowerCase(),u=(/(safari)[ \/]([\w.]+)/.exec(e)&&/(chrome)[ \/]([\w.]+)/.exec(e),window);l.fullscreen=function(e){var o=jQuery(d).find(".fp-player")[0];if(!l.disabled)return(e=void 0===e?!l.isFullscreen:e)&&(i=u.scrollY,a=u.scrollX),n?e?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){if("function"==typeof o[e])return o[e](Element.ALLOW_KEYBOARD_INPUT),"webkitRequestFullScreen"!==e||document.webkitFullscreenElement||o[e](),!1}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){"function"==typeof document[e]&&document[e]()}):l.trigger(e?"fullscreen":"fullscreen-exit",[l]),l},l.on("fullscreen-exit",function(){u.scrollTo(a,i)})},mute:function(e){void 0!==v&&(l.muted=!!e,e?v.mute():v.unMute(),l.trigger("mute",[l,e]))},pause:function(){clearInterval(l.YTErrorTimeout),v.pauseVideo()},pick:function(e){for(var o,t=0;t<e.length;t+=1)if((o=e[t]).src.match(/(youtube\.com|youtube-nocookie\.com|youtu\.be)/))return o.src.match(/\/shorts\//)&&(o.src=o.src.replace("/shorts/","/watch?v=")),o},resume:function(){l.finished,void 0!==v.playVideo&&v.playVideo()},seek:function(e){v.seekTo(e,!0),l.seeking=!0,c.currentTime=e,r()},speed:function(e){v.setPlaybackRate(parseFloat(e)),l.trigger("speed",[l,e])},stop:function(){v.stopVideo()},unload:function(){clearInterval(n),fv_player_pro_youtube_is_mobile()?v.stopVideo():v.destroy(),l.youtube_unmute_attempted=!1,l.one("load",function(e,o){fv_player_pro_youtube_is_mobile()&&"fvyoutube"!=o.engine.engineName&&(clearInterval(n),v.destroy(),l.youtube=!1,jQuery(".fvyoutube-engine",d).remove(),jQuery(".fv-pf-yt-temp2",d).remove(),jQuery(d).removeClass("is-ytios11"))}),flowplayer.support.firstframe||l.one("ready",function(e,o){o.stop()})},volume:function(e){"function"==typeof v.setVolume&&(0<e&&l.mute(!1),l.volumeLevel=e,v.setVolume(100*e),l.trigger("volume",[l,e]))}};return jQuery(document).on("afterClose.fb beforeLoad.fb",function(){v&&l.lightbox_visible&&!l.lightbox_visible()&&l.is_in_lightbox&&l.is_in_lightbox()&&(l.trigger("unload",[l]),v.destroy(),v=!1)}),e}o.engineName="fvyoutube",o.canPlay=function(e){return/video\/youtube/i.test(e)},flowplayer.engines.push(o),flowplayer(function(e,o){jQuery(o).hasClass("lightboxed")||fv_player_pro_youtube_is_mobile()&&fv_player_pro_youtube_preload(o,e)}),jQuery(document).ready(function(){fv_player_pro_youtube_is_mobile()&&jQuery(document).on("afterShow.fb",function(){jQuery(".fancybox-slide--current .flowplayer").each(function(){fv_player_pro_youtube_preload(this)})})})}()),"undefined"!=typeof flowplayer&&flowplayer(function(e,o){e.on("ready beforeseek",function(){"fvyoutube"==e.engine.engineName?void 0!==e.youtube&&"function"==typeof e.youtube.getAvailablePlaybackRates&&(e.conf.backupSpeeds=e.conf.speeds,e.conf.speeds=e.youtube.getAvailablePlaybackRates()):(e.youtube&&(e.youtube.destroy(),e.youtube=!1,jQuery(".fp-ui",o).css("background-image",""),jQuery(".fvyoutube-engine",o).remove(),jQuery(".fv-pf-yt-temp2",o).remove(),jQuery(o).removeClass("is-ytios11")),void 0!==e.conf.backupSpeeds&&(e.conf.speeds=e.conf.backupSpeeds))}),void 0!==jQuery.fn.fitVids&&jQuery(o).addClass("fitvidsignore")});
flowplayer/fv-player.min.js CHANGED
@@ -1 +1 @@
1
- function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if("undefined"!=typeof fv_flowplayer_conf){var FVAbrController,parseIOSVersion=function(e){e=/iP(ad|hone)(; CPU)? OS (\d+_\d)/.exec(e);return e&&1<e.length?parseFloat(e[e.length-1].replace("_","."),10):0};try{"object"==_typeof(window.localStorage)&&void 0!==window.localStorage.volume&&delete fv_flowplayer_conf.volume}catch(e){}flowplayer.conf=fv_flowplayer_conf,flowplayer.conf.fullscreen=!1,flowplayer.conf.chromecast=!1,flowplayer.conf.embed=!1,flowplayer.conf.share=!1,flowplayer.conf.analytics=!1,void 0!==fv_flowplayer_conf.disable_localstorage&&(flowplayer.conf.storage={});try{flowplayer.conf.key=atob(flowplayer.conf.key)}catch(e){}!flowplayer.support.android&&flowplayer.conf.dacast_hlsjs&&((FVAbrController=function(e){this.hls=e,this.nextAutoLevel=3}).prototype.nextAutoLevel=function(e){this.nextAutoLevel=e},FVAbrController.prototype.destroy=function(){},flowplayer.conf.hlsjs={startLevel:-1,abrController:FVAbrController}),flowplayer.support.iOS&&flowplayer.support.iOS.chrome&&0==flowplayer.support.iOS.version&&(flowplayer.support.iOS.version=parseIOSVersion(navigator.userAgent)),(flowplayer.support.iOS&&13<=parseInt(flowplayer.support.iOS.version)||!flowplayer.support.iOS&&flowplayer.support.browser.safari&&8<=parseInt(flowplayer.support.browser.version))&&(flowplayer.conf.hlsjs.safari=!0),flowplayer.support.fvmobile=!(flowplayer.support.firstframe&&!flowplayer.support.iOS&&!flowplayer.support.android);var fls=flowplayer.support;flowplayer.conf.mobile_native_fullscreen&&"ontouchstart"in window&&fls.fvmobile&&(flowplayer.conf.native_fullscreen=!0),"ontouchstart"in window&&(fls.android&&fls.android.version<4.4&&!(fls.browser.chrome&&54<fls.browser.version)&&(flowplayer.conf.native_fullscreen=!0),fls.iOS&&(fv_player_in_iframe()||fls.iOS.version<7)&&(flowplayer.conf.native_fullscreen=!0))}"undefined"!=typeof fv_flowplayer_translations&&(flowplayer.defaults.errors=fv_flowplayer_translations);var fv_player_did_autoplay=!1;function fv_player_videos_parse(e,a){try{var o=JSON.parse(e)}catch(e){return!1}var n;flowplayer.support.browser.safari&&(n=!1,jQuery(o.sources).each(function(e,t){if("video/webm"!=t.type)return!(n=!0)}),n&&jQuery(o.sources).each(function(e,t){"video/webm"==t.type&&delete o.sources[e]}));var r,e=new RegExp("[\\?&]fv_flowplayer_mobile=([^&#]*)").exec(location.search);return!(null!=e&&"yes"==e[1]||jQuery(window).width()<=480||jQuery(window).height()<=480)||null!=e&&"no"==e[1]||(r=!1,jQuery(o.sources).each(function(e,t){t.mobile&&(o.sources[e]=o.sources[0],o.sources[0]=t,r=!0),r&&jQuery(a).after('<p class="fv-flowplayer-mobile-switch">'+fv_flowplayer_translations.mobile_browser_detected_1+' <a href="'+document.URL+'?fv_flowplayer_mobile=no">'+fv_flowplayer_translations.mobile_browser_detected_2+"</a>.</p>")})),a.trigger("fv_player_videos_parse",o),o}function fv_player_in_iframe(){try{return window.self!==window.top}catch(e){return!0}}function fv_escape_attr(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,function(e){return t[e]})}function fv_player_preload(){function e(){jQuery(".flowplayer.fp-is-embed").each(function(){var e=jQuery(this);e.hasClass("has-chapters")||e.hasClass("has-transcript")||0!=jQuery(".fp-playlist-external[rel="+e.attr("id")+"]").length||e.height(jQuery(window).height())})}if(flowplayer.support.touch&&jQuery(".fp-playlist-external.fv-playlist-design-2017").addClass("visible-captions"),flowplayer(function(n,r){localStorage.flowplayerTestStorage&&delete localStorage.flowplayerTestStorage;var e,t,i=(r=jQuery(r)).find(".fp-player"),l=!1,a=(r.hasClass("fixed-controls")&&r.find(".fp-controls").on("click",function(e){n.loading||n.ready||(e.preventDefault(),e.stopPropagation(),n.load())}),flowplayer.support.volume||flowplayer.support.autoplay||r.find(".fp-volume").hide(),0==r.data("volume")&&r.hasClass("no-controlbar")&&r.find(".fp-volume").remove(),jQuery(".fp-playlist-external[rel="+r.attr("id")+"]")),s=((!n.conf.playlist||0==n.conf.playlist.length)&&a.length&&0<a.find("a[data-item]").length?(e=[],a.find("a[data-item]").each(function(){(parsed=fv_player_videos_parse(jQuery(this).attr("data-item"),r))?e.push(parsed):jQuery(this).remove()}),n.conf.playlist=e,n.conf.clip=e[0]):n.conf.clip||(n.conf.clip=fv_player_videos_parse(jQuery(r).attr("data-item"),r)),jQuery("a",a).on("click",function(e){e.preventDefault(),l=!0;var e=jQuery(this),t=jQuery(".fp-playlist-external[rel="+r.attr("id")+"]"),t=jQuery("a",t).index(this),a=e.prev("a"),o=e.data("item");if(location.href.match(/wp-admin/)&&0<e.parents(".fv-player-editor-preview").length)return fv_flowplayer_conf.current_video_to_edit=t,e.parents(".fv-player-custom-video").find(".edit-video .fv-player-editor-button").trigger("click"),!1;if(a.length&&e.is(":visible")&&!a.is(":visible"))return a.trigger("click"),!1;if(!jQuery("#"+e.parent().attr("rel")).hasClass("dynamic-playlist")){if(fv_player_playlist_active(jQuery(".fp-playlist-external[rel="+r.attr("id")+"]"),this),n){if(n.error&&(n.pause(),n.error=n.loading=!1,r.removeClass("is-error"),r.find(".fp-message.fp-shown").remove()),!n.video||n.video.index==t)return;n.play(t)}a=(a=o.splash)||e.find("img").attr("src");p(r,i,o,a),r[0].getBoundingClientRect().bottom-100<0&&jQuery("html, body").animate({scrollTop:jQuery(r).offset().top-100},300)}}),jQuery("[rel="+r.attr("id")+"]")),o=!1,f=r.find(".fp-splash"),c=r.find(".fv-fp-splash-text");function p(e,t,a,o){e=e.find("img.fp-splash");o?(0==e.length&&(e=jQuery('<img class="fp-splash" />'),t.prepend(e)),e.attr("alt",a.fv_title?fv_escape_attr(a.fv_title):"video"),e.attr("src",o)):e.length&&e.remove()}n.bind("load",function(e,t,a){var o;t.conf.playlist.length&&(a.type.match(/^audio/)&&!l&&(o=(o=(a=(t=s.find("a").eq(a.index)).data("item")).splash)||t.find("img").attr("src"),p(r,i,a,o)),l=!1)}),n.bind("ready",function(e,t,a){setTimeout(function(){var e;-1<a.index&&0<s.length&&(e=jQuery("a",s).eq(a.index),fv_player_playlist_active(s,e),o=e.find(".fvp-progress"))},100),f=r.find(".fp-splash"),a.is_audio_stream||a.type.match(/^audio/)||(window.fv_player_pro&&window.fv_player_pro.autoplay_scroll||r.data("fvautoplay")?t.one("progress",function(){f.remove(),c.remove()}):(f.remove(),c.remove()))}),n.bind("unload",function(){jQuery(".fp-playlist-external .now-playing").remove(),jQuery(".fp-playlist-external a").removeClass("is-active");var e=i.find("iframe.fp-engine");e.length?(e.after(c),e.after(f)):(i.prepend(c),i.prepend(f)),o=!1}),n.bind("progress",function(e,t,a){o.length&&t.playlist_thumbnail_progress(o,t.video,a)}),n.bind("error-subtitles",function(){console.log("error-subtitles"),fv_player_notice(r,fv_flowplayer_translations[8],2e3)}),(a=jQuery(r).parent().find("div.fp-playlist-vertical[rel="+jQuery(r).attr("id")+"]")).length&&((t=function(e){var t=a.hasClass("fp-playlist-only-captions")?"height":"max-height";a.parents(".fp-playlist-text-wrapper").hasClass("is-fv-narrow")&&(t="max-height"),a.css(t,function(){var e=r.height();0==e&&(e=r.css("max-height"));return e}()),"max-height"==t&&a.css("height","auto")})(),jQuery(window).on("resize tabsactivate",function(){setTimeout(t,0)})),n.show_status=function(e){var a="";["loading","ready","playing","paused","seeking"].every(function(e,t){return n[e]&&(a+=" "+e),!0}),console.log("FV Player Status ("+e+")",a)},window.fv_player_loaded||(window.fv_player_loaded=!0,setTimeout(function(){jQuery(document).trigger("fv_player_loaded");var e=new CustomEvent("fv_player_loaded",[]);document.dispatchEvent(e)},100)),setTimeout(function(){r.trigger("fv_player_loaded")},10),r.data("error")&&(n.message(r.data("error")),r.find(".fp-controls").remove(),r.find(".fp-header").css("opacity",1).show(),n.conf.clip={sources:[{src:!1,type:"video/mp4"}]},n.on("load",function(e){e.preventDefault(),e.stopPropagation()}))}),window.self==window.top||location.href.match(/fv_player_preview/)||(e(),jQuery(window.self).resize(e)),"undefined"!=typeof fv_flowplayer_playlists)for(var t in fv_flowplayer_playlists)fv_flowplayer_playlists.hasOwnProperty(t)&&jQuery("#"+t).flowplayer({playlist:fv_flowplayer_playlists[t]});fv_player_load(),fv_autoplay_exec(),jQuery(document).ajaxComplete(function(){fv_player_load()}),jQuery(window).on("hashchange",fv_autoplay_exec)}function fv_player_load(n){n&&1<n.lenght&&console.log("FV Player: Can't use fv_player_load with more than a single forced element!");var r=!1;if((n||jQuery(".flowplayer")).each(function(e,t){var a=jQuery(t),t=a.data("flowplayer");if(t)n&&(r=t);else{n&&(a.find(".fp-preload, .fvfp_admin_error").remove(),a.attr("data-item-lazy")?(a.attr("data-item",a.attr("data-item-lazy")),a.removeAttr("item-lazy")):(playlist=jQuery("[rel="+a.attr("id")+"]"))&&playlist.find("a[data-item-lazy]").each(function(e,t){(t=jQuery(t)).attr("data-item",t.attr("data-item-lazy")),t.removeAttr("data-item-lazy")}));t=!1;if(a.attr("data-item"))t={clip:fv_player_videos_parse(a.attr("data-item"),a)};else if(playlist=jQuery("[rel="+a.attr("id")+"]")){if(0==playlist.find("a[data-item]").length)return;var o=[];playlist.find("a[data-item]").each(function(){(parsed=fv_player_videos_parse(jQuery(this).attr("data-item"),a))?o.push(parsed):jQuery(this).remove()}),t={playlist:o}}t&&(t=flowplayer.extend(t,a.data()),r=flowplayer(a[0],t),a.data("flowplayer",r))}}),jQuery(".fv-playlist-slider-wrapper").each(function(e,t){var a=jQuery(this).find("a");jQuery(this).find(".fp-playlist-external").css("width",a.outerWidth()*a.length)}),void 0!==jQuery().tabs&&(jQuery("body").removeClass("fv_flowplayer_tabs_hide"),jQuery(".fv_flowplayer_tabs_content").tabs()),n&&r)return r}function fv_player_playlist_active(e,t){e&&(jQuery("a",e).removeClass("is-active"),jQuery(".now-playing").remove()),$playlist=jQuery(e);var a,e=!1,t=(($item=jQuery(t)).addClass("is-active"),$playlist.hasClass("fv-playlist-design-2014"));(t&&0==$item.find("h4").length||!t)&&0==$item.find(".now-playing").length&&$item.prepend('<strong class="now-playing"><span>'+fv_flowplayer_translations.playlist_current+"</span></strong>"),$playlist.parent().find(".flowplayer").length||(e=!0),($playlist.hasClass("fp-playlist-vertical")||$playlist.hasClass("fp-playlist-horizontal")&&$playlist.hasClass("is-audio"))&&!function(e){var t=e.getBoundingClientRect(),a=t.top,o=t.height,n=a+o,e=e.parentNode;do{if(t=e.getBoundingClientRect(),n<=t.bottom==!1)return;if(a<=t.top)return}while(e=e.parentNode,e!=document.body);return n<=document.documentElement.clientHeight}($item.get(0))?(a=e?$playlist.parent():$playlist).animate({scrollTop:a.scrollTop()+($item.position().top-a.position().top)},750):$playlist.hasClass("fp-playlist-horizontal")&&!function(e){var t=e.getBoundingClientRect(),a=t.left,o=t.width,n=a+o,e=e.parentNode;do{if(t=e.getBoundingClientRect(),n<=t.right==!1)return;if(a<=t.left)return}while(e=e.parentNode,e!=document.body);return n<=document.documentElement.clientWidth}($item.get(0))&&(a=e?$playlist.parent():$playlist).animate({scrollLeft:a.scrollLeft()+($item.position().left-a.position().left)},750)}jQuery(document).ready(function(){var e=0,t=setInterval(function(){++e<1e3&&(window.fv_video_intelligence_conf&&!window.FV_Player_IMA||window.fv_vast_conf&&!window.FV_Player_IMA||window.fv_player_pro&&!window.FV_Flowplayer_Pro&&document.getElementById("fv_player_pro")!=fv_player_pro||window.fv_player_user_playlists&&!window.fv_player_user_playlists.is_loaded||window.FV_Player_JS_Loader_scripts_total&&window.FV_Player_JS_Loader_scripts_loaded<window.FV_Player_JS_Loader_scripts_total)||(clearInterval(t),fv_player_preload())},10)});var fv_fp_date=new Date,fv_fp_utime=fv_fp_date.getTime();function fv_parse_sharelink(e){var t="fvp_";if((e=e.replace("https?://[^./].","")).match(/(youtube.com)/))return t+e.match(/(?:v=)([A-Za-z0-9_-]*)/)[1];if(e.match(/(vimeo.com)|(youtu.be)/))return t+e.match(/(?:\/)([^/]*$)/)[1];var a=e.match(/(?:\/)([^/]*$)/);return a?t+a[1].match(/^[^.]*/)[0]:t+e}function fv_player_get_video_link_hash(e){var t=fv_parse_sharelink((void 0!==e.video.sources_original&&void 0!==e.video.sources_original[0]?e.video.sources_original:e.video.sources)[0].src);return t=void 0!==e.video.id?fv_parse_sharelink(e.video.id.toString()):t}function fv_player_time_hms(e){if(isNaN(e))return NaN;var t=parseInt(e,10),a=Math.floor(t/3600),o=Math.floor(t/60)%60,e=t%60;return a?a+="h":a="",a&&o<10?o="0"+o+"m":o?o+="m":o="",(a||o)&&e<10&&(e="0"+e),a+o+(e+="s")}function fv_player_time_hms_ms(e){if(isNaN(e))return NaN;var t=void 0!==(t=((e=parseFloat(e).toFixed(3))+"").split("."))[1]&&0<t[1]?t[1]+"ms":"";return fv_player_time_hms(e)+t}function fv_player_time_seconds(e,t){if(!e)return-1;var a=0;return e.match(/(\d+[a-z]{1,2})/g).forEach(function(e){e.endsWith("h")?a+=3600*parseInt(e):e.endsWith("m")?a+=60*parseInt(e):e.endsWith("s")&&!e.endsWith("ms")?a+=parseInt(e):e.endsWith("ms")&&parseInt(e)&&(a+=parseInt(e)/1e3)}),t?Math.min(a,t):a}function fv_autoplay_init(e,a,t,o,n){var r,i,l;fv_autoplay_exec_in_progress||(fv_autoplay_exec_in_progress=!0,(r=e.data("flowplayer"))&&(i=fv_player_time_seconds(t),n=fv_player_time_seconds(n),o=fv_player_time_seconds(o),e.parent().hasClass("ui-tabs-panel")&&(t=e.parent().attr("id"),jQuery("[aria-controls="+t+"] a").trigger("click")),e.find(".fp-player").attr("class").match(/\bis-sticky/)||(l=jQuery(e).offset().top-(jQuery(window).height()-jQuery(e).height())/2,window.scrollTo(0,l),r.one("ready",function(){window.scrollTo(0,l)})),e.hasClass("lightboxed")&&setTimeout(function(){jQuery("[href=\\#"+e.attr("id")+"]").trigger("click")},0),a?fv_player_video_link_autoplay_can(r,parseInt(a))?r.ready?fv_player_video_link_seek(r,i):(r.play(parseInt(a)),r.one("ready",function(){fv_player_video_link_seek(r,i,n,o)})):flowplayer.support.inlineVideo&&(r.one(r.playing?"progress":"ready",function(e,t){t.play(parseInt(a)),t.one("ready",function(){fv_player_video_link_seek(t,i,n,o)})}),e.find(".fp-splash").attr("src",jQuery("[rel="+e.attr("id")+"] div").eq(a).find("img").attr("src")),fv_player_in_iframe()||fv_player_notice(e,fv_flowplayer_translations[11],"progress")):r.ready?fv_player_video_link_seek(r,i):(fv_player_video_link_autoplay_can(r)?r.load():fv_player_in_iframe()||fv_player_notice(e,fv_flowplayer_translations[11],"progress"),r.one("ready",function(){fv_player_video_link_seek(r,i,n,o)}))))}function fv_player_video_link_seek(e,t,a,o){fv_autoplay_exec_in_progress=!1;var n=setInterval(function(){e.loading||((0<t||0<e.video.time)&&(e.custom_seek?e.custom_seek(t):e.seek(t)),a&&o&&e.trigger("link-ab",[e,o,a]),clearInterval(n))},10)}var fv_autoplay_exec_in_progress=!1;function fv_autoplay_exec(){var e,i,l,s,f,c=!0;"undefined"!=typeof flowplayer&&"undefined"!=typeof fv_flowplayer_conf&&fv_flowplayer_conf.video_hash_links&&window.location.hash.substring(1).length&&(e=window.location.hash.match(/\?t=/)?window.location.hash.substring(1).split("?t="):window.location.hash.substring(1).split(","),i=e[0],l=void 0!==e[1]&&e[1],s=void 0!==e[2]&&e[2],f=void 0!==e[3]&&e[3],jQuery(".flowplayer").each(function(){var e=jQuery(this),t=(e=e.hasClass("lightbox-starter")?jQuery(e.attr("href")):e).data("flowplayer");if(t){var a,o=void 0!==t.conf.playlist&&1<t.conf.playlist.length?t.conf.playlist:[t.conf.clip];for(a in o)if(o.hasOwnProperty(a)){var n=void 0!==o[a].id&&fv_parse_sharelink(o[a].id.toString());if(i===n&&c)return console.log("fv_autoplay_exec for "+n,a),fv_autoplay_init(e,parseInt(a),l,s,f),c=!1}for(a in o)if(o.hasOwnProperty(a)){var r=fv_parse_sharelink(o[a].sources[0].src);if(i===r&&c)return console.log("fv_autoplay_exec for "+r,a),fv_autoplay_init(e,parseInt(a),l,s,f),c=!1}}})),c&&flowplayer.support.firstframe&&jQuery(".flowplayer[data-fvautoplay]").each(function(){var e,t,a=jQuery(this),o=a.data("flowplayer"),n=a.attr("data-fvautoplay");!fv_player_did_autoplay&&n&&-1!=n&&((flowplayer.support.android||flowplayer.support.iOS)&&o&&"video/youtube"==o.conf.clip.sources[0].type?console.log("FV Player: Autoplay for YouTube not supported on Android and iOS"):(fv_player_did_autoplay=!0,o.conf.playlist.length&&!isNaN(parseFloat(n))&&isFinite(n)?o.play(parseInt(n)):o.load(),e=a.find(".fp-play").addClass("invisible"),t=a.find(".fp-controls").addClass("invisible"),o.one("progress",function(){e.removeClass("invisible"),t.removeClass("invisible")}),"muted"==n&&o.mute(!0,!0)))})}function fv_player_video_link_autoplay_can(e,t){return!("video/youtube"==(t?e.conf.playlist[t]:e.conf.clip).sources[0].type&&(flowplayer.support.iOS||flowplayer.support.android)||fv_player_in_iframe())&&flowplayer.support.firstframe}function fv_player_notice(e,t,a){var o=jQuery(".fvfp-notices",e),n=(o.length||(o=jQuery('<div class="fvfp-notices">'),jQuery(".fp-player",e).append(o)),jQuery('<div class="fvfp-notice-content">'+t+"</div></div>"));return o.append(n),"string"==typeof a&&jQuery(e).data("flowplayer").on(a,function(){n.fadeOut(100,function(){jQuery(this).remove()})}),0<a&&setTimeout(function(){n.fadeOut(2e3,function(){jQuery(this).remove()})},a),n}var fv_player_clipboard=function(e,t,a){if(navigator.clipboard&&"function"==typeof navigator.clipboard.writeText)navigator.clipboard.writeText(e).then(function(){t()},function(){a()});else try{(fv_player_doCopy(e)?t:a)()}catch(e){void 0!==a&&a(e)}};function fv_player_doCopy(e){var t,a,o,n=document.createElement("textarea"),e=(n.value=e,n.style.opacity=0,n.style.position="absolute",n.setAttribute("readonly",!0),document.body.appendChild(n),0<document.getSelection().rangeCount&&document.getSelection().getRangeAt(0));navigator.userAgent.match(/ipad|ipod|iphone/i)?(t=n.contentEditable,n.contentEditable=!0,(a=document.createRange()).selectNodeContents(n),(o=window.getSelection()).removeAllRanges(),o.addRange(a),n.setSelectionRange(0,999999),n.contentEditable=t):n.select();try{var r=document.execCommand("copy");return e&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(e)),document.body.removeChild(n),r}catch(e){throw new Error("Unsuccessfull")}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function is_ga_4(e){return!(void 0===e.conf.fvanalytics||!e.conf.fvanalytics||!e.conf.fvanalytics.startsWith("G-"))}function fv_player_track(e,t,a,o,n,r){if("object"!=_typeof(e)&&(r=n,n=o,o=a,a=t,t=e,e=!1),t=t||flowplayer.conf.fvanalytics,void 0===o&&(o="Unknown engine"),/fv_player_track_debug/.test(window.location.href)&&console.log("FV Player Track: "+a+" - "+o+" '"+n+"'",r),"undefined"!=typeof gtag)is_ga_4(e)?gtag("event",a,{video_current_time:e.video.time,video_provider:o,video_duration:e.video.duration,value:r||1}):gtag("event",a,{event_category:o,event_label:n,value:r||1});else if(t&&"undefined"!=typeof ga)ga("create",t,"auto",n,{allowLinker:!0}),ga("require","linker"),r?ga("send","event",a,o,n,r):ga("send","event",a,o,n);else if(t&&"undefined"!=typeof _gat){e=_gat._getTracker(t);if(void 0===e._setAllowLinker)return;e._setAllowLinker(!0),r?e._trackEvent(a,o,n,r):e._trackEvent(a,o,n)}flowplayer.conf.matomo_domain&&flowplayer.conf.matomo_site_id&&"undefined"!=typeof _paq&&(r?_paq.push(["trackEvent",a,o,n,r]):_paq.push(["trackEvent",a,o,n]))}function fv_player_track_name(e,t){e=e.attr("title");return(e=(e=e||void 0===t.fv_title?e:t.fv_title)||void 0===t.title?e:t.title)||void 0===t.src||(e=t.src.split("/").slice(-1)[0].replace(/\.(\w{3,4})(\?.*)?$/i,""),t.type.match(/mpegurl/)&&(e=t.src.split("/").slice(-2)[0].replace(/\.(\w{3,4})(\?.*)?$/i,"")+"/"+e)),e}flowplayer(function(a,r){var n,t,i,o,l;function e(){var e;"dash"==a.engine.engineName?((e=i[a.engine.dash.getQualityFor("video")]).qualityIndex!=o&&(o=e.qualityIndex,s(e.qualityIndex,i)),t.match(/dash_debug/)&&f(e.width,e.height,e.bitrate)):"hlsjs-lite"==a.engine.engineName&&(n.currentLevel!=o&&(o=n.currentLevel,s(n.currentLevel,n.levels)),t.match(/hls_debug/)&&(e=n.levels[n.currentLevel])&&f(e.width,e.height,e.bitrate))}function s(e,t){var a,o,n;t[e]&&(a=t[e].height,o=541,n=1e5,jQuery(t).each(function(e,t){720<=t.height&&t.height<1400&&(o=720),t.height<n&&(n=t.height),localStorage.FVPlayerHLSQuality==t.height&&(r.find("a[data-quality]").removeClass("fp-selected fp-color"),r.find("a[data-quality="+e+"]").addClass("fp-selected fp-color"))}),r.find("a[data-quality]").removeClass("is-current"),r.find("a[data-quality="+e+"]").addClass("is-current"),t=1400<=a?"4K":o<=a?"HD":360<=a&&n<a?"SD":"SD",r.find(".fp-qsel").html(t))}function f(e,t,a){l.html("Using "+e+"x"+t+" at "+Math.round(a/1024)+" kbps")}function c(){var a=r.find(".fp-qsel-menu");a.children().each(function(e,t){a.prepend(t)}),a.children().each(function(e,t){var a;/^NaNp/.test(jQuery(t).html())?(a=jQuery(t).html().match(/\((.*?)\)/))&&void 0!==a[1]&&jQuery(t).html(a[1]):jQuery(t).html(jQuery(t).html().replace(/\(.*?\)/,""))}),a.prepend(a.find("a[data-quality=-1]")),a.prepend(a.find("strong"))}r=jQuery(r),void 0===a.conf.disable_localstorage&&(flowplayer.engine("hlsjs-lite").plugin(function(e){(n=e.hls).on(Hls.Events.ERROR,function(e,t){"mediaError"==t.type&&"fragParsingError"==t.details&&1==t.fatal&&(n.destroy(),a.trigger("error",[a,{code:3}]),setTimeout(function(){r.removeClass("is-seeking"),r.addClass("is-paused")},0))}),flowplayer.support.browser.safari&&n.on(Hls.Events.KEY_LOADED,function(e){"hlsKeyLoaded"==e&&setTimeout(function(){a.loading&&(console.log("FV Player: Safari stuck loading HLS, resuming playback..."),a.resume())},0)});var o=!(!flowplayer.conf.hd_streaming||flowplayer.support.fvmobile)&&720;0==jQuery(e.root).data("hd_streaming")&&(o=!1),(o=localStorage.FVPlayerHLSQuality?localStorage.FVPlayerHLSQuality:o)&&n.on(Hls.Events.MANIFEST_PARSED,function(e,t){var a=!1;jQuery.each(t.levels,function(e,t){t.height==o&&(a=e)}),localStorage.FVPlayerHLSQuality||a||jQuery.each(t.levels,function(e,t){t.height>a&&(a=e)}),a&&(console.log("FV Player: Picked "+t.levels[a].height+"p quality"),n.startLevel=a,n.currentLevel=a)})}),r=jQuery(r),t=document.location.search,localStorage.FVPlayerDashQuality&&(a.conf.dash||(a.conf.dash={}),a.conf.dash.initialVideoQuality="restore"),r.on("click",".fp-qsel-menu a",function(){var e;"hlsjs-lite"==a.engine.engineName&&(-1==(e=jQuery(this).data("quality"))?localStorage.removeItem("FVPlayerHLSQuality"):(e=n.levels[e],localStorage.FVPlayerHLSQuality=e.height))}),localStorage.FVPlayerHLSQuality?(a.conf.hlsjs.startLevel=parseInt(localStorage.FVPlayerHLSQuality),a.conf.hlsjs.testBandwidth=!1,a.conf.hlsjs.autoLevelEnabled=!1):flowplayer.conf.hd_streaming&&!flowplayer.support.fvmobile&&(a.conf.hlsjs.startLevel=3,a.conf.hlsjs.testBandwidth=!1,a.conf.hlsjs.autoLevelEnabled=!1),a.bind("quality",function(e,t,a){"dash"==t.engine.engineName&&(-1==a?localStorage.removeItem("FVPlayerDashQuality"):i[a]&&(localStorage.FVPlayerDashQuality=i[a].height))}),i=[],o=-1,a.bind("ready",function(e,t){var o;r.find(".fp-qsel-menu strong").text(fv_flowplayer_translations.quality),"dash"==t.engine.engineName?(i=t.engine.dash.getBitrateInfoListFor("video"),localStorage.FVPlayerDashQuality&&t.conf.dash.initialVideoQuality&&t.quality(t.conf.dash.initialVideoQuality),c()):"hlsjs-lite"==t.engine.engineName?(r.addClass("is-loading"),t.loading=!0,t.one("progress",function(){t.loading&&(r.removeClass("is-loading"),t.loading=!1)}),t.video.qualities&&2<t.video.qualities.length&&(o=-1,localStorage.FVPlayerHLSQuality?jQuery(t.video.qualities).each(function(e,t){if(t.value==localStorage.FVPlayerHLSQuality)return o=localStorage.FVPlayerHLSQuality,!1}):flowplayer.conf.hd_streaming&&!flowplayer.support.fvmobile&&jQuery(t.video.qualities).each(function(e,t){var a=parseInt(t.label);0<a&&-1==o&&720<=a&&a<=720&&(o=t.value)}),-1<(o=parseInt(o))&&r.one("progress",function(){setTimeout(function(){t.quality(o)})}),c())):t.video.sources_fvqs&&0<t.video.sources_fvqs.length&&t.video.src.match(/vimeo.*?\.mp4/)&&setTimeout(c,0),r.find("a[data-quality]").removeClass("is-current")}),(t.match(/dash_debug/)||t.match(/hls_debug/))&&(l=jQuery('<div class="fv-debug" style="background: gray; color: white; top: 10%; position: absolute; z-index: 1000">').appendTo(r.find(".fp-player"))),a.bind("ready progress",e),a.bind("quality",function(){setTimeout(e,0)}))}),flowplayer(function(o,n){var r=(n=jQuery(n)).attr("id"),i=!1;function l(){var t,a,e=n.attr("data-ad");if(void 0!==e&&e.length){try{e=JSON.parse(e)}catch(e){return}!i&&!n.hasClass("is-cva")&&n.width()>=parseInt(e.width)&&(e=(e=e.html).replace("%random%",Math.random()),i=jQuery('<div id="'+r+'_ad" class="wpfp_custom_ad">'+e+"</div>"),n.find(".fp-player").append(i),t=0,a=setInterval(function(){var e=i&&i.find(".adsbygoogle").height();(200<++t||0<e)&&clearInterval(a),e>n.height()&&i.addClass("tall-ad")},50),setTimeout(function(){n.find(".wpfp_custom_ad video").length&&o.pause()},500))}}function a(e){var t=n.attr("data-popup");if(void 0!==t&&t.length){try{t=JSON.parse(t)}catch(e){return}("finish"==e||t.pause||t.html.match(/fv-player-ppv-purchase-btn-wrapper/))&&0==n.find(".wpfp_custom_popup").length&&(n.addClass("is-popup-showing"),n.find(".fp-player").append('<div id="'+r+'_custom_popup" class="wpfp_custom_popup">'+t.html+"</div>"))}}n.data("end_popup_preview")&&jQuery(document).ready(function(){o.trigger("finish",[o])}),o.bind("ready",function(e,t){1==i.length&&(i.remove(),i=!1),n.data("ad_show_after")||l()}).bind("progress",function(e,t,a){a>n.data("ad_show_after")&&l()}).bind("finish",function(e,t){void 0!==t.video.index&&t.video.index+1!=t.conf.playlist.length||a(e.type)}).bind("pause",function(e,t){a(e.type)}).bind("resume unload seek",function(e,t){n.hasClass("is-popup-showing")&&(n.find(".wpfp_custom_popup").remove(),n.removeClass("is-popup-showing"))})}),jQuery(document).on("click",".fv_fp_close",function(){var e=jQuery(this).parents(".wpfp_custom_ad_content"),t=e.find("video");return e.fadeOut(),t.length&&t[0].pause(),!1}),jQuery(document).on("focus",".fv_player_popup input[type=text], .fv_player_popup input[type=email], .fv_player_popup textarea",function(){var e=jQuery(this).parents(".flowplayer").data("flowplayer");e&&e.disable(!0)}),jQuery(document).on("blur",".fv_player_popup input[type=text], .fv_player_popup input[type=email], .fv_player_popup textarea",function(){var e=jQuery(this).parents(".flowplayer").data("flowplayer");e&&e.disable(!1)}),flowplayer(function(o,s){var n,r,e,t,a,s=jQuery(s),i=flowplayer.bean,l=0,f=0,c=("undefined"==typeof ga&&o.conf.fvanalytics&&"undefined"==typeof _gat&&"undefined"==typeof gtag&&(is_ga_4(o)?jQuery.getScript({url:"https://www.googletagmanager.com/gtag/js?id="+o.conf.fvanalytics,cache:!0},function(){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",o.conf.fvanalytics)}):jQuery.getScript({url:"https://www.google-analytics.com/analytics.js",cache:!0},function(){ga("create",o.conf.fvanalytics,"auto")})),!window._paq&&o.conf.matomo_domain&&o.conf.matomo_site_id&&(e="//"+o.conf.matomo_domain+"/",(a=window._paq=window._paq||[]).push(["setTrackerUrl",e+"matomo.php"]),a.push(["setSiteId",o.conf.matomo_site_id]),t=(a=document).createElement("script"),a=a.getElementsByTagName("script")[0],t.type="text/javascript",t.async=!0,t.src=e+"matomo.js",a.parentNode.insertBefore(t,a)),o.bind("progress",function(e,t,a){var o=t.video,n=o.duration,r=0,i=fv_player_track_name(s,o);if(n&&(19*n/20<a?r=4:3*n/4<a?r=3:n/2<a?r=2:n/4<a&&(r=1)),t.live&&(r=0),!s.data("fv_track_"+c[r])){for(var l in c)if(c.hasOwnProperty(l)){if(l==r)break;if(!s.data("fv_track_"+c[l]))return}s.trigger("fv_track_"+c[r].replace(/ /,"_"),[t,i]),s.data("fv_track_"+c[r],!0),fv_player_track(t,!1,"Video "+(s.hasClass("is-cva")?"Ad ":"")+c[r],t.engine.engineName+"/"+o.type,i)}}).bind("finish ready ",function(e,t){for(var a in c)c.hasOwnProperty(a)&&s.removeData("fv_track_"+c[a])}).bind("error",function(e,t,a){setTimeout(function(){var e;t.error&&((e=void 0!==t.video&&void 0!==t.video.src&&t.video)||void 0===t.conf.clip||void 0===t.conf.clip.sources||void 0===t.conf.clip.sources[0]||void 0===t.conf.clip.sources[0].src||(e=t.conf.clip.sources[0]),!(e=fv_player_track_name(s,e))||e.match(/\/\/vimeo.com\/\d/)||is_ga_4(t)||fv_player_track(t,!1,"Video "+(s.hasClass("is-cva")?"Ad ":"")+"error",a.message,e))},100)}),o.bind("load unload",p).bind("progress",function(e,t){t.seeking||(l+=f?+new Date-f:0,f=+new Date),n=n||setTimeout(function(){n=null,is_ga_4(t)||fv_player_track(t,!1,"Flowplayer heartbeat",t.engine.engineName+"/"+t.video.type,"Heartbeat",0)},6e5)}).bind("pause",function(){f=0}),o.bind("shutdown",function(){i.off(window,"unload",p)}),i.on(window,"unload",p),is_ga_4(o)?["Play","25 Percent Played","50 Percent Played","75 Percent Played","100 Percent Played"]:["start","first quartile","second quartile","third quartile","complete"]);function p(e,t,a){a=a||o.video,"load"===e.type&&(r=fv_player_track_name(s,a)),l&&(fv_player_track(o,!1,"Video / Seconds played",o.engine.engineName+"/"+o.video.type,r,Math.round(l/1e3)),l=0,n&&(clearTimeout(n),n=null))}o.get_time_played=function(){return l/1e3}}),flowplayer(function(o,n){var r=(n=jQuery(n)).find(".fp-player"),i=n.hasClass("no-volume"),l=n.hasClass("fp-mute"),s=n.hasClass("fp-full"),f=0;function t(){var e=r.width()||n.width(),t=o.video.index||0,a=(900<e?jQuery(".fp-subtitle",n).addClass("is-wide"):jQuery(".fp-subtitle",n).removeClass("is-wide"),n.toggleClass("is-tiny",e<400),n.toggleClass("is-small",e<600&&400<=e),e<480+35*f),t=(void 0!==o.fv_timeline_chapters_data&&void 0!==o.fv_timeline_chapters_data[t]&&(a=!0),s||n.toggleClass("fp-full",n.hasClass("has-abloop")||a),""),a=(e<400?t="is-tiny":e<600&&400<=e&&(t="is-small"),n.trigger("fv-player-size",[t]),r);(a=n.parent().hasClass("fp-playlist-vertical-wrapper")||n.parent().hasClass("fp-playlist-text-wrapper")?n.parent():a).width()<=560?a.addClass("is-fv-narrow"):a.removeClass("is-fv-narrow"),e<=320?n.addClass("no-volume fp-mute"):(i||n.removeClass("no-volume"),l||n.removeClass("fp-mute"))}t(),jQuery(window).on("resize",t),"fonts"in document&&o.one("load",function(){document.fonts.load("1em flowplayer")}),o.on("ready fullscreen fullscreen-exit sticky sticky-exit",function(e){setTimeout(function(){f=n.find(".fp-controls > strong:visible").length+n.find(".fp-controls > .fp-icon:visible").length,t()},0)}),o.on("unload pause finish error",function(){"undefined"!=typeof checker&&clearInterval(checker)})}),jQuery(window).on("resize tabsactivate",function(){jQuery(".fp-playlist-external").each(function(){var e=jQuery(this);900<=e.parent().width()?e.addClass("is-wide"):e.removeClass("is-wide")})}).trigger("resize"),flowplayer(function(e,t){e.bind("ready",function(){/Chrome/.test(navigator.userAgent)&&54<parseFloat(/Chrome\/(\d\d)/.exec(navigator.userAgent)[1],10)&&(e.video.subtitles?jQuery(t).addClass("chrome55fix-subtitles"):jQuery(t).addClass("chrome55fix"))});var a,o=(t=jQuery(t)).css("background-image");(o=o&&o.replace(/url\((['"])?(.*?)\1\)/gi,"$2").split(","))&&o[0].match(/^(https?:)?\/\//)&&((a=new Image).src=o[0],o=a.height/a.width,a=t.height()/t.width(),Math.abs(a-o)<.05&&t.css("background-size","cover"))}),function(e){e(window).on("resize",function(){e("iframe[id][src][height][width]").each(function(){e(this).attr("id").match(/(fv_vimeo_)|(fv_ytplayer_)/)&&e(this).width()<=e(this).attr("width")&&e(this).height(e(this).width()*e(this).attr("height")/e(this).attr("width"))}),jQuery(".wistia_embed").each(function(){e(this).height(e(this).width()*e(this).data("ratio"))})}).trigger("resize")}(jQuery),jQuery(document).on("tabsactivate",".fv_flowplayer_tabs_content",function(e,t){var a=jQuery(t.oldPanel).find(".flowplayer").data("flowplayer");void 0!==a&&a.pause(),jQuery(".flowplayer",t.newPanel).data("flowplayer").load()}),flowplayer(function(t,o){o=jQuery(o);var e=flowplayer.bean;o.hasClass("is-audio")&&(e.off(o[0],"mouseenter"),e.off(o[0],"mouseleave"),o.removeClass("is-mouseout"),o.addClass("fixed-controls").addClass("is-mouseover"),t.on("error",function(e,t,a){jQuery(".fp-message",o).html(jQuery(".fp-message",o).html().replace(/video/,"audio"))}),o.on("click",function(e){t.ready||(e.preventDefault(),e.stopPropagation(),t.load())}))}),flowplayer(function(f,c){var t,r,a,i,e,l,n;function o(){}function s(e){console.log("FV Player: Chromecast listener",e),e===chrome.cast.ReceiverAvailability.AVAILABLE&&(flowplayer.conf.chromecast_available=!0)}function p(){}function d(){console.log("chromecast onError")}function u(){clearInterval(a),a=null,f.release(),l.toggleClass(c,"is-chromecast",!1),l.toggleClass(i,"fp-active",!1)}function y(){var e=!1,t=f.video.sources_fvqs||f.video.sources;for(o in t){var a=t[o].type;if("video/mp4"==a||"video/fv-mp4"==a||"application/dash+xml"==a){e=t[o];break}}if(!e)for(var o in t)if("application/x-mpegurl"==t[o].type){e=t[o];break}if(f.video.fvhkey&&!f.conf.hls_cast)return!1;if(e){var n,r=!1,i=["fullhd","hd","md","sd"];for(n in i){var l=new RegExp("-"+i[n]);for(o in f.video.sources_fvqs){var s=f.video.sources_fvqs[o];if(s.src.match(l)&&"video/mp4"==s.type){r=s;break}}if(r){e=r;break}}}return e}function v(){var o,e=y();e&&(o=[],f.video.subtitles&&f.video.subtitles.forEach(function(e,t){e.src.match(/\.srt/)&&console.log("FV Player: Chromecast doesn't support SRT subtitles");var a=new chrome.cast.media.Track(t,chrome.cast.media.TrackType.TEXT);a.trackContentId=e.src,a.trackContentType="text/vtt",a.subtype=chrome.cast.media.TextTrackType.SUBTITLES,a.name=e.label,a.language=e.srclang+"-"+t,a.customData=null,o.push(a)}),(e=new chrome.cast.media.MediaInfo(e.src,e.type)).tracks=o,e=new chrome.cast.media.LoadRequest(e),f.live||(e.currentTime=f.video.time),clearInterval(a),a=!1,r.loadMedia(e,_,function(e){console.log("onMediaError",e)}))}function _(o){m(o),o.addUpdateListener(function(e){r&&(a=a||setInterval(function(){f.trigger("progress",[f,o.getEstimatedTime()]),o.activeTrackIds.forEach(function(a){jQuery.each(o.media.tracks,function(e,t){if(t.trackId==a&&"AUDIO"==t.type)return h("data-audio",t.language)||h("data-lang",t.language),!1})})},500),e&&(l.toggleClass(c,"is-chromecast",!0),l.toggleClass(i,"fp-active",!0),f.hijack({pause:function(){console.log("hijacked pause!"),o.pause()},resume:function(){if(f.finished)return clearInterval(a),a=null,f.release(),void v();o.play()},seek:function(e){var t=new chrome.cast.media.SeekRequest;t.currentTime=e,o.seek(t)}})),e=o.playerState,f.paused&&e===chrome.cast.media.PlayerState.PLAYING&&f.trigger("resume",[f]),f.playing&&e===chrome.cast.media.PlayerState.PAUSED&&f.trigger("pause",[f]),f.seeking&&e===chrome.cast.media.PlayerState.BUFFERING&&(n=!0),f.seeking&&e===chrome.cast.media.PlayerState.PLAYING&&n&&(n=!1,f.trigger("seek",[f])),e==chrome.cast.media.PlayerState.IDLE&&o.idleReason==chrome.cast.media.IdleReason.FINISHED&&f.trigger("finish",[f]),l.toggleClass(c,"is-loading",e===chrome.cast.media.PlayerState.BUFFERING))})}function h(a,o){var e=jQuery(c).find(".fv-fp-hls-menu a"),n=!1;return e.each(function(e,t){jQuery(t).attr(a)===o?(jQuery(t).addClass("fp-selected"),n=!0):jQuery(t).removeClass("fp-selected")}),n}function m(e){console.log(e.media.tracks);var a=jQuery(c).find(".fv-fp-hls-menu [data-audio].fp-selected").data("audio"),o=jQuery(c).find(".fv-fp-hls-menu [data-audio].fp-selected").data("lang"),n=jQuery(c).find(".fp-subtitle-menu [data-subtitle-index].fp-selected").data("subtitle-index"),r=-1<n&&f.video.subtitles[n].srclang,i=!1,l=!1,t=[],s=(jQuery.each(e.media.tracks,function(e,t){t.language==a&&"AUDIO"==t.type&&(i=t),t.language==r+"-"+n&&"TEXT"==t.type&&(l=t)}),i||jQuery.each(e.media.tracks,function(e,t){if(t.language==o&&"AUDIO"==t.type)return i=t,!1}),"");i&&(t.push(i.trackId),s+=i.language+" audio"),l&&(t.push(l.trackId),s&&(s+=" "),s+=l.language+" subtitles"),t&&(t=new chrome.cast.media.EditTracksInfoRequest(t),e.editTracksInfo(t,function(){console.log("FV Player: Chromecast "+s+" loaded")},function(){console.log("FV Player: Chromecast "+s+" failed")}))}f.conf.fv_chromecast&&(window.__onGCastApiAvailable||(jQuery.getScript({url:"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js",cache:!0}),window.__onGCastApiAvailable=function(e){e&&(e=t.applicationId||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,e=new chrome.cast.SessionRequest(e),e=new chrome.cast.ApiConfig(e,o,s),chrome.cast.initialize(e,p,d))}),t=f.conf.chromecast||{},e=flowplayer.bean,l=flowplayer.common,n=!1,f.bind("ready",function(e,t,a){var o,n;r?y()?(t.one("progress",function(e,t){t.release(),t.pause(),t.mute(!1,!0),v()}),t.mute(!0,!0)):(r.stop(),r=null,u(),jQuery(i).hide()):flowplayer.conf.chromecast_available&&(y()?((t=l.find(".fp-header",c)[0])&&(l.find(".fp-chromecast",t).forEach(l.removeNode),l.find(".fp-chromecast-engine",c).forEach(l.removeNode),i=l.createElement("a",{class:"fp-chromecast fp-icon",title:"Play on Cast device"}),t.appendChild(i),t=l.createElement("div",{class:"fp-chromecast-engine"}),o=l.createElement("p",{class:"fp-chromecast-engine-status"}),n=l.createElement("p",{class:"fp-chromecast-engine-icon"}),t.appendChild(n),t.appendChild(o),(n=l.find(".fp-engine",c)[0])?n.parentNode.insertBefore(t,n):l.prepend(l.find(".fp-player",c)[0]||c,t)),jQuery(i).show()):(FV_Flowplayer_Pro.log("FV Player: Can't find media source suitable for Chromecast!"),jQuery(i).hide()))}),e.on(c,"click",".fp-chromecast",function(e){var t;if(e.preventDefault(),r)return f.trigger("pause",[f]),r.media[0].media&&(t=r.media[0].getEstimatedTime(),setTimeout(function(){f.seek(t)},0)),r.stop(),r=null,void u();f.playing&&f.pause(),chrome.cast.requestSession(function(e){jQuery(c).addClass("is-loading");e=(r=e).receiver.friendlyName;l.html(l.find(".fp-chromecast-engine-status",c)[0],"Playing on device "+e),v()},function(e){console.error("requestSession error",e)})}),e.on(c,"click",".fv-fp-hls-menu [data-audio], .fp-subtitle-menu [data-subtitle-index]",function(){if(r&&r.media[0].media)return m(r.media[0]),!1}),jQuery(window).on("unload",function(){r&&r.stop()}))}),jQuery(document).on("mfpClose",function(){void 0!==jQuery(".flowplayer").data("flowplayer")&&jQuery(".flowplayer").data("flowplayer").unload()}),jQuery(document).on("click",".vc_tta-tab a",function(){var e=jQuery(".flowplayer.is-playing").data("flowplayer");e&&e.pause()}),flowplayer(function(e,t){t=jQuery(t),e.bind("ready",function(){setTimeout(function(){var e=jQuery("video",t);0<e.length&&e.prop("autoplay",!1)},100),t.find("video.fp-engine").addClass("intrinsic-ignore")})}),jQuery(".flowplayer").on("ready",function(e,t){/BB10/.test(navigator.userAgent)&&t.fullscreen()});var fv_flowplayer_safety_resize_arr=Array();function fv_flowplayer_safety_resize(){var t=!1;jQuery(".flowplayer").each(function(){if(jQuery(this).is(":visible")&&!jQuery(this).hasClass("lightboxed")&&!jQuery(this).hasClass("lightbox-starter")&&!jQuery(this).hasClass("is-audio")&&(jQuery(this).width()<30||jQuery(this).height()<20)){t=!0;for(var e=jQuery(this);(jQuery(e).width()<30||jQuery(e).width()==jQuery(this).width())&&0!=jQuery(e).parent().length;)(e=jQuery(e).parent()).hasClass("ld-video")&&(""==e[0].style.height&&e.css("height","auto"),0<parseInt(e.css("padding-bottom"))&&e.css("padding-bottom","0"));jQuery(this).width(jQuery(e).width()),jQuery(this).height(parseInt(jQuery(this).width()*jQuery(this).attr("data-ratio"))),fv_flowplayer_safety_resize_arr[jQuery(this).attr("id")]=e}}),t&&jQuery(window).resize(function(){jQuery(".flowplayer").each(function(){jQuery(this).hasClass("lightboxed")||jQuery(this).hasClass("lightbox-starter")||fv_flowplayer_safety_resize_arr[jQuery(this).attr("id")]&&(jQuery(this).width(fv_flowplayer_safety_resize_arr[jQuery(this).attr("id")].width()),jQuery(this).height(parseInt(jQuery(this).width()*jQuery(this).attr("data-ratio"))))})})}void 0!==flowplayer.conf.safety_resize&&flowplayer.conf.safety_resize&&jQuery(document).ready(function(){setTimeout(function(){fv_flowplayer_safety_resize()},10)});var fv_player_warning,isIE11=!!navigator.userAgent.match(/Trident.*rv[ :]*11\./);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fv_flowplayer_mobile_switch(e){var t,a=new RegExp("[\\?&]fv_flowplayer_mobile=([^&#]*)").exec(location.search);!(null!=a&&"yes"==a[1]||jQuery(window).width()<=480||jQuery(window).height()<=480)||null!=a&&"no"==a[1]||(t=!1,jQuery("#wpfp_"+e+" video source").each(function(){jQuery(this).attr("id")!="wpfp_"+e+"_mobile"&&(t=!0,jQuery(this).remove())}),t&&jQuery("#wpfp_"+e).after('<p class="fv-flowplayer-mobile-switch">'+fv_flowplayer_translations.mobile_browser_detected_1+' <a href="'+document.URL+'?fv_flowplayer_mobile=no">'+fv_flowplayer_translations.mobile_browser_detected_2+"</a>.</p>"))}if(isIE11&&(jQuery(document).ready(function(){jQuery(".fp-waiting").hide()}),flowplayer(function(e,t){e.bind("load",function(e){jQuery(e.currentTarget).find(".fp-waiting").show()}).bind("beforeseek",function(e){jQuery(e.currentTarget).find(".fp-waiting").show()}).bind("progress",function(e){jQuery(e.currentTarget).find(".fp-waiting").hide()}).bind("seek",function(e){jQuery(e.currentTarget).find(".fp-waiting").hide()}).bind("fullscreen",function(e){jQuery("#wpadminbar").hide()}).bind("fullscreen-exit",function(e){jQuery("#wpadminbar").show()})})),flowplayer.support.browser&&flowplayer.support.browser.msie&&parseInt(flowplayer.support.browser.version,10)<9&&jQuery(".flowplayer").each(function(){jQuery(this).css("width",jQuery(this).css("max-width")),jQuery(this).css("height",jQuery(this).css("max-height"))}),location.href.match(/elementor-preview=/)?(console.log("FV Player: Elementor editor is active"),setInterval(fv_player_load,1e3)):location.href.match(/brizy-edit-iframe/)&&(console.log("FV Player: Brizy editor is active"),setInterval(fv_player_load,1e3)),window.DELEGATE_NAMES&&flowplayer(function(e,t){fv_player_notice(t,fv_flowplayer_translations.chrome_extension_disable_html5_autoplay)}),flowplayer(function(e,t){flowplayer.bean.off(t,"contextmenu")}),location.href.match(/elementor-preview=/)&&(console.log("FV Player: Elementor editor is active"),setInterval(fv_player_load,1e3)),flowplayer(function(a,o){void 0!==(o=jQuery(o)).data("fv-embed")&&o.data("fv-embed")&&"false"!=o.data("fv-embed")&&(a.embedCode=function(){a.video;var e=o.width(),t=o.height();return t+=2,(o.hasClass("has-chapters")||o.hasClass("has-transcript"))&&(t+=300),0<jQuery(".fp-playlist-external[rel="+o.attr("id")+"]").length&&(t+=170),'<iframe src="'+(o.data("fv-embed")+"#"+fv_player_get_video_link_hash(a))+'" allowfullscreen width="'+e+'" height="'+t+'" frameborder="0" style="max-width:100%"></iframe>'})}),jQuery(document).on("click",".flowplayer .embed-code-toggle",function(){var e=jQuery(this).closest(".flowplayer");if("undefined"!=typeof fv_player_editor_conf)return fv_player_notice(e,fv_player_editor_translations.embed_notice,2e3),!1;var t=jQuery(this),a=t.parents(".flowplayer"),e=a.data("flowplayer");return"function"==typeof e.embedCode&&a.find(".embed-code textarea").val(e.embedCode()),fv_player_clipboard(a.find(".embed-code textarea").val(),function(){fv_player_notice(a,fv_flowplayer_translations.embed_copied,2e3)},function(){t.parents(".fvp-share-bar").find(".embed-code").toggle(),t.parents(".fvp-share-bar").toggleClass("visible")}),!1}),flowplayer(function(o,n){var r,i,l,s,f,c,p,e,d;0!=jQuery(n).data("fullscreen")&&(o.one("ready",function(e,t,a){0==jQuery(n).find(".fp-fullscreen").length&&jQuery(n).find(".fp-header").append('<a class="fp-fullscreen fp-icon"></a>')}),r="fullscreen",i="fullscreen-exit",l=flowplayer.support.fullscreen,s=window,p=flowplayer.bean,o.fullscreen=function(e){if(!o.disabled){var t=d.find("video.fp-engine",n)[0];if(flowplayer.conf.native_fullscreen&&t&&flowplayer.support.iOS)return o.trigger(r,[o]),p.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement===t&&(p.off(document,".nativefullscreen"),p.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement||(p.off(document,".nativefullscreen"),o.trigger(i,[o]))}))}),t.webkitEnterFullScreen(),void p.one(t,"webkitendfullscreen",function(){p.off(document,"fullscreenchange.nativefullscreen"),o.trigger(i,[o]),d.prop(t,"controls",!0),d.prop(t,"controls",!1)});var a=jQuery(n).find(".fp-player")[0];return(e=void 0===e?!o.isFullscreen:e)&&(c=s.scrollY,f=s.scrollX),l?e?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){"function"==typeof a[e]&&(a[e]({navigationUI:"hide"}),"webkitRequestFullScreen"!==e||document.webkitFullscreenElement||a[e]())}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){"function"==typeof document[e]&&document[e]()}):o.trigger(e?r:i,[o]),o}},d=flowplayer.common,o.on("mousedown.fs",function(){+new Date-e<150&&o.ready&&o.fullscreen(),e=+new Date}),o.on(r,function(){d.addClass(n,"is-fullscreen"),d.toggleClass(n,"fp-minimal-fullscreen",d.hasClass(n,"fp-minimal")),d.removeClass(n,"fp-minimal"),l||d.css(n,"position","fixed"),o.isFullscreen=!0}).on(i,function(){var e;d.toggleClass(n,"fp-minimal",d.hasClass(n,"fp-minimal-fullscreen")),d.removeClass(n,"fp-minimal-fullscreen"),l||"html5"!==o.engine||(e=n.css("opacity")||"",d.css(n,"opacity",0)),l||d.css(n,"position",""),d.removeClass(n,"is-fullscreen"),l||"html5"!==o.engine||setTimeout(function(){n.css("opacity",e)}),o.isFullscreen=!1,"fvyoutube"!=o.engine.engineName&&s.scrollTo(f,c)}).on("unload",function(){o.isFullscreen&&o.fullscreen()}),o.on("shutdown",function(){FULL_PLAYER=null,d.removeNode(wrapper)}))}),flowplayer(function(a,o){var e,t,n,r,i,l;function s(){var e=window.innerWidth<window.innerHeight?window.innerWidth<=375?.6:.575:window.innerWidth<=667?2:2.4;return window.innerWidth/window.innerHeight>e}function f(){a.isFullscreen&&window.innerWidth>window.innerHeight&&s()&&!l&&(fv_player_notice(o,fv_flowplayer_translations.iphone_swipe_up_location_bar,"resize-good"),l=setTimeout(function(){l=!1,a.trigger("resize-good")},5e3))}o=jQuery(o),flowplayer.conf.wpadmin||jQuery(o).hasClass("is-audio")||(e=(e=jQuery(".fp-playlist-external[rel="+o.attr("id")+"]")).hasClass("fp-playlist-season")||e.hasClass("fp-playlist-polaroid"),t=1==o.data("fsforce"),0!=o.data("fullscreen")&&(flowplayer.conf.mobile_force_fullscreen&&flowplayer.support.fvmobile||!flowplayer.support.fullscreen&&t||e?(flowplayer.support.fullscreen||a.bind("ready",function(){a.video.vr||a.fullscreen(!0)}),o.on("click",function(){a.ready&&!a.paused||a.fullscreen(!0)}),jQuery("[rel="+o.attr("id")+"] a").on("click",function(e){a.isFullscreen||(a.fullscreen(),a.resume())}),a.on("resume",function(){a.video.vr||a.isFullscreen||a.fullscreen()}),a.on("finish",function(){0!=a.conf.playlist.length&&a.conf.playlist.length-1!=a.video.index||a.fullscreen(!1)}).on("fullscreen",function(e,t){o.addClass("forced-fullscreen")}).on("fullscreen-exit",function(e,t){t.pause(),o.removeClass("forced-fullscreen")})):t&&(r=o.find(".fp-unload"),i=!1,a.isFakeFullscreen=!1,o.addClass("is-closeable"),o.on("click",function(e){a.ready||e.target==r[0]||a.fakeFullscreen(!0)}),r.on("click",function(e){return a.ready&&a.isFullscreen?a.fullscreen(!1):a.loading&&(i=!0,a.one("resume",function(e){i=!1,a.pause()})),a.fakeFullscreen(!1),!1}),jQuery("[rel="+o.attr("id")+"] a").on("click",function(e){a.isFakeFullscreen||(a.fakeFullscreen(),a.resume())}),a.on("resume",function(){i||a.isFakeFullscreen||a.fakeFullscreen()}).on("finish",function(){0!=a.conf.playlist.length&&a.conf.playlist.length-1!=a.video.index||a.fakeFullscreen(!1)}).on("fullscreen",function(e,t){o.removeClass("fake-fullscreen")}).on("fullscreen-exit",function(e,t){t.isFakeFullscreen&&t.fakeFullscreen(!0,!0)}).on("unload",function(e,t){}),a.fakeFullscreen=function(e,t){(t||a.isFakeFullscreen!=e&&!a.disabled)&&(void 0===n&&(n=o.css("position")),void 0===e&&(e=!a.isFakeFullscreen),a.isFakeFullscreen=e,a.trigger(e?"fakefullscreen":"fakefullscreen-exit",[a]),o.toggleClass("is-fullscreen fake-fullscreen forced-fullscreen",e),e?o.css("position","fixed"):o.css("position",n))}),flowplayer.support.android&&window.screen&&window.screen.orientation&&a.on("fullscreen",function(e,t){void 0!==(t=t).video.width&&void 0!==t.video.height&&0!=t.video.width&&0!=t.video.height&&t.video.width<t.video.height?screen.orientation.lock("portrait-primary"):screen.orientation.lock("landscape-primary")}),l=!1,flowplayer.support.iOS&&!flowplayer.support.fullscreen&&(a.on("fullscreen",f),window.addEventListener("resize",f),window.addEventListener("resize",function(){s()||(clearTimeout(l),l=!1,a.trigger("resize-good"))}))))}),flowplayer(function(a,o){o=jQuery(o);var r,n,i,l,s;window.MediaSource||window.WebKitMediaSource;function f(){var e=o.find("video");return e.length&&e[0].audioTracks?e[0].audioTracks:[]}function c(a){a.name||(a.name=a.label),o.find(".fv-fp-hls-menu a").each(function(e,t){jQuery(t).toggleClass("fp-selected",jQuery(t).attr("data-audio")===a.name)})}function p(){if(n&&!(n.length<2))if(o.find(".fp-chromecast").hide(),l=jQuery('<strong class="fv-fp-hls">'+fv_flowplayer_translations.audio_button+"</strong>"),(s=jQuery('<div class="fp-menu fv-fp-hls-menu"></div>').insertAfter(o.find(".fp-controls"))).append("<strong>"+fv_flowplayer_translations.audio_menu+"</strong>"),n.forEach(function(e){s.append('<a data-audio="'+e.name+'" data-lang="'+e.lang+'">'+e.name+"</a>")}),l.insertAfter(o.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),s.hasClass("fp-active")?a.hideMenu(s[0]):(o.click(),a.showMenu(s[0]))}),jQuery("a",s).on("click",function(e){var t=e.target.getAttribute("data-audio");if(r){var a=r.audioTracks[r.audioTrack].groupId,e=r.audioTracks.filter(function(e){return e.groupId===a&&(e.name===t||e.lang===t)})[0];r.audioTrack=e.id,c(e)}else{var o,n=f();for(o in n)n.hasOwnProperty(o)&&n[o].label==t&&(n[o].enabled=!0,c(n[o]))}}),r)c(r.audioTracks[r.audioTrack]);else{var e,t=f();for(e in t)t.hasOwnProperty(e)&&t[e].enabled&&c(t[e])}}flowplayer.engine("hlsjs-lite").plugin(function(e){r=e.hls}),a.bind("ready",function(e,t){var a;o.find(".fp-chromecast").show(),jQuery(s).remove(),jQuery(l).remove(),r&&"application/x-mpegurl"==t.video.type&&(i=[],n=[],(a=r).levels.forEach(function(e){e=e.attrs.AUDIO;e&&i.indexOf(e)<0&&i.push(e),i.length&&(n=a.audioTracks.filter(function(e){return e.groupId===i[0]}))}),p())}),a.one("progress",function(){if("html5"==a.engine.engineName&&"application/x-mpegurl"==a.video.type){i=[],n=[];var e,t=f();for(e in t)t.hasOwnProperty(e)&&n.push({id:t[e].id,name:t[e].label});p()}})}),flowplayer(function(e,n){var r=-1,i=!1;e.on("error",function(e,t,a){var o;4==a.code&&"hlsjs"==t.engine.engineName&&(console.log("FV Player: HLSJS failed to play the video, switching to Flash HLS"),t.error=t.loading=!1,jQuery(n).removeClass("is-error"),jQuery(flowplayer.engines).each(function(e,t){"hlsjs"==flowplayer.engines[e].engineName&&(r=e,i=flowplayer.engines[e],delete flowplayer.engines[e])}),(o=(0<(a=void 0!==t.video.index?t.video.index:0)?t.conf.playlist[a]:t.conf.clip).sources).index=a,t.load({sources:o}),t.bind("unload error",function(){flowplayer.engines[r]=i}))})}),flowplayer(function(e,i){var l,t=e.conf.live_stream_reload||30,s=t,f=fv_flowplayer_translations.live_stream_retry;function c(e){e=Number(e);var t=Math.floor(e/86400),a=Math.floor(e%86400/3600),o=Math.floor(e%3600/60),e=Math.floor(e%60),n=fv_flowplayer_translations,t=0<t?(1==t?n.duration_1_day:n.duration_n_days).replace(/%s/,t):"";return t&&0<a&&(t+=", "),(t+=0<a?(1==a?n.duration_1_hour:n.duration_n_hours).replace(/%s/,a):"")&&0<o&&(t+=", "),(t+=0<o?(1==o?n.duration_1_minute:n.duration_n_minutes).replace(/%s/,o):"")&&0<e&&(t+=n.and),t+=0<e?(1==e?n.duration_1_second:n.duration_n_seconds).replace(/%s/,e):""}e.clearLiveStreamCountdown=function(){l&&(clearInterval(l),e.error=e.loading=!1,jQuery(i).removeClass("is-error"),jQuery(i).find(".fp-message.fp-shown").remove(),e.unload())},e.conf.flashls={manifestloadmaxretry:2},e.on("ready",function(){s=t,f=fv_flowplayer_translations.live_stream_retry}).on("progress",function(){s=10,f=fv_flowplayer_translations.live_stream_continue,clearInterval(l)}),e.on("error",function(e,n,r){setTimeout(function(){var e,t,a,o;(n.conf.clip.live||n.conf.live||r.video&&r.video.src.match(/\/\/vimeo.com\/event\//))&&(e=s,n.conf.clip.streaming_time?e=n.conf.clip.streaming_time-Math.floor(Date.now()/1e3):n.conf.clip.live_starts_in&&(e=n.conf.clip.live_starts_in),t=fv_flowplayer_translations.live_stream_starting.replace(/%d/,c(e)),f=f.replace(/%d/,c(e)),t=n.conf.clip.live_starts_in?t:f,clearInterval(l),1!==r.code&&2!==r.code&&4!==r.code||(i.className+=" is-offline",flowplayer.support.flashVideo&&n.one("flashdisabled",function(){i.querySelector(".fp-flash-disabled").style.display="none"}),(a=i.querySelector(".fp-ui .fp-message")).innerHTML=t,o=300<e?300:e,l=setInterval(function(){--e,0<--o&&a?a.querySelector("span").innerHTML=c(e):(clearInterval(l),n.error&&(n.error=n.loading=!1,(a=i.querySelector(".fp-ui .fp-message"))&&i.querySelector(".fp-ui").removeChild(a),i.className=i.className.replace(/\bis-(error|offline)\b/g,""),n.load()))},1e3)))},1)})}),flowplayer(function(e,t){var a;t=jQuery(t),flowplayer.engine("hlsjs-lite").plugin(function(e){a=e.hls}),e.on("ready",function(e,t){a&&t.conf.playlist.length&&"hlsjs-lite"!=t.engine.engineName&&a.destroy()})}),flowplayer(function(a,o){var n,r,i;function l(){r&&n&&"html5"==a.engine.engineName&&(1<++i?3<i&&(console.log("FV Player: iOS video element needs a push, triggering 'stalled'"),n.trigger("stalled")):(console.log("FV Player: iOS video element will trigger error after 'stalled' arrives"),n.one("stalled",function(){var e,t=a.video.time;if(a.video.type.match(/video\//))return console.log("FV Player: Running check of video file..."),(e=document.createElement("video")).src=a.video.src,e.onloadedmetadata=function(){i=0,console.log("FV Player: Video link works")},void(e.onerror=function(){console.log("FV Player: Video link issue!"),0<i&&a.trigger("error",[a,{code:4,video:a.video}])});setTimeout(function(){console.log(a.video.time,t),a.video.time!=t?console.log("FV Player: iOS video element continues playing, no need for error"):a.paused?console.log("FV Player: iOS video element paused, no need for error"):a.trigger("error",[a,{code:4,video:a.video}])},5e3)})))}(flowplayer.support.browser.safari||flowplayer.support.iOS)&&(o=jQuery(o),r=n=!1,i=0,a.on("ready",function(e,t,a){i=0,r=!1,"html5"==t.engine.engineName&&a.src.match(/\?/)&&((n=o.find("video")).data("fv-ios-recovery")||(n.on("waiting",l),n.data("fv-ios-recovery",!0)),t.one("progress",function(){r=!0}))}),a.bind("beforeseek",l))}),!function(e){var t,a,o=!1;"function"==typeof define&&define.amd&&(define(e),o=!0),"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&(module.exports=e(),o=!0),o||(t=window.Cookies,(a=window.Cookies=e()).noConflict=function(){return window.Cookies=t,a})}(function(){function v(){for(var e=0,t={};e<arguments.length;e++){var a,o=arguments[e];for(a in o)t[a]=o[a]}return t}return function e(u){function y(e,t,a){var o,n;if("undefined"!=typeof document){if(1<arguments.length){"number"==typeof(a=v({path:"/"},y.defaults,a)).expires&&((n=new Date).setMilliseconds(n.getMilliseconds()+864e5*a.expires),a.expires=n),a.expires=a.expires?a.expires.toUTCString():"";try{o=JSON.stringify(t),/^[\{\[]/.test(o)&&(t=o)}catch(e){}t=u.write?u.write(t,e):encodeURIComponent(t+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(e+"")).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var r,i="";for(r in a)a[r]&&(i+="; "+r,!0!==a[r]&&(i+="="+a[r]));return document.cookie=e+"="+t+i}e||(o={});for(var l=document.cookie?document.cookie.split("; "):[],s=/(%[0-9A-Z]{2})+/g,f=0;f<l.length;f++){var c=l[f].split("="),p=c.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var d=c[0].replace(s,decodeURIComponent),p=u.read?u.read(p,d):u(p,d)||p.replace(s,decodeURIComponent);if(this.json)try{p=JSON.parse(p)}catch(e){}if(e===d){o=p;break}e||(o[d]=p)}catch(e){}}return o}}return(y.set=y).get=function(e){return y.call(y,e)},y.getJSON=function(){return y.apply({json:!0},[].slice.call(arguments))},y.defaults={},y.remove=function(e,t){y(e,"",v(t,{expires:-1}))},y.withConverter=e,y}(function(){})}),flowplayer(function(e,t){t=jQuery(t),window.learndash_video_data&&"local"==learndash_video_data.videos_found_provider&&t.closest("[data-video-progression=true]").length&&(LearnDash_disable_assets(!0),LearnDash_watchPlayers(),e.on("finish",function(e,t,a){"string"!=typeof t.video.click&&window.LearnDash_disable_assets(!1)}))}),flowplayer(function(e,t){e.bind("load",function(e,t,a){var o,n=jQuery(e.currentTarget);n.data("live")&&(o=setTimeout(function(){n.find(".fp-ui").append('<div class="fp-message">'+fv_flowplayer_translations.live_stream_failed+"</div>"),n.addClass("is-error")},1e4),jQuery(e.currentTarget).data("live_check",o))}).bind("ready",function(e,t,a){clearInterval(jQuery(e.currentTarget).data("live_check"))}).bind("error",function(e,t,a){e=jQuery(e.currentTarget);e.data("live")&&e.find(".fp-message").html(fv_flowplayer_translations.live_stream_failed_2)})}),!function(o){flowplayer(function(e,a){jQuery(a).hasClass("is-cva")||o(document).on("submit","#"+jQuery(a).attr("id")+" .mailchimp-form",function(e){e.preventDefault(),o(".mailchimp-response",a).remove(),o("input[type=submit]",a).attr("disabled","disabled").addClass("fv-form-loading");var t={action:"fv_wp_flowplayer_email_signup"};o("[name]",this).each(function(){t[this.name]=o(this).val()}),o.post(fv_player.ajaxurl,t,function(e){e=JSON.parse(e),o('<div class="mailchimp-response"></div>').insertAfter(".mailchimp-form",a),e.text.match(/already subscribed/)&&(e.status="ERROR"),"OK"===e.status?(o(".mailchimp-form input[type=text],.mailchimp-form input[type=email]",a).val(""),o(".mailchimp-response",a).removeClass("is-fv-error").html(e.text),setTimeout(function(){o(".wpfp_custom_popup",a).fadeOut()},2e3)):o(".mailchimp-response",a).addClass("is-fv-error").html(e.text),o("input[type=submit]",a).removeAttr("disabled").removeClass("fv-form-loading")})})})}(jQuery),"undefined"!=typeof fv_flowplayer_mobile_switch_array)for(var fv_flowplayer_mobile_switch_i in fv_flowplayer_mobile_switch_array)fv_flowplayer_mobile_switch_array.hasOwnProperty(fv_flowplayer_mobile_switch_i)&&fv_flowplayer_mobile_switch(fv_flowplayer_mobile_switch_i);function fv_flowplayer_browser_ff_m4v(e){flowplayer.support.browser&&flowplayer.support.browser.mozilla&&-1!=navigator.userAgentData.platform.indexOf("Win")&&jQuery("#wpfp_"+e).attr("data-engine","flash")}if(flowplayer(function(n,e){var t,a;function o(e,t,a){var o;n.ready?(n.seek(a),(o=t).addClass("is-active"),setTimeout(function(){o.removeClass("is-active")},500)):n.toggle(),e.preventDefault()}flowplayer.support.touch&&(jQuery.fn.fv_single_double_click=function(o,n,r){return this.each(function(){var t=0,a=this;jQuery(this).on("click",function(e){1==++t&&setTimeout(function(){(1==t?o:n).call(a,e),t=0},r||300)})})},e=jQuery(e),t=jQuery('<div class="fv-fp-tap-left"><span>-10s</span></div>'),a=jQuery('<div class="fv-fp-tap-right"><span>+10s</span></div>'),t.fv_single_double_click(function(){n.toggle()},function(e){o(e,t,!!n.ready&&n.video.time-10)}),a.fv_single_double_click(function(){n.toggle()},function(e){o(e,a,!!n.ready&&n.video.time+10)}),e.find(".fp-ui").append(t).append(a))}),flowplayer(function(o,e){var n=(e=jQuery(e)).data("flowplayer-instance-id");flowplayer.audible_instance=-1,o.one("load",function(){setTimeout(function(){o.conf.splash=!1},0)}),o.on("ready",function(){var a=0==e.data("volume");a||(flowplayer.audible_instance=n),jQuery(".flowplayer[data-flowplayer-instance-id]").each(function(){var e=jQuery(this).data("flowplayer"),t=jQuery(this).data("flowplayer-instance-id");-1!=flowplayer.audible_instance&&t!=flowplayer.audible_instance&&t!=n&&e&&(e.ready?o.conf.multiple_playback?a||e.mute(!0,!0):e.playing&&e.pause():(e.clearLiveStreamCountdown(),e.unload()))})}).on("mute",function(e,t,a){a||flowplayer.audible_instance==n||(flowplayer(flowplayer.audible_instance).mute(!0,!0),flowplayer.audible_instance=n)}).on("resume",function(){o.muted||(flowplayer.audible_instance=n),o.conf.multiple_playback||jQuery(".flowplayer[data-flowplayer-instance-id]").each(function(){var e;n!=jQuery(this).data("flowplayer-instance-id")&&(e=jQuery(this).data("flowplayer"))&&e.playing&&e.pause()})})}),"undefined"!=typeof fv_flowplayer_browser_ff_m4v_array)for(var fv_flowplayer_browser_ff_m4v_i in fv_flowplayer_browser_ff_m4v_array)fv_flowplayer_browser_ff_m4v_array.hasOwnProperty(fv_flowplayer_browser_ff_m4v_i)&&fv_flowplayer_browser_ff_m4v(fv_flowplayer_browser_ff_m4v_i);function fv_flowplayer_browser_chrome_fail(o,n,r,i){jQuery("#wpfp_"+o).bind("error",function(e,t,a){!/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())||null==a||3!=a.code&&4!=a.code&&5!=a.code||(t.unload(),jQuery("#wpfp_"+o).attr("id","bad_wpfp_"+o),jQuery("#bad_wpfp_"+o).after('<div id="wpfp_'+o+'" '+n+' data-engine="flash"></div>'),jQuery("#wpfp_"+o).flowplayer({playlist:[[{mp4:r}]]}),i?jQuery("#wpfp_"+o).bind("ready",function(e,t){t.play()}):jQuery("#wpfp_"+o).flowplayer().play(0),jQuery("#bad_wpfp_"+o).remove())})}if("undefined"!=typeof fv_flowplayer_browser_chrome_fail_array)for(var fv_flowplayer_browser_chrome_fail_i in fv_flowplayer_browser_chrome_fail_array)fv_flowplayer_browser_chrome_fail_array.hasOwnProperty(fv_flowplayer_browser_chrome_fail_i)&&fv_flowplayer_browser_chrome_fail(fv_flowplayer_browser_chrome_fail_i,fv_flowplayer_browser_chrome_fail_array[fv_flowplayer_browser_chrome_fail_i].attrs,fv_flowplayer_browser_chrome_fail_array[fv_flowplayer_browser_chrome_fail_i].mp4,fv_flowplayer_browser_chrome_fail_array[fv_flowplayer_browser_chrome_fail_i].auto_buffer);function fv_flowplayer_browser_ie(e){(flowplayer.support.browser&&flowplayer.support.browser.msie&&9<=parseInt(flowplayer.support.browser.version,10)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))&&jQuery("#wpfp_"+e).attr("data-engine","flash")}if("undefined"!=typeof fv_flowplayer_browser_ie_array)for(var fv_flowplayer_browser_ie_i in fv_flowplayer_browser_ie_array)fv_flowplayer_browser_ie_array.hasOwnProperty(fv_flowplayer_browser_ie_i)&&fv_flowplayer_browser_ie(fv_flowplayer_browser_ie_i);function fv_flowplayer_browser_chrome_mp4(e){var t=window.navigator.appVersion.match(/Chrome\/(\d+)\./);null!=t&&(t=parseInt(t[1],10),(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())&&t<28&&-1!=navigator.appVersion.indexOf("Win")||/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())&&t<27&&-1!=navigator.appVersion.indexOf("Linux")&&-1==navigator.userAgent.toLowerCase().indexOf("android"))&&jQuery("#wpfp_"+e).attr("data-engine","flash"))}function fv_flowplayer_amazon_s3(e,n){jQuery("#wpfp_"+e).bind("error",function(e,t,a){var o=new Date;4==a.code&&o.getTime()>fv_fp_utime+parseInt(n)&&jQuery(e.target).find(".fp-message").delay(500).queue(function(e){jQuery(this).html(fv_flowplayer_translations.video_expired),e()})})}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}-1==navigator.platform.indexOf("iPhone")&&-1==navigator.platform.indexOf("iPod")&&-1==navigator.platform.indexOf("iPad")&&-1==navigator.userAgent.toLowerCase().indexOf("android")||flowplayer(function(e,t){e.bind("error",function(e,t,a){10==a.code&&jQuery(e.target).find(".fp-message").html(fv_flowplayer_translations.unsupported_format)})}),jQuery(document).ready(function(){-1==navigator.platform.indexOf("iPhone")&&-1==navigator.platform.indexOf("iPod")&&-1==navigator.platform.indexOf("iPad")||jQuery(window).trigger("load"),jQuery(".flowplayer").on("mouseleave",function(){jQuery(this).find(".fvp-share-bar").removeClass("visible"),jQuery(this).find(".embed-code").hide()})}),"undefined"!=typeof flowplayer&&flowplayer(function(e,o){o=jQuery(o);var n,r=!1,t=(flowplayer.engine("hlsjs-lite").plugin(function(e){n=e.hls}),e.conf.playlist.length?e.conf.playlist:[e.conf.clip]);function i(e){l();var t="Video is being processed",a="Please return later to see the actual video in this player.";e.pending_encoding_error?(t="Video unavailable",a="There was an error in the video encoding."):e.pending_encoding_progress&&(a+="<br /><br />("+e.pending_encoding_progress+" done)"),r=jQuery('<div class="fv-player-encoder-video-processing-modal"><div><h2>'+t+"</h2><p>"+a+"</p></div></div"),o.append(r)}function l(){r&&r.remove()}t[0]&&t[0].pending_encoding&&i(t[0]),e.on("load",function(e,t,a){if(a.pending_encoding)return i(a),n&&n.destroy(),!1;l()})}),Date.now||(Date.now=function(){return(new Date).getTime()}),function(){function b(e){if(e.id)return e.id;var t=(void 0!==e.sources_original&&void 0!==e.sources_original[0]?e.sources_original:e.sources)[0].src;return t=void 0!==e.sources_original&&void 0!==e.sources_original[0]?t:o(t)}function j(e,t){t.video.sources&&(t=b(t.video),T[t]=0,A[t]=0,w[t]=1)}function Q(e,t){var a,o,n="sendBeacon"in navigator,r=(!0!==e&&(e=!1),t&&void 0!==t||(t=function(){}),[]),i=[];for(a in T)T.hasOwnProperty(a)&&r.push({name:a,position:T[a],top_position:A[a],saw:void 0!==w[a]&&w[a]});for(o in O)O.hasOwnProperty(o)&&i.push({player:o,item:O[o]});if(i.length||D(F),!r.length)return D(S),D(P),void D(I);if("1"==flowplayer.conf.is_logged_in){if(n){try{var l,s={},f={},c={},p={};for(m in r)r.hasOwnProperty(m)&&(s[l=r[m].name]=r[m].position,f[l]=r[m].top_position,c[l]=r[m].saw);for(m in i)i.hasOwnProperty(m)&&(p[i[m].player]=i[m].item);N(S,E(s)),N(P,E(f)),N(I,E(c)),N(F,E(p))}catch(e){return}n=new FormData;return n.append("action","fv_wp_flowplayer_video_position_save"),n.append("videoTimes",encodeURIComponent(JSON.stringify(r))),n.append("playlistItems",encodeURIComponent(JSON.stringify(i))),navigator.sendBeacon(fv_player.ajaxurl,n),!1}return jQuery.ajax({type:"POST",async:e,url:fv_player.ajaxurl,complete:t,data:{action:"fv_wp_flowplayer_video_position_save",videoTimes:r,playlistItems:i}})}try{var d=V(x),u=V(C),d=d&&void 0!==d?JSON.parse(d):{},u=u&&void 0!==u?JSON.parse(u):{};for(m in r)r.hasOwnProperty(m)&&(d[r[m].name]=r[m].position);for(m in i)i.hasOwnProperty(m)&&(u[i[m].player]=i[m].item);var y=JSON.stringify(d),v=JSON.stringify(u),_=L(y),h=L(v);if(g<_)for(;g<_;)for(var m in d)if(d.hasOwnProperty(m)){delete d[m],y=JSON.stringify(d),_=L(y);break}if(g<h)for(;g<h;)for(var m in d)if(u.hasOwnProperty(m)){delete u[m],v=JSON.stringify(u),h=L(y);break}N(x,y),N(C,v)}catch(e){return}return!1}var k=null,g=2500,a=null,x="video_positions",C="player_playlist_item",S="video_positions_tmp",P="video_top_positions_tmp",F="player_playlist_item_tmp",I="video_saw_tmp",T=[],A=[],O=[],w=[],E=function(e){var t=JSON.stringify(e),a=L(t);if(g<a)for(;g<a;)for(var o in e)if(e.hasOwnProperty(o)){delete e[o],t=JSON.stringify(e),a=L(t);break}return t},L=function(e){return encodeURIComponent(e).length},V=function(e){return a?localStorage.getItem(e):Cookies.get(e)},N=function(e,t){return a?localStorage.setItem(e,t):Cookies.set(e,t)},D=function(e){a?localStorage.removeItem(e):Cookies.remove(e)},o=function(e){return e.replace(/(X-Amz-Algorithm=[^&]+&?)/gm,"").replace(/(X-Amz-Credential=[^&]+&?)/gm,"").replace(/(X-Amz-Date=[^&]+&?)/gm,"").replace(/(X-Amz-Expires=[^&]+&?)/gm,"").replace(/(X-Amz-SignedHeaders=[^&]+&?)/gm,"").replace(/(X-Amz-Signature=[^&]+&?)/gm,"")};if(flowplayer(function(o,e){if(void 0===o.conf.disable_localstorage){function r(){return!(o.live||o.video&&"string"==typeof o.video.click)}function t(e,t){!r()||(t=function(e){var t=b(e.video),a=e.video.position;if("1"!=flowplayer.conf.is_logged_in){var o=V(x);if(o&&void 0!==o)try{(o=JSON.parse(o))[t]&&(a=o[t])}catch(e){return}}return e.get_custom_end&&e.get_custom_end()<a&&(a=!1),a=e.get_custom_start&&0<e.get_custom_start()&&a<e.get_custom_start()?!1:a}(t))&&n(t)}function a(e,t){var a,o,n;r()&&t.video.sources&&(a=b(t.video),o=Math.round(t.video.time),T[a]=o,void 0===A[a]?(n=0,n=t.conf.playlist?t.conf.playlist[t.video.index]&&t.conf.playlist[t.video.index].sources[0]&&t.conf.playlist[t.video.index].sources[0].top_position?t.conf.playlist[t.video.index].sources[0].top_position:0:t.conf.clip.sources[0]&&t.conf.clip.sources[0].top_position?t.conf.clip.sources[0].top_position:0,A[a]=n):A[a]<o&&(A[a]=o),0<t.conf.playlist.length&&p&&(O[p]=t.video.index),60<=c++&&flowplayer.conf.closingPage&&(k&&k.abort(),k=Q(!0,function(){k=null}),c=0))}function n(e){var t,a;o.custom_seek?o.custom_seek(e):(t=0,a=setInterval(function(){20<++t&&clearInterval(a),o.loading||(o.seek(parseInt(e)),clearInterval(a))},10))}function i(e,t){var a=V(e),o=!1;if(a&&void 0!==a)try{if(void 0!==(a=JSON.parse(a))[t]){o=a[t],delete a[t];var n,r=!1;for(n in a)if(a.hasOwnProperty(n)){r=!0;break}r?N(e,JSON.stringify(a)):D(e)}return o}catch(e){}}function l(e,t){if(void 0!==t&&0!=t.conf.playlist.length){var a=-1;if(p)if("1"!=flowplayer.conf.is_logged_in){var o=V(C);if(o&&void 0!==o)try{(o=JSON.parse(o))[p]&&(a=o[p])}catch(e){return}}else"1"==flowplayer.conf.is_logged_in&&(a=0<t.conf.playlist.length&&i(F,p));0<=a&&!d&&(t.video&&"video/youtube"!=t.video.type&&t.play(a),d=!0,s.data("position_changed",1))}}var s=jQuery(e),f=flowplayer.conf.video_position_save_enable&&0!=s.data("save-position")||s.data("save-position"),c=0,p=!!s.data("player-id")&&s.data("player-id"),d=!1;if(f){if(V(F)&&s.removeData("playlist_start"),o.bind("finish",j),o.on("ready",function(){o.one("progress",t)}),o.bind("progress",a),o.bind("unload",function(){d=!1,o.one("ready",l)}),o.one("ready",l),jQuery(".fp-ui",e).on("click",function(){l()}),o.playlist_thumbnail_progress=function(e,t,a){o.get_custom_start&&0<o.get_custom_start(t)&&(a-=o.get_custom_start(t))<0&&(a=0);t=t.duration;(t=(t=o.get_custom_duration&&0<o.get_custom_duration()?o.get_custom_duration():t)||e.data("duration"))&&e.css("width",100*a/t+"%")},"1"==flowplayer.conf.is_logged_in){var u,y,v,_,h,m=0<o.conf.playlist.length,g=m?o.conf.playlist:[o.conf.clip],w=jQuery("[rel="+jQuery(e).attr("id")+"]");for(u in g)g.hasOwnProperty(u)&&(_=b(g[u]),y=i(S,_),v=i(P,_),_=i(I,_),y&&(m?(o.conf.playlist[u].sources[0].position=y,(h=jQuery("a",w).eq(u).find(".fvp-progress")).length&&o.playlist_thumbnail_progress(h,o.conf.playlist[u],y)):o.conf.clip.sources[0].position=y),v&&(!g[u].sources[0].top_position||g[u].sources[0].top_position<v)&&(m?o.conf.playlist[u].sources[0].top_position=v:o.conf.clip.sources[0].top_position=v),_&&(m?o.conf.playlist[u].sources[0].saw=!0:o.conf.clip.sources[0].saw=!0))}o.bind("finish",function(e,t){t.conf.playlist.length?t.conf.playlist[t.video.index].sources[0].saw=!0:t.conf.clip.sources[0].saw=!0})}}}),jQuery(window).on("beforeunload pagehide",function(){flowplayer.conf.closingPage||(flowplayer.conf.closingPage=!0,Q())}),null===(a=void 0===fv_flowplayer_conf.disable_localstorage&&a)){a=!0;try{localStorage.setItem("t","t"),"t"!==localStorage.getItem("t")&&(a=!1),localStorage.removeItem("t")}catch(e){a=!1}}}(jQuery),flowplayer(function(t,a){var o,n,r,i,l,s,f,c;function e(e){e.preventDefault(),e.stopPropagation(),l.hasClass("fp-active")?t.hideMenu(l[0]):(a.trigger("click"),t.showMenu(l[0]))}function p(e){e=e.clone();return e.find("i.dur").remove(),e.text()}a=jQuery(a),0!=t.conf.playlist.length&&(o=0,jQuery(t.conf.playlist).each(function(e,t){void 0===t.click&&o++}),o<2||(n=jQuery(".fp-playlist-external[rel="+a.attr("id")+"]"),r=jQuery('<strong class="fv-fp-list">Item 1.</strong>'),i=jQuery('<strong class="fv-fp-list-name">Item 1.</strong>'),l=jQuery('<div class="fp-menu fv-fp-list-menu"></div>').insertAfter(a.find(".fp-controls")),s=0,f=[],c=[],jQuery(t.conf.playlist).each(function(e,t){void 0===t.click&&(t=p(n.find("h4").eq(s)),l.append('<a data-index="'+e+'">'+(s+1)+". "+t+"</a>"),c[e]=t,f.push(e),s++)}),r.insertAfter(a.find(".fp-controls .fp-volume")).on("click",e),i.insertAfter(r).on("click",e),jQuery("a",l).on("click",function(){void 0!==t.conf.playlist[jQuery(this).data("index")-1]&&void 0!==t.conf.playlist[jQuery(this).data("index")-1].click?t.play(jQuery(this).data("index")-1):t.play(jQuery(this).data("index"))}),t.on("ready",function(e,t,a){l.find("a").removeClass("fp-selected");var o=l.find("a[data-index="+a.index+"]"),n=(o.addClass("fp-selected"),fv_flowplayer_translations.playlist_item_no);n=(n=n.replace(/%d/,f.indexOf(a.index)+1)).replace(/%s/,p(o.find("h4"))),r.html(n),i.html(f.indexOf(a.index)+1+". "+c[a.index])})))}),flowplayer(function(e,o){o=jQuery(o);var n,r=e.conf.playlist;e.bind("load",function(e,t,a){n=a.index}),e.bind("error",function(e,t,a){setTimeout(function(){if(0<r.length&&1==t.error){if(n=t.video.index,"1"==t.conf.video_checker&&r[n].video_checker&&0<r[n].video_checker.length)return console.log("FV Player: Video checker message present, stopping auto-advance to next playlist item"),!1;t.error=t.loading=!1,o.removeClass("is-error"),o.find(".fp-message.fp-shown").remove(),++n>r.length-1&&(n=0),console.log("FV Player: Playlist item failure, auto-advancing to "+(n+1)+". item"),t.play(n)}},1e3)})}),flowplayer(function(e,r){var i,l,s;function f(a){return a=[],jQuery(e.conf.playlist).each(function(e,t){a.push(e)}),a=function(e){for(var t,a,o=e.length;o;o--)t=Math.floor(Math.random()*o),a=e[o-1],e[o-1]=e[t],e[t]=a;return e}(a),console.log("FV Player Randomizer random seed:",a),a}((r=jQuery(r)).data("button-no_picture")||r.data("button-repeat")||r.data("button-rewind"))&&e.bind("ready",function(e,t){var a,o,n;void 0===l&&void 0===i&&(l=t.next,i=t.prev),!t.video.type.match(/^audio/)&&r.data("button-no_picture")&&0==r.find(".fv-fp-no-picture").length&&jQuery('<span class="fv-fp-no-picture"><svg viewBox="0 0 90 80" width="18px" height="18px" class="fvp-icon fvp-nopicture"><use xlink:href="#fvp-nopicture"></use></svg></span>').insertAfter(r.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),jQuery(".fp-engine",r).slideToggle(20),jQuery(this).toggleClass("is-active fp-color-fill"),r.toggleClass("is-no-picture")}),r.data("button-repeat")&&(0<t.conf.playlist.length&&0==r.find(".fv-fp-playlist").length?(n=fv_flowplayer_translations,a=jQuery('<strong class="fv-fp-playlist mode-normal"> <svg viewBox="0 0 80.333 80" width="18px" height="18px" class="fvp-icon fvp-replay-list"><title>'+n.playlist_replay_all+'</title><use xlink:href="#fvp-replay-list"></use></svg> <svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-shuffle"><title>'+n.playlist_shuffle+'</title><use xlink:href="#fvp-shuffle"></use></svg> <svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-replay-track"><title>'+n.playlist_replay_video+'</title><use xlink:href="#fvp-replay-track"></use></svg> <span id="fvp-playlist-play" title="'+n.playlist_play_all+'">'+n.playlist_play_all_button+"</span> </strong>"),o=jQuery('<div class="fp-menu fv-fp-playlist-menu"> <a data-action="repeat_playlist"><svg viewBox="0 0 80.333 80" width="18px" height="18px" class="fvp-icon fvp-replay-list"><title>'+n.playlist_replay_all+'</title><use xlink:href="#fvp-replay-list"></use></svg> <span class="screen-reader-text">'+n.playlist_replay_all+'</span></a> <a data-action="shuffle_playlist"><svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-shuffle"><title>'+n.playlist_shuffle+'</title><use xlink:href="#fvp-shuffle"></use></svg> <span class="screen-reader-text">'+n.playlist_shuffle+'</span></a> <a data-action="repeat_track"><svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-replay-track"><title>'+n.playlist_replay_video+'</title><use xlink:href="#fvp-replay-track"></use></svg> <span class="screen-reader-text">'+n.playlist_replay_video+'</span></a> <a class="fp-selected" data-action="normal"><span id="fvp-playlist-play" title="'+n.playlist_play_all+'">'+n.playlist_play_all_button+"</span></a> </div>").insertAfter(r.find(".fp-controls")),t.conf.playlist_shuffle=t.conf.track_repeat=!1,s=f(),t.conf.advance,a.insertAfter(r.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),"auto"!==o.css("right")&&o.css({right:"auto",left:a.position().left+"px"}),o.hasClass("fp-active")?t.hideMenu(o[0]):(r.trigger("click"),t.showMenu(o[0]))}),jQuery("a",o).on("click",function(){jQuery(this).siblings("a").removeClass("fp-selected"),jQuery(this).addClass("fp-selected"),a.removeClass("mode-normal mode-repeat-track mode-repeat-playlist mode-shuffle-playlist");var e=jQuery(this).data("action");"repeat_playlist"==e?(a.addClass("mode-repeat-playlist"),t.conf.loop=!0,t.conf.advance=!0,t.video.loop=t.conf.track_repeat=!1,t.conf.playlist_shuffle=!1):"shuffle_playlist"==e?(a.addClass("mode-shuffle-playlist"),t.conf.loop=!0,t.conf.advance=!0,t.conf.playlist_shuffle=!0):"repeat_track"==e?(a.addClass("mode-repeat-track"),t.conf.track_repeat=t.video.loop=!0,t.conf.loop=t.conf.playlist_shuffle=!1):"normal"==e&&(a.addClass("mode-normal"),t.conf.track_repeat=t.video.loop=!1,t.conf.loop=t.conf.playlist_shuffle=!1),t.conf.playlist_shuffle?(t.next=function(){t.play(s.pop()),0==s.length&&(s=f())},t.prev=function(){t.play(s.shift()),0==s.length&&(s=f())}):(t.next=l,t.prev=i)}),t.conf.loop&&jQuery("a[data-action=repeat_playlist]",o).trigger("click"),t.on("progress",function(){t.video.loop=t.conf.track_repeat}),t.on("finish.pl",function(e,t){console.log("playlist_repeat",t.conf.loop,"advance",t.conf.advance,"video.loop",t.video.loop),t.conf.playlist_shuffle&&(t.play(s.pop()),0==s.length&&(s=f()))})):0==r.find(".fv-fp-track-repeat").length&&0==t.conf.playlist.length&&((n=jQuery('<strong class="fv-fp-track-repeat"><svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-replay-track"><use xlink:href="#fvp-replay-track"></use></svg></strong>')).insertAfter(r.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),jQuery(this).toggleClass("is-active fp-color-fill",t.video.loop),t.video.loop?t.video.loop=!1:t.video.loop=!0}),t.conf.loop&&n.addClass("is-active fp-color-fill"))),r.data("button-rewind")&&(0==r.find(".fv-fp-rewind").length&&((n=jQuery('<span class="fv-fp-rewind"><svg viewBox="0 0 24 24" width="21px" height="21px" class="fvp-icon fvp-rewind"><use xlink:href="#fvp-rewind"></use></svg></span>')).insertBefore(r.find(".fp-controls .fp-playbtn")).on("click",function(e){e.preventDefault(),e.stopPropagation(),t.seek(t.video.time-10)}),n.toggle(!t.video.live)),0==r.find(".fv-fp-forward").length&&((n=jQuery('<span class="fv-fp-forward"><svg viewBox="0 0 24 24" width="21px" height="21px" class="fvp-icon fvp-forward"><use xlink:href="#fvp-forward"></use></svg></span>')).insertAfter(r.find(".fp-controls .fp-playbtn")).on("click",function(e){e.preventDefault(),e.stopPropagation(),t.seek(t.video.time+10)}),n.toggle(!t.video.live)))}).bind("unload",function(){r.find(".fv-fp-no-picture").remove(),r.find(".fv-fp-playlist").remove(),r.find(".fv-fp-track-repeat").remove()})}),flowplayer(function(e,t){var a=jQuery(t),o=a.data("playlist_start");function n(){1!==a.data("position_changed")&&e.conf.playlist.length&&(o--,void 0===e.conf.playlist[o].click&&e.play(o),a.data("position_changed",1))}void 0!==o&&(e.bind("unload",function(){o=a.data("playlist_start"),a.removeData("position_changed"),e.one("ready",n)}),e.one("ready",n),jQuery(".fp-ui",t).on("click",function(){n(),a.data("position_changed",1)}))}),document.addEventListener("custombox:overlay:close",function(e){console.log("FV Player: Custombox/Popup anything ligtbox closed");var t=jQuery(this).find(".flowplayer");0!=t.length&&(console.log("FV Player: Custombox/Popup anything ligtbox contains a player"),t.each(function(e,t){var a=jQuery(t).data("flowplayer");void 0!==a&&(a.playing?(console.log("FV Player: Custombox/Popup anything ligtbox video pause"),a.pause()):a.loading&&a.one("ready",function(){console.log("FV Player: Custombox/Popup anything ligtbox video unload"),a.unload()}))}))}),flowplayer(function(t,e){t.bind("finish",function(){var e=t.video.time;t.video.loop&&t.one("pause",function(){e<=t.video.time&&t.resume()})})}),flowplayer(function(t,o){(o=jQuery(o)).find(".fp-logo").removeAttr("href"),o.hasClass("no-controlbar")&&((e=t.sliders.timeline).disable(!0),t.bind("ready",function(){e.disable(!0)})),jQuery(".fvfp_admin_error",o).remove(),o.find(".fp-logo, .fp-header").on("click",function(e){e.target===this&&o.find(".fp-ui").trigger("click")}),jQuery(".fvp-share-bar .sharing-facebook",o).append('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="#fff"><title>Facebook</title><path d="M11.9 5.2l-2.6 0 0-1.6c0-0.7 0.3-0.7 0.7-0.7 0.3 0 1.6 0 1.6 0l0-2.9 -2.3 0c-2.6 0-3.3 2-3.3 3.3l0 2 -1.6 0 0 2.9 1.6 0c0 3.6 0 7.8 0 7.8l3.3 0c0 0 0-4.2 0-7.8l2.3 0 0.3-2.9Z"/></svg>'),jQuery(".fvp-share-bar .sharing-twitter",o).append('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="#fff"><title>Twitter</title><path d="M16 3.1c-0.6 0.3-1.2 0.4-1.9 0.5 0.7-0.4 1.2-1 1.4-1.8 -0.6 0.4-1.3 0.6-2.1 0.8 -0.6-0.6-1.4-1-2.4-1 -2 0.1-3.2 1.6-3.2 4 -2.7-0.1-5.1-1.4-6.7-3.4 -0.9 1.4 0.2 3.8 1 4.4 -0.5 0-1-0.1-1.5-0.4l0 0.1c0 1.6 1.1 2.9 2.6 3.2 -0.7 0.2-1.3 0.1-1.5 0.1 0.4 1.3 1.6 2.2 3 2.3 -1.6 1.7-4.6 1.4-4.8 1.3 1.4 0.9 3.2 1.4 5 1.4 6 0 9.3-5 9.3-9.3 0-0.1 0-0.3 0-0.4 0.6-0.4 1.2-1 1.6-1.7Z"/></svg>'),jQuery(".fvp-share-bar .sharing-email",o).append('<svg xmlns="http://www.w3.org/2000/svg" height="16" viewBox="0 0 16 16" width="16" fill="#fff"><title>Email</title><path d="M8 10c0 0 0 0-1 0L0 6v7c0 1 0 1 1 1h14c1 0 1 0 1-1V6L9 10C9 10 8 10 8 10zM15 2H1C0 2 0 2 0 3v1l8 4 8-4V3C16 2 16 2 15 2z"/></svg>'),jQuery(".fp-header",o).prepend(jQuery(".fvp-share-bar",o)),t.conf.playlist.length&&(i=!0,2==(a=t.conf.playlist).length?(void 0!==a[0].click&&void 0===a[1].click&&(i=!1),void 0===a[0].click&&void 0!==a[1].click&&(i=!1)):3==a.length&&void 0!==a[0].click&&void 0===a[1].click&&void 0!==a[2].click&&(i=!1),i&&(a=jQuery('<a class="fp-icon fv-fp-prevbtn"></a>'),i=jQuery('<a class="fp-icon fv-fp-nextbtn"></a>'),o.find(".fp-controls .fp-playbtn").before(a).after(i),a.on("click",function(){t.trigger("prev",[t]),t.prev()}),i.on("click",function(){t.trigger("next",[t]),t.next()}))),"undefined"!=typeof fv_player_editor_conf&&o.on("click",".fvp-sharing > li",function(e){return e.preventDefault(),fv_player_notice(o,fv_player_editor_translations.link_notice,2e3),!1}),t.bind("pause resume finish unload ready",function(e,t){o.addClass("no-brand")}),t.one("ready",function(){o.find(".fp-fullscreen").clone().appendTo(o.find(".fp-controls"))}),t.on("ready",function(e,t,a){setTimeout(function(){jQuery(".fvp-share-bar",o).show(),jQuery(".fv-player-buttons-wrap",o).appendTo(jQuery(".fv-player-buttons-wrap",o).parent().find(".fp-ui"))},100)}),t.bind("finish",function(){var e=o.data("fv_redirect");e&&(void 0===t.video.is_last||t.video.is_last)&&(location.href=e)}),flowplayer.support.iOS&&11==flowplayer.support.iOS.version&&t.bind("error",function(e,t,a){4==a.code&&o.find(".fp-engine").hide()}),jQuery(document).on("contextmenu",".flowplayer",function(e){e.preventDefault()}),t.one("ready",function(e,t,a){o.find(".fp-chromecast").insertAfter(o.find(".fp-header .fp-fullscreen"))}),o.find(".fp-waiting").html('<div class="fp-preload"><b></b><b></b><b></b><b></b></div>');var e,n=o.attr("id"),r=!flowplayer.conf.native_fullscreen&&flowplayer.conf.mobile_alternative_fullscreen,a="fakefullscreen",i="fakefullscreen-exit";flowplayer.support.fullscreen||(a+=" fullscreen",i+=" fullscreen-exit"),t.bind(a,function(e,t){jQuery("#wpadminbar, .nc_wrapper").hide(),!r&&"fakefullscreen"!=e.type||"video/youtube"==t.video.type||(o.before('<span data-fv-placeholder="'+n+'"></span>'),o.appendTo("body"))}),t.bind(i,function(e,t,a){jQuery("#wpadminbar, .nc_wrapper").show(),!r&&"fakefullscreen-exit"!=e.type||jQuery("span[data-fv-placeholder="+n+"]").replaceWith(o)})}),function(){function e(p){p(function(o,n){var r,e,i,l,s;function f(e){return Math.round(100*e)/100}function c(t){r.find(".fp-speed",n)[0].innerHTML=t+"x",r.find(".fp-speed-menu a",n).forEach(function(e){r.toggleClass(e,"fp-selected",e.getAttribute("data-speed")==t),r.toggleClass(e,"fp-color",e.getAttribute("data-speed")==t)})}!jQuery(n).data("speedb")||(e=p.support).video&&e.inlineVideo&&(r=p.common,e=p.bean,i=r.find(".fp-ui",n)[0],l=r.find(".fp-controls",i)[0],s=o.conf.speeds,e.on(n,"click",".fp-speed",function(){var e=r.find(".fp-speed-menu",n)[0];r.hasClass(e,"fp-active")?o.hideMenu():o.showMenu(e)}),e.on(n,"click",".fp-speed-menu a",function(e){e=e.target.getAttribute("data-speed");o.speed(e)}),o.on("speed",function(e,t,a){1<s.length&&c(a)}).on("ready",function(e,t){var a;r.find(".fp-speed-menu",n).forEach(r.removeNode),r.find(".fp-speed",n).forEach(r.removeNode),p.support.android&&"html5"==t.engine.engineName&&"application/x-mpegurl"==t.video.type||1<(s=t.conf.speeds).length&&(l.appendChild(r.createElement("strong",{className:"fp-speed"},o.currentSpeed+"x")),a=r.createElement("div",{className:"fp-menu fp-speed-menu",css:{width:"auto"}},"<strong>Speed</strong>"),s.forEach(function(e){e=r.createElement("a",{"data-speed":f(e)},f(e)+"x");a.appendChild(e)}),i.appendChild(a),c(o.currentSpeed),jQuery(n).find(".fp-speed-menu strong").text(fv_flowplayer_translations.speed))}))})}"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e:"function"==typeof window.flowplayer&&e(window.flowplayer)}(),flowplayer(function(e,t){void 0===fv_flowplayer_conf.disable_localstorage&&(e.on("speed",function(e,t,a){try{window.localStorage.fv_player_speed=a}catch(e){}}),e.on("ready",function(){window.localStorage.fv_player_speed&&jQuery(t).find("strong.fp-speed").is(":visible")&&e.speed(parseFloat(window.localStorage.fv_player_speed)),0==jQuery(t).data("volume")&&e.mute(!0,!0)}))}),flowplayer(function(e,o){o=jQuery(o);var n=-1;function r(){return e.video.index||0}e.conf.fv_stats&&(e.conf.fv_stats.enabled||o.data("fv_stats")&&"no"!=o.data("fv_stats"))&&e.on("ready finish",function(e,t){t.one("progress",function(e,t){if(o.data("fv_stats_data")){try{var a=o.data("fv_stats_data")}catch(e){return!1}n!=r()&&(n=r(),jQuery.post(t.conf.fv_stats.url,{blog_id:t.conf.fv_stats.blog_id,video_id:t.video.id||0,player_id:a.player_id,post_id:a.post_id,tag:"play"}))}})}).on("finish",function(){n=-1})}),flowplayer(function(a,e){var t,o,n,r,i=jQuery(e),l=i.find(".fp-player"),e=i.data("fvsticky"),s=!1,f=i.data("ratio");if(a.is_sticky=!1,void 0===f&&(f=.5625),(s=1==flowplayer.conf.sticky_video&&void 0===e?!0:s)||e){if(!flowplayer.support.firstframe)return;var c=flowplayer.conf.sticky_place,p=flowplayer.conf.sticky_width,d=(p=""==p?380:p)*f;t=jQuery(window),n=(o=i).offset().top,r=Math.floor(n+o.outerHeight()/2),a.on("unload",function(){y(),i.removeClass("is-unSticky")}),t.on("resize",function(){v()?(n=o.offset().top,r=Math.floor(n+o.outerHeight()/2)):a.is_sticky&&y()}).on("scroll",function(){if(v())if(n=o.offset().top,r=Math.floor(n+o.outerHeight()/2),t.scrollTop()>r&&(a.loading||flowplayer.audible_instance==i.data("flowplayer-instance-id"))){if(0<jQuery("div.flowplayer.is-unSticky").length)return!1;u()}else y();else a.is_sticky&&y()})}function u(){l.hasClass("is-sticky-"+c)||(l.addClass("is-sticky"),l.addClass("is-sticky-"+c),0==i.find("a.fp-sticky").length&&i.find("div.fp-header").prepend('<a class="fp-sticky fp-icon"></a>'),l.css("width",p),l.css("height",d),l.css("max-height",d),a.is_sticky=!0,a.trigger("sticky",[a]),l.parent(".flowplayer").addClass("is-stickable"))}function y(){l.removeClass("is-sticky"),l.removeClass("is-sticky-"+c),l.css("width",""),l.css("height",""),l.css("max-height",""),l.parent(".flowplayer").removeClass("is-stickable"),a.is_sticky&&(a.is_sticky=!1,a.trigger("sticky-exit",[a]))}function v(){return jQuery(window).innerWidth()>=fv_flowplayer_conf.sticky_min_width}a.sticky=function(e,t){void 0===e&&(e=!a.is_sticky),t&&i.toggleClass("is-unSticky",!e),(e?u:y)()}}),jQuery(function(a){a(document).on("click","a.fp-sticky",function(){var e=a("div.flowplayer.is-stickable"),t=e.data("flowplayer"),e=(e.addClass("is-unSticky"),e.find(".fp-player"));e.removeClass("is-sticky"),e.removeClass("is-sticky-right-bottom"),e.removeClass("is-sticky-left-bottom"),e.removeClass("is-sticky-right-top"),e.removeClass("is-sticky-left-top"),e.css("width",""),e.css("height",""),e.css("max-height",""),t.is_sticky&&(t.is_sticky=!1,t.trigger("sticky-exit",[t]))}),a(document).on("click","div.flowplayer.is-unSticky",function(){a("div.flowplayer").removeClass("is-unSticky")})}),flowplayer(function(e,n){var r;n=jQuery(n),void 0===fv_flowplayer_conf.disable_localstorage&&(r=window.localStorage,e.on("ready",function(e,a,t){var o;n.find("strong.fp-cc").is(":visible")&&(r.fv_player_subtitle&&a.video.subtitles.length?"none"===r.fv_player_subtitle?a.disableSubtitles():a.video.subtitles.forEach(function(e,t){e.srclang===r.fv_player_subtitle&&a.loadSubtitles(t)}):(o=t.subtitles.filter(function(e){return e.fv_default})[0])&&a.loadSubtitles(t.subtitles.indexOf(o))),n.find(".fp-subtitle-menu").on("click",function(e){var t=e.target.getAttribute("data-subtitle-index");if("string"==typeof t)try{r.fv_player_subtitle=-1<t?a.video.subtitles[t].srclang:"none"}catch(e){}})}))}),flowplayer(function(e,a){a=jQuery(a),e.on("ready",function(e,t){a.find(".fp-subtitle-menu strong").text(fv_flowplayer_translations.closed_captions),a.find('.fp-subtitle-menu a[data-subtitle-index="-1"]').text(fv_flowplayer_translations.no_subtitles)})}),"undefined"!=typeof flowplayer&&"undefined"!=typeof fv_flowplayer_conf&&fv_flowplayer_conf.video_hash_links&&(flowplayer(function(a,o){var n,r,i,l,s,f;0<jQuery(o).find(".sharing-link").length&&(n=function(e,t){l=fv_player_get_video_link_hash(a),s=","+fv_player_time_hms(a.video.time),e&&t?(i=","+fv_player_time_hms_ms(e+a.get_custom_start()),r=","+fv_player_time_hms_ms(t+a.get_custom_start())):(r=f&&void 0!==a.get_ab_end()&&a.get_ab_end()?","+fv_player_time_hms_ms(a.get_ab_end()):"",i=f&&void 0!==a.get_ab_start()&&a.get_ab_start()?","+fv_player_time_hms_ms(a.get_ab_start()):""),jQuery(".sharing-link",o).attr("href",jQuery(".sharing-link",o).attr("href").replace(/#.*/,"")+"#"+l+s+i+r)},a.on("ready",function(e,t,a){t.fv_noUiSlider&&t.fv_noUiSlider.on("set",function(e){n(e[0],e[1])})}),a.on("progress",function(e,t){t.video.sources&&t.video.sources[0]&&n()}),a.on("abloop",function(e,t,a){f=a,t.playing||n()}),jQuery(".sharing-link",o).on("click",function(e){fv_player_clipboard(jQuery(this).attr("href"),function(){e.preventDefault(),fv_player_notice(o,fv_flowplayer_translations.link_copied,2e3)})}))}),jQuery(document).on("click",'a[href*="fvp_"]',function(){var e=jQuery(this);setTimeout(function(){0==e.parents(".fvp-share-bar").length&&fv_autoplay_exec()})})),flowplayer(function(a,o){o=jQuery(o);var n=flowplayer.bean,r=flowplayer.conf.default_volume,i=(0==r&&(r="0.5"),o.on("mousedown touchstart",".fp-volumebtn",function(e){var t=jQuery(this);0==a.volumeLevel&&t.one("click",function(){return a.volume(r),!1})}),o.on("mousedown touchstart mouseup touchend",".fp-volumebar",function(e){0!=a.volumeLevel&&(r=a.volumeLevel)}),a.on("volume",function(e,t){o.hasClass("is-mouseover")&&!t.muted&&0==t.volumeLevel&&(n.off(flowplayer.support.touch?o:document,"mousemove.sld touchmove.sld"),t.mute(!0))}),!1);function l(){o.removeClass("has-fp-message-muted"),o.find(".fp-message-muted").remove()}a.one("ready",function(e,t){o.hasClass("is-audio")||(i=!0)}),a.on("progress",function(e,t,a){i&&1<a&&(i=!1,(a=jQuery("root").find("video")).length&&!((a=a[0]).mozHasAudio||Boolean(a.webkitAudioDecodedByteCount)||Boolean(a.audioTracks&&a.audioTracks.length))||!t.muted&&0!=t.volumeLevel||"true"==localStorage.muted||"0"==localStorage.volume||((a=jQuery('<div class="fp-message fp-message-muted"><span class="fp-icon fp-volumebtn-notice"></span> '+fv_flowplayer_translations.click_to_unmute+"</div>")).on("click touchstart",function(){t.mute(!1),t.volume(1)}),o.find(".fp-ui").append(a),o.addClass("has-fp-message-muted"),setTimeout(l,5e3)))}),a.on("mute volume",function(){(!a.muted||0<a.volumeLevel)&&l()})}),"undefined"!=typeof flowplayer&&(fv_player_warning=function(e,t,a){var o=jQuery(e).prev(".fv-player-warning-wrapper");0==o.length&&(jQuery(e).before('<div class="fv-player-warning-wrapper">'),o=jQuery(e).prev(".fv-player-warning-wrapper")),0==o.find(".fv-player-warning-"+a).length&&(e=jQuery("<p style='display: none' "+(a?" class='fv-player-warning-"+a+"'":"")+">"+t+"</p>"),o.append(e),e.slideDown())},flowplayer(function(t,o){o=jQuery(o),navigator.userAgent.match(/iPhone.* OS [0-6]_/i)&&t.one("progress",function(e){void 0!==t.video.subtitles&&t.video.subtitles.length&&fv_player_warning(o,fv_flowplayer_translations.warning_iphone_subs)}),flowplayer.support.android&&flowplayer.support.android.version<5&&(flowplayer.support.android.samsung||flowplayer.support.browser.safari)&&fv_player_warning(o,fv_flowplayer_translations.warning_unstable_android,"firefox"),/Android 4/.test(navigator.userAgent)&&!/Firefox/.test(navigator.userAgent)&&(t.on("ready",function(e,t,a){setTimeout(function(){a.src&&a.src.match(/fpdl.vimeocdn.com/)&&(0==a.time||1==a.time)&&(fv_player_warning(o,fv_flowplayer_translations.warning_unstable_android,"firefox"),t.on("progress",function(e,t){o.prev().find(".fv-player-warning-firefox").remove()}))},1500)}),t.on("error",function(e,t,a){2==a.MEDIA_ERR_NETWORK&&a.video.src.match(/fpdl.vimeocdn.com/)&&fv_player_warning(o,fv_flowplayer_translations.warning_unstable_android,"firefox")})),/Safari/.test(navigator.userAgent)&&/Version\/5/.test(navigator.userAgent)&&t.on("error",function(e,t,a){a.video.src.match(/fpdl.vimeocdn.com/)&&fv_player_warning(o,fv_flowplayer_translations.warning_old_safari)});var e=flowplayer.support;e.android&&(e.android.samsung&&parseInt(e.browser.version)<66||e.browser.safari)&&t.on("error",function(e,t,a){fv_player_warning(o,fv_flowplayer_translations.warning_samsungbrowser,"warning_samsungbrowser")})}));
1
+ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if("undefined"!=typeof fv_flowplayer_conf){var FVAbrController,parseIOSVersion=function(e){e=/iP(ad|hone)(; CPU)? OS (\d+_\d)/.exec(e);return e&&1<e.length?parseFloat(e[e.length-1].replace("_","."),10):0};try{"object"==_typeof(window.localStorage)&&void 0!==window.localStorage.volume&&delete fv_flowplayer_conf.volume}catch(e){}flowplayer.conf=fv_flowplayer_conf,flowplayer.conf.fullscreen=!1,flowplayer.conf.chromecast=!1,flowplayer.conf.embed=!1,flowplayer.conf.share=!1,flowplayer.conf.analytics=!1,void 0!==fv_flowplayer_conf.disable_localstorage&&(flowplayer.conf.storage={});try{flowplayer.conf.key=atob(flowplayer.conf.key)}catch(e){}!flowplayer.support.android&&flowplayer.conf.dacast_hlsjs&&((FVAbrController=function(e){this.hls=e,this.nextAutoLevel=3}).prototype.nextAutoLevel=function(e){this.nextAutoLevel=e},FVAbrController.prototype.destroy=function(){},flowplayer.conf.hlsjs={startLevel:-1,abrController:FVAbrController}),flowplayer.support.iOS&&flowplayer.support.iOS.chrome&&0==flowplayer.support.iOS.version&&(flowplayer.support.iOS.version=parseIOSVersion(navigator.userAgent)),(flowplayer.support.iOS&&13<=parseInt(flowplayer.support.iOS.version)||!flowplayer.support.iOS&&flowplayer.support.browser.safari&&8<=parseInt(flowplayer.support.browser.version))&&(flowplayer.conf.hlsjs.safari=!0),flowplayer.support.fvmobile=!(flowplayer.support.firstframe&&!flowplayer.support.iOS&&!flowplayer.support.android);var fls=flowplayer.support;flowplayer.conf.mobile_native_fullscreen&&"ontouchstart"in window&&fls.fvmobile&&(flowplayer.conf.native_fullscreen=!0),"ontouchstart"in window&&(fls.android&&fls.android.version<4.4&&!(fls.browser.chrome&&54<fls.browser.version)&&(flowplayer.conf.native_fullscreen=!0),fls.iOS&&(fv_player_in_iframe()||fls.iOS.version<7)&&(flowplayer.conf.native_fullscreen=!0))}"undefined"!=typeof fv_flowplayer_translations&&(flowplayer.defaults.errors=fv_flowplayer_translations);var fv_player_did_autoplay=!1;function fv_player_videos_parse(e,o){try{var a=JSON.parse(e)}catch(e){return!1}var n;flowplayer.support.browser.safari&&(n=[],jQuery(a.sources).each(function(e,t){"video/webm"!=t.type&&n.push(t)}),0<n.length&&(a.sources=n));var r,e=new RegExp("[\\?&]fv_flowplayer_mobile=([^&#]*)").exec(location.search);return!(null!=e&&"yes"==e[1]||jQuery(window).width()<=480||jQuery(window).height()<=480)||null!=e&&"no"==e[1]||(r=!1,jQuery(a.sources).each(function(e,t){if(!t)return!1;t.mobile&&(a.sources[e]=a.sources[0],a.sources[0]=t,r=!0),r&&jQuery(o).after('<p class="fv-flowplayer-mobile-switch">'+fv_flowplayer_translations.mobile_browser_detected_1+' <a href="'+document.URL+'?fv_flowplayer_mobile=no">'+fv_flowplayer_translations.mobile_browser_detected_2+"</a>.</p>")})),o.trigger("fv_player_videos_parse",a),a}function fv_player_in_iframe(){try{return window.self!==window.top}catch(e){return!0}}function fv_escape_attr(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,function(e){return t[e]})}function fv_player_preload(){function e(){jQuery(".flowplayer.fp-is-embed").each(function(){var e=jQuery(this);e.hasClass("has-chapters")||e.hasClass("has-transcript")||0!=jQuery(".fp-playlist-external[rel="+e.attr("id")+"]").length||e.height(jQuery(window).height())})}if(flowplayer.support.touch&&jQuery(".fp-playlist-external.fv-playlist-design-2017").addClass("visible-captions"),flowplayer(function(n,r){localStorage.flowplayerTestStorage&&delete localStorage.flowplayerTestStorage;var e,t,i=(r=jQuery(r)).find(".fp-player"),l=!1,o=(r.hasClass("fixed-controls")&&r.find(".fp-controls").on("click",function(e){n.loading||n.ready||(e.preventDefault(),e.stopPropagation(),n.load())}),flowplayer.support.volume||flowplayer.support.autoplay||r.find(".fp-volume").hide(),0==r.data("volume")&&r.hasClass("no-controlbar")&&r.find(".fp-volume").remove(),jQuery(".fp-playlist-external[rel="+r.attr("id")+"]")),s=((!n.conf.playlist||0==n.conf.playlist.length)&&o.length&&0<o.find("a[data-item]").length?(e=[],o.find("a[data-item]").each(function(){(parsed=fv_player_videos_parse(jQuery(this).attr("data-item"),r))?e.push(parsed):jQuery(this).remove()}),n.conf.playlist=e,n.conf.clip=e[0]):n.conf.clip||(n.conf.clip=fv_player_videos_parse(jQuery(r).attr("data-item"),r)),jQuery("a",o).on("click",function(e){e.preventDefault(),l=!0;var e=jQuery(this),t=jQuery(".fp-playlist-external[rel="+r.attr("id")+"]"),t=jQuery("a",t).index(this),o=e.prev("a"),a=e.data("item");if(location.href.match(/wp-admin/)&&0<e.parents(".fv-player-editor-preview").length)return fv_flowplayer_conf.current_video_to_edit=t,e.parents(".fv-player-custom-video").find(".edit-video .fv-player-editor-button").trigger("click"),!1;if(o.length&&e.is(":visible")&&!o.is(":visible"))return o.trigger("click"),!1;if(!jQuery("#"+e.parent().attr("rel")).hasClass("dynamic-playlist")){if(fv_player_playlist_active(jQuery(".fp-playlist-external[rel="+r.attr("id")+"]"),this),n){if(n.error&&(n.pause(),n.error=n.loading=!1,r.removeClass("is-error"),r.find(".fp-message.fp-shown").remove()),!n.video||n.video.index==t)return;n.play(t)}o=(o=a.splash)||e.find("img").attr("src");p(r,i,a,o),r[0].getBoundingClientRect().bottom-100<0&&jQuery("html, body").animate({scrollTop:jQuery(r).offset().top-100},300)}}),jQuery("[rel="+r.attr("id")+"]")),a=!1,f=r.find(".fp-splash"),c=r.find(".fv-fp-splash-text");function p(e,t,o,a){e=e.find("img.fp-splash");a?(0==e.length&&(e=jQuery('<img class="fp-splash" />'),t.prepend(e)),e.attr("alt",o.fv_title?fv_escape_attr(o.fv_title):"video"),e.attr("src",a)):e.length&&e.remove()}n.bind("load",function(e,t,o){var a;t.conf.playlist.length&&(o.type.match(/^audio/)&&!l&&(a=(a=(o=(t=s.find("a").eq(o.index)).data("item")).splash)||t.find("img").attr("src"),p(r,i,o,a)),l=!1)}),n.bind("ready",function(e,t,o){setTimeout(function(){var e;-1<o.index&&0<s.length&&(e=jQuery("a",s).eq(o.index),fv_player_playlist_active(s,e),a=e.find(".fvp-progress"))},100),f=r.find(".fp-splash"),o.is_audio_stream||o.type.match(/^audio/)||(window.fv_player_pro&&window.fv_player_pro.autoplay_scroll||r.data("fvautoplay")?t.one("progress",function(){f.remove(),c.remove()}):(f.remove(),c.remove()))}),n.bind("unload",function(){jQuery(".fp-playlist-external .now-playing").remove(),jQuery(".fp-playlist-external a").removeClass("is-active");var e=i.find("iframe.fp-engine");e.length?(e.after(c),e.after(f)):(i.prepend(c),i.prepend(f)),a=!1}),n.bind("progress",function(e,t,o){a.length&&t.playlist_thumbnail_progress(a,t.video,o)}),n.bind("error-subtitles",function(){console.log("error-subtitles"),fv_player_notice(r,fv_flowplayer_translations[8],2e3)}),(o=jQuery(r).parent().find("div.fp-playlist-vertical[rel="+jQuery(r).attr("id")+"]")).length&&((t=function(e){var t=o.hasClass("fp-playlist-only-captions")?"height":"max-height";o.parents(".fp-playlist-text-wrapper").hasClass("is-fv-narrow")&&(t="max-height"),o.css(t,function(){var e=r.height();0==e&&(e=r.css("max-height"));return e}()),"max-height"==t&&o.css("height","auto")})(),jQuery(window).on("resize tabsactivate",function(){setTimeout(t,0)})),n.show_status=function(e){var o="";["loading","ready","playing","paused","seeking"].every(function(e,t){return n[e]&&(o+=" "+e),!0}),console.log("FV Player Status ("+e+")",o)},window.fv_player_loaded||(window.fv_player_loaded=!0,setTimeout(function(){jQuery(document).trigger("fv_player_loaded");var e=new CustomEvent("fv_player_loaded",[]);document.dispatchEvent(e)},100)),setTimeout(function(){r.trigger("fv_player_loaded")},10),r.data("error")&&(n.message(r.data("error")),r.find(".fp-controls").remove(),r.find(".fp-header").css("opacity",1).show(),n.conf.clip={sources:[{src:!1,type:"video/mp4"}]},n.on("load",function(e){e.preventDefault(),e.stopPropagation()}))}),window.self==window.top||location.href.match(/fv_player_preview/)||(e(),jQuery(window.self).resize(e)),"undefined"!=typeof fv_flowplayer_playlists)for(var t in fv_flowplayer_playlists)fv_flowplayer_playlists.hasOwnProperty(t)&&jQuery("#"+t).flowplayer({playlist:fv_flowplayer_playlists[t]});fv_player_load(),fv_autoplay_exec(),jQuery(document).ajaxComplete(function(){fv_player_load()}),jQuery(window).on("hashchange",fv_autoplay_exec)}function fv_player_load(n){n&&1<n.lenght&&console.log("FV Player: Can't use fv_player_load with more than a single forced element!");var r=!1;if((n||jQuery(".flowplayer")).each(function(e,t){var o=jQuery(t),t=o.data("flowplayer");if(t)n&&(r=t);else{n&&(o.find(".fp-preload, .fvfp_admin_error").remove(),o.attr("data-item-lazy")?(o.attr("data-item",o.attr("data-item-lazy")),o.removeAttr("item-lazy")):(playlist=jQuery("[rel="+o.attr("id")+"]"))&&playlist.find("a[data-item-lazy]").each(function(e,t){(t=jQuery(t)).attr("data-item",t.attr("data-item-lazy")),t.removeAttr("data-item-lazy")}));t=!1;if(o.attr("data-item"))t={clip:fv_player_videos_parse(o.attr("data-item"),o)};else if(playlist=jQuery("[rel="+o.attr("id")+"]")){if(0==playlist.find("a[data-item]").length)return;var a=[];playlist.find("a[data-item]").each(function(){(parsed=fv_player_videos_parse(jQuery(this).attr("data-item"),o))?a.push(parsed):jQuery(this).remove()}),t={playlist:a}}t&&(t=flowplayer.extend(t,o.data()),r=flowplayer(o[0],t),o.data("flowplayer",r))}}),jQuery(".fv-playlist-slider-wrapper").each(function(e,t){var o=jQuery(this).find("a");jQuery(this).find(".fp-playlist-external").css("width",o.outerWidth()*o.length)}),void 0!==jQuery().tabs&&(jQuery("body").removeClass("fv_flowplayer_tabs_hide"),jQuery(".fv_flowplayer_tabs_content").tabs()),n&&r)return r}function fv_player_playlist_active(e,t){e&&(jQuery("a",e).removeClass("is-active"),jQuery(".now-playing").remove()),$playlist=jQuery(e);var o,e=!1,t=(($item=jQuery(t)).addClass("is-active"),$playlist.hasClass("fv-playlist-design-2014"));(t&&0==$item.find("h4").length||!t)&&0==$item.find(".now-playing").length&&$item.prepend('<strong class="now-playing"><span>'+fv_flowplayer_translations.playlist_current+"</span></strong>"),$playlist.parent().find(".flowplayer").length||(e=!0),($playlist.hasClass("fp-playlist-vertical")||$playlist.hasClass("fp-playlist-horizontal")&&$playlist.hasClass("is-audio"))&&!function(e){var t=e.getBoundingClientRect(),o=t.top,a=t.height,n=o+a,e=e.parentNode;do{if(t=e.getBoundingClientRect(),n<=t.bottom==!1)return;if(o<=t.top)return}while(e=e.parentNode,e!=document.body);return n<=document.documentElement.clientHeight}($item.get(0))?(o=e?$playlist.parent():$playlist).animate({scrollTop:o.scrollTop()+($item.position().top-o.position().top)},750):$playlist.hasClass("fp-playlist-horizontal")&&!function(e){var t=e.getBoundingClientRect(),o=t.left,a=t.width,n=o+a,e=e.parentNode;do{if(t=e.getBoundingClientRect(),n<=t.right==!1)return;if(o<=t.left)return}while(e=e.parentNode,e!=document.body);return n<=document.documentElement.clientWidth}($item.get(0))&&(o=e?$playlist.parent():$playlist).animate({scrollLeft:o.scrollLeft()+($item.position().left-o.position().left)},750)}jQuery(document).ready(function(){var e=0,t=setInterval(function(){++e<1e3&&(window.fv_video_intelligence_conf&&!window.FV_Player_IMA||window.fv_vast_conf&&!window.FV_Player_IMA||window.fv_player_pro&&!window.FV_Flowplayer_Pro&&document.getElementById("fv_player_pro")!=fv_player_pro||window.fv_player_user_playlists&&!window.fv_player_user_playlists.is_loaded||window.FV_Player_JS_Loader_scripts_total&&window.FV_Player_JS_Loader_scripts_loaded<window.FV_Player_JS_Loader_scripts_total)||(clearInterval(t),fv_player_preload())},10)});var fv_fp_date=new Date,fv_fp_utime=fv_fp_date.getTime();function fv_parse_sharelink(e){var t="fvp_";if((e=e.replace("https?://[^./].","")).match(/(youtube.com)/))return t+e.match(/(?:v=)([A-Za-z0-9_-]*)/)[1];if(e.match(/(vimeo.com)|(youtu.be)/))return t+e.match(/(?:\/)([^/]*$)/)[1];var o=e.match(/(?:\/)([^/]*$)/);return o?t+o[1].match(/^[^.]*/)[0]:t+e}function fv_player_get_video_link_hash(e){var t=fv_parse_sharelink((void 0!==e.video.sources_original&&void 0!==e.video.sources_original[0]?e.video.sources_original:e.video.sources)[0].src);return t=void 0!==e.video.id?fv_parse_sharelink(e.video.id.toString()):t}function fv_player_time_hms(e){if(isNaN(e))return NaN;var t=parseInt(e,10),o=Math.floor(t/3600),a=Math.floor(t/60)%60,e=t%60;return o?o+="h":o="",o&&a<10?a="0"+a+"m":a?a+="m":a="",(o||a)&&e<10&&(e="0"+e),o+a+(e+="s")}function fv_player_time_hms_ms(e){if(isNaN(e))return NaN;var t=void 0!==(t=((e=parseFloat(e).toFixed(3))+"").split("."))[1]&&0<t[1]?t[1]+"ms":"";return fv_player_time_hms(e)+t}function fv_player_time_seconds(e,t){if(!e)return-1;var o=0;return e.match(/(\d+[a-z]{1,2})/g).forEach(function(e){e.endsWith("h")?o+=3600*parseInt(e):e.endsWith("m")?o+=60*parseInt(e):e.endsWith("s")&&!e.endsWith("ms")?o+=parseInt(e):e.endsWith("ms")&&parseInt(e)&&(o+=parseInt(e)/1e3)}),t?Math.min(o,t):o}function fv_autoplay_init(e,o,t,a,n){var r,i,l;fv_autoplay_exec_in_progress||(fv_autoplay_exec_in_progress=!0,(r=e.data("flowplayer"))&&(i=fv_player_time_seconds(t),n=fv_player_time_seconds(n),a=fv_player_time_seconds(a),e.parent().hasClass("ui-tabs-panel")&&(t=e.parent().attr("id"),jQuery("[aria-controls="+t+"] a").trigger("click")),e.find(".fp-player").attr("class").match(/\bis-sticky/)||(l=jQuery(e).offset().top-(jQuery(window).height()-jQuery(e).height())/2,window.scrollTo(0,l),r.one("ready",function(){window.scrollTo(0,l)})),e.hasClass("lightboxed")&&setTimeout(function(){jQuery("[href=\\#"+e.attr("id")+"]").trigger("click")},0),o?fv_player_video_link_autoplay_can(r,parseInt(o))?r.ready?fv_player_video_link_seek(r,i):(r.play(parseInt(o)),r.one("ready",function(){fv_player_video_link_seek(r,i,n,a)})):flowplayer.support.inlineVideo&&(r.one(r.playing?"progress":"ready",function(e,t){t.play(parseInt(o)),t.one("ready",function(){fv_player_video_link_seek(t,i,n,a)})}),e.find(".fp-splash").attr("src",jQuery("[rel="+e.attr("id")+"] div").eq(o).find("img").attr("src")),fv_player_in_iframe()||fv_player_notice(e,fv_flowplayer_translations[11],"progress")):r.ready?fv_player_video_link_seek(r,i):(fv_player_video_link_autoplay_can(r)?r.load():fv_player_in_iframe()||fv_player_notice(e,fv_flowplayer_translations[11],"progress"),r.one("ready",function(){fv_player_video_link_seek(r,i,n,a)}))))}function fv_player_video_link_seek(e,t,o,a){fv_autoplay_exec_in_progress=!1;var n=setInterval(function(){e.loading||((0<t||0<e.video.time)&&(e.custom_seek?e.custom_seek(t):e.seek(t)),o&&a&&e.trigger("link-ab",[e,a,o]),clearInterval(n))},10)}var fv_autoplay_exec_in_progress=!1;function fv_autoplay_exec(){var e,i,l,s,f,c=!0;"undefined"!=typeof flowplayer&&"undefined"!=typeof fv_flowplayer_conf&&fv_flowplayer_conf.video_hash_links&&window.location.hash.substring(1).length&&(e=window.location.hash.match(/\?t=/)?window.location.hash.substring(1).split("?t="):window.location.hash.substring(1).split(","),i=e[0],l=void 0!==e[1]&&e[1],s=void 0!==e[2]&&e[2],f=void 0!==e[3]&&e[3],jQuery(".flowplayer").each(function(){var e=jQuery(this),t=(e=e.hasClass("lightbox-starter")?jQuery(e.attr("href")):e).data("flowplayer");if(t){var o,a=void 0!==t.conf.playlist&&1<t.conf.playlist.length?t.conf.playlist:[t.conf.clip];for(o in a)if(a.hasOwnProperty(o)){var n=void 0!==a[o].id&&fv_parse_sharelink(a[o].id.toString());if(i===n&&c)return console.log("fv_autoplay_exec for "+n,o),fv_autoplay_init(e,parseInt(o),l,s,f),c=!1}for(o in a)if(a.hasOwnProperty(o)){var r=fv_parse_sharelink(a[o].sources[0].src);if(i===r&&c)return console.log("fv_autoplay_exec for "+r,o),fv_autoplay_init(e,parseInt(o),l,s,f),c=!1}}})),c&&flowplayer.support.firstframe&&jQuery(".flowplayer[data-fvautoplay]").each(function(){var e,t,o=jQuery(this),a=o.data("flowplayer"),n=o.attr("data-fvautoplay");!fv_player_did_autoplay&&n&&-1!=n&&((flowplayer.support.android||flowplayer.support.iOS)&&a&&"video/youtube"==a.conf.clip.sources[0].type?console.log("FV Player: Autoplay for YouTube not supported on Android and iOS"):(fv_player_did_autoplay=!0,a.conf.playlist.length&&!isNaN(parseFloat(n))&&isFinite(n)?a.play(parseInt(n)):a.load(),e=o.find(".fp-play").addClass("invisible"),t=o.find(".fp-controls").addClass("invisible"),a.one("progress",function(){e.removeClass("invisible"),t.removeClass("invisible")}),"muted"==n&&a.mute(!0,!0)))})}function fv_player_video_link_autoplay_can(e,t){return!("video/youtube"==(t?e.conf.playlist[t]:e.conf.clip).sources[0].type&&(flowplayer.support.iOS||flowplayer.support.android)||fv_player_in_iframe())&&flowplayer.support.firstframe}function fv_player_notice(e,t,o){var a=jQuery(".fvfp-notices",e),n=(a.length||(a=jQuery('<div class="fvfp-notices">'),jQuery(".fp-player",e).append(a)),jQuery('<div class="fvfp-notice-content">'+t+"</div></div>"));return a.append(n),"string"==typeof o&&jQuery(e).data("flowplayer").on(o,function(){n.fadeOut(100,function(){jQuery(this).remove()})}),0<o&&setTimeout(function(){n.fadeOut(2e3,function(){jQuery(this).remove()})},o),n}var fv_player_clipboard=function(e,t,o){if(navigator.clipboard&&"function"==typeof navigator.clipboard.writeText)navigator.clipboard.writeText(e).then(function(){t()},function(){o()});else try{(fv_player_doCopy(e)?t:o)()}catch(e){void 0!==o&&o(e)}};function fv_player_doCopy(e){var t,o,a,n=document.createElement("textarea"),e=(n.value=e,n.style.opacity=0,n.style.position="absolute",n.setAttribute("readonly",!0),document.body.appendChild(n),0<document.getSelection().rangeCount&&document.getSelection().getRangeAt(0));navigator.userAgent.match(/ipad|ipod|iphone/i)?(t=n.contentEditable,n.contentEditable=!0,(o=document.createRange()).selectNodeContents(n),(a=window.getSelection()).removeAllRanges(),a.addRange(o),n.setSelectionRange(0,999999),n.contentEditable=t):n.select();try{var r=document.execCommand("copy");return e&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(e)),document.body.removeChild(n),r}catch(e){throw new Error("Unsuccessfull")}}function fv_player_log(e,t){fv_flowplayer_conf.debug&&"undefined"!=typeof console&&"function"==typeof console.log&&(t?console.log(e,t):console.log(e)),fv_flowplayer_conf.debug&&void 0!==window.location.search&&window.location.search.match(/fvfp/)&&jQuery("body").prepend(e+"<br />")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function is_ga_4(e){return!(void 0===e.conf.fvanalytics||!e.conf.fvanalytics||!e.conf.fvanalytics.startsWith("G-"))}function fv_player_track(e,t,o,a,n,r){if("object"!=_typeof(e)&&(r=n,n=a,a=o,o=t,t=e,e=!1),t=t||flowplayer.conf.fvanalytics,void 0===a&&(a="Unknown engine"),/fv_player_track_debug/.test(window.location.href)&&console.log("FV Player Track: "+o+" - "+a+" '"+n+"'",r),"undefined"!=typeof gtag)is_ga_4(e)?gtag("event",o,{video_title:n,video_current_time:e.video.time,video_provider:a,video_duration:e.video.duration,value:r||1}):gtag("event",o,{event_category:a,event_label:n,value:r||1});else if(t&&"undefined"!=typeof ga)ga("create",t,"auto",n,{allowLinker:!0}),ga("require","linker"),r?ga("send","event",o,a,n,r):ga("send","event",o,a,n);else if(t&&"undefined"!=typeof _gat){e=_gat._getTracker(t);if(void 0===e._setAllowLinker)return;e._setAllowLinker(!0),r?e._trackEvent(o,a,n,r):e._trackEvent(o,a,n)}flowplayer.conf.matomo_domain&&flowplayer.conf.matomo_site_id&&"undefined"!=typeof _paq&&(r?_paq.push(["trackEvent",o,a,n,r]):_paq.push(["trackEvent",o,a,n]))}function fv_player_track_name(e,t){e=e.attr("title");return(e=(e=e||void 0===t.fv_title?e:t.fv_title)||void 0===t.title?e:t.title)||void 0===t.src||(e=t.src.split("/").slice(-1)[0].replace(/\.(\w{3,4})(\?.*)?$/i,""),t.type.match(/mpegurl/)&&(e=t.src.split("/").slice(-2)[0].replace(/\.(\w{3,4})(\?.*)?$/i,"")+"/"+e)),e}flowplayer(function(o,r){var n,t,i,a,l;function e(){var e;"dash"==o.engine.engineName?((e=i[o.engine.dash.getQualityFor("video")]).qualityIndex!=a&&(a=e.qualityIndex,s(e.qualityIndex,i)),t.match(/dash_debug/)&&f(e.width,e.height,e.bitrate)):"hlsjs-lite"==o.engine.engineName&&(n.currentLevel!=a&&(a=n.currentLevel,s(n.currentLevel,n.levels)),t.match(/hls_debug/)&&(e=n.levels[n.currentLevel])&&f(e.width,e.height,e.bitrate))}function s(e,t){var o,a,n;t[e]&&(o=t[e].height,a=541,n=1e5,jQuery(t).each(function(e,t){720<=t.height&&t.height<1400&&(a=720),t.height<n&&(n=t.height),localStorage.FVPlayerHLSQuality==t.height&&(r.find("a[data-quality]").removeClass("fp-selected fp-color"),r.find("a[data-quality="+e+"]").addClass("fp-selected fp-color"))}),r.find("a[data-quality]").removeClass("is-current"),r.find("a[data-quality="+e+"]").addClass("is-current"),t=1400<=o?"4K":a<=o?"HD":360<=o&&n<o?"SD":"SD",r.find(".fp-qsel").html(t))}function f(e,t,o){l.html("Using "+e+"x"+t+" at "+Math.round(o/1024)+" kbps")}function c(){var o=r.find(".fp-qsel-menu");o.children().each(function(e,t){o.prepend(t)}),o.children().each(function(e,t){var o;/^NaNp/.test(jQuery(t).html())?(o=jQuery(t).html().match(/\((.*?)\)/))&&void 0!==o[1]&&jQuery(t).html(o[1]):jQuery(t).html(jQuery(t).html().replace(/\(.*?\)/,""))}),o.prepend(o.find("a[data-quality=-1]")),o.prepend(o.find("strong"))}r=jQuery(r),void 0===o.conf.disable_localstorage&&(flowplayer.engine("hlsjs-lite").plugin(function(e){(n=e.hls).on(Hls.Events.ERROR,function(e,t){"mediaError"==t.type&&"fragParsingError"==t.details&&1==t.fatal&&(n.destroy(),o.trigger("error",[o,{code:3}]),setTimeout(function(){r.removeClass("is-seeking"),r.addClass("is-paused")},0))}),flowplayer.support.browser.safari&&n.on(Hls.Events.KEY_LOADED,function(e){"hlsKeyLoaded"==e&&setTimeout(function(){o.loading&&(console.log("FV Player: Safari stuck loading HLS, resuming playback..."),o.resume())},0)});var a=!(!flowplayer.conf.hd_streaming||flowplayer.support.fvmobile)&&720;0==jQuery(e.root).data("hd_streaming")&&(a=!1),(a=localStorage.FVPlayerHLSQuality?localStorage.FVPlayerHLSQuality:a)&&n.on(Hls.Events.MANIFEST_PARSED,function(e,t){var o=!1;jQuery.each(t.levels,function(e,t){t.height==a&&(o=e)}),localStorage.FVPlayerHLSQuality||o||jQuery.each(t.levels,function(e,t){t.height>o&&(o=e)}),o&&(console.log("FV Player: Picked "+t.levels[o].height+"p quality"),n.startLevel=o,n.currentLevel=o)})}),r=jQuery(r),t=document.location.search,localStorage.FVPlayerDashQuality&&(o.conf.dash||(o.conf.dash={}),o.conf.dash.initialVideoQuality="restore"),r.on("click",".fp-qsel-menu a",function(){var e;"hlsjs-lite"==o.engine.engineName&&(-1==(e=jQuery(this).data("quality"))?localStorage.removeItem("FVPlayerHLSQuality"):(e=n.levels[e],localStorage.FVPlayerHLSQuality=e.height))}),localStorage.FVPlayerHLSQuality?(o.conf.hlsjs.startLevel=parseInt(localStorage.FVPlayerHLSQuality),o.conf.hlsjs.testBandwidth=!1,o.conf.hlsjs.autoLevelEnabled=!1):flowplayer.conf.hd_streaming&&!flowplayer.support.fvmobile&&(o.conf.hlsjs.startLevel=3,o.conf.hlsjs.testBandwidth=!1,o.conf.hlsjs.autoLevelEnabled=!1),o.bind("quality",function(e,t,o){"dash"==t.engine.engineName&&(-1==o?localStorage.removeItem("FVPlayerDashQuality"):i[o]&&(localStorage.FVPlayerDashQuality=i[o].height))}),i=[],a=-1,o.bind("ready",function(e,t){var a;r.find(".fp-qsel-menu strong").text(fv_flowplayer_translations.quality),"dash"==t.engine.engineName?(i=t.engine.dash.getBitrateInfoListFor("video"),localStorage.FVPlayerDashQuality&&t.conf.dash.initialVideoQuality&&t.quality(t.conf.dash.initialVideoQuality),c()):"hlsjs-lite"==t.engine.engineName?(r.addClass("is-loading"),t.loading=!0,t.one("progress",function(){t.loading&&(r.removeClass("is-loading"),t.loading=!1)}),t.video.qualities&&2<t.video.qualities.length&&(a=-1,localStorage.FVPlayerHLSQuality?jQuery(t.video.qualities).each(function(e,t){if(t.value==localStorage.FVPlayerHLSQuality)return a=localStorage.FVPlayerHLSQuality,!1}):flowplayer.conf.hd_streaming&&!flowplayer.support.fvmobile&&jQuery(t.video.qualities).each(function(e,t){var o=parseInt(t.label);0<o&&-1==a&&720<=o&&o<=720&&(a=t.value)}),-1<(a=parseInt(a))&&r.one("progress",function(){setTimeout(function(){t.quality(a)})}),c())):t.video.sources_fvqs&&0<t.video.sources_fvqs.length&&t.video.src.match(/vimeo.*?\.mp4/)&&setTimeout(c,0),r.find("a[data-quality]").removeClass("is-current")}),(t.match(/dash_debug/)||t.match(/hls_debug/))&&(l=jQuery('<div class="fv-debug" style="background: gray; color: white; top: 10%; position: absolute; z-index: 1000">').appendTo(r.find(".fp-player"))),o.bind("ready progress",e),o.bind("quality",function(){setTimeout(e,0)}))}),flowplayer(function(a,n){var r=(n=jQuery(n)).attr("id"),i=!1;function l(){var t,o,e=n.attr("data-ad");if(void 0!==e&&e.length){try{e=JSON.parse(e)}catch(e){return}!i&&!n.hasClass("is-cva")&&n.width()>=parseInt(e.width)&&(e=(e=e.html).replace("%random%",Math.random()),i=jQuery('<div id="'+r+'_ad" class="wpfp_custom_ad">'+e+"</div>"),n.find(".fp-player").append(i),t=0,o=setInterval(function(){var e=i&&i.find(".adsbygoogle").height();(200<++t||0<e)&&clearInterval(o),e>n.height()&&i.addClass("tall-ad")},50),setTimeout(function(){n.find(".wpfp_custom_ad video").length&&a.pause()},500))}}function o(e){var t=n.attr("data-popup");if(void 0!==t&&t.length){try{t=JSON.parse(t)}catch(e){return}("finish"==e||t.pause||t.html.match(/fv-player-ppv-purchase-btn-wrapper/))&&0==n.find(".wpfp_custom_popup").length&&(n.addClass("is-popup-showing"),n.find(".fp-player").append('<div id="'+r+'_custom_popup" class="wpfp_custom_popup">'+t.html+"</div>"))}}n.data("end_popup_preview")&&jQuery(document).ready(function(){a.trigger("finish",[a])}),a.bind("ready",function(e,t){1==i.length&&(i.remove(),i=!1),n.data("ad_show_after")||l()}).bind("progress",function(e,t,o){o>n.data("ad_show_after")&&l()}).bind("finish",function(e,t){void 0!==t.video.index&&t.video.index+1!=t.conf.playlist.length||o(e.type)}).bind("pause",function(e,t){o(e.type)}).bind("resume unload seek",function(e,t){n.hasClass("is-popup-showing")&&(n.find(".wpfp_custom_popup").remove(),n.removeClass("is-popup-showing"))})}),jQuery(document).on("click",".fv_fp_close",function(){var e=jQuery(this).parents(".wpfp_custom_ad_content"),t=e.find("video");return e.fadeOut(),t.length&&t[0].pause(),!1}),jQuery(document).on("focus",".fv_player_popup input[type=text], .fv_player_popup input[type=email], .fv_player_popup textarea",function(){var e=jQuery(this).parents(".flowplayer").data("flowplayer");e&&e.disable(!0)}),jQuery(document).on("blur",".fv_player_popup input[type=text], .fv_player_popup input[type=email], .fv_player_popup textarea",function(){var e=jQuery(this).parents(".flowplayer").data("flowplayer");e&&e.disable(!1)}),flowplayer(function(a,s){var n,r,e,t,o,s=jQuery(s),i=flowplayer.bean,l=0,f=0,c=("undefined"==typeof ga&&a.conf.fvanalytics&&"undefined"==typeof _gat&&"undefined"==typeof gtag&&(is_ga_4(a)?jQuery.getScript({url:"https://www.googletagmanager.com/gtag/js?id="+a.conf.fvanalytics,cache:!0},function(){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",a.conf.fvanalytics)}):jQuery.getScript({url:"https://www.google-analytics.com/analytics.js",cache:!0},function(){ga("create",a.conf.fvanalytics,"auto")})),!window._paq&&a.conf.matomo_domain&&a.conf.matomo_site_id&&(e="//"+a.conf.matomo_domain+"/",(o=window._paq=window._paq||[]).push(["setTrackerUrl",e+"matomo.php"]),o.push(["setSiteId",a.conf.matomo_site_id]),t=(o=document).createElement("script"),o=o.getElementsByTagName("script")[0],t.type="text/javascript",t.async=!0,t.src=e+"matomo.js",o.parentNode.insertBefore(t,o)),a.bind("progress",function(e,t,o){var a=t.video,n=a.duration,r=0,i=fv_player_track_name(s,a);if(n&&(19*n/20<o?r=4:3*n/4<o?r=3:n/2<o?r=2:n/4<o&&(r=1)),t.live&&(r=0),!s.data("fv_track_"+c[r])){for(var l in c)if(c.hasOwnProperty(l)){if(l==r)break;if(!s.data("fv_track_"+c[l]))return}s.trigger("fv_track_"+c[r].replace(/ /,"_"),[t,i]),s.data("fv_track_"+c[r],!0),fv_player_track(t,!1,"Video "+(s.hasClass("is-cva")?"Ad ":"")+c[r],t.engine.engineName+"/"+a.type,i)}}).bind("finish ready ",function(e,t){for(var o in c)c.hasOwnProperty(o)&&s.removeData("fv_track_"+c[o])}).bind("error",function(e,t,o){setTimeout(function(){var e;t.error&&((e=void 0!==t.video&&void 0!==t.video.src&&t.video)||void 0===t.conf.clip||void 0===t.conf.clip.sources||void 0===t.conf.clip.sources[0]||void 0===t.conf.clip.sources[0].src||(e=t.conf.clip.sources[0]),!(e=fv_player_track_name(s,e))||e.match(/\/\/vimeo.com\/\d/)||is_ga_4(t)||fv_player_track(t,!1,"Video "+(s.hasClass("is-cva")?"Ad ":"")+"error",o.message,e))},100)}),a.bind("load unload",p).bind("progress",function(e,t){t.seeking||(l+=f?+new Date-f:0,f=+new Date),n=n||setTimeout(function(){n=null,is_ga_4(t)||fv_player_track(t,!1,"Flowplayer heartbeat",t.engine.engineName+"/"+t.video.type,"Heartbeat",0)},6e5)}).bind("pause",function(){f=0}),a.bind("shutdown",function(){i.off(window,"unload",p)}),i.on(window,"unload",p),is_ga_4(a)?["Play","25 Percent Played","50 Percent Played","75 Percent Played","100 Percent Played"]:["start","first quartile","second quartile","third quartile","complete"]);function p(e,t,o){o=o||a.video,"load"===e.type&&(r=fv_player_track_name(s,o)),l&&(fv_player_track(a,!1,"Video / Seconds played",a.engine.engineName+"/"+a.video.type,r,Math.round(l/1e3)),l=0,n&&(clearTimeout(n),n=null))}a.get_time_played=function(){return l/1e3}}),flowplayer(function(a,n){var r=(n=jQuery(n)).find(".fp-player"),i=n.hasClass("no-volume"),l=n.hasClass("fp-mute"),s=n.hasClass("fp-full"),f=0;function t(){var e=r.width()||n.width(),t=a.video.index||0,o=(900<e?jQuery(".fp-subtitle",n).addClass("is-wide"):jQuery(".fp-subtitle",n).removeClass("is-wide"),n.toggleClass("is-tiny",e<400),n.toggleClass("is-small",e<600&&400<=e),e<480+35*f),t=(void 0!==a.fv_timeline_chapters_data&&void 0!==a.fv_timeline_chapters_data[t]&&(o=!0),s||n.toggleClass("fp-full",n.hasClass("has-abloop")||o),""),o=(e<400?t="is-tiny":e<600&&400<=e&&(t="is-small"),n.trigger("fv-player-size",[t]),r);(o=n.parent().hasClass("fp-playlist-vertical-wrapper")||n.parent().hasClass("fp-playlist-text-wrapper")?n.parent():o).width()<=560?o.addClass("is-fv-narrow"):o.removeClass("is-fv-narrow"),e<=320?n.addClass("no-volume fp-mute"):(!i&&flowplayer.support.volume&&n.removeClass("no-volume"),!l&&flowplayer.support.volume&&n.removeClass("fp-mute"))}t(),jQuery(window).on("resize",t),"fonts"in document&&a.one("load",function(){document.fonts.load("1em flowplayer")}),a.on("ready fullscreen fullscreen-exit sticky sticky-exit",function(e){setTimeout(function(){f=n.find(".fp-controls > strong:visible").length+n.find(".fp-controls > .fp-icon:visible").length,t()},0)}),a.on("unload pause finish error",function(){"undefined"!=typeof checker&&clearInterval(checker)})}),jQuery(window).on("resize tabsactivate",function(){jQuery(".fp-playlist-external").each(function(){var e=jQuery(this);900<=e.parent().width()?e.addClass("is-wide"):e.removeClass("is-wide")})}).trigger("resize"),flowplayer(function(e,a){a=jQuery(a),e.bind("ready",function(){/Chrome/.test(navigator.userAgent)&&54<parseFloat(/Chrome\/(\d\d)/.exec(navigator.userAgent)[1],10)&&(e.video.subtitles?jQuery(a).addClass("chrome55fix-subtitles"):jQuery(a).addClass("chrome55fix"))});var t=a.css("background-image");if(t){if(!(t=t.replace(/url\((['"])?(.*?)\1\)/gi,"$2").split(","))||!t[0].match(/^(https?:)?\/\//))return;var o=new Image,t=(o.src=t[0],o.height/o.width),o=a.height()/a.width();Math.abs(o-t)<.05&&a.css("background-size","cover")}var n=!1;jQuery(e.conf.playlist).each(function(e,t){t.sources[0].type.match(/youtube/)&&(n=!0)}),n&&a.addClass("is-youtube"),e.bind("ready",function(e,t,o){"video/youtube"==o.type?a.addClass("is-youtube"):a.removeClass("is-youtube")})}),function(e){e(window).on("resize",function(){e("iframe[id][src][height][width]").each(function(){e(this).attr("id").match(/fv_vimeo_/)&&e(this).width()<=e(this).attr("width")&&e(this).height(e(this).width()*e(this).attr("height")/e(this).attr("width"))}),jQuery(".wistia_embed").each(function(){e(this).height(e(this).width()*e(this).data("ratio"))})}).trigger("resize")}(jQuery),jQuery(document).on("tabsactivate",".fv_flowplayer_tabs_content",function(e,t){var o=jQuery(t.oldPanel).find(".flowplayer").data("flowplayer");void 0!==o&&o.pause(),jQuery(".flowplayer",t.newPanel).data("flowplayer").load()}),flowplayer(function(t,a){a=jQuery(a);var e=flowplayer.bean;a.hasClass("is-audio")&&(e.off(a[0],"mouseenter"),e.off(a[0],"mouseleave"),a.removeClass("is-mouseout"),a.addClass("fixed-controls").addClass("is-mouseover"),t.on("error",function(e,t,o){jQuery(".fp-message",a).html(jQuery(".fp-message",a).html().replace(/video/,"audio"))}),a.on("click",function(e){t.ready||(e.preventDefault(),e.stopPropagation(),t.load())}))}),flowplayer(function(f,c){var t,r,o,i,e,l,n;function a(){}function s(e){console.log("FV Player: Chromecast listener",e),e===chrome.cast.ReceiverAvailability.AVAILABLE&&(flowplayer.conf.chromecast_available=!0)}function p(){}function d(){console.log("chromecast onError")}function u(){clearInterval(o),o=null,f.release(),l.toggleClass(c,"is-chromecast",!1),l.toggleClass(i,"fp-active",!1)}function y(){var e=!1,t=f.video.sources_fvqs||f.video.sources;for(a in t){var o=t[a].type;if("video/mp4"==o||"video/fv-mp4"==o||"application/dash+xml"==o){e=t[a];break}}if(!e)for(var a in t)if("application/x-mpegurl"==t[a].type){e=t[a];break}if(f.video.fvhkey&&!f.conf.hls_cast)return!1;if(e){var n,r=!1,i=["fullhd","hd","md","sd"];for(n in i){var l=new RegExp("-"+i[n]);for(a in f.video.sources_fvqs){var s=f.video.sources_fvqs[a];if(s.src.match(l)&&"video/mp4"==s.type){r=s;break}}if(r){e=r;break}}}return e}function v(){var a,e=y();e&&(a=[],f.video.subtitles&&f.video.subtitles.forEach(function(e,t){e.src.match(/\.srt/)&&console.log("FV Player: Chromecast doesn't support SRT subtitles");var o=new chrome.cast.media.Track(t,chrome.cast.media.TrackType.TEXT);o.trackContentId=e.src,o.trackContentType="text/vtt",o.subtype=chrome.cast.media.TextTrackType.SUBTITLES,o.name=e.label,o.language=e.srclang+"-"+t,o.customData=null,a.push(o)}),(e=new chrome.cast.media.MediaInfo(e.src,e.type)).tracks=a,e=new chrome.cast.media.LoadRequest(e),f.live||(e.currentTime=f.video.time),clearInterval(o),o=!1,r.loadMedia(e,_,function(e){console.log("onMediaError",e)}))}function _(a){m(a),a.addUpdateListener(function(e){r&&(o=o||setInterval(function(){f.trigger("progress",[f,a.getEstimatedTime()]),a.activeTrackIds.forEach(function(o){jQuery.each(a.media.tracks,function(e,t){if(t.trackId==o&&"AUDIO"==t.type)return h("data-audio",t.language)||h("data-lang",t.language),!1})})},500),e&&(l.toggleClass(c,"is-chromecast",!0),l.toggleClass(i,"fp-active",!0),f.hijack({pause:function(){console.log("hijacked pause!"),a.pause()},resume:function(){if(f.finished)return clearInterval(o),o=null,f.release(),void v();a.play()},seek:function(e){var t=new chrome.cast.media.SeekRequest;t.currentTime=e,a.seek(t)}})),e=a.playerState,f.paused&&e===chrome.cast.media.PlayerState.PLAYING&&f.trigger("resume",[f]),f.playing&&e===chrome.cast.media.PlayerState.PAUSED&&f.trigger("pause",[f]),f.seeking&&e===chrome.cast.media.PlayerState.BUFFERING&&(n=!0),f.seeking&&e===chrome.cast.media.PlayerState.PLAYING&&n&&(n=!1,f.trigger("seek",[f])),e==chrome.cast.media.PlayerState.IDLE&&a.idleReason==chrome.cast.media.IdleReason.FINISHED&&f.trigger("finish",[f]),l.toggleClass(c,"is-loading",e===chrome.cast.media.PlayerState.BUFFERING))})}function h(o,a){var e=jQuery(c).find(".fv-fp-hls-menu a"),n=!1;return e.each(function(e,t){jQuery(t).attr(o)===a?(jQuery(t).addClass("fp-selected"),n=!0):jQuery(t).removeClass("fp-selected")}),n}function m(e){console.log(e.media.tracks);var o=jQuery(c).find(".fv-fp-hls-menu [data-audio].fp-selected").data("audio"),a=jQuery(c).find(".fv-fp-hls-menu [data-audio].fp-selected").data("lang"),n=jQuery(c).find(".fp-subtitle-menu [data-subtitle-index].fp-selected").data("subtitle-index"),r=-1<n&&f.video.subtitles[n].srclang,i=!1,l=!1,t=[],s=(jQuery.each(e.media.tracks,function(e,t){t.language==o&&"AUDIO"==t.type&&(i=t),t.language==r+"-"+n&&"TEXT"==t.type&&(l=t)}),i||jQuery.each(e.media.tracks,function(e,t){if(t.language==a&&"AUDIO"==t.type)return i=t,!1}),"");i&&(t.push(i.trackId),s+=i.language+" audio"),l&&(t.push(l.trackId),s&&(s+=" "),s+=l.language+" subtitles"),t&&(t=new chrome.cast.media.EditTracksInfoRequest(t),e.editTracksInfo(t,function(){console.log("FV Player: Chromecast "+s+" loaded")},function(){console.log("FV Player: Chromecast "+s+" failed")}))}f.conf.fv_chromecast&&(window.__onGCastApiAvailable||(jQuery.getScript({url:"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js",cache:!0}),window.__onGCastApiAvailable=function(e){e&&(e=t.applicationId||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,e=new chrome.cast.SessionRequest(e),e=new chrome.cast.ApiConfig(e,a,s),chrome.cast.initialize(e,p,d))}),t=f.conf.chromecast||{},e=flowplayer.bean,l=flowplayer.common,n=!1,f.bind("ready",function(e,t,o){var a,n;r?y()?(t.one("progress",function(e,t){t.release(),t.pause(),t.mute(!1,!0),v()}),t.mute(!0,!0)):(r.stop(),r=null,u(),jQuery(i).hide()):flowplayer.conf.chromecast_available&&(y()?((t=l.find(".fp-header",c)[0])&&(l.find(".fp-chromecast",t).forEach(l.removeNode),l.find(".fp-chromecast-engine",c).forEach(l.removeNode),i=l.createElement("a",{class:"fp-chromecast fp-icon",title:"Play on Cast device"}),t.appendChild(i),t=l.createElement("div",{class:"fp-chromecast-engine"}),a=l.createElement("p",{class:"fp-chromecast-engine-status"}),n=l.createElement("p",{class:"fp-chromecast-engine-icon"}),t.appendChild(n),t.appendChild(a),(n=l.find(".fp-engine",c)[0])?n.parentNode.insertBefore(t,n):l.prepend(l.find(".fp-player",c)[0]||c,t)),jQuery(i).show()):(fv_player_log("FV Player: Can't find media source suitable for Chromecast!"),jQuery(i).hide()))}),e.on(c,"click",".fp-chromecast",function(e){var t;if(e.preventDefault(),r)return f.trigger("pause",[f]),r.media[0].media&&(t=r.media[0].getEstimatedTime(),setTimeout(function(){f.seek(t)},0)),r.stop(),r=null,void u();f.playing&&f.pause(),chrome.cast.requestSession(function(e){jQuery(c).addClass("is-loading");e=(r=e).receiver.friendlyName;l.html(l.find(".fp-chromecast-engine-status",c)[0],"Playing on device "+e),v()},function(e){console.error("requestSession error",e)})}),e.on(c,"click",".fv-fp-hls-menu [data-audio], .fp-subtitle-menu [data-subtitle-index]",function(){if(r&&r.media[0].media)return m(r.media[0]),!1}),jQuery(window).on("unload",function(){r&&r.stop()}))}),jQuery(document).on("mfpClose",function(){void 0!==jQuery(".flowplayer").data("flowplayer")&&jQuery(".flowplayer").data("flowplayer").unload()}),jQuery(document).on("click",".vc_tta-tab a",function(){var e=jQuery(".flowplayer.is-playing").data("flowplayer");e&&e.pause()}),flowplayer(function(e,t){t=jQuery(t),e.bind("ready",function(){setTimeout(function(){var e=jQuery("video",t);0<e.length&&e.prop("autoplay",!1)},100),t.find("video.fp-engine").addClass("intrinsic-ignore")})}),jQuery(".flowplayer").on("ready",function(e,t){/BB10/.test(navigator.userAgent)&&t.fullscreen()});var fv_flowplayer_safety_resize_arr=Array();function fv_flowplayer_safety_resize(){var t=!1;jQuery(".flowplayer").each(function(){if(jQuery(this).is(":visible")&&!jQuery(this).hasClass("lightboxed")&&!jQuery(this).hasClass("lightbox-starter")&&!jQuery(this).hasClass("is-audio")&&(jQuery(this).width()<30||jQuery(this).height()<20)){t=!0;for(var e=jQuery(this);(jQuery(e).width()<30||jQuery(e).width()==jQuery(this).width())&&0!=jQuery(e).parent().length;)(e=jQuery(e).parent()).hasClass("ld-video")&&(""==e[0].style.height&&e.css("height","auto"),0<parseInt(e.css("padding-bottom"))&&e.css("padding-bottom","0"));jQuery(this).width(jQuery(e).width()),jQuery(this).height(parseInt(jQuery(this).width()*jQuery(this).attr("data-ratio"))),fv_flowplayer_safety_resize_arr[jQuery(this).attr("id")]=e}}),t&&jQuery(window).resize(function(){jQuery(".flowplayer").each(function(){jQuery(this).hasClass("lightboxed")||jQuery(this).hasClass("lightbox-starter")||fv_flowplayer_safety_resize_arr[jQuery(this).attr("id")]&&(jQuery(this).width(fv_flowplayer_safety_resize_arr[jQuery(this).attr("id")].width()),jQuery(this).height(parseInt(jQuery(this).width()*jQuery(this).attr("data-ratio"))))})})}void 0!==flowplayer.conf.safety_resize&&flowplayer.conf.safety_resize&&jQuery(document).ready(function(){setTimeout(function(){fv_flowplayer_safety_resize()},10)});var fv_player_warning,isIE11=!!navigator.userAgent.match(/Trident.*rv[ :]*11\./);function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fv_flowplayer_mobile_switch(e){var t,o=new RegExp("[\\?&]fv_flowplayer_mobile=([^&#]*)").exec(location.search);!(null!=o&&"yes"==o[1]||jQuery(window).width()<=480||jQuery(window).height()<=480)||null!=o&&"no"==o[1]||(t=!1,jQuery("#wpfp_"+e+" video source").each(function(){jQuery(this).attr("id")!="wpfp_"+e+"_mobile"&&(t=!0,jQuery(this).remove())}),t&&jQuery("#wpfp_"+e).after('<p class="fv-flowplayer-mobile-switch">'+fv_flowplayer_translations.mobile_browser_detected_1+' <a href="'+document.URL+'?fv_flowplayer_mobile=no">'+fv_flowplayer_translations.mobile_browser_detected_2+"</a>.</p>"))}if(isIE11&&(jQuery(document).ready(function(){jQuery(".fp-waiting").hide()}),flowplayer(function(e,t){e.bind("load",function(e){jQuery(e.currentTarget).find(".fp-waiting").show()}).bind("beforeseek",function(e){jQuery(e.currentTarget).find(".fp-waiting").show()}).bind("progress",function(e){jQuery(e.currentTarget).find(".fp-waiting").hide()}).bind("seek",function(e){jQuery(e.currentTarget).find(".fp-waiting").hide()}).bind("fullscreen",function(e){jQuery("#wpadminbar").hide()}).bind("fullscreen-exit",function(e){jQuery("#wpadminbar").show()})})),flowplayer.support.browser&&flowplayer.support.browser.msie&&parseInt(flowplayer.support.browser.version,10)<9&&jQuery(".flowplayer").each(function(){jQuery(this).css("width",jQuery(this).css("max-width")),jQuery(this).css("height",jQuery(this).css("max-height"))}),location.href.match(/elementor-preview=/)?(console.log("FV Player: Elementor editor is active"),setInterval(fv_player_load,1e3)):location.href.match(/brizy-edit-iframe/)&&(console.log("FV Player: Brizy editor is active"),setInterval(fv_player_load,1e3)),window.DELEGATE_NAMES&&flowplayer(function(e,t){fv_player_notice(t,fv_flowplayer_translations.chrome_extension_disable_html5_autoplay)}),flowplayer(function(e,t){flowplayer.bean.off(t,"contextmenu")}),location.href.match(/elementor-preview=/)&&(console.log("FV Player: Elementor editor is active"),setInterval(fv_player_load,1e3)),flowplayer(function(o,a){void 0!==(a=jQuery(a)).data("fv-embed")&&a.data("fv-embed")&&"false"!=a.data("fv-embed")&&(o.embedCode=function(){o.video;var e=a.width(),t=a.height();return t+=2,(a.hasClass("has-chapters")||a.hasClass("has-transcript"))&&(t+=300),0<jQuery(".fp-playlist-external[rel="+a.attr("id")+"]").length&&(t+=170),'<iframe src="'+(a.data("fv-embed")+"#"+fv_player_get_video_link_hash(o))+'" allowfullscreen width="'+e+'" height="'+t+'" frameborder="0" style="max-width:100%"></iframe>'})}),jQuery(document).on("click",".flowplayer .embed-code-toggle",function(){var e=jQuery(this).closest(".flowplayer");if("undefined"!=typeof fv_player_editor_conf)return fv_player_notice(e,fv_player_editor_translations.embed_notice,2e3),!1;var t=jQuery(this),o=t.parents(".flowplayer"),e=o.data("flowplayer");return"function"==typeof e.embedCode&&o.find(".embed-code textarea").val(e.embedCode()),fv_player_clipboard(o.find(".embed-code textarea").val(),function(){fv_player_notice(o,fv_flowplayer_translations.embed_copied,2e3)},function(){t.parents(".fvp-share-bar").find(".embed-code").toggle(),t.parents(".fvp-share-bar").toggleClass("visible")}),!1}),flowplayer(function(a,n){var r,i,l,s,f,c,p,e,d;0!=jQuery(n).data("fullscreen")&&(a.one("ready",function(e,t,o){0==jQuery(n).find(".fp-fullscreen").length&&jQuery(n).find(".fp-header").append('<a class="fp-fullscreen fp-icon"></a>')}),r="fullscreen",i="fullscreen-exit",l=flowplayer.support.fullscreen,s=window,p=flowplayer.bean,a.fullscreen=function(e){if(!a.disabled){var t=d.find("video.fp-engine",n)[0];if(flowplayer.conf.native_fullscreen&&t&&flowplayer.support.iOS)return a.trigger(r,[a]),p.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement===t&&(p.off(document,".nativefullscreen"),p.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement||(p.off(document,".nativefullscreen"),a.trigger(i,[a]))}))}),t.webkitEnterFullScreen(),void p.one(t,"webkitendfullscreen",function(){p.off(document,"fullscreenchange.nativefullscreen"),a.trigger(i,[a]),d.prop(t,"controls",!0),d.prop(t,"controls",!1)});var o=jQuery(n).find(".fp-player")[0];return(e=void 0===e?!a.isFullscreen:e)&&(c=s.scrollY,f=s.scrollX),l?e?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){"function"==typeof o[e]&&(o[e]({navigationUI:"hide"}),"webkitRequestFullScreen"!==e||document.webkitFullscreenElement||o[e]())}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){"function"==typeof document[e]&&document[e]()}):a.trigger(e?r:i,[a]),a}},d=flowplayer.common,a.on("mousedown.fs",function(){+new Date-e<150&&a.ready&&a.fullscreen(),e=+new Date}),a.on(r,function(){d.addClass(n,"is-fullscreen"),d.toggleClass(n,"fp-minimal-fullscreen",d.hasClass(n,"fp-minimal")),d.removeClass(n,"fp-minimal"),l||d.css(n,"position","fixed"),a.isFullscreen=!0}).on(i,function(){var e;d.toggleClass(n,"fp-minimal",d.hasClass(n,"fp-minimal-fullscreen")),d.removeClass(n,"fp-minimal-fullscreen"),l||"html5"!==a.engine||(e=n.css("opacity")||"",d.css(n,"opacity",0)),l||d.css(n,"position",""),d.removeClass(n,"is-fullscreen"),l||"html5"!==a.engine||setTimeout(function(){n.css("opacity",e)}),a.isFullscreen=!1,"fvyoutube"!=a.engine.engineName&&s.scrollTo(f,c)}).on("unload",function(){a.isFullscreen&&a.fullscreen()}),a.on("shutdown",function(){FULL_PLAYER=null,d.removeNode(wrapper)}))}),flowplayer(function(o,a){var e,t,n,r,i,l;function s(){var e=window.innerWidth<window.innerHeight?window.innerWidth<=375?.6:.575:window.innerWidth<=667?2:2.4;return window.innerWidth/window.innerHeight>e}function f(){o.isFullscreen&&window.innerWidth>window.innerHeight&&s()&&!l&&(fv_player_notice(a,fv_flowplayer_translations.iphone_swipe_up_location_bar,"resize-good"),l=setTimeout(function(){l=!1,o.trigger("resize-good")},5e3))}a=jQuery(a),flowplayer.conf.wpadmin||jQuery(a).hasClass("is-audio")||(e=(e=jQuery(".fp-playlist-external[rel="+a.attr("id")+"]")).hasClass("fp-playlist-season")||e.hasClass("fp-playlist-polaroid"),t=1==a.data("fsforce"),0!=a.data("fullscreen")&&(flowplayer.conf.mobile_force_fullscreen&&flowplayer.support.fvmobile||!flowplayer.support.fullscreen&&t||e?(flowplayer.support.fullscreen||o.bind("ready",function(){o.video.vr||o.fullscreen(!0)}),a.on("click",function(){o.ready&&!o.paused||o.fullscreen(!0)}),jQuery("[rel="+a.attr("id")+"] a").on("click",function(e){o.isFullscreen||(o.fullscreen(),o.resume())}),o.on("resume",function(){o.video.vr||o.isFullscreen||o.fullscreen()}),o.on("finish",function(){0!=o.conf.playlist.length&&o.conf.playlist.length-1!=o.video.index||o.fullscreen(!1)}).on("fullscreen",function(e,t){a.addClass("forced-fullscreen")}).on("fullscreen-exit",function(e,t){t.pause(),a.removeClass("forced-fullscreen")})):t&&(r=a.find(".fp-unload"),i=!1,o.isFakeFullscreen=!1,a.addClass("is-closeable"),a.on("click",function(e){o.ready||e.target==r[0]||o.fakeFullscreen(!0)}),r.on("click",function(e){return o.ready&&o.isFullscreen?o.fullscreen(!1):o.loading&&(i=!0,o.one("resume",function(e){i=!1,o.pause()})),o.fakeFullscreen(!1),!1}),jQuery("[rel="+a.attr("id")+"] a").on("click",function(e){o.isFakeFullscreen||(o.fakeFullscreen(),o.resume())}),o.on("resume",function(){i||o.isFakeFullscreen||o.fakeFullscreen()}).on("finish",function(){0!=o.conf.playlist.length&&o.conf.playlist.length-1!=o.video.index||o.fakeFullscreen(!1)}).on("fullscreen",function(e,t){a.removeClass("fake-fullscreen")}).on("fullscreen-exit",function(e,t){t.isFakeFullscreen&&t.fakeFullscreen(!0,!0)}).on("unload",function(e,t){}),o.fakeFullscreen=function(e,t){(t||o.isFakeFullscreen!=e&&!o.disabled)&&(void 0===n&&(n=a.css("position")),void 0===e&&(e=!o.isFakeFullscreen),o.isFakeFullscreen=e,o.trigger(e?"fakefullscreen":"fakefullscreen-exit",[o]),a.toggleClass("is-fullscreen fake-fullscreen forced-fullscreen",e),e?a.css("position","fixed"):a.css("position",n))}),flowplayer.support.android&&flowplayer.conf.mobile_landscape_fullscreen&&window.screen&&window.screen.orientation&&o.on("fullscreen",function(e,t){void 0!==(t=t).video.width&&void 0!==t.video.height&&0!=t.video.width&&0!=t.video.height&&t.video.width<t.video.height?screen.orientation.lock("portrait-primary"):screen.orientation.lock("landscape-primary")}),l=!1,!flowplayer.support.iOS||flowplayer.support.fullscreen||flowplayer.conf.native_fullscreen||(o.on("fullscreen",f),window.addEventListener("resize",f),window.addEventListener("resize",function(){s()||(clearTimeout(l),l=!1,o.trigger("resize-good"))}))))}),flowplayer(function(o,a){a=jQuery(a);var r,n,i,l,s;window.MediaSource||window.WebKitMediaSource;function f(){var e=a.find("video");return e.length&&e[0].audioTracks?e[0].audioTracks:[]}function c(o){o.name||(o.name=o.label),a.find(".fv-fp-hls-menu a").each(function(e,t){jQuery(t).toggleClass("fp-selected",jQuery(t).attr("data-audio")===o.name)})}function p(){if(n&&!(n.length<2))if(a.find(".fp-chromecast").hide(),l=jQuery('<strong class="fv-fp-hls">'+fv_flowplayer_translations.audio_button+"</strong>"),(s=jQuery('<div class="fp-menu fv-fp-hls-menu"></div>').insertAfter(a.find(".fp-controls"))).append("<strong>"+fv_flowplayer_translations.audio_menu+"</strong>"),n.forEach(function(e){s.append('<a data-audio="'+e.name+'" data-lang="'+e.lang+'">'+e.name+"</a>")}),l.insertAfter(a.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),s.hasClass("fp-active")?o.hideMenu(s[0]):(a.click(),o.showMenu(s[0]))}),jQuery("a",s).on("click",function(e){var t=e.target.getAttribute("data-audio");if(r){var o=r.audioTracks[r.audioTrack].groupId,e=r.audioTracks.filter(function(e){return e.groupId===o&&(e.name===t||e.lang===t)})[0];r.audioTrack=e.id,c(e)}else{var a,n=f();for(a in n)n.hasOwnProperty(a)&&n[a].label==t&&(n[a].enabled=!0,c(n[a]))}}),r)c(r.audioTracks[r.audioTrack]);else{var e,t=f();for(e in t)t.hasOwnProperty(e)&&t[e].enabled&&c(t[e])}}flowplayer.engine("hlsjs-lite").plugin(function(e){r=e.hls}),o.bind("ready",function(e,t){var o;a.find(".fp-chromecast").show(),jQuery(s).remove(),jQuery(l).remove(),r&&"application/x-mpegurl"==t.video.type&&(i=[],n=[],(o=r).levels.forEach(function(e){e=e.attrs.AUDIO;e&&i.indexOf(e)<0&&i.push(e),i.length&&(n=o.audioTracks.filter(function(e){return e.groupId===i[0]}))}),p())}),o.one("progress",function(){if("html5"==o.engine.engineName&&"application/x-mpegurl"==o.video.type){i=[],n=[];var e,t=f();for(e in t)t.hasOwnProperty(e)&&n.push({id:t[e].id,name:t[e].label});p()}})}),flowplayer(function(e,n){var r=-1,i=!1;e.on("error",function(e,t,o){var a;4==o.code&&"hlsjs"==t.engine.engineName&&(console.log("FV Player: HLSJS failed to play the video, switching to Flash HLS"),t.error=t.loading=!1,jQuery(n).removeClass("is-error"),jQuery(flowplayer.engines).each(function(e,t){"hlsjs"==flowplayer.engines[e].engineName&&(r=e,i=flowplayer.engines[e],delete flowplayer.engines[e])}),(a=(0<(o=void 0!==t.video.index?t.video.index:0)?t.conf.playlist[o]:t.conf.clip).sources).index=o,t.load({sources:a}),t.bind("unload error",function(){flowplayer.engines[r]=i}))})}),flowplayer(function(e,l){var s,t=e.conf.live_stream_reload||30,f=t,c=fv_flowplayer_translations.live_stream_retry;function p(e){e=Number(e);var t=Math.floor(e/86400),o=Math.floor(e%86400/3600),a=Math.floor(e%3600/60),e=Math.floor(e%60),n=fv_flowplayer_translations,t=0<t?(1==t?n.duration_1_day:n.duration_n_days).replace(/%s/,t):"";return t&&0<o&&(t+=", "),(t+=0<o?(1==o?n.duration_1_hour:n.duration_n_hours).replace(/%s/,o):"")&&0<a&&(t+=", "),(t+=0<a?(1==a?n.duration_1_minute:n.duration_n_minutes).replace(/%s/,a):"")&&0<e&&(t+=n.and),t+=0<e?(1==e?n.duration_1_second:n.duration_n_seconds).replace(/%s/,e):""}e.clearLiveStreamCountdown=function(){s&&(clearInterval(s),e.error=e.loading=!1,jQuery(l).removeClass("is-error"),jQuery(l).find(".fp-message.fp-shown").remove(),e.unload())},e.conf.flashls={manifestloadmaxretry:2},e.on("ready",function(){f=t,c=fv_flowplayer_translations.live_stream_retry}).on("progress",function(){f=10,c=fv_flowplayer_translations.live_stream_continue,clearInterval(s)}),e.on("error",function(e,r,i){setTimeout(function(){var e,t,o,a,n;(r.conf.clip.live||r.conf.live||i.video&&i.video.src.match(/\/\/vimeo.com\/event\//))&&(e=f,r.conf.clip.streaming_time?e=r.conf.clip.streaming_time-Math.floor(Date.now()/1e3):r.conf.clip.live_starts_in&&(e=r.conf.clip.live_starts_in),t=fv_flowplayer_translations.live_stream_starting.replace(/%d/,p(e)),c=c.replace(/%d/,p(e)),o=r.conf.clip.live_starts_in?t:c,clearInterval(s),1!==i.code&&2!==i.code&&4!==i.code||(l.className+=" is-offline",flowplayer.support.flashVideo&&r.one("flashdisabled",function(){l.querySelector(".fp-flash-disabled").style.display="none"}),(a=l.querySelector(".fp-ui .fp-message")).innerHTML=o,n=300<e?300:e,s=setInterval(function(){--n,--e,a.innerHTML=o,0<n&&a?a.querySelector("span").innerHTML=p(e):(clearInterval(s),r.error&&(r.error=r.loading=!1,(a=l.querySelector(".fp-ui .fp-message"))&&l.querySelector(".fp-ui").removeChild(a),l.className=l.className.replace(/\bis-(error|offline)\b/g,""),r.load()))},1e3)))},1)})}),flowplayer(function(e,t){var o;t=jQuery(t),flowplayer.engine("hlsjs-lite").plugin(function(e){o=e.hls}),e.on("ready",function(e,t){o&&t.conf.playlist.length&&"hlsjs-lite"!=t.engine.engineName&&o.destroy()})}),flowplayer(function(o,a){var n,r,i,l;function s(){r&&n&&"html5"==o.engine.engineName&&(1<++l?3<l&&(console.log("FV Player: iOS video element needs a push, triggering 'stalled'"),n.trigger("stalled")):(console.log("FV Player: iOS video element will trigger error after 'stalled' arrives"),n.one("stalled",function(){var e,t=o.video.time;if(o.video.type.match(/video\//))return console.log("FV Player: Running check of video file..."),(e=document.createElement("video")).src=o.video.src,e.onloadedmetadata=function(){l=0,console.log("FV Player: Video link works")},void(e.onerror=function(){console.log("FV Player: Video link issue!"),0<l&&o.trigger("error",[o,{code:4,video:o.video}])});setTimeout(function(){console.log(o.video.time,t),o.video.time!=t?console.log("FV Player: iOS video element continues playing, no need for error"):o.paused?console.log("FV Player: iOS video element paused, no need for error"):o.trigger("error",[o,{code:4,video:o.video}])},5e3)})))}(flowplayer.support.browser.safari||flowplayer.support.iOS)&&(a=jQuery(a),i=r=n=!1,l=0,o.on("ready",function(e,t,o){l=0,r=!1,"html5"==t.engine.engineName&&o.src.match(/\?/)&&((n=a.find("video")).data("fv-ios-recovery")||(n.on("waiting",s),n.data("fv-ios-recovery",!0)),t.live&&o.src.match(/m3u8|stream_loader/)&&(console.log("FV Player: iOS video element is a live stream..."),clearInterval(i),i=setTimeout(function(){jQuery.get(o.src,function(e){e.match(/#EXT/)||(console.log("FV Player: iOS video element live stream does not look like a HLS file, triggering error..."),t.trigger("error",[t,{code:1,video:t.video}]))})},5e3)),t.one("progress",function(){r=!0,clearInterval(i)}))}),o.bind("beforeseek",s))}),!function(e){var t,o,a=!1;"function"==typeof define&&define.amd&&(define(e),a=!0),"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&(module.exports=e(),a=!0),a||(t=window.Cookies,(o=window.Cookies=e()).noConflict=function(){return window.Cookies=t,o})}(function(){function v(){for(var e=0,t={};e<arguments.length;e++){var o,a=arguments[e];for(o in a)t[o]=a[o]}return t}return function e(u){function y(e,t,o){var a,n;if("undefined"!=typeof document){if(1<arguments.length){"number"==typeof(o=v({path:"/"},y.defaults,o)).expires&&((n=new Date).setMilliseconds(n.getMilliseconds()+864e5*o.expires),o.expires=n),o.expires=o.expires?o.expires.toUTCString():"";try{a=JSON.stringify(t),/^[\{\[]/.test(a)&&(t=a)}catch(e){}t=u.write?u.write(t,e):encodeURIComponent(t+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(e+"")).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var r,i="";for(r in o)o[r]&&(i+="; "+r,!0!==o[r]&&(i+="="+o[r]));return document.cookie=e+"="+t+i}e||(a={});for(var l=document.cookie?document.cookie.split("; "):[],s=/(%[0-9A-Z]{2})+/g,f=0;f<l.length;f++){var c=l[f].split("="),p=c.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var d=c[0].replace(s,decodeURIComponent),p=u.read?u.read(p,d):u(p,d)||p.replace(s,decodeURIComponent);if(this.json)try{p=JSON.parse(p)}catch(e){}if(e===d){a=p;break}e||(a[d]=p)}catch(e){}}return a}}return(y.set=y).get=function(e){return y.call(y,e)},y.getJSON=function(){return y.apply({json:!0},[].slice.call(arguments))},y.defaults={},y.remove=function(e,t){y(e,"",v(t,{expires:-1}))},y.withConverter=e,y}(function(){})}),flowplayer(function(e,t){t=jQuery(t),window.learndash_video_data&&"local"==learndash_video_data.videos_found_provider&&t.closest("[data-video-progression=true]").length&&(LearnDash_disable_assets(!0),LearnDash_watchPlayers(),e.on("finish",function(e,t,o){"string"!=typeof t.video.click&&window.LearnDash_disable_assets(!1)}))}),flowplayer(function(e,t){e.bind("load",function(e,t,o){var a,n=jQuery(e.currentTarget);n.data("live")&&(a=setTimeout(function(){n.find(".fp-ui").append('<div class="fp-message">'+fv_flowplayer_translations.live_stream_failed+"</div>"),n.addClass("is-error")},1e4),jQuery(e.currentTarget).data("live_check",a))}).bind("ready",function(e,t,o){clearInterval(jQuery(e.currentTarget).data("live_check"))}).bind("error",function(e,t,o){e=jQuery(e.currentTarget);e.data("live")&&e.find(".fp-message").html(fv_flowplayer_translations.live_stream_failed_2)})}),!function(a){flowplayer(function(e,o){jQuery(o).hasClass("is-cva")||a(document).on("submit","#"+jQuery(o).attr("id")+" .mailchimp-form",function(e){e.preventDefault(),a(".mailchimp-response",o).remove(),a("input[type=submit]",o).attr("disabled","disabled").addClass("fv-form-loading");var t={action:"fv_wp_flowplayer_email_signup"};a("[name]",this).each(function(){t[this.name]=a(this).val()}),a.post(fv_player.ajaxurl,t,function(e){e=JSON.parse(e),a('<div class="mailchimp-response"></div>').insertAfter(".mailchimp-form",o),e.text.match(/already subscribed/)&&(e.status="ERROR"),"OK"===e.status?(a(".mailchimp-form input[type=text],.mailchimp-form input[type=email]",o).val(""),a(".mailchimp-response",o).removeClass("is-fv-error").html(e.text),setTimeout(function(){a(".wpfp_custom_popup",o).fadeOut()},2e3)):a(".mailchimp-response",o).addClass("is-fv-error").html(e.text),a("input[type=submit]",o).removeAttr("disabled").removeClass("fv-form-loading")})})})}(jQuery),"undefined"!=typeof fv_flowplayer_mobile_switch_array)for(var fv_flowplayer_mobile_switch_i in fv_flowplayer_mobile_switch_array)fv_flowplayer_mobile_switch_array.hasOwnProperty(fv_flowplayer_mobile_switch_i)&&fv_flowplayer_mobile_switch(fv_flowplayer_mobile_switch_i);function fv_flowplayer_browser_ff_m4v(e){flowplayer.support.browser&&flowplayer.support.browser.mozilla&&-1!=navigator.userAgentData.platform.indexOf("Win")&&jQuery("#wpfp_"+e).attr("data-engine","flash")}if(flowplayer(function(n,e){var t,o;function a(e,t,o){var a;n.ready?(n.seek(o),(a=t).addClass("is-active"),setTimeout(function(){a.removeClass("is-active")},500)):n.toggle(),e.preventDefault()}flowplayer.support.touch&&(jQuery.fn.fv_single_double_click=function(a,n,r){return this.each(function(){var t=0,o=this;jQuery(this).on("click",function(e){1==++t&&setTimeout(function(){(1==t?a:n).call(o,e),t=0},r||300)})})},e=jQuery(e),t=jQuery('<div class="fv-fp-tap-left"><span>-10s</span></div>'),o=jQuery('<div class="fv-fp-tap-right"><span>+10s</span></div>'),t.fv_single_double_click(function(){n.toggle()},function(e){a(e,t,!!n.ready&&n.video.time-10)}),o.fv_single_double_click(function(){n.toggle()},function(e){a(e,o,!!n.ready&&n.video.time+10)}),e.find(".fp-ui").append(t).append(o))}),flowplayer(function(a,e){var n=(e=jQuery(e)).data("flowplayer-instance-id");flowplayer.audible_instance=-1,a.one("load",function(){setTimeout(function(){a.conf.splash=!1},0)}),a.on("ready",function(){var o=0==e.data("volume");o||(flowplayer.audible_instance=n),jQuery(".flowplayer[data-flowplayer-instance-id]").each(function(){var e=jQuery(this).data("flowplayer"),t=jQuery(this).data("flowplayer-instance-id");-1!=flowplayer.audible_instance&&t!=flowplayer.audible_instance&&t!=n&&e&&(e.ready?a.conf.multiple_playback?o||e.mute(!0,!0):e.playing&&e.pause():(e.clearLiveStreamCountdown(),e.unload()))})}).on("mute",function(e,t,o){o||flowplayer.audible_instance==n||(flowplayer(flowplayer.audible_instance).mute(!0,!0),flowplayer.audible_instance=n)}).on("resume",function(){a.muted||(flowplayer.audible_instance=n),a.conf.multiple_playback||jQuery(".flowplayer[data-flowplayer-instance-id]").each(function(){var e;n!=jQuery(this).data("flowplayer-instance-id")&&(e=jQuery(this).data("flowplayer"))&&e.playing&&e.pause()})})}),"undefined"!=typeof fv_flowplayer_browser_ff_m4v_array)for(var fv_flowplayer_browser_ff_m4v_i in fv_flowplayer_browser_ff_m4v_array)fv_flowplayer_browser_ff_m4v_array.hasOwnProperty(fv_flowplayer_browser_ff_m4v_i)&&fv_flowplayer_browser_ff_m4v(fv_flowplayer_browser_ff_m4v_i);function fv_flowplayer_browser_chrome_fail(a,n,r,i){jQuery("#wpfp_"+a).bind("error",function(e,t,o){!/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())||null==o||3!=o.code&&4!=o.code&&5!=o.code||(t.unload(),jQuery("#wpfp_"+a).attr("id","bad_wpfp_"+a),jQuery("#bad_wpfp_"+a).after('<div id="wpfp_'+a+'" '+n+' data-engine="flash"></div>'),jQuery("#wpfp_"+a).flowplayer({playlist:[[{mp4:r}]]}),i?jQuery("#wpfp_"+a).bind("ready",function(e,t){t.play()}):jQuery("#wpfp_"+a).flowplayer().play(0),jQuery("#bad_wpfp_"+a).remove())})}if("undefined"!=typeof fv_flowplayer_browser_chrome_fail_array)for(var fv_flowplayer_browser_chrome_fail_i in fv_flowplayer_browser_chrome_fail_array)fv_flowplayer_browser_chrome_fail_array.hasOwnProperty(fv_flowplayer_browser_chrome_fail_i)&&fv_flowplayer_browser_chrome_fail(fv_flowplayer_browser_chrome_fail_i,fv_flowplayer_browser_chrome_fail_array[fv_flowplayer_browser_chrome_fail_i].attrs,fv_flowplayer_browser_chrome_fail_array[fv_flowplayer_browser_chrome_fail_i].mp4,fv_flowplayer_browser_chrome_fail_array[fv_flowplayer_browser_chrome_fail_i].auto_buffer);function fv_flowplayer_browser_ie(e){(flowplayer.support.browser&&flowplayer.support.browser.msie&&9<=parseInt(flowplayer.support.browser.version,10)||navigator.userAgent.match(/Trident.*rv[ :]*11\./))&&jQuery("#wpfp_"+e).attr("data-engine","flash")}if("undefined"!=typeof fv_flowplayer_browser_ie_array)for(var fv_flowplayer_browser_ie_i in fv_flowplayer_browser_ie_array)fv_flowplayer_browser_ie_array.hasOwnProperty(fv_flowplayer_browser_ie_i)&&fv_flowplayer_browser_ie(fv_flowplayer_browser_ie_i);function fv_flowplayer_browser_chrome_mp4(e){var t=window.navigator.appVersion.match(/Chrome\/(\d+)\./);null!=t&&(t=parseInt(t[1],10),(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())&&t<28&&-1!=navigator.appVersion.indexOf("Win")||/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())&&t<27&&-1!=navigator.appVersion.indexOf("Linux")&&-1==navigator.userAgent.toLowerCase().indexOf("android"))&&jQuery("#wpfp_"+e).attr("data-engine","flash"))}function fv_flowplayer_amazon_s3(e,n){jQuery("#wpfp_"+e).bind("error",function(e,t,o){var a=new Date;4==o.code&&a.getTime()>fv_fp_utime+parseInt(n)&&jQuery(e.target).find(".fp-message").delay(500).queue(function(e){jQuery(this).html(fv_flowplayer_translations.video_expired),e()})})}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}-1==navigator.platform.indexOf("iPhone")&&-1==navigator.platform.indexOf("iPod")&&-1==navigator.platform.indexOf("iPad")&&-1==navigator.userAgent.toLowerCase().indexOf("android")||flowplayer(function(e,t){e.bind("error",function(e,t,o){10==o.code&&jQuery(e.target).find(".fp-message").html(fv_flowplayer_translations.unsupported_format)})}),jQuery(document).ready(function(){-1==navigator.platform.indexOf("iPhone")&&-1==navigator.platform.indexOf("iPod")&&-1==navigator.platform.indexOf("iPad")||jQuery(window).trigger("load"),jQuery(".flowplayer").on("mouseleave",function(){jQuery(this).find(".fvp-share-bar").removeClass("visible"),jQuery(this).find(".embed-code").hide()})}),"undefined"!=typeof flowplayer&&flowplayer(function(e,a){a=jQuery(a);var n,r=!1,t=(flowplayer.engine("hlsjs-lite").plugin(function(e){n=e.hls}),e.conf.playlist.length?e.conf.playlist:[e.conf.clip]);function i(e){l();var t="Video is being processed",o="Please return later to see the actual video in this player.";e.pending_encoding_error?(t="Video unavailable",o="There was an error in the video encoding."):e.pending_encoding_progress&&(o+="<br /><br />("+e.pending_encoding_progress+" done)"),r=jQuery('<div class="fv-player-encoder-video-processing-modal"><div><h2>'+t+"</h2><p>"+o+"</p></div></div"),a.append(r)}function l(){r&&r.remove()}t[0]&&t[0].pending_encoding&&i(t[0]),e.on("load",function(e,t,o){if(o.pending_encoding)return i(o),n&&n.destroy(),!1;l()})}),Date.now||(Date.now=function(){return(new Date).getTime()}),function(){function b(e){if(e.id)return e.id;var t=(void 0!==e.sources_original&&void 0!==e.sources_original[0]?e.sources_original:e.sources)[0].src;return t=void 0!==e.sources_original&&void 0!==e.sources_original[0]?t:a(t)}function j(e,t){t.video.sources&&(t=b(t.video),T[t]=0,O[t]=0,w[t]=1)}function Q(e,t){var o,a,n="sendBeacon"in navigator,r=(!0!==e&&(e=!1),t&&void 0!==t||(t=function(){}),[]),i=[];for(o in T)T.hasOwnProperty(o)&&r.push({name:o,position:T[o],top_position:O[o],saw:void 0!==w[o]&&w[o]});for(a in A)A.hasOwnProperty(a)&&i.push({player:a,item:A[a]});if(i.length||D(F),!r.length)return D(S),D(P),void D(I);if("1"==flowplayer.conf.is_logged_in){if(n){try{var l,s={},f={},c={},p={};for(m in r)r.hasOwnProperty(m)&&(s[l=r[m].name]=r[m].position,f[l]=r[m].top_position,c[l]=r[m].saw);for(m in i)i.hasOwnProperty(m)&&(p[i[m].player]=i[m].item);N(S,E(s)),N(P,E(f)),N(I,E(c)),N(F,E(p))}catch(e){return}n=new FormData;return n.append("action","fv_wp_flowplayer_video_position_save"),n.append("videoTimes",encodeURIComponent(JSON.stringify(r))),n.append("playlistItems",encodeURIComponent(JSON.stringify(i))),navigator.sendBeacon(fv_player.ajaxurl,n),!1}return jQuery.ajax({type:"POST",async:e,url:fv_player.ajaxurl,complete:t,data:{action:"fv_wp_flowplayer_video_position_save",videoTimes:r,playlistItems:i}})}try{var d=V(x),u=V(C),d=d&&void 0!==d?JSON.parse(d):{},u=u&&void 0!==u?JSON.parse(u):{};for(m in r)r.hasOwnProperty(m)&&(d[r[m].name]=r[m].position);for(m in i)i.hasOwnProperty(m)&&(u[i[m].player]=i[m].item);var y=JSON.stringify(d),v=JSON.stringify(u),_=L(y),h=L(v);if(g<_)for(;g<_;)for(var m in d)if(d.hasOwnProperty(m)){delete d[m],y=JSON.stringify(d),_=L(y);break}if(g<h)for(;g<h;)for(var m in d)if(u.hasOwnProperty(m)){delete u[m],v=JSON.stringify(u),h=L(y);break}N(x,y),N(C,v)}catch(e){return}return!1}var k=null,g=2500,o=null,x="video_positions",C="player_playlist_item",S="video_positions_tmp",P="video_top_positions_tmp",F="player_playlist_item_tmp",I="video_saw_tmp",T=[],O=[],A=[],w=[],E=function(e){var t=JSON.stringify(e),o=L(t);if(g<o)for(;g<o;)for(var a in e)if(e.hasOwnProperty(a)){delete e[a],t=JSON.stringify(e),o=L(t);break}return t},L=function(e){return encodeURIComponent(e).length},V=function(e){return o?localStorage.getItem(e):Cookies.get(e)},N=function(e,t){return o?localStorage.setItem(e,t):Cookies.set(e,t)},D=function(e){o?localStorage.removeItem(e):Cookies.remove(e)},a=function(e){return e.replace(/(X-Amz-Algorithm=[^&]+&?)/gm,"").replace(/(X-Amz-Credential=[^&]+&?)/gm,"").replace(/(X-Amz-Date=[^&]+&?)/gm,"").replace(/(X-Amz-Expires=[^&]+&?)/gm,"").replace(/(X-Amz-SignedHeaders=[^&]+&?)/gm,"").replace(/(X-Amz-Signature=[^&]+&?)/gm,"")};if(flowplayer(function(a,e){if(void 0===a.conf.disable_localstorage){function r(){return!(a.live||a.video&&"string"==typeof a.video.click)}function t(e,t){!r()||(t=function(e){var t=b(e.video),o=e.video.position;if("1"!=flowplayer.conf.is_logged_in){var a=V(x);if(a&&void 0!==a)try{(a=JSON.parse(a))[t]&&(o=a[t])}catch(e){return}}return e.get_custom_end&&e.get_custom_end()<o&&(o=!1),o=e.get_custom_start&&0<e.get_custom_start()&&o<e.get_custom_start()?!1:o}(t))&&n(t)}function o(e,t){var o,a,n;r()&&t.video.sources&&(o=b(t.video),a=Math.round(t.video.time),T[o]=a,void 0===O[o]?(n=0,n=t.conf.playlist?t.conf.playlist[t.video.index]&&t.conf.playlist[t.video.index].sources[0]&&t.conf.playlist[t.video.index].sources[0].top_position?t.conf.playlist[t.video.index].sources[0].top_position:0:t.conf.clip.sources[0]&&t.conf.clip.sources[0].top_position?t.conf.clip.sources[0].top_position:0,O[o]=n):O[o]<a&&(O[o]=a),0<t.conf.playlist.length&&p&&(A[p]=t.video.index),60<=c++&&flowplayer.conf.closingPage&&(k&&k.abort(),k=Q(!0,function(){k=null}),c=0))}function n(e){var t,o;a.custom_seek?a.custom_seek(e):(t=0,o=setInterval(function(){20<++t&&clearInterval(o),a.loading||(a.seek(parseInt(e)),clearInterval(o))},10))}function i(e,t){var o=V(e),a=!1;if(o&&void 0!==o)try{if(void 0!==(o=JSON.parse(o))[t]){a=o[t],delete o[t];var n,r=!1;for(n in o)if(o.hasOwnProperty(n)){r=!0;break}r?N(e,JSON.stringify(o)):D(e)}return a}catch(e){}}function l(e,t){if(void 0!==t&&0!=t.conf.playlist.length){var o=-1;if(p)if("1"!=flowplayer.conf.is_logged_in){var a=V(C);if(a&&void 0!==a)try{(a=JSON.parse(a))[p]&&(o=a[p])}catch(e){return}}else"1"==flowplayer.conf.is_logged_in&&(o=0<t.conf.playlist.length&&i(F,p));0<=o&&!d&&(t.video&&"video/youtube"!=t.video.type&&t.play(o),d=!0,s.data("position_changed",1))}}var s=jQuery(e),f=flowplayer.conf.video_position_save_enable&&0!=s.data("save-position")||s.data("save-position"),c=0,p=!!s.data("player-id")&&s.data("player-id"),d=!1;if(f){if(V(F)&&s.removeData("playlist_start"),a.bind("finish",j),a.on("ready",function(){a.one("progress",t)}),a.bind("progress",o),a.bind("unload",function(){d=!1,a.one("ready",l)}),a.one("ready",l),jQuery(".fp-ui",e).on("click",function(){l()}),a.playlist_thumbnail_progress=function(e,t,o){a.get_custom_start&&0<a.get_custom_start(t)&&(o-=a.get_custom_start(t))<0&&(o=0);t=t.duration;(t=(t=a.get_custom_duration&&0<a.get_custom_duration()?a.get_custom_duration():t)||e.data("duration"))&&e.css("width",100*o/t+"%")},"1"==flowplayer.conf.is_logged_in){var u,y,v,_,h,m=0<a.conf.playlist.length,g=m?a.conf.playlist:[a.conf.clip],w=jQuery("[rel="+jQuery(e).attr("id")+"]");for(u in g)g.hasOwnProperty(u)&&(_=b(g[u]),y=i(S,_),v=i(P,_),_=i(I,_),y&&(m?(a.conf.playlist[u].sources[0].position=y,(h=jQuery("a",w).eq(u).find(".fvp-progress")).length&&a.playlist_thumbnail_progress(h,a.conf.playlist[u],y)):a.conf.clip.sources[0].position=y),v&&(!g[u].sources[0].top_position||g[u].sources[0].top_position<v)&&(m?a.conf.playlist[u].sources[0].top_position=v:a.conf.clip.sources[0].top_position=v),_&&(m?a.conf.playlist[u].sources[0].saw=!0:a.conf.clip.sources[0].saw=!0))}a.bind("finish",function(e,t){t.conf.playlist.length?t.conf.playlist[t.video.index].sources[0].saw=!0:t.conf.clip.sources[0].saw=!0})}}}),jQuery(window).on("beforeunload pagehide",function(){flowplayer.conf.closingPage||(flowplayer.conf.closingPage=!0,Q())}),null===(o=void 0===fv_flowplayer_conf.disable_localstorage&&o)){o=!0;try{localStorage.setItem("t","t"),"t"!==localStorage.getItem("t")&&(o=!1),localStorage.removeItem("t")}catch(e){o=!1}}}(jQuery),flowplayer(function(t,o){var a,n,r,i,l,s,f,c;function e(e){e.preventDefault(),e.stopPropagation(),l.hasClass("fp-active")?t.hideMenu(l[0]):(o.trigger("click"),t.showMenu(l[0]))}function p(e){e=e.clone();return e.find("i.dur").remove(),e.text()}o=jQuery(o),0!=t.conf.playlist.length&&(a=0,jQuery(t.conf.playlist).each(function(e,t){void 0===t.click&&a++}),a<2||(n=jQuery(".fp-playlist-external[rel="+o.attr("id")+"]"),r=jQuery('<strong class="fv-fp-list">Item 1.</strong>'),i=jQuery('<strong class="fv-fp-list-name">Item 1.</strong>'),l=jQuery('<div class="fp-menu fv-fp-list-menu"></div>').insertAfter(o.find(".fp-controls")),s=0,f=[],c=[],jQuery(t.conf.playlist).each(function(e,t){void 0===t.click&&(t=p(n.find("h4").eq(s)),l.append('<a data-index="'+e+'">'+(s+1)+". "+t+"</a>"),c[e]=t,f.push(e),s++)}),r.insertAfter(o.find(".fp-controls .fp-volume")).on("click",e),i.insertAfter(r).on("click",e),jQuery("a",l).on("click",function(){void 0!==t.conf.playlist[jQuery(this).data("index")-1]&&void 0!==t.conf.playlist[jQuery(this).data("index")-1].click?t.play(jQuery(this).data("index")-1):t.play(jQuery(this).data("index"))}),t.on("ready",function(e,t,o){l.find("a").removeClass("fp-selected");var a=l.find("a[data-index="+o.index+"]"),n=(a.addClass("fp-selected"),fv_flowplayer_translations.playlist_item_no);n=(n=n.replace(/%d/,f.indexOf(o.index)+1)).replace(/%s/,p(a.find("h4"))),r.html(n),i.html(f.indexOf(o.index)+1+". "+c[o.index])})))}),flowplayer(function(e,a){a=jQuery(a);var n,r=e.conf.playlist;e.bind("load",function(e,t,o){n=o.index}),e.bind("error",function(e,t,o){setTimeout(function(){if(0<r.length&&1==t.error){if(n=t.video.index,"1"==t.conf.video_checker&&r[n].video_checker&&0<r[n].video_checker.length)return console.log("FV Player: Video checker message present, stopping auto-advance to next playlist item"),!1;t.error=t.loading=!1,a.removeClass("is-error"),a.find(".fp-message.fp-shown").remove(),++n>r.length-1&&(n=0),console.log("FV Player: Playlist item failure, auto-advancing to "+(n+1)+". item"),t.play(n)}},1e3)})}),flowplayer(function(e,r){var i,l,s;function f(o){return o=[],jQuery(e.conf.playlist).each(function(e,t){o.push(e)}),o=function(e){for(var t,o,a=e.length;a;a--)t=Math.floor(Math.random()*a),o=e[a-1],e[a-1]=e[t],e[t]=o;return e}(o),console.log("FV Player Randomizer random seed:",o),o}((r=jQuery(r)).data("button-no_picture")||r.data("button-repeat")||r.data("button-rewind"))&&e.bind("ready",function(e,t){var o,a,n;void 0===l&&void 0===i&&(l=t.next,i=t.prev),!t.video.type.match(/^audio/)&&r.data("button-no_picture")&&0==r.find(".fv-fp-no-picture").length&&jQuery('<span class="fv-fp-no-picture"><svg viewBox="0 0 90 80" width="18px" height="18px" class="fvp-icon fvp-nopicture"><use xlink:href="#fvp-nopicture"></use></svg></span>').insertAfter(r.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),jQuery(".fp-engine",r).slideToggle(20),jQuery(this).toggleClass("is-active fp-color-fill"),r.toggleClass("is-no-picture")}),r.data("button-repeat")&&(0<t.conf.playlist.length&&0==r.find(".fv-fp-playlist").length?(n=fv_flowplayer_translations,o=jQuery('<strong class="fv-fp-playlist mode-normal"> <svg viewBox="0 0 80.333 80" width="18px" height="18px" class="fvp-icon fvp-replay-list"><title>'+n.playlist_replay_all+'</title><use xlink:href="#fvp-replay-list"></use></svg> <svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-shuffle"><title>'+n.playlist_shuffle+'</title><use xlink:href="#fvp-shuffle"></use></svg> <svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-replay-track"><title>'+n.playlist_replay_video+'</title><use xlink:href="#fvp-replay-track"></use></svg> <span id="fvp-playlist-play" title="'+n.playlist_play_all+'">'+n.playlist_play_all_button+"</span> </strong>"),a=jQuery('<div class="fp-menu fv-fp-playlist-menu"> <a data-action="repeat_playlist"><svg viewBox="0 0 80.333 80" width="18px" height="18px" class="fvp-icon fvp-replay-list"><title>'+n.playlist_replay_all+'</title><use xlink:href="#fvp-replay-list"></use></svg> <span class="screen-reader-text">'+n.playlist_replay_all+'</span></a> <a data-action="shuffle_playlist"><svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-shuffle"><title>'+n.playlist_shuffle+'</title><use xlink:href="#fvp-shuffle"></use></svg> <span class="screen-reader-text">'+n.playlist_shuffle+'</span></a> <a data-action="repeat_track"><svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-replay-track"><title>'+n.playlist_replay_video+'</title><use xlink:href="#fvp-replay-track"></use></svg> <span class="screen-reader-text">'+n.playlist_replay_video+'</span></a> <a class="fp-selected" data-action="normal"><span id="fvp-playlist-play" title="'+n.playlist_play_all+'">'+n.playlist_play_all_button+"</span></a> </div>").insertAfter(r.find(".fp-controls")),t.conf.playlist_shuffle=t.conf.track_repeat=!1,s=f(),t.conf.advance,o.insertAfter(r.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),"auto"!==a.css("right")&&a.css({right:"auto",left:o.position().left+"px"}),a.hasClass("fp-active")?t.hideMenu(a[0]):(r.trigger("click"),t.showMenu(a[0]))}),jQuery("a",a).on("click",function(){jQuery(this).siblings("a").removeClass("fp-selected"),jQuery(this).addClass("fp-selected"),o.removeClass("mode-normal mode-repeat-track mode-repeat-playlist mode-shuffle-playlist");var e=jQuery(this).data("action");"repeat_playlist"==e?(o.addClass("mode-repeat-playlist"),t.conf.loop=!0,t.conf.advance=!0,t.video.loop=t.conf.track_repeat=!1,t.conf.playlist_shuffle=!1):"shuffle_playlist"==e?(o.addClass("mode-shuffle-playlist"),t.conf.loop=!0,t.conf.advance=!0,t.conf.playlist_shuffle=!0):"repeat_track"==e?(o.addClass("mode-repeat-track"),t.conf.track_repeat=t.video.loop=!0,t.conf.loop=t.conf.playlist_shuffle=!1):"normal"==e&&(o.addClass("mode-normal"),t.conf.track_repeat=t.video.loop=!1,t.conf.loop=t.conf.playlist_shuffle=!1),t.conf.playlist_shuffle?(t.next=function(){t.play(s.pop()),0==s.length&&(s=f())},t.prev=function(){t.play(s.shift()),0==s.length&&(s=f())}):(t.next=l,t.prev=i)}),t.conf.loop&&jQuery("a[data-action=repeat_playlist]",a).trigger("click"),t.on("progress",function(){t.video.loop=t.conf.track_repeat}),t.on("finish.pl",function(e,t){console.log("playlist_repeat",t.conf.loop,"advance",t.conf.advance,"video.loop",t.video.loop),t.conf.playlist_shuffle&&(t.play(s.pop()),0==s.length&&(s=f()))})):0==r.find(".fv-fp-track-repeat").length&&0==t.conf.playlist.length&&((n=jQuery('<strong class="fv-fp-track-repeat"><svg viewBox="0 0 80.333 71" width="18px" height="18px" class="fvp-icon fvp-replay-track"><use xlink:href="#fvp-replay-track"></use></svg></strong>')).insertAfter(r.find(".fp-controls .fp-volume")).on("click",function(e){e.preventDefault(),e.stopPropagation(),jQuery(this).toggleClass("is-active fp-color-fill",t.video.loop),t.video.loop?t.video.loop=!1:t.video.loop=!0}),t.conf.loop&&n.addClass("is-active fp-color-fill"))),r.data("button-rewind")&&(0==r.find(".fv-fp-rewind").length&&((n=jQuery('<span class="fv-fp-rewind"><svg viewBox="0 0 24 24" width="21px" height="21px" class="fvp-icon fvp-rewind"><use xlink:href="#fvp-rewind"></use></svg></span>')).insertBefore(r.find(".fp-controls .fp-playbtn")).on("click",function(e){e.preventDefault(),e.stopPropagation(),t.seek(t.video.time-10)}),n.toggle(!t.video.live||t.video.dvr)),0==r.find(".fv-fp-forward").length&&((n=jQuery('<span class="fv-fp-forward"><svg viewBox="0 0 24 24" width="21px" height="21px" class="fvp-icon fvp-forward"><use xlink:href="#fvp-forward"></use></svg></span>')).insertAfter(r.find(".fp-controls .fp-playbtn")).on("click",function(e){e.preventDefault(),e.stopPropagation(),t.seek(t.video.time+10)}),n.toggle(!t.video.live||t.video.dvr)))}).bind("unload",function(){r.find(".fv-fp-no-picture").remove(),r.find(".fv-fp-playlist").remove(),r.find(".fv-fp-track-repeat").remove()})}),flowplayer(function(e,t){var o=jQuery(t),a=o.data("playlist_start");function n(){1!==o.data("position_changed")&&e.conf.playlist.length&&(a--,void 0===e.conf.playlist[a].click&&(e.engine&&"hlsjs-lite"==e.engine.engineName&&(e.loading=!1),e.play(a)),o.data("position_changed",1))}void 0!==a&&(e.bind("unload",function(){a=o.data("playlist_start"),o.removeData("position_changed"),e.one("ready",n)}),e.one("ready",n),jQuery(".fp-ui",t).on("click",function(){n(),o.data("position_changed",1)}))}),document.addEventListener("custombox:overlay:close",function(e){console.log("FV Player: Custombox/Popup anything ligtbox closed");var t=jQuery(this).find(".flowplayer");0!=t.length&&(console.log("FV Player: Custombox/Popup anything ligtbox contains a player"),t.each(function(e,t){var o=jQuery(t).data("flowplayer");void 0!==o&&(o.playing?(console.log("FV Player: Custombox/Popup anything ligtbox video pause"),o.pause()):o.loading&&o.one("ready",function(){console.log("FV Player: Custombox/Popup anything ligtbox video unload"),o.unload()}))}))}),flowplayer(function(t,e){t.bind("finish",function(){var e=t.video.time;t.video.loop&&t.one("pause",function(){e<=t.video.time&&t.resume()})})}),flowplayer(function(t,a){(a=jQuery(a)).find(".fp-logo").removeAttr("href"),a.hasClass("no-controlbar")&&((e=t.sliders.timeline).disable(!0),t.bind("ready",function(){e.disable(!0)})),jQuery(".fvfp_admin_error",a).remove(),a.find(".fp-logo, .fp-header").on("click",function(e){e.target===this&&a.find(".fp-ui").trigger("click")}),jQuery(".fvp-share-bar .sharing-facebook",a).append('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="#fff"><title>Facebook</title><path d="M11.9 5.2l-2.6 0 0-1.6c0-0.7 0.3-0.7 0.7-0.7 0.3 0 1.6 0 1.6 0l0-2.9 -2.3 0c-2.6 0-3.3 2-3.3 3.3l0 2 -1.6 0 0 2.9 1.6 0c0 3.6 0 7.8 0 7.8l3.3 0c0 0 0-4.2 0-7.8l2.3 0 0.3-2.9Z"/></svg>'),jQuery(".fvp-share-bar .sharing-twitter",a).append('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="#fff"><title>Twitter</title><path d="M16 3.1c-0.6 0.3-1.2 0.4-1.9 0.5 0.7-0.4 1.2-1 1.4-1.8 -0.6 0.4-1.3 0.6-2.1 0.8 -0.6-0.6-1.4-1-2.4-1 -2 0.1-3.2 1.6-3.2 4 -2.7-0.1-5.1-1.4-6.7-3.4 -0.9 1.4 0.2 3.8 1 4.4 -0.5 0-1-0.1-1.5-0.4l0 0.1c0 1.6 1.1 2.9 2.6 3.2 -0.7 0.2-1.3 0.1-1.5 0.1 0.4 1.3 1.6 2.2 3 2.3 -1.6 1.7-4.6 1.4-4.8 1.3 1.4 0.9 3.2 1.4 5 1.4 6 0 9.3-5 9.3-9.3 0-0.1 0-0.3 0-0.4 0.6-0.4 1.2-1 1.6-1.7Z"/></svg>'),jQuery(".fvp-share-bar .sharing-email",a).append('<svg xmlns="http://www.w3.org/2000/svg" height="16" viewBox="0 0 16 16" width="16" fill="#fff"><title>Email</title><path d="M8 10c0 0 0 0-1 0L0 6v7c0 1 0 1 1 1h14c1 0 1 0 1-1V6L9 10C9 10 8 10 8 10zM15 2H1C0 2 0 2 0 3v1l8 4 8-4V3C16 2 16 2 15 2z"/></svg>'),jQuery(".fp-header",a).prepend(jQuery(".fvp-share-bar",a)),t.conf.playlist.length&&(i=!0,2==(o=t.conf.playlist).length?(void 0!==o[0].click&&void 0===o[1].click&&(i=!1),void 0===o[0].click&&void 0!==o[1].click&&(i=!1)):3==o.length&&void 0!==o[0].click&&void 0===o[1].click&&void 0!==o[2].click&&(i=!1),i&&(o=jQuery('<a class="fp-icon fv-fp-prevbtn"></a>'),i=jQuery('<a class="fp-icon fv-fp-nextbtn"></a>'),a.find(".fp-controls .fp-playbtn").before(o).after(i),o.on("click",function(){t.trigger("prev",[t]),t.prev()}),i.on("click",function(){t.trigger("next",[t]),t.next()}))),"undefined"!=typeof fv_player_editor_conf&&a.on("click",".fvp-sharing > li",function(e){return e.preventDefault(),fv_player_notice(a,fv_player_editor_translations.link_notice,2e3),!1}),t.bind("pause resume finish unload ready",function(e,t){a.addClass("no-brand")}),t.one("ready",function(){a.find(".fp-fullscreen").clone().appendTo(a.find(".fp-controls"))}),t.on("ready",function(e,t,o){setTimeout(function(){jQuery(".fvp-share-bar",a).show(),jQuery(".fv-player-buttons-wrap",a).appendTo(jQuery(".fv-player-buttons-wrap",a).parent().find(".fp-ui"))},100)}),t.bind("finish",function(){var e=a.data("fv_redirect");e&&(void 0===t.video.is_last||t.video.is_last)&&(location.href=e)}),flowplayer.support.iOS&&11==flowplayer.support.iOS.version&&t.bind("error",function(e,t,o){4==o.code&&a.find(".fp-engine").hide()}),jQuery(document).on("contextmenu",".flowplayer",function(e){e.preventDefault()}),t.one("ready",function(e,t,o){a.find(".fp-chromecast").insertAfter(a.find(".fp-header .fp-fullscreen"))}),a.find(".fp-waiting").html('<div class="fp-preload"><b></b><b></b><b></b><b></b></div>');var e,n=a.attr("id"),r=!flowplayer.conf.native_fullscreen&&flowplayer.conf.mobile_alternative_fullscreen,o="fakefullscreen",i="fakefullscreen-exit";flowplayer.support.fullscreen||(o+=" fullscreen",i+=" fullscreen-exit"),t.bind(o,function(e,t){jQuery("#wpadminbar, .nc_wrapper").hide(),!r&&"fakefullscreen"!=e.type||"video/youtube"==t.video.type||(a.before('<span data-fv-placeholder="'+n+'"></span>'),a.appendTo("body"))}),t.bind(i,function(e,t,o){jQuery("#wpadminbar, .nc_wrapper").show(),!r&&"fakefullscreen-exit"!=e.type||jQuery("span[data-fv-placeholder="+n+"]").replaceWith(a)})}),function(){function e(p){p(function(a,n){var r,e,i,l,s;function f(e){return Math.round(100*e)/100}function c(t){r.find(".fp-speed",n)[0].innerHTML=t+"x",r.find(".fp-speed-menu a",n).forEach(function(e){r.toggleClass(e,"fp-selected",e.getAttribute("data-speed")==t),r.toggleClass(e,"fp-color",e.getAttribute("data-speed")==t)})}!jQuery(n).data("speedb")||(e=p.support).video&&e.inlineVideo&&(r=p.common,e=p.bean,i=r.find(".fp-ui",n)[0],l=r.find(".fp-controls",i)[0],s=a.conf.speeds,e.on(n,"click",".fp-speed",function(){var e=r.find(".fp-speed-menu",n)[0];r.hasClass(e,"fp-active")?a.hideMenu():a.showMenu(e)}),e.on(n,"click",".fp-speed-menu a",function(e){e=e.target.getAttribute("data-speed");a.speed(e)}),a.on("speed",function(e,t,o){1<s.length&&c(o)}).on("ready",function(e,t){var o;r.find(".fp-speed-menu",n).forEach(r.removeNode),r.find(".fp-speed",n).forEach(r.removeNode),p.support.android&&"html5"==t.engine.engineName&&"application/x-mpegurl"==t.video.type||1<(s=t.conf.speeds).length&&(l.appendChild(r.createElement("strong",{className:"fp-speed"},a.currentSpeed+"x")),o=r.createElement("div",{className:"fp-menu fp-speed-menu",css:{width:"auto"}},"<strong>Speed</strong>"),s.forEach(function(e){e=r.createElement("a",{"data-speed":f(e)},f(e)+"x");o.appendChild(e)}),i.appendChild(o),c(a.currentSpeed),jQuery(n).find(".fp-speed-menu strong").text(fv_flowplayer_translations.speed))}))})}"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e:"function"==typeof window.flowplayer&&e(window.flowplayer)}(),flowplayer(function(e,t){void 0===fv_flowplayer_conf.disable_localstorage&&(e.on("speed",function(e,t,o){try{window.localStorage.fv_player_speed=o}catch(e){}}),e.on("ready",function(){window.localStorage.fv_player_speed&&jQuery(t).find("strong.fp-speed").is(":visible")&&e.speed(parseFloat(window.localStorage.fv_player_speed)),0==jQuery(t).data("volume")&&e.mute(!0,!0)}))}),flowplayer(function(e,a){a=jQuery(a);var n=-1;function r(){return e.video.index||0}e.conf.fv_stats&&(e.conf.fv_stats.enabled||a.data("fv_stats")&&"no"!=a.data("fv_stats"))&&e.on("ready finish",function(e,t){t.one("progress",function(e,t){if(a.data("fv_stats_data")){try{var o=a.data("fv_stats_data")}catch(e){return!1}n!=r()&&(n=r(),jQuery.post(t.conf.fv_stats.url,{blog_id:t.conf.fv_stats.blog_id,video_id:t.video.id||0,player_id:o.player_id,post_id:o.post_id,tag:"play"}))}})}).on("finish",function(){n=-1})}),flowplayer(function(o,e){var t,a,n,r,i=jQuery(e),l=i.find(".fp-player"),e=i.data("fvsticky"),s=!1,f=i.data("ratio");if(o.is_sticky=!1,void 0===f&&(f=.5625),(s=1==flowplayer.conf.sticky_video&&void 0===e?!0:s)||e){if(!flowplayer.support.firstframe)return;var c=flowplayer.conf.sticky_place,p=flowplayer.conf.sticky_width,d=(p=""==p?380:p)*f;t=jQuery(window),n=(a=i).offset().top,r=Math.floor(n+a.outerHeight()/2),o.on("unload",function(){y(),i.removeClass("is-unSticky")}),t.on("resize",function(){v()?(n=a.offset().top,r=Math.floor(n+a.outerHeight()/2)):o.is_sticky&&y()}).on("scroll",function(){if(v())if(n=a.offset().top,r=Math.floor(n+a.outerHeight()/2),t.scrollTop()>r&&(o.loading||flowplayer.audible_instance==i.data("flowplayer-instance-id"))){if(0<jQuery("div.flowplayer.is-unSticky").length)return!1;u()}else y();else o.is_sticky&&y()})}function u(){l.hasClass("is-sticky-"+c)||(l.addClass("is-sticky"),l.addClass("is-sticky-"+c),0==i.find("a.fp-sticky").length&&i.find("div.fp-header").prepend('<a class="fp-sticky fp-icon"></a>'),l.css("width",p),l.css("height",d),l.css("max-height",d),o.is_sticky=!0,o.trigger("sticky",[o]),l.parent(".flowplayer").addClass("is-stickable"))}function y(){l.removeClass("is-sticky"),l.removeClass("is-sticky-"+c),l.css("width",""),l.css("height",""),l.css("max-height",""),l.parent(".flowplayer").removeClass("is-stickable"),o.is_sticky&&(o.is_sticky=!1,o.trigger("sticky-exit",[o]))}function v(){return jQuery(window).innerWidth()>=fv_flowplayer_conf.sticky_min_width}o.sticky=function(e,t){void 0===e&&(e=!o.is_sticky),t&&i.toggleClass("is-unSticky",!e),(e?u:y)()}}),jQuery(function(o){o(document).on("click","a.fp-sticky",function(){var e=o("div.flowplayer.is-stickable"),t=e.data("flowplayer"),e=(e.addClass("is-unSticky"),e.find(".fp-player"));e.removeClass("is-sticky"),e.removeClass("is-sticky-right-bottom"),e.removeClass("is-sticky-left-bottom"),e.removeClass("is-sticky-right-top"),e.removeClass("is-sticky-left-top"),e.css("width",""),e.css("height",""),e.css("max-height",""),t.is_sticky&&(t.is_sticky=!1,t.trigger("sticky-exit",[t]))}),o(document).on("click","div.flowplayer.is-unSticky",function(){o("div.flowplayer").removeClass("is-unSticky")})}),flowplayer(function(e,n){var r;n=jQuery(n),void 0===fv_flowplayer_conf.disable_localstorage&&(r=window.localStorage,e.on("ready",function(e,o,t){var a;t.subtitles&&t.subtitles.length&&(r.fv_player_subtitle&&o.video.subtitles.length?"none"===r.fv_player_subtitle?o.disableSubtitles():o.video.subtitles.forEach(function(e,t){e.srclang===r.fv_player_subtitle&&o.loadSubtitles(t)}):(a=t.subtitles.filter(function(e){return e.fv_default})[0])&&o.loadSubtitles(t.subtitles.indexOf(a))),n.find(".fp-subtitle-menu").on("click",function(e){var t=e.target.getAttribute("data-subtitle-index");if("string"==typeof t)try{r.fv_player_subtitle=-1<t?o.video.subtitles[t].srclang:"none"}catch(e){}})}))}),flowplayer(function(e,o){o=jQuery(o),e.on("ready",function(e,t){o.find(".fp-subtitle-menu strong").text(fv_flowplayer_translations.closed_captions),o.find('.fp-subtitle-menu a[data-subtitle-index="-1"]').text(fv_flowplayer_translations.no_subtitles)})}),"undefined"!=typeof flowplayer&&"undefined"!=typeof fv_flowplayer_conf&&fv_flowplayer_conf.video_hash_links&&(flowplayer(function(o,a){var n,r,i,l,s,f;0<jQuery(a).find(".sharing-link").length&&(n=function(e,t){l=fv_player_get_video_link_hash(o),s=","+fv_player_time_hms(o.video.time),e&&t?(i=","+fv_player_time_hms_ms(e+o.get_custom_start()),r=","+fv_player_time_hms_ms(t+o.get_custom_start())):(r=f&&void 0!==o.get_ab_end()&&o.get_ab_end()?","+fv_player_time_hms_ms(o.get_ab_end()):"",i=f&&void 0!==o.get_ab_start()&&o.get_ab_start()?","+fv_player_time_hms_ms(o.get_ab_start()):""),jQuery(".sharing-link",a).attr("href",jQuery(".sharing-link",a).attr("href").replace(/#.*/,"")+"#"+l+s+i+r)},o.on("ready",function(e,t,o){t.fv_noUiSlider&&t.fv_noUiSlider.on("set",function(e){n(e[0],e[1])})}),o.on("progress",function(e,t){t.video.sources&&t.video.sources[0]&&n()}),o.on("abloop",function(e,t,o){f=o,t.playing||n()}),jQuery(".sharing-link",a).on("click",function(e){fv_player_clipboard(jQuery(this).attr("href"),function(){e.preventDefault(),fv_player_notice(a,fv_flowplayer_translations.link_copied,2e3)})}))}),jQuery(document).on("click",'a[href*="fvp_"]',function(){var e=jQuery(this);setTimeout(function(){0==e.parents(".fvp-share-bar").length&&fv_autoplay_exec()})})),flowplayer(function(o,a){a=jQuery(a);var n=flowplayer.bean,r=flowplayer.conf.default_volume,i=(0==r&&(r="0.5"),a.on("mousedown touchstart",".fp-volumebtn",function(e){var t=jQuery(this);0==o.volumeLevel&&t.one("click",function(){return o.volume(r),!1})}),a.on("mousedown touchstart mouseup touchend",".fp-volumebar",function(e){0!=o.volumeLevel&&(r=o.volumeLevel)}),o.on("volume",function(e,t){a.hasClass("is-mouseover")&&!t.muted&&0==t.volumeLevel&&(n.off(flowplayer.support.touch?a:document,"mousemove.sld touchmove.sld"),t.mute(!0))}),!1);function l(){a.removeClass("has-fp-message-muted"),a.find(".fp-message-muted").remove()}o.one("ready",function(e,t){a.hasClass("is-audio")||(i=!0)}),o.on("progress",function(e,t,o){i&&1<o&&(i=!1,(o=jQuery("root").find("video")).length&&!((o=o[0]).mozHasAudio||Boolean(o.webkitAudioDecodedByteCount)||Boolean(o.audioTracks&&o.audioTracks.length))||!t.muted&&0!=t.volumeLevel||"true"==localStorage.muted||"0"==localStorage.volume||((o=jQuery('<div class="fp-message fp-message-muted"><span class="fp-icon fp-volumebtn-notice"></span> '+fv_flowplayer_translations.click_to_unmute+"</div>")).on("click touchstart",function(){t.mute(!1),t.volume(1)}),a.find(".fp-ui").append(o),a.addClass("has-fp-message-muted"),setTimeout(l,5e3)))}),o.on("mute volume",function(){(!o.muted||0<o.volumeLevel)&&l()})}),"undefined"!=typeof flowplayer&&(fv_player_warning=function(e,t,o){var a=jQuery(e).prev(".fv-player-warning-wrapper");0==a.length&&(jQuery(e).before('<div class="fv-player-warning-wrapper">'),a=jQuery(e).prev(".fv-player-warning-wrapper")),0==a.find(".fv-player-warning-"+o).length&&(e=jQuery("<p style='display: none' "+(o?" class='fv-player-warning-"+o+"'":"")+">"+t+"</p>"),a.append(e),e.slideDown())},flowplayer(function(t,a){a=jQuery(a),navigator.userAgent.match(/iPhone.* OS [0-6]_/i)&&t.one("progress",function(e){void 0!==t.video.subtitles&&t.video.subtitles.length&&fv_player_warning(a,fv_flowplayer_translations.warning_iphone_subs)}),flowplayer.support.android&&flowplayer.support.android.version<5&&(flowplayer.support.android.samsung||flowplayer.support.browser.safari)&&fv_player_warning(a,fv_flowplayer_translations.warning_unstable_android,"firefox"),/Android 4/.test(navigator.userAgent)&&!/Firefox/.test(navigator.userAgent)&&(t.on("ready",function(e,t,o){setTimeout(function(){o.src&&o.src.match(/fpdl.vimeocdn.com/)&&(0==o.time||1==o.time)&&(fv_player_warning(a,fv_flowplayer_translations.warning_unstable_android,"firefox"),t.on("progress",function(e,t){a.prev().find(".fv-player-warning-firefox").remove()}))},1500)}),t.on("error",function(e,t,o){2==o.MEDIA_ERR_NETWORK&&o.video.src.match(/fpdl.vimeocdn.com/)&&fv_player_warning(a,fv_flowplayer_translations.warning_unstable_android,"firefox")})),/Safari/.test(navigator.userAgent)&&/Version\/5/.test(navigator.userAgent)&&t.on("error",function(e,t,o){o.video.src.match(/fpdl.vimeocdn.com/)&&fv_player_warning(a,fv_flowplayer_translations.warning_old_safari)});var e=flowplayer.support;e.android&&(e.android.samsung&&parseInt(e.browser.version)<66||e.browser.safari)&&t.on("error",function(e,t,o){fv_player_warning(a,fv_flowplayer_translations.warning_samsungbrowser,"warning_samsungbrowser")})}));
flowplayer/hls.min.js CHANGED
@@ -1 +1,2 @@
1
- "undefined"!=typeof window&&function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s=20)}([function(t,e,r){"use strict";var i;r.d(e,"a",(function(){return i})),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(i||(i={}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return l}));var i=function(){},n={trace:i,debug:i,log:i,warn:i,info:i,error:i},a=n;function s(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):i}function o(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];r.forEach((function(e){a[e]=t[e]?t[e].bind(t):s(e)}))}(t,"debug","log","info","warn","error");try{a.log()}catch(t){a=n}}else a=n}var l=n},function(t,e,r){"use strict";var i,n;r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return n})),function(t){t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError"}(i||(i={})),function(t){t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown"}(n||(n={}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var i=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)};Number.MAX_SAFE_INTEGER},function(t,e,r){"use strict";var i,n;r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return n})),function(t){t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack"}(i||(i={})),function(t){t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle"}(n||(n={}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return g})),r.d(e,"c",(function(){return v}));var i,n=r(3),a=r(11),s=r(1),o=r(17),l=r(12);function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t,e,r){return e&&d(t.prototype,e),r&&d(t,r),t}!function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"}(i||(i={}));var f=function(){function t(t){var e;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((e={})[i.AUDIO]=null,e[i.VIDEO]=null,e[i.AUDIOVIDEO]=null,e),this.baseurl=t}return t.prototype.setByteRange=function(t,e){var r=t.split("@",2),i=[];1===r.length?i[0]=e?e.byteRangeEndOffset:0:i[0]=parseInt(r[1]),i[1]=parseInt(r[0])+i[0],this._byteRange=i},c(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(a.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(t){this._url=t}}]),t}(),g=function(t){function e(e,r){var i;return(i=t.call(this,r)||this)._decryptdata=null,i.rawProgramDateTime=null,i.programDateTime=null,i.tagList=[],i.duration=0,i.sn=0,i.levelkey=void 0,i.type=void 0,i.loader=null,i.level=-1,i.cc=0,i.startPTS=void 0,i.endPTS=void 0,i.appendedPTS=void 0,i.startDTS=void 0,i.endDTS=void 0,i.start=0,i.deltaPTS=void 0,i.maxStartPTS=void 0,i.minEndPTS=void 0,i.stats=new l.a,i.urlId=0,i.data=void 0,i.bitrateTest=!1,i.title=null,i.initSegment=null,i.type=e,i}u(e,t);var r=e.prototype;return r.createInitializationVector=function(t){for(var e=new Uint8Array(16),r=12;r<16;r++)e[r]=t>>8*(15-r)&255;return e},r.setDecryptDataFromLevelKey=function(t,e){var r=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((r=o.a.fromURI(t.uri)).method=t.method,r.iv=this.createInitializationVector(e),r.keyFormat="identity"),r},r.setElementaryStreamInfo=function(t,e,r,i,n,a){void 0===a&&(a=!1);var s=this.elementaryStreams,o=s[t];o?(o.startPTS=Math.min(o.startPTS,e),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,i),o.endDTS=Math.max(o.endDTS,n)):s[t]={startPTS:e,endPTS:r,startDTS:i,endDTS:n,partial:a}},r.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[i.AUDIO]=null,t[i.VIDEO]=null,t[i.AUDIOVIDEO]=null},c(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&s.b.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.a)(this.programDateTime))return null;var t=Object(n.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(f),v=function(t){function e(e,r,i,n,a){var s;(s=t.call(this,i)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new l.a,s.duration=e.decimalFloatingPoint("DURATION"),s.gap=e.bool("GAP"),s.independent=e.bool("INDEPENDENT"),s.relurl=e.enumeratedString("URI"),s.fragment=r,s.index=n;var o=e.enumeratedString("BYTERANGE");return o&&s.setByteRange(o,a),a&&(s.fragOffset=a.fragOffset+a.duration),s}return u(e,t),c(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(f)},function(t,e,r){"use strict";r.d(e,"b",(function(){return h})),r.d(e,"g",(function(){return d})),r.d(e,"f",(function(){return c})),r.d(e,"d",(function(){return f})),r.d(e,"c",(function(){return g})),r.d(e,"e",(function(){return p})),r.d(e,"h",(function(){return m})),r.d(e,"a",(function(){return y}));var i=r(9),n=r(5),a=Math.pow(2,32)-1,s=[].push;function o(t){return String.fromCharCode.apply(null,t)}function l(t,e){"data"in t&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r<0?4294967296+r:r}function u(t,e,r){"data"in t&&(e+=t.start,t=t.data),t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r}function h(t,e){var r,i,n,a=[];if(!e.length)return a;"data"in t?(r=t.data,i=t.start,n=t.end):(i=0,n=(r=t).byteLength);for(var u=i;u<n;){var d=l(r,u),c=d>1?u+d:n;if(o(r.subarray(u+4,u+8))===e[0])if(1===e.length)a.push({data:r,start:u+8,end:c});else{var f=h({data:r,start:u+8,end:c},e.slice(1));f.length&&s.apply(a,f)}u=c}return a}function d(t){var e=h(t,["moov"])[0],r=e?e.end:null,i=h(t,["sidx"]);if(!i||!i[0])return null;var n=[],a=i[0],s=a.data[0],o=0===s?8:16,u=l(a,o);o+=4;o+=0===s?8:16,o+=2;var d=a.end+0,c=function(t,e){"data"in t&&(e+=t.start,t=t.data);var r=t[e]<<8|t[e+1];return r<0?65536+r:r}(a,o);o+=2;for(var f=0;f<c;f++){var g=o,v=l(a,g);g+=4;var p=2147483647&v;if(1===(2147483648&v)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var m=l(a,g);g+=4,n.push({referenceSize:p,subsegmentDuration:m,info:{duration:m/u,start:d,end:d+p-1}}),d+=p,o=g+=4}return{earliestPresentationTime:0,timescale:u,version:s,referencesCount:c,references:n,moovEndOffset:r}}function c(t){for(var e=[],r=h(t,["moov","trak"]),i=0;i<r.length;i++){var a=r[i],s=h(a,["tkhd"])[0];if(s){var u=s.data[s.start],d=0===u?12:20,c=l(s,d),f=h(a,["mdia","mdhd"])[0];if(f){var g=l(f,d=0===(u=f.data[f.start])?12:20),v=h(a,["mdia","hdlr"])[0];if(v){var p=o(v.data.subarray(v.start+8,v.start+12)),m={soun:n.a.AUDIO,vide:n.a.VIDEO}[p];if(m){var y=h(a,["mdia","minf","stbl","stsd"])[0],T=void 0;y&&(T=o(y.data.subarray(y.start+12,y.start+16))),e[c]={timescale:g,type:m},e[m]={timescale:g,id:c,codec:T}}}}}}return h(t,["moov","mvex","trex"]).forEach((function(t){var r=l(t,4),i=e[r];i&&(i.default={duration:l(t,12),flags:l(t,20)})})),e}function f(t,e){return h(e,["moof","traf"]).reduce((function(e,r){var i=h(r,["tfdt"])[0],n=i.data[i.start],a=h(r,["tfhd"]).reduce((function(e,r){var a=l(r,4),s=t[a];if(s){var o=l(i,4);1===n&&(o*=Math.pow(2,32),o+=l(i,8));var u=o/(s.timescale||9e4);if(isFinite(u)&&(null===e||u<e))return u}return e}),null);return null!==a&&isFinite(a)&&(null===e||a<e)?a:e}),null)||0}function g(t,e){for(var r=0,i=0,a=0,s=h(t,["moof","traf"]),o=0;o<s.length;o++){var u=s[o],c=h(u,["tfhd"])[0],f=e[l(c,4)];if(f){var g=f.default,p=l(c,0)|(null==g?void 0:g.flags),m=null==g?void 0:g.duration;8&p&&(m=l(c,2&p?12:8));for(var y=f.timescale||9e4,T=h(u,["trun"]),b=0;b<T.length;b++){if(!(r=v(T[b]))&&m)r=m*l(T[b],4);f.type===n.a.VIDEO?i+=r/y:f.type===n.a.AUDIO&&(a+=r/y)}}}if(0===i&&0===a){var E=d(t);if(null!=E&&E.references)return E.references.reduce((function(t,e){return t+e.info.duration||0}),0)}return i||a}function v(t){var e=l(t,0),r=8;1&e&&(r+=4),4&e&&(r+=4);for(var i=0,n=l(t,4),a=0;a<n;a++){if(256&e)i+=l(t,r),r+=4;512&e&&(r+=4),1024&e&&(r+=4),2048&e&&(r+=4)}return i}function p(t,e,r){h(e,["moof","traf"]).forEach((function(e){h(e,["tfhd"]).forEach((function(i){var n=l(i,4),s=t[n];if(s){var o=s.timescale||9e4;h(e,["tfdt"]).forEach((function(t){var e=t.data[t.start],i=l(t,4);if(0===e)u(t,4,i-r*o);else{i*=Math.pow(2,32),i+=l(t,8),i-=r*o,i=Math.max(i,0);var n=Math.floor(i/(a+1)),s=Math.floor(i%(a+1));u(t,4,n),u(t,8,s)}}))}}))}))}function m(t){var e={valid:null,remainder:null},r=h(t,["moof"]);if(!r)return e;if(r.length<2)return e.remainder=t,e;var n=r[r.length-1];return e.valid=Object(i.a)(t,0,n.start-8),e.remainder=Object(i.a)(t,n.start-8),e}function y(t,e){var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return l})),r.d(e,"d",(function(){return u})),r.d(e,"e",(function(){return h})),r.d(e,"c",(function(){return c})),r.d(e,"f",(function(){return y}));var i,n=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},a=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},s=function(t,e){for(var r=e,i=0;n(t,e);){i+=10,i+=o(t,e+6),a(t,e+10)&&(i+=10),e+=i}if(i>0)return t.subarray(r,r+i)},o=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},l=function(t,e){return n(t,e)&&o(t,e+6)+10<=t.length-e},u=function(t){for(var e=c(t),r=0;r<e.length;r++){var i=e[r];if(h(i))return m(i)}},h=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},d=function(t){var e=String.fromCharCode(t[0],t[1],t[2],t[3]),r=o(t,4);return{type:e,size:r,data:t.subarray(10,10+r)}},c=function(t){for(var e=0,r=[];n(t,e);){for(var i=o(t,e+6),s=(e+=10)+i;e+8<s;){var l=d(t.subarray(e)),u=f(l);u&&r.push(u),e+=l.size+10}a(t,e)&&(e+=10)}return r},f=function(t){return"PRIV"===t.type?g(t):"W"===t.type[0]?p(t):v(t)},g=function(t){if(!(t.size<2)){var e=y(t.data,!0),r=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:r.buffer}}},v=function(t){if(!(t.size<2)){if("TXXX"===t.type){var e=1,r=y(t.data.subarray(e),!0);e+=r.length+1;var i=y(t.data.subarray(e));return{key:t.type,info:r,data:i}}var n=y(t.data.subarray(1));return{key:t.type,data:n}}},p=function(t){if("WXXX"===t.type){if(t.size<2)return;var e=1,r=y(t.data.subarray(e),!0);e+=r.length+1;var i=y(t.data.subarray(e));return{key:t.type,info:r,data:i}}var n=y(t.data);return{key:t.type,data:n}},m=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),r=1&e[3],i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,r&&(i+=47721858.84),Math.round(i)}},y=function(t,e){void 0===e&&(e=!1);var r=T();if(r){var i=r.decode(t);if(e){var n=i.indexOf("\0");return-1!==n?i.substring(0,n):i}return i.replace(/\0/g,"")}for(var a,s,o,l=t.length,u="",h=0;h<l;){if(0===(a=t[h++])&&e)return u;if(0!==a&&3!==a)switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(a);break;case 12:case 13:s=t[h++],u+=String.fromCharCode((31&a)<<6|63&s);break;case 14:s=t[h++],o=t[h++],u+=String.fromCharCode((15&a)<<12|(63&s)<<6|(63&o)<<0)}}return u};function T(){return i||void 0===self.TextDecoder||(i=new self.TextDecoder("utf-8")),i}},function(t,e,r){"use strict";r.d(e,"c",(function(){return n})),r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return s}));function i(t,e,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var n=t*e*r;return i?Math.round(n):n}function n(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=!1),i(t,e,1/r,n)}function a(t,e){return void 0===e&&(e=!1),i(t,1e3,1/9e4,e)}function s(t,e){return void 0===e&&(e=1),i(t,9e4,1/e)}},function(t,e,r){"use strict";function i(t,e,r){return Uint8Array.prototype.slice?t.slice(e,r):new Uint8Array(Array.prototype.slice.call(t,e,r))}r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";r.d(e,"c",(function(){return lt})),r.d(e,"d",(function(){return ht})),r.d(e,"a",(function(){return dt})),r.d(e,"b",(function(){return ct}));var i=r(0),n=r(2),a=r(15),s=r(3),o=r(7);var l=r(6),u=r(9),h=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,r){},e.demux=function(t,e){this.cachedData&&(t=Object(l.a)(this.cachedData,t),this.cachedData=null);var r,i,n=o.b(t,0),a=n?n.length:0,s=this._audioTrack,h=this._id3Track,c=n?o.d(n):void 0,f=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=d(c,e)),n&&n.length>0&&h.samples.push({pts:this.initPTS,dts:this.initPTS,data:n}),i=this.initPTS;a<f;){if(this.canParse(t,a)){var g=this.appendFrame(s,t,a);g?(this.frameIndex++,i=g.sample.pts,r=a+=g.length):a=f}else o.a(t,a)?(n=o.b(t,a),h.samples.push({pts:i,dts:i,data:n}),r=a+=n.length):a++;if(a===f&&r!==f){var v=Object(u.a)(t,r);this.cachedData?this.cachedData=Object(l.a)(this.cachedData,v):this.cachedData=v}}return{audioTrack:s,avcTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},id3Track:h,textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},e.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},id3Track:this._id3Track,textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.destroy=function(){},t}(),d=function(t,e){return Object(s.a)(t)?90*t:9e4*e},c=h,f=r(1);function g(t,e){return 255===t[e]&&240==(246&t[e+1])}function v(t,e){return 1&t[e+1]?7:9}function p(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function m(t,e){return e+1<t.length&&g(t,e)}function y(t,e){if(m(t,e)){var r=v(t,e);if(e+r>=t.length)return!1;var i=p(t,e);if(i<=r)return!1;var n=e+i;return n===t.length||m(t,n)}return!1}function T(t,e,r,a,s){if(!t.samplerate){var o=function(t,e,r,a){var s,o,l,u,h=navigator.userAgent.toLowerCase(),d=a,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[r+2])>>>6);var g=(60&e[r+2])>>>2;if(!(g>c.length-1))return l=(1&e[r+2])<<2,l|=(192&e[r+3])>>>6,f.b.log("manifest codec:"+a+", ADTS type:"+s+", samplingIndex:"+g),/firefox/i.test(h)?g>=6?(s=5,u=new Array(4),o=g-3):(s=2,u=new Array(2),o=g):-1!==h.indexOf("android")?(s=2,u=new Array(2),o=g):(s=5,u=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&g>=6?o=g-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(g>=6&&1===l||/vivaldi/i.test(h))||!a&&1===l)&&(s=2,u=new Array(2)),o=g)),u[0]=s<<3,u[0]|=(14&g)>>1,u[1]|=(1&g)<<7,u[1]|=l<<3,5===s&&(u[1]|=(14&o)>>1,u[2]=(1&o)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:c[g],channelCount:l,codec:"mp4a.40."+s,manifestCodec:d};t.trigger(i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g})}(e,r,a,s);if(!o)return;t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,f.b.log("parsed codec:"+t.codec+", rate:"+o.samplerate+", channels:"+o.channelCount)}}function b(t){return 9216e4/t}function E(t,e,r,i,n){var a=function(t,e,r,i,n){var a=v(t,e),s=p(t,e);if((s-=a)>0)return{headerLength:a,frameLength:s,stamp:r+i*n}}(e,r,i,n,b(t.samplerate));if(a){var s,o=a.frameLength,l=a.headerLength,u=a.stamp,h=l+o,d=Math.max(0,r+h-e.length);d?(s=new Uint8Array(h-l)).set(e.subarray(r+l,e.length),0):s=e.subarray(r+l,r+h);var c={unit:s,pts:u};return d||t.samples.push(c),{sample:c,length:h,missing:d}}}function S(t,e){return(S=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var L=function(t){var e,r;function i(e,r){var i;return(i=t.call(this)||this).observer=void 0,i.config=void 0,i.observer=e,i.config=r,i}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,S(e,r);var n=i.prototype;return n.resetInitSegment=function(e,r,i){t.prototype.resetInitSegment.call(this,e,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,r=t.length;e<r;e++)if(y(t,e))return f.b.log("ADTS sync word found !"),!0;return!1},n.canParse=function(t,e){return function(t,e){return function(t,e){return e+5<t.length}(t,e)&&g(t,e)&&p(t,e)<=t.length-e}(t,e)},n.appendFrame=function(t,e,r){T(t,this.observer,e,r,t.manifestCodec);var i=E(t,e,r,this.initPTS,this.frameIndex);if(i&&0===i.missing)return i},i}(c);L.minProbeByteLength=9;var A=L,R=function(){function t(t,e){this.remainderData=null,this.config=void 0,this.config=e}var e=t.prototype;return e.resetTimeStamp=function(){},e.resetInitSegment=function(){},e.resetContiguity=function(){},t.probe=function(t){return Object(l.b)({data:t,start:0,end:Math.min(t.length,16384)},["moof"]).length>0},e.demux=function(t){var e=t,r={type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0};if(this.config.progressive){this.remainderData&&(e=Object(l.a)(this.remainderData,t));var i=Object(l.h)(e);this.remainderData=i.remainder,r.samples=i.valid||new Uint8Array}else r.samples=e;return{audioTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},avcTrack:r,id3Track:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.flush=function(){var t={type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0};return t.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},avcTrack:t,id3Track:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();R.minProbeByteLength=1024;var D=R,k=null,_=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function O(t,e,r,i,n){if(!(r+24>e.length)){var a=x(e,r);if(a&&r+a.frameLength<=e.length){var s=i+n*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:e.subarray(r,r+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}}function x(t,e){var r=t[e+1]>>3&3,i=t[e+1]>>1&3,n=t[e+2]>>4&15,a=t[e+2]>>2&3;if(1!==r&&0!==n&&15!==n&&3!==a){var s=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*_[14*(3===r?3-i:3===i?3:4)+n-1],u=I[3*(3===r?0:2===r?1:2)+a],h=3===o?1:2,d=C[r][i],c=w[i],f=8*d*c,g=Math.floor(d*l/u+s)*c;if(null===k){var v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);k=v?parseInt(v[1]):0}return!!k&&k<=87&&2===i&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:u,channelCount:h,frameLength:g,samplesPerFrame:f}}}function P(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function M(t,e){return e+1<t.length&&P(t,e)}function F(t,e){if(e+1<t.length&&P(t,e)){var r=x(t,e),i=4;null!=r&&r.frameLength&&(i=r.frameLength);var n=e+i;return n===t.length||M(t,n)}return!1}var N=function(){function t(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var e=t.prototype;return e.loadWord=function(){var t=this.data,e=this.bytesAvailable,r=t.byteLength-e,i=new Uint8Array(4),n=Math.min(4,e);if(0===n)throw new Error("no bytes available");i.set(t.subarray(r,r+n)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n},e.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&f.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?r<<e|this.readBits(e):r},e.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,r=8,i=0;i<t;i++)0!==r&&(r=(e+this.readEG()+256)%256),e=0===r?e:r},e.readSPS=function(){var t,e,r,i=0,n=0,a=0,s=0,o=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),h=this.readBoolean.bind(this),d=this.skipBits.bind(this),c=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);o();var v=o();if(l(5),d(3),o(),f(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){var p=u();if(3===p&&d(1),f(),f(),d(1),h())for(e=3!==p?8:12,r=0;r<e;r++)h()&&g(r<6?16:64)}f();var m=u();if(0===m)u();else if(1===m)for(d(1),c(),c(),t=u(),r=0;r<t;r++)c();f(),d(1);var y=u(),T=u(),b=l(1);0===b&&d(1),d(1),h()&&(i=u(),n=u(),a=u(),s=u());var E=[1,1];if(h()&&h())switch(o()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[o()<<8|o(),o()<<8|o()]}return{width:Math.ceil(16*(y+1)-2*i-2*n),height:(2-b)*(T+1)*16-(b?2:4)*(a+s),pixelRatio:E}},e.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}(),U=function(){function t(t,e,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new a.a(t,e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,e)},e.decryptAacSample=function(t,e,r,i){var n=t[e].unit,a=n.subarray(16,n.length-n.length%16),s=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),o=this;this.decryptBuffer(s,(function(a){var s=new Uint8Array(a);n.set(s,16),i||o.decryptAacSamples(t,e+1,r)}))},e.decryptAacSamples=function(t,e,r){for(;;e++){if(e>=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,n=32;n<t.length-16;n+=160,i+=16)r.set(t.subarray(n,n+16),i);return r},e.getAvcDecryptedUnit=function(t,e){for(var r=new Uint8Array(e),i=0,n=32;n<t.length-16;n+=160,i+=16)t.set(r.subarray(i,i+16),n);return t},e.decryptAvcSample=function(t,e,r,i,n,a){var s=q(n.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,(function(o){n.data=l.getAvcDecryptedUnit(s,o),a||l.decryptAvcSamples(t,e,r+1,i)}))},e.decryptAvcSamples=function(t,e,r,i){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,r=0){if(e>=t.length)return void i();for(var n=t[e].units;!(r>=n.length);r++){var a=n[r];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,i,a,s),!s)return}}}},t}(),B={video:1,audio:2,id3:3,text:4},G=function(){function t(t,e,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=r}t.probe=function(e){var r=t.syncOffset(e);return!(r<0)&&(r&&f.b.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)},t.syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),r=0;r<e;){if(71===t[r]&&71===t[r+188]&&71===t[r+376])return r;r++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:B[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,r,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video",i),this._audioTrack=t.createTrack("audio",i),this._id3Track=t.createTrack("id3",i),this._txtTrack=t.createTrack("text",i),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=e,this.videoCodec=r,this._duration=i},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,r=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},e.demux=function(e,r,a,s){var o;void 0===a&&(a=!1),void 0===s&&(s=!1),a||(this.sampleAes=null);var u=this._avcTrack,h=this._audioTrack,d=this._id3Track,c=u.pid,g=u.pesData,v=h.pid,p=d.pid,m=h.pesData,y=d.pesData,T=!1,b=this.pmtParsed,E=this._pmtId,S=e.length;if(this.remainderData&&(S=(e=Object(l.a)(this.remainderData,e)).length,this.remainderData=null),S<188&&!s)return this.remainderData=e,{audioTrack:h,avcTrack:u,id3Track:d,textTrack:this._txtTrack};var L=Math.max(0,t.syncOffset(e));(S-=(S+L)%188)<e.byteLength&&!s&&(this.remainderData=new Uint8Array(e.buffer,S,e.buffer.byteLength-S));for(var A=0,R=L;R<S;R+=188)if(71===e[R]){var D=!!(64&e[R+1]),k=((31&e[R+1])<<8)+e[R+2],_=void 0;if((48&e[R+3])>>4>1){if((_=R+5+e[R+4])===R+188)continue}else _=R+4;switch(k){case c:D&&(g&&(o=V(g))&&this.parseAVCPES(o,!1),g={data:[],size:0}),g&&(g.data.push(e.subarray(_,R+188)),g.size+=R+188-_);break;case v:D&&(m&&(o=V(m))&&(h.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),m={data:[],size:0}),m&&(m.data.push(e.subarray(_,R+188)),m.size+=R+188-_);break;case p:D&&(y&&(o=V(y))&&this.parseID3PES(o),y={data:[],size:0}),y&&(y.data.push(e.subarray(_,R+188)),y.size+=R+188-_);break;case 0:D&&(_+=e[_]+1),E=this._pmtId=j(e,_);break;case E:D&&(_+=e[_]+1);var I=H(e,_,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,a);(c=I.avc)>0&&(u.pid=c),(v=I.audio)>0&&(h.pid=v,h.isAAC=I.isAAC),(p=I.id3)>0&&(d.pid=p),T&&!b&&(f.b.log("reparse from beginning"),T=!1,R=L-188),b=this.pmtParsed=!0;break;case 17:case 8191:break;default:T=!0}}else A++;A>0&&this.observer.emit(i.a.ERROR,i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+A+" TS packet/s that do not start with 0x47"}),u.pesData=g,h.pesData=m,d.pesData=y;var C={audioTrack:h,avcTrack:u,id3Track:d,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(C),C},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,r=t.audioTrack,i=t.avcTrack,n=t.id3Track,a=i.pesData,s=r.pesData,o=n.pesData;a&&(e=V(a))?(this.parseAVCPES(e,!0),i.pesData=null):i.pesData=a,s&&(e=V(s))?(r.isAAC?this.parseAACPES(e):this.parseMPEGPES(e),r.pesData=null):(null!=s&&s.size&&f.b.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=s),o&&(e=V(o))?(this.parseID3PES(e),n.pesData=null):n.pesData=o},e.demuxSampleAes=function(t,e,r){var i=this.demux(t,r,!0,!this.config.progressive),n=this.sampleAes=new U(this.observer,this.config,e);return this.decrypt(i,n)},e.decrypt=function(t,e){return new Promise((function(r){var i=t.audioTrack,n=t.avcTrack;i.samples&&i.isAAC?e.decryptAacSamples(i.samples,0,(function(){n.samples?e.decryptAvcSamples(n.samples,0,0,(function(){r(t)})):r(t)})):n.samples&&e.decryptAvcSamples(n.samples,0,0,(function(){r(t)}))}))},e.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},e.parseAVCPES=function(t,e){var r,i=this,n=this._avcTrack,a=this.parseAVCNALu(t.data),s=this.avcSample,l=!1;t.data=null,s&&a.length&&!n.audFound&&(W(s,n),s=this.avcSample=K(!1,t.pts,t.dts,"")),a.forEach((function(e){switch(e.type){case 1:r=!0,s||(s=i.avcSample=K(!0,t.pts,t.dts,"")),s.frame=!0;var a=e.data;if(l&&a.length>4){var u=new N(a).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(s.key=!0)}break;case 5:r=!0,s||(s=i.avcSample=K(!0,t.pts,t.dts,"")),s.key=!0,s.frame=!0;break;case 6:r=!0;var h=new N(q(e.data));h.readUByte();for(var d=0,c=0,f=!1,g=0;!f&&h.bytesAvailable>1;){d=0;do{d+=g=h.readUByte()}while(255===g);c=0;do{c+=g=h.readUByte()}while(255===g);if(4===d&&0!==h.bytesAvailable){if(f=!0,181===h.readUByte())if(49===h.readUShort())if(1195456820===h.readUInt())if(3===h.readUByte()){for(var v=h.readUByte(),p=31&v,m=[v,h.readUByte()],y=0;y<p;y++)m.push(h.readUByte()),m.push(h.readUByte()),m.push(h.readUByte());Y(i._txtTrack.samples,{type:3,pts:t.pts,bytes:m})}}else if(5===d&&0!==h.bytesAvailable){if(f=!0,c>16){for(var T=[],b=0;b<16;b++)T.push(h.readUByte().toString(16)),3!==b&&5!==b&&7!==b&&9!==b||T.push("-");for(var E=c-16,S=new Uint8Array(E),L=0;L<E;L++)S[L]=h.readUByte();Y(i._txtTrack.samples,{pts:t.pts,payloadType:d,uuid:T.join(""),userData:Object(o.f)(S),userDataBytes:S})}}else if(c<h.bytesAvailable)for(var A=0;A<c;A++)h.readUByte()}break;case 7:if(r=!0,l=!0,!n.sps){var R=new N(e.data).readSPS();n.width=R.width,n.height=R.height,n.pixelRatio=R.pixelRatio,n.sps=[e.data],n.duration=i._duration;for(var D=e.data.subarray(1,4),k="avc1.",_=0;_<3;_++){var I=D[_].toString(16);I.length<2&&(I="0"+I),k+=I}n.codec=k}break;case 8:r=!0,n.pps||(n.pps=[e.data]);break;case 9:r=!1,n.audFound=!0,s&&W(s,n),s=i.avcSample=K(!1,t.pts,t.dts,"");break;case 12:r=!1;break;default:r=!1,s&&(s.debug+="unknown NAL "+e.type+" ")}s&&r&&s.units.push(e)})),e&&s&&(W(s,n),this.avcSample=null)},e.getLastNalUnit=function(){var t,e,r=this.avcSample;if(!r||0===r.units.length){var i=this._avcTrack.samples;r=i[i.length-1]}if(null!==(t=r)&&void 0!==t&&t.units){var n=r.units;e=n[n.length-1]}return e},e.parseAVCNALu=function(t){var e,r,i=t.byteLength,n=this._avcTrack,a=n.naluState||0,s=a,o=[],l=0,u=-1,h=0;for(-1===a&&(u=0,h=31&t[0],a=0,l=1);l<i;)if(e=t[l++],a)if(1!==a)if(e)if(1===e){if(u>=0){var d={data:t.subarray(u,l-a-1),type:h};o.push(d)}else{var c=this.getLastNalUnit();if(c&&(s&&l<=4-s&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-s)),(r=l-a-1)>0)){var f=new Uint8Array(c.data.byteLength+r);f.set(c.data,0),f.set(t.subarray(0,r),c.data.byteLength),c.data=f,c.state=0}}l<i?(u=l,h=31&t[l],a=0):a=-1}else a=0;else a=3;else a=e?0:2;else a=e?0:1;if(u>=0&&a>=0){var g={data:t.subarray(u,i),type:h,state:a};o.push(g)}if(0===o.length){var v=this.getLastNalUnit();if(v){var p=new Uint8Array(v.data.byteLength+t.byteLength);p.set(v.data,0),p.set(t,v.data.byteLength),v.data=p}}return n.naluState=a,o},e.parseAACPES=function(t){var e,r,a,s,o,l=0,u=this._audioTrack,h=this.aacOverFlow,d=t.data;if(h){this.aacOverFlow=null;var c=h.sample.unit.byteLength,g=Math.min(h.missing,c),v=c-g;h.sample.unit.set(d.subarray(0,g),v),u.samples.push(h.sample),l=h.missing}for(e=l,r=d.length;e<r-1&&!m(d,e);e++);if(e!==l&&(e<r-1?(a="AAC PES did not start with ADTS header,offset:"+e,s=!1):(a="no ADTS header found in AAC PES",s=!0),f.b.warn("parsing error:"+a),this.observer.emit(i.a.ERROR,i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:s,reason:a}),s))return;if(T(u,this.observer,d,e,this.audioCodec),void 0!==t.pts)o=t.pts;else{if(!h)return void f.b.warn("[tsdemuxer]: AAC PES unknown PTS");var p=b(u.samplerate);o=h.sample.pts+p}for(var y=0;e<r;){if(m(d,e)){if(e+5<r){var S=E(u,d,e,o,y);if(S){if(!S.missing){e+=S.length,y++;continue}this.aacOverFlow=S}}break}e++}},e.parseMPEGPES=function(t){var e=t.data,r=e.length,i=0,n=0,a=t.pts;if(void 0!==a)for(;n<r;)if(M(e,n)){var s=O(this._audioTrack,e,n,a,i);if(!s)break;n+=s.length,i++}else n++;else f.b.warn("[tsdemuxer]: MPEG PES unknown PTS")},e.parseID3PES=function(t){void 0!==t.pts?this._id3Track.samples.push(t):f.b.warn("[tsdemuxer]: ID3 PES unknown PTS")},t}();function K(t,e,r,i){return{key:t,frame:!1,pts:e,dts:r,units:[],debug:i,length:0}}function j(t,e){return(31&t[e+10])<<8|t[e+11]}function H(t,e,r,i){var n={audio:-1,avc:-1,id3:-1,isAAC:!0},a=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<a;){var s=(31&t[e+1])<<8|t[e+2];switch(t[e]){case 207:if(!i){f.b.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===n.audio&&(n.audio=s);break;case 21:-1===n.id3&&(n.id3=s);break;case 219:if(!i){f.b.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===n.avc&&(n.avc=s);break;case 3:case 4:r?-1===n.audio&&(n.audio=s,n.isAAC=!1):f.b.log("MPEG audio found, not supported in this browser");break;case 36:f.b.warn("Unsupported HEVC stream type found")}e+=5+((15&t[e+3])<<8|t[e+4])}return n}function V(t){var e,r,i,n,a,s=0,o=t.data;if(!t||0===t.size)return null;for(;o[0].length<19&&o.length>1;){var l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(1===((e=o[0])[0]<<16)+(e[1]<<8)+e[2]){if((r=(e[4]<<8)+e[5])&&r>t.size-6)return null;var u=e[7];192&u&&(n=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&u?n-(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(f.b.warn(Math.round((n-a)/9e4)+"s delta between PTS and DTS, align them"),n=a):a=n);var h=(i=e[8])+9;if(t.size<=h)return null;t.size-=h;for(var d=new Uint8Array(t.size),c=0,g=o.length;c<g;c++){var v=(e=o[c]).byteLength;if(h){if(h>v){h-=v;continue}e=e.subarray(h),v-=h,h=0}d.set(e,s),s+=v}return r&&(r-=i+3),{data:d,pts:n,dts:a,len:r}}return null}function W(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var r=e.samples,i=r.length;if(!i)return void e.dropped++;var n=r[i-1];t.pts=n.pts,t.dts=n.dts}e.samples.push(t)}t.debug.length&&f.b.log(t.pts+"/"+t.dts+":"+t.debug)}function Y(t,e){var r=t.length;if(r>0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts<t[i].pts){t.splice(i,0,e);break}}else t.push(e)}function q(t){for(var e=t.byteLength,r=[],i=1;i<e-2;)0===t[i]&&0===t[i+1]&&3===t[i+2]?(r.push(i+2),i+=2):i++;if(0===r.length)return t;var n=e-r.length,a=new Uint8Array(n),s=0;for(i=0;i<n;s++,i++)s===r[0]&&(s++,r.shift()),a[i]=t[s];return a}G.minProbeByteLength=188;var X=G;function z(t,e){return(z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Q=function(t){var e,r;function i(){return t.apply(this,arguments)||this}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,z(e,r);var n=i.prototype;return n.resetInitSegment=function(e,r,i){t.prototype.resetInitSegment.call(this,e,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,r=t.length;e<r;e++)if(F(t,e))return f.b.log("MPEG Audio sync word found !"),!0;return!1},n.canParse=function(t,e){return function(t,e){return P(t,e)&&4<=t.length-e}(t,e)},n.appendFrame=function(t,e,r){if(null!==this.initPTS)return O(t,e,r,this.initPTS,this.frameIndex)},i}(c);Q.minProbeByteLength=4;var $=Q,J=r(16),Z=r(5),tt=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndDTS=null},e.resetNextTimestamp=function(){this.lastEndDTS=null},e.resetInitSegment=function(t,e,r){this.audioCodec=e,this.videoCodec=r,this.generateInitSegment(t),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,r=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var i=this.initData=Object(l.f)(t);e||(e=rt(i.audio,Z.a.AUDIO)),r||(r=rt(i.video,Z.a.VIDEO));var n={};i.audio&&i.video?n.audiovideo={container:"video/mp4",codec:e+","+r,initSegment:t,id:"main"}:i.audio?n.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:i.video?n.video={container:"video/mp4",codec:r,initSegment:t,id:"main"}:f.b.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},e.remux=function(t,e,r,i,n){var a=this.initPTS,o=this.lastEndDTS,u={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};Object(s.a)(o)||(o=this.lastEndDTS=n||0);var h=e.samples;if(!h||!h.length)return u;var d={initPTS:void 0,timescale:1},c=this.initData;if(c&&c.length||(this.generateInitSegment(h),c=this.initData),!c||!c.length)return f.b.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(d.tracks=this.initTracks,this.emitInitSegment=!1),Object(s.a)(a)||(this.initPTS=d.initPTS=a=et(c,h,o));var g=Object(l.c)(h,c),v=o,p=g+v;Object(l.e)(c,h,a),g>0?this.lastEndDTS=p:(f.b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!c.audio,y=!!c.video,T="";m&&(T+="audio"),y&&(T+="video");var b={data1:h,startPTS:v,startDTS:v,endPTS:p,endDTS:p,type:T,hasAudio:m,hasVideo:y,nb:1,dropped:0};return u.audio="audio"===b.type?b:void 0,u.video="audio"!==b.type?b:void 0,u.text=i,u.id3=r,u.initSegment=d,u},t}(),et=function(t,e,r){return Object(l.d)(t,e)-r};function rt(t,e){var r=null==t?void 0:t.codec;return r&&r.length>4?r:"hvc1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||e===Z.a.VIDEO?"avc1.42e01e":"mp4a.40.5"}var it,nt=tt,at=r(13);try{it=self.performance.now.bind(self.performance)}catch(t){f.b.debug("Unable to use Performance API on this environment"),it=self.Date.now}var st=[{demux:X,remux:J.a},{demux:D,remux:nt},{demux:A,remux:J.a},{demux:$,remux:J.a}],ot=1024;st.forEach((function(t){var e=t.demux;ot=Math.max(ot,e.minProbeByteLength)}));var lt=function(){function t(t,e,r,i,n){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new at.a,this.observer=t,this.typeSupported=e,this.config=r,this.vendor=i,this.id=n}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,r,i){var n=this,a=r.transmuxing;a.executeStart=it();var s=new Uint8Array(t),o=this.cache,u=this.config,h=this.currentTransmuxState,d=this.transmuxConfig;i&&(this.currentTransmuxState=i);var c=function(t,e){var r=null;t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(r=e);return r}(s,e);if(c&&"AES-128"===c.method){var f=this.getDecrypter();if(!u.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(s,c.key.buffer,c.iv.buffer).then((function(t){var e=n.push(t,null,r);return n.decryptionPromise=null,e})),this.decryptionPromise;var g=f.softwareDecrypt(s,c.key.buffer,c.iv.buffer);if(!g)return a.executeEnd=it(),ut(r);s=new Uint8Array(g)}var v=i||h,p=v.contiguous,m=v.discontinuity,y=v.trackSwitch,T=v.accurateTimeOffset,b=v.timeOffset,E=v.initSegmentChange,S=d.audioCodec,L=d.videoCodec,A=d.defaultInitPts,R=d.duration,D=d.initSegmentData;if((m||y||E)&&this.resetInitSegment(D,S,L,R),(m||E)&&this.resetInitialTimestamp(A),p||this.resetContiguity(),this.needsProbing(s,m,y)){if(o.dataLength){var k=o.flush();s=Object(l.a)(k,s)}this.configureTransmuxer(s,d)}var _=this.transmux(s,c,b,T,r),I=this.currentTransmuxState;return I.contiguous=!0,I.discontinuity=!1,I.trackSwitch=!1,a.executeEnd=it(),_},e.flush=function(t){var e=this,r=t.transmuxing;r.executeStart=it();var a=this.decrypter,s=this.cache,o=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then((function(){return e.flush(t)}));var u=[],h=o.timeOffset;if(a){var d=a.flush();d&&u.push(this.push(d,null,t))}var c=s.dataLength;s.reset();var f=this.demuxer,g=this.remuxer;if(!f||!g)return c>=ot&&this.observer.emit(i.a.ERROR,i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=it(),[ut(t)];var v=f.flush(h);return ht(v)?v.then((function(r){return e.flushRemux(u,r,t),u})):(this.flushRemux(u,v,t),u)},e.flushRemux=function(t,e,r){var i=e.audioTrack,n=e.avcTrack,a=e.id3Track,s=e.textTrack,o=this.currentTransmuxState,l=o.accurateTimeOffset,u=o.timeOffset;f.b.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var h=this.remuxer.remux(i,n,a,s,u,l,!0,this.id);t.push({remuxResult:h,chunkMeta:r}),r.transmuxing.executeEnd=it()},e.resetInitialTimestamp=function(t){var e=this.demuxer,r=this.remuxer;e&&r&&(e.resetTimeStamp(t),r.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,r,i){var n=this.demuxer,a=this.remuxer;n&&a&&(n.resetInitSegment(e,r,i),a.resetInitSegment(t,e,r))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,r,i,n){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,r,i,n):this.transmuxUnencrypted(t,r,i,n)},e.transmuxUnencrypted=function(t,e,r,i){var n=this.demuxer.demux(t,e,!1,!this.config.progressive),a=n.audioTrack,s=n.avcTrack,o=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(a,s,o,l,e,r,!1,this.id),chunkMeta:i}},e.transmuxSampleAes=function(t,e,r,i,n){var a=this;return this.demuxer.demuxSampleAes(t,e,r).then((function(t){return{remuxResult:a.remuxer.remux(t.audioTrack,t.avcTrack,t.id3Track,t.textTrack,r,i,!1,a.id),chunkMeta:n}}))},e.configureTransmuxer=function(t,e){for(var r,i=this.config,n=this.observer,a=this.typeSupported,s=this.vendor,o=e.audioCodec,l=e.defaultInitPts,u=e.duration,h=e.initSegmentData,d=e.videoCodec,c=0,g=st.length;c<g;c++)if(st[c].demux.probe(t)){r=st[c];break}r||(f.b.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),r={demux:D,remux:nt});var v=this.demuxer,p=this.remuxer,m=r.remux,y=r.demux;p&&p instanceof m||(this.remuxer=new m(n,i,a,s)),v&&v instanceof y||(this.demuxer=new y(n,i,a),this.probe=y.probe),this.resetInitSegment(h,o,d,u),this.resetInitialTimestamp(l)},e.needsProbing=function(t,e,r){return!this.demuxer||!this.remuxer||e||r},e.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new a.a(this.observer,this.config)),t},t}();var ut=function(t){return{remuxResult:{},chunkMeta:t}};function ht(t){return"then"in t&&t.then instanceof Function}var dt=function(t,e,r,i,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=r,this.duration=i,this.defaultInitPts=n},ct=function(t,e,r,i,n,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=r,this.trackSwitch=i,this.timeOffset=n,this.initSegmentChange=a}},function(t,e,r){var i,n,a,s,o;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var i=o.parseURL(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):e;var s=o.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=n.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var h=s.path,d=h.substring(0,h.lastIndexOf("/")+1)+a.path;u.path=o.normalizePath(d)}else u.path=s.path,a.params||(u.params=s.params,a.query||(u.query=s.query));return null===u.path&&(u.path=r.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(u)},parseURL:function(t){var e=i.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(a,"");t.length!==(t=t.replace(s,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=o},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var i=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var i=function(){function t(){this.chunks=[],this.dataLength=0}var e=t.prototype;return e.push=function(t){this.chunks.push(t),this.dataLength+=t.length},e.flush=function(){var t,e=this.chunks,r=this.dataLength;return e.length?(t=1===e.length?e[0]:function(t,e){for(var r=new Uint8Array(e),i=0,n=0;n<t.length;n++){var a=t[n];r.set(a,i),i+=a.length}return r}(e,r),this.reset(),t):new Uint8Array(0)},e.reset=function(){this.chunks.length=0,this.dataLength=0},t}()},function(t,e,r){"use strict";var i=Object.prototype.hasOwnProperty,n="~";function a(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,i||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new a:delete t._events[e]}function u(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},u.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);i<a;i++)s[i]=r[i].fn;return s},u.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},u.prototype.emit=function(t,e,r,i,a,s){var o=n?n+t:t;if(!this._events[o])return!1;var l,u,h=this._events[o],d=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),d){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,r),!0;case 4:return h.fn.call(h.context,e,r,i),!0;case 5:return h.fn.call(h.context,e,r,i,a),!0;case 6:return h.fn.call(h.context,e,r,i,a,s),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var c,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),d){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,r);break;case 4:h[u].fn.call(h[u].context,e,r,i);break;default:if(!l)for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];h[u].fn.apply(h[u].context,l)}}return!0},u.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},u.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},u.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return l(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||l(this,a);else{for(var o=0,u=[],h=s.length;o<h;o++)(s[o].fn!==e||i&&!s[o].once||r&&s[o].context!==r)&&u.push(s[o]);u.length?this._events[a]=1===u.length?u[0]:u:l(this,a)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&l(this,e)):(this._events=new a,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var i=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),n=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),a=r(9);var s=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),r=new Uint32Array(4),i=0;i<4;i++)r[i]=e.getUint32(4*i);return r},e.initTable=function(){var t=this.sBox,e=this.invSBox,r=this.subMix,i=r[0],n=r[1],a=r[2],s=r[3],o=this.invSubMix,l=o[0],u=o[1],h=o[2],d=o[3],c=new Uint32Array(256),f=0,g=0,v=0;for(v=0;v<256;v++)c[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var p=g^g<<1^g<<2^g<<3^g<<4;p=p>>>8^255&p^99,t[f]=p,e[p]=f;var m=c[f],y=c[m],T=c[y],b=257*c[p]^16843008*p;i[f]=b<<24|b>>>8,n[f]=b<<16|b>>>16,a[f]=b<<8|b>>>24,s[f]=b,b=16843009*T^65537*y^257*m^16843008*f,l[p]=b<<24|b>>>8,u[p]=b<<16|b>>>16,h[p]=b<<8|b>>>24,d[p]=b,f?(f=m^c[c[c[T^m]]],g^=c[c[g]]):f=g=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i<e.length&&r;)r=e[i]===this.key[i],i++;if(!r){this.key=e;var n=this.keySize=e.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);var a,s,o,l,u=this.ksRows=4*(n+6+1),h=this.keySchedule=new Uint32Array(u),d=this.invKeySchedule=new Uint32Array(u),c=this.sBox,f=this.rcon,g=this.invSubMix,v=g[0],p=g[1],m=g[2],y=g[3];for(a=0;a<u;a++)a<n?o=h[a]=e[a]:(l=o,a%n==0?(l=c[(l=l<<8|l>>>24)>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l],l^=f[a/n|0]<<24):n>6&&a%n==4&&(l=c[l>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l]),h[a]=o=(h[a-n]^l)>>>0);for(s=0;s<u;s++)a=u-s,l=3&s?h[a]:h[a-4],d[s]=s<4||a<=4?l:v[c[l>>>24]]^p[c[l>>>16&255]]^m[c[l>>>8&255]]^y[c[255&l]],d[s]=d[s]>>>0}},e.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},e.decrypt=function(t,e,r){for(var i,n,a,s,o,l,u,h,d,c,f,g,v,p,m=this.keySize+6,y=this.invKeySchedule,T=this.invSBox,b=this.invSubMix,E=b[0],S=b[1],L=b[2],A=b[3],R=this.uint8ArrayToUint32Array_(r),D=R[0],k=R[1],_=R[2],I=R[3],C=new Int32Array(t),w=new Int32Array(C.length),O=this.networkToHostOrderSwap;e<C.length;){for(d=O(C[e]),c=O(C[e+1]),f=O(C[e+2]),g=O(C[e+3]),o=d^y[0],l=g^y[1],u=f^y[2],h=c^y[3],v=4,p=1;p<m;p++)i=E[o>>>24]^S[l>>16&255]^L[u>>8&255]^A[255&h]^y[v],n=E[l>>>24]^S[u>>16&255]^L[h>>8&255]^A[255&o]^y[v+1],a=E[u>>>24]^S[h>>16&255]^L[o>>8&255]^A[255&l]^y[v+2],s=E[h>>>24]^S[o>>16&255]^L[l>>8&255]^A[255&u]^y[v+3],o=i,l=n,u=a,h=s,v+=4;i=T[o>>>24]<<24^T[l>>16&255]<<16^T[u>>8&255]<<8^T[255&h]^y[v],n=T[l>>>24]<<24^T[u>>16&255]<<16^T[h>>8&255]<<8^T[255&o]^y[v+1],a=T[u>>>24]<<24^T[h>>16&255]<<16^T[o>>8&255]<<8^T[255&l]^y[v+2],s=T[h>>>24]<<24^T[o>>16&255]<<16^T[l>>8&255]<<8^T[255&u]^y[v+3],w[e]=O(i^D),w[e+1]=O(s^k),w[e+2]=O(a^_),w[e+3]=O(n^I),D=d,k=c,_=f,I=g,e+=4}return w.buffer},t}(),o=r(1),l=r(6),u=function(){function t(t,e,r){var i=(void 0===r?{}:r).removePKCS7Padding,n=void 0===i||i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=t,this.config=e,this.removePKCS7Padding=n,n)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(t){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var e=t.prototype;return e.destroy=function(){this.observer=null},e.isSync=function(){return this.config.enableSoftwareAES},e.flush=function(){var t=this.currentResult;if(t){var e,r,i,n=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?(r=(e=n).byteLength,(i=r&&new DataView(e.buffer).getUint8(r-1))?Object(a.a)(e,0,r-i):e):n}this.reset()},e.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},e.decrypt=function(t,e,r,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),e,r);var n=this.flush();n&&i(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),e,r).then(i)},e.softwareDecrypt=function(t,e,r){var i=this.currentIV,n=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(t=Object(l.a)(o,t),this.remainderData=null);var u=this.getValidChunk(t);if(!u.length)return null;i&&(r=i);var h=this.softwareDecrypter;h||(h=this.softwareDecrypter=new s),h.expandKey(e);var d=n;return this.currentResult=h.decrypt(u.buffer,0,r),this.currentIV=Object(a.a)(u,-16).buffer,d||null},e.webCryptoDecrypt=function(t,e,r){var a=this,s=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new n(s,e)),this.fastAesKey.expandKey().then((function(e){return s?new i(s,r).decrypt(t.buffer,e):Promise.reject(new Error("web crypto not initialized"))})).catch((function(i){return a.onWebCryptoError(i,t,e,r)}))},e.onWebCryptoError=function(t,e,r,i){return o.b.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(e,r,i)},e.getValidChunk=function(t){var e=t,r=t.length-t.length%16;return r!==t.length&&(e=Object(a.a)(t,0,r),this.remainderData=Object(a.a)(t,r)),e},e.logOnce=function(t){this.logEnabled&&(o.b.log("[decrypter.ts]: "+t),this.logEnabled=!1)},t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return m})),r.d(e,"b",(function(){return y}));var i=r(3),n=function(){function t(){}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},t}(),a=Math.pow(2,32)-1,s=function(){function t(){}return t.init=function(){var e;for(e in t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:i};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,s,l,s,o),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))},t.box=function(t){for(var e=8,r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];for(var a=i.length,s=a;a--;)e+=i[a].byteLength;var o=new Uint8Array(e);for(o[0]=e>>24&255,o[1]=e>>16&255,o[2]=e>>8&255,o[3]=255&e,o.set(t,4),a=0,e=8;a<s;a++)o.set(i[a],e),e+=i[a].byteLength;return o},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,r){r*=e;var i=Math.floor(r/(a+1)),n=Math.floor(r%(a+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(a+1)),n=Math.floor(r%(a+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,s)},t.sdtp=function(e){var r,i,n=e.samples||[],a=new Uint8Array(4+n.length);for(r=0;r<n.length;r++)i=n[r].flags,a[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t.box(t.types.sdtp,a)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var r,i,n,a=[],s=[];for(r=0;r<e.sps.length;r++)n=(i=e.sps[r]).byteLength,a.push(n>>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(i));for(r=0;r<e.pps.length;r++)n=(i=e.pps[r]).byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(i));var o=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(s))),l=e.width,u=e.height,h=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,255&h,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,n=e.width,s=e.height,o=Math.floor(i/(a+1)),l=Math.floor(i%(a+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,s>>8&255,255&s,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),n=e.id,s=Math.floor(r/(a+1)),o=Math.floor(r%(a+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i,n,a,s,o,l,u=e.samples||[],h=u.length,d=12+16*h,c=new Uint8Array(d);for(r+=8+d,c.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,255&h,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i<h;i++)a=(n=u[i]).duration,s=n.size,o=n.flags,l=n.cts,c.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),i=new Uint8Array(t.FTYP.byteLength+r.byteLength);return i.set(t.FTYP),i.set(r,t.FTYP.byteLength),i},t}();s.types=void 0,s.HDLR_TYPES=void 0,s.STTS=void 0,s.STSC=void 0,s.STCO=void 0,s.STSZ=void 0,s.VMHD=void 0,s.SMHD=void 0,s.STSD=void 0,s.FTYP=void 0,s.DINF=void 0;var o=s,l=r(0),u=r(2),h=r(1),d=r(4),c=r(8);function f(){return(f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}var g=null,v=null,p=!1,m=function(){function t(t,e,r,i){if(void 0===i&&(i=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=r,this.ISGenerated=!1,null===g){var n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);g=n?parseInt(n[1]):0}if(null===v){var a=navigator.userAgent.match(/Safari\/(\d+)/i);v=a?parseInt(a[1]):0}p=!!g&&g<75||!!v&&v<600}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){h.b.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},e.resetNextTimestamp=function(){h.b.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},e.resetInitSegment=function(){h.b.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},e.getVideoStartPts=function(t){var e=!1,r=t.reduce((function(t,r){var i=r.pts-t;return i<-4294967296?(e=!0,y(t,r.pts)):i>0?t:r.pts}),t[0].pts);return e&&h.b.debug("PTS rollover detected"),r},e.remux=function(t,e,r,i,n,a,s,o){var l,u,c,f,g,v,p=n,m=n,T=t.pid>-1,b=e.pid>-1,E=e.samples.length,S=t.samples.length>0,L=E>1;if((!T||S)&&(!b||L)||this.ISGenerated||s){this.ISGenerated||(c=this.generateIS(t,e,n));var A=this.isVideoContiguous,R=-1;if(L&&(R=function(t){for(var e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!A&&this.config.forceKeyFrameOnDiscontinuity))if(v=!0,R>0){h.b.warn("[mp4-remuxer]: Dropped "+R+" out of "+E+" video samples due to a missing keyframe");var D=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(R),e.dropped+=R,m+=(e.samples[0].pts-D)/(e.timescale||9e4)}else-1===R&&(h.b.warn("[mp4-remuxer]: No keyframe found out of "+E+" video samples"),v=!1);if(this.ISGenerated){if(S&&L){var k=this.getVideoStartPts(e.samples),_=(y(t.samples[0].pts,k)-k)/e.inputTimeScale;p+=Math.max(0,_),m+=Math.max(0,-_)}if(S){if(t.samplerate||(h.b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(t,e,n)),u=this.remuxAudio(t,p,this.isAudioContiguous,a,b||L||o===d.b.AUDIO?m:void 0),L){var I=u?u.endPTS-u.startPTS:0;e.inputTimeScale||(h.b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(t,e,n)),l=this.remuxVideo(e,m,A,I)}}else L&&(l=this.remuxVideo(e,m,A,0));l&&(l.firstKeyFrame=R,l.independent=-1!==R)}}return this.ISGenerated&&(r.samples.length&&(g=this.remuxID3(r,n)),i.samples.length&&(f=this.remuxText(i,n))),{audio:u,video:l,initSegment:c,independent:v,text:f,id3:g}},e.generateIS=function(t,e,r){var n,a,s,l=t.samples,u=e.samples,h=this.typeSupported,d={},c=!Object(i.a)(this._initPTS),f="audio/mp4";if(c&&(n=a=1/0),t.config&&l.length&&(t.timescale=t.samplerate,t.isAAC||(h.mpeg?(f="audio/mpeg",t.codec=""):h.mp3&&(t.codec="mp3")),d.audio={id:"audio",container:f,codec:t.codec,initSegment:!t.isAAC&&h.mpeg?new Uint8Array(0):o.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(s=t.inputTimeScale,n=a=l[0].pts-Math.round(s*r))),e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:o.initSegment([e]),metadata:{width:e.width,height:e.height}},c)){s=e.inputTimeScale;var g=this.getVideoStartPts(u),v=Math.round(s*r);a=Math.min(a,y(u[0].dts,g)-v),n=Math.min(n,g-v)}if(Object.keys(d).length)return this.ISGenerated=!0,c&&(this._initPTS=n,this._initDTS=a),{tracks:d,initPTS:n,timescale:s}},e.remuxVideo=function(t,e,r,i){var n,a,s,d=t.inputTimeScale,v=t.samples,m=[],b=v.length,E=this._initPTS,S=this.nextAvcDts,L=8,A=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,D=0,k=!1;r&&null!==S||(S=e*d-(v[0].pts-y(v[0].dts,v[0].pts)));for(var _=0;_<b;_++){var I=v[_];if(I.pts=y(I.pts-E,S),I.dts=y(I.dts-E,S),I.dts>I.pts){D=Math.max(Math.min(D,I.pts-I.dts),-18e3)}I.dts<v[_>0?_-1:_].dts&&(k=!0)}k&&v.sort((function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||i})),a=v[0].dts,s=v[v.length-1].dts;var C=Math.round((s-a)/(b-1));if(D<0){if(D<-2*C){h.b.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.b)(-C,!0)+" ms");for(var w=D,O=0;O<b;O++)v[O].dts=w=Math.max(w,v[O].pts-C),v[O].pts=Math.max(w,v[O].pts)}else{h.b.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(c.b)(D,!0)+" ms to overcome this issue");for(var x=0;x<b;x++)v[x].dts=v[x].dts+D}a=v[0].dts}if(r){var P=a-S,M=P>C;if(M||P<-1){M?h.b.warn("AVC: "+Object(c.b)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):h.b.warn("AVC: "+Object(c.b)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),a=S;var F=v[0].pts-P;v[0].dts=a,v[0].pts=F,h.b.log("Video: First PTS/DTS adjusted: "+Object(c.b)(F,!0)+"/"+Object(c.b)(a,!0)+", delta: "+Object(c.b)(P,!0)+" ms")}}p&&(a=Math.max(0,a));for(var N=0,U=0,B=0;B<b;B++){for(var G=v[B],K=G.units,j=K.length,H=0,V=0;V<j;V++)H+=K[V].data.length;U+=H,N+=j,G.length=H,G.dts=Math.max(G.dts,a),G.pts=Math.max(G.pts,G.dts,0),A=Math.min(G.pts,A),R=Math.max(G.pts,R)}s=v[b-1].dts;var W,Y=U+4*N+8;try{W=new Uint8Array(Y)}catch(t){return void this.observer.emit(l.a.ERROR,l.a.ERROR,{type:u.b.MUX_ERROR,details:u.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:Y,reason:"fail allocating video mdat "+Y})}var q=new DataView(W.buffer);q.setUint32(0,Y),W.set(o.types.mdat,4);for(var X=0;X<b;X++){for(var z=v[X],Q=z.units,$=0,J=0,Z=Q.length;J<Z;J++){var tt=Q[J],et=tt.data,rt=tt.data.byteLength;q.setUint32(L,rt),L+=4,W.set(et,L),L+=rt,$+=4+rt}if(X<b-1)n=v[X+1].dts-z.dts;else{var it=this.config,nt=z.dts-v[X>0?X-1:X].dts;if(it.stretchShortVideoTrack&&null!==this.nextAudioPts){var at=Math.floor(it.maxBufferHole*d),st=(i?A+i*d:this.nextAudioPts)-z.pts;st>at?((n=st-nt)<0&&(n=nt),h.b.log("[mp4-remuxer]: It is approximately "+st/90+" ms to the next segment; using duration "+n/90+" ms for the last video frame.")):n=nt}else n=nt}var ot=Math.round(z.pts-z.dts);m.push(new T(z.key,n,$,ot))}if(m.length&&g&&g<70){var lt=m[0].flags;lt.dependsOn=2,lt.isNonSync=0}this.nextAvcDts=S=s+n,this.isVideoContiguous=!0;var ut={data1:o.moof(t.sequenceNumber++,a,f({},t,{samples:m})),data2:W,startPTS:A/d,endPTS:(R+n)/d,startDTS:a/d,endDTS:S/d,type:"video",hasAudio:!1,hasVideo:!0,nb:m.length,dropped:t.dropped};return t.samples=[],t.dropped=0,ut},e.remuxAudio=function(t,e,r,i,a){var s=t.inputTimeScale,d=s/(t.samplerate?t.samplerate:s),c=t.isAAC?1024:1152,g=c*d,v=this._initPTS,p=!t.isAAC&&this.typeSupported.mpeg,m=[],b=t.samples,E=p?0:8,S=this.nextAudioPts||-1,L=e*s;if(this.isAudioContiguous=r=r||b.length&&S>0&&(i&&Math.abs(L-S)<9e3||Math.abs(y(b[0].pts-v,L)-S)<20*g),b.forEach((function(t){t.pts=y(t.pts-v,L)})),!r||S<0){if(!(b=b.filter((function(t){return t.pts>=0}))).length)return;S=0===a?0:i?Math.max(0,L):b[0].pts}if(t.isAAC)for(var A=void 0!==a,R=this.config.maxAudioFramesDrift,D=0,k=S;D<b.length;D++){var _=b[D],I=_.pts,C=I-k,w=Math.abs(1e3*C/s);if(C<=-R*g&&A)0===D&&(h.b.warn("Audio frame @ "+(I/s).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*C/s)+" ms."),this.nextAudioPts=S=k=I);else if(C>=R*g&&w<1e4&&A){var O=Math.round(C/g);(k=I-O*g)<0&&(O--,k+=g),0===D&&(this.nextAudioPts=S=k),h.b.warn("[mp4-remuxer]: Injecting "+O+" audio frame @ "+(k/s).toFixed(3)+"s due to "+Math.round(1e3*C/s)+" ms gap.");for(var x=0;x<O;x++){var P=Math.max(k,0),M=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);M||(h.b.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),M=_.unit.subarray()),b.splice(D,0,{unit:M,pts:P}),k+=g,D++}}_.pts=k,k+=g}for(var F,N=null,U=null,B=0,G=b.length;G--;)B+=b[G].unit.byteLength;for(var K=0,j=b.length;K<j;K++){var H=b[K],V=H.unit,W=H.pts;if(null!==U){m[K-1].duration=Math.round((W-U)/d)}else{if(r&&t.isAAC&&(W=S),N=W,!(B>0))return;B+=E;try{F=new Uint8Array(B)}catch(t){return void this.observer.emit(l.a.ERROR,l.a.ERROR,{type:u.b.MUX_ERROR,details:u.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}p||(new DataView(F.buffer).setUint32(0,B),F.set(o.types.mdat,4))}F.set(V,E);var Y=V.byteLength;E+=Y,m.push(new T(!0,c,Y,0)),U=W}var q=m.length;if(q){var X=m[m.length-1];this.nextAudioPts=S=U+d*X.duration;var z=p?new Uint8Array(0):o.moof(t.sequenceNumber++,N/d,f({},t,{samples:m}));t.samples=[];var Q=N/s,$=S/s,J={data1:z,data2:F,startPTS:Q,endPTS:$,startDTS:Q,endDTS:$,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,J}},e.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,s=a/(t.samplerate?t.samplerate:a),o=this.nextAudioPts,l=(null!==o?o:i.startDTS*a)+this._initDTS,u=i.endDTS*a+this._initDTS,d=1024*s,c=Math.ceil((u-l)/d),f=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(h.b.warn("[mp4-remuxer]: remux empty Audio"),f){for(var g=[],v=0;v<c;v++){var p=l+v*d;g.push({unit:f,pts:p,dts:p})}return t.samples=g,this.remuxAudio(t,e,r,!1)}h.b.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},e.remuxID3=function(t,e){var r=t.samples.length;if(r){for(var i=t.inputTimeScale,n=this._initPTS,a=this._initDTS,s=0;s<r;s++){var o=t.samples[s];o.pts=y(o.pts-n,e*i)/i,o.dts=y(o.dts-a,e*i)/i}var l=t.samples;return t.samples=[],{samples:l}}},e.remuxText=function(t,e){var r=t.samples.length;if(r){for(var i=t.inputTimeScale,n=this._initPTS,a=0;a<r;a++){var s=t.samples[a];s.pts=y(s.pts-n,e*i)/i}t.samples.sort((function(t,e){return t.pts-e.pts}));var o=t.samples;return t.samples=[],{samples:o}}},t}();function y(t,e){var r;if(null===e)return t;for(r=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=r;return t}var T=function(t,e,r,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=r,this.cts=i,this.flags=new b(t)},b=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var i=r(11);function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=function(){function t(t,e){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=e?Object(i.buildAbsoluteURL)(t,e,{alwaysNormalize:!0}):t}var e,r,a;return t.fromURL=function(e,r){return new t(e,r)},t.fromURI=function(e){return new t(e)},e=t,(r=[{key:"uri",get:function(){return this._uri}}])&&n(e.prototype,r),a&&n(e,a),t}()},function(t,e,r){function i(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r.oe=function(t){throw console.error(t),t};var i=r(r.s=ENTRY_MODULE);return i.default||i}function n(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t,e,i){var a={};a[i]=[];var s=e.toString(),o=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return a;for(var l,u=o[1],h=new RegExp("(\\\\n|\\W)"+n(u)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=h.exec(s);)"dll-reference"!==l[3]&&a[i].push(l[3]);for(h=new RegExp("\\("+n(u)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=h.exec(s);)t[l[2]]||(a[i].push(l[1]),t[l[2]]=r(l[1]).m),a[l[2]]=a[l[2]]||[],a[l[2]].push(l[4]);for(var d,c=Object.keys(a),f=0;f<c.length;f++)for(var g=0;g<a[c[f]].length;g++)d=a[c[f]][g],isNaN(1*d)||(a[c[f]][g]=1*a[c[f]][g]);return a}function s(t){return Object.keys(t).reduce((function(e,r){return e||t[r].length>0}),!1)}t.exports=function(t,e){e=e||{};var n={main:r.m},o=e.all?{main:Object.keys(n.main)}:function(t,e){for(var r={main:[e]},i={main:[]},n={main:{}};s(r);)for(var o=Object.keys(r),l=0;l<o.length;l++){var u=o[l],h=r[u].pop();if(n[u]=n[u]||{},!n[u][h]&&t[u][h]){n[u][h]=!0,i[u]=i[u]||[],i[u].push(h);for(var d=a(t,t[u][h],u),c=Object.keys(d),f=0;f<c.length;f++)r[c[f]]=r[c[f]]||[],r[c[f]]=r[c[f]].concat(d[c[f]])}}return i}(n,t),l="";Object.keys(o).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;o[t][e];)e++;o[t].push(e),n[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+t+" = ("+i.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+o[t].map((function(e){return JSON.stringify(e)+": "+n[t][e].toString()})).join(",")+"});\n"})),l=l+"new (("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+o.main.map((function(t){return JSON.stringify(t)+": "+n.main[t].toString()})).join(",")+"}))(self);";var u=new window.Blob([l],{type:"text/javascript"});if(e.bare)return u;var h=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(u),d=new window.Worker(h);return d.objectURL=h,d}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return o}));var i=r(10),n=r(0),a=r(1),s=r(14);function o(t){var e=new s.EventEmitter,r=function(e,r){t.postMessage({event:e,data:r})};e.on(n.a.FRAG_DECRYPTED,r),e.on(n.a.ERROR,r),t.addEventListener("message",(function(n){var s=n.data;switch(s.cmd){case"init":var o=JSON.parse(s.config);t.transmuxer=new i.c(e,s.typeSupported,o,s.vendor,s.id),Object(a.a)(o.debug),r("init",null);break;case"configure":t.transmuxer.configure(s.config);break;case"demux":var u=t.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(i.d)(u)?u.then((function(e){l(t,e)})):l(t,u);break;case"flush":var d=s.chunkMeta,c=t.transmuxer.flush(d);Object(i.d)(c)?c.then((function(e){h(t,e,d)})):h(t,c,d)}}))}function l(t,e){if((r=e.remuxResult).audio||r.video||r.text||r.id3||r.initSegment){var r,i=[],n=e.remuxResult,a=n.audio,s=n.video;a&&u(i,a),s&&u(i,s),t.postMessage({event:"transmuxComplete",data:e},i)}}function u(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function h(t,e,r){e.forEach((function(e){l(t,e)})),t.postMessage({event:"flush",data:r})}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return ri}));var i=r(11),n=r(3),a=r(0),s=r(2),o=r(1),l=r(6),u=r(5);function h(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var d=function(){function t(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=t}var e,r,i;return t.prototype.reloaded=function(t){if(!t)return this.advanced=!0,void(this.updated=!0);var e=this.lastPartSn-t.lastPartSn,r=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!r||!!e,this.advanced=this.endSN>t.endSN||e>0||0===e&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(n.a)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&h(e.prototype,r),i&&h(e,i),t}(),c=r(17),f=/^(\d+)x(\d+)$/,g=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,v=function(){function t(e){for(var r in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(r)&&(this[r]=e[r])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),i=0;i<e.length/2;i++)r[i]=parseInt(e.slice(2*i,2*i+2),16);return r}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var r=this[t];return r?parseFloat(r):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=f.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,r={};for(g.lastIndex=0;null!==(e=g.exec(t));){var i=e[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[e[1]]=i}return r},t}(),p={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function m(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}var y=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,T=/#EXT-X-MEDIA:(.*)/g,b=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),E=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),S=/\.(mp4|m4s|m4v|m4a)$/i;var L=function(){function t(){}return t.findGroup=function(t,e){for(var r=0;r<t.length;r++){var i=t[r];if(i.id===e)return i}},t.convertAVC1ToAVCOTI=function(t){var e=t.split(".");if(e.length>2){var r=e.shift()+".";return r+=parseInt(e.shift()).toString(16),r+=("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.resolve=function(t,e){return i.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var i,n=[],a={},s=!1;for(y.lastIndex=0;null!=(i=y.exec(e));)if(i[1]){var o=new v(i[1]),l={attrs:o,bitrate:o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),name:o.NAME,url:t.resolve(i[2],r)},u=o.decimalResolution("RESOLUTION");u&&(l.width=u.width,l.height=u.height),A((o.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=t.convertAVC1ToAVCOTI(l.videoCodec)),n.push(l)}else if(i[3]){var h=new v(i[3]);h["DATA-ID"]&&(s=!0,a[h["DATA-ID"]]=h)}return{levels:n,sessionData:s?a:null}},t.parseMasterPlaylistMedia=function(e,r,i,n){var a;void 0===n&&(n=[]);var s=[],o=0;for(T.lastIndex=0;null!==(a=T.exec(e));){var l=new v(a[1]);if(l.TYPE===i){var u={attrs:l,bitrate:0,id:o++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:i,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,r):""};if(n.length){var h=t.findGroup(n,u.groupId)||n[0];R(u,h,"audioCodec"),R(u,h,"textCodec")}s.push(u)}}return s},t.parseLevelPlaylist=function(t,e,r,a,s){var l,h,f,g=new d(e),p=g.fragments,m=null,y=0,T=0,L=0,A=0,R=null,k=new u.b(a,e),_=-1,I=!1;for(b.lastIndex=0,g.m3u8=t;null!==(l=b.exec(t));){I&&(I=!1,(k=new u.b(a,e)).start=L,k.sn=y,k.cc=A,k.level=r,m&&(k.initSegment=m,k.rawProgramDateTime=m.rawProgramDateTime));var C=l[1];if(C){k.duration=parseFloat(C);var w=(" "+l[2]).slice(1);k.title=w||null,k.tagList.push(w?["INF",C,w]:["INF",C])}else if(l[3])Object(n.a)(k.duration)&&(k.start=L,f&&(k.levelkey=f),k.sn=y,k.level=r,k.cc=A,k.urlId=s,p.push(k),k.relurl=(" "+l[3]).slice(1),D(k,R),R=k,L+=k.duration,y++,T=0,I=!0);else if(l[4]){var O=(" "+l[4]).slice(1);R?k.setByteRange(O,R):k.setByteRange(O)}else if(l[5])k.rawProgramDateTime=(" "+l[5]).slice(1),k.tagList.push(["PROGRAM-DATE-TIME",k.rawProgramDateTime]),-1===_&&(_=p.length);else{if(!(l=l[0].match(E))){o.b.warn("No matches on slow regex match for level playlist!");continue}for(h=1;h<l.length&&void 0===l[h];h++);var x=(" "+l[h]).slice(1),P=(" "+l[h+1]).slice(1),M=l[h+2]?(" "+l[h+2]).slice(1):"";switch(x){case"PLAYLIST-TYPE":g.type=P.toUpperCase();break;case"MEDIA-SEQUENCE":y=g.startSN=parseInt(P);break;case"SKIP":var F=new v(P),N=F.decimalInteger("SKIPPED-SEGMENTS");if(Object(n.a)(N)){g.skippedSegments=N;for(var U=N;U--;)p.unshift(null);y+=N}var B=F.enumeratedString("RECENTLY-REMOVED-DATERANGES");B&&(g.recentlyRemovedDateranges=B.split("\t"));break;case"TARGETDURATION":g.targetduration=parseFloat(P);break;case"VERSION":g.version=parseInt(P);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(P||M)&&k.tagList.push(M?[P,M]:[P]);break;case"DIS":A++;case"GAP":k.tagList.push([x]);break;case"BITRATE":k.tagList.push([x,P]);break;case"DISCONTINUITY-SEQ":A=parseInt(P);break;case"KEY":var G,K=new v(P),j=K.enumeratedString("METHOD"),H=K.URI,V=K.hexadecimalInteger("IV"),W=K.enumeratedString("KEYFORMATVERSIONS"),Y=K.enumeratedString("KEYID"),q=null!=(G=K.enumeratedString("KEYFORMAT"))?G:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(q)>-1){o.b.warn("Keyformat "+q+" is not supported from the manifest");continue}if("identity"!==q)continue;j&&(f=c.a.fromURL(e,H),H&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(j)>=0&&(f.method=j,f.keyFormat=q,Y&&(f.keyID=Y),W&&(f.keyFormatVersions=W),f.iv=V));break;case"START":var X=new v(P).decimalFloatingPoint("TIME-OFFSET");Object(n.a)(X)&&(g.startTimeOffset=X);break;case"MAP":var z=new v(P);k.relurl=z.URI,z.BYTERANGE&&k.setByteRange(z.BYTERANGE),k.level=r,k.sn="initSegment",f&&(k.levelkey=f),k.initSegment=null,m=k,I=!0;break;case"SERVER-CONTROL":var Q=new v(P);g.canBlockReload=Q.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Q.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Q.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Q.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Q.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var $=new v(P);g.partTarget=$.decimalFloatingPoint("PART-TARGET");break;case"PART":var J=g.partList;J||(J=g.partList=[]);var Z=T>0?J[J.length-1]:void 0,tt=T++,et=new u.c(new v(P),k,e,tt,Z);J.push(et),k.duration+=et.duration;break;case"PRELOAD-HINT":var rt=new v(P);g.preloadHint=rt;break;case"RENDITION-REPORT":var it=new v(P);g.renditionReports=g.renditionReports||[],g.renditionReports.push(it);break;default:o.b.warn("line parsed but not handled: "+l)}}}R&&!R.relurl?(p.pop(),L-=R.duration,g.partList&&(g.fragmentHint=R)):g.partList&&(D(k,R),k.cc=A,g.fragmentHint=k);var nt=p.length,at=p[0],st=p[nt-1];if((L+=g.skippedSegments*g.targetduration)>0&&nt&&st){g.averagetargetduration=L/nt;var ot=st.sn;g.endSN="initSegment"!==ot?ot:0,at&&(g.startCC=at.cc,at.initSegment||g.fragments.every((function(t){return t.relurl&&(e=t.relurl,S.test(null!=(r=null===(n=i.parseURL(e))||void 0===n?void 0:n.path)?r:""));var e,r,n}))&&(o.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(k=new u.b(a,e)).relurl=st.relurl,k.level=r,k.sn="initSegment",at.initSegment=k,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(L+=g.fragmentHint.duration),g.totalduration=L,g.endCC=A,_>0&&function(t,e){for(var r=t[e],i=e;i--;){var n=t[i];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(p,_),g},t}();function A(t,e){["video","audio","text"].forEach((function(r){var i=t.filter((function(t){return function(t,e){var r=p[e];return!!r&&!0===r[t.slice(0,4)]}(t,r)}));if(i.length){var n=i.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[r+"Codec"]=n.length>0?n[0]:i[0],t=t.filter((function(t){return-1===i.indexOf(t)}))}})),e.unknownCodecs=t}function R(t,e,r){var i=e[r];i&&(t[r]=i)}function D(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(n.a)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}var k=r(4);function _(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf("data:")||(r=e.url),r}var I=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(a.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(a.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(a.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(a.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,i=e.loader,n=new(r||i)(e);return t.loader=n,this.loaders[t.type]=n,n},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var r=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:k.a.MANIFEST,url:r,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var r=e.id,i=e.level,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:null,level:i,responseType:"text",type:k.a.LEVEL,url:n,deliveryDirectives:a})},e.onAudioTrackLoading=function(t,e){var r=e.id,i=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:k.a.AUDIO_TRACK,url:n,deliveryDirectives:a})},e.onSubtitleTrackLoading=function(t,e){var r=e.id,i=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:k.a.SUBTITLE_TRACK,url:n,deliveryDirectives:a})},e.load=function(t){var e,r,i,n,a,s,l=this.hls.config,u=this.getInternalLoader(t);if(u){var h=u.context;if(h&&h.url===t.url)return void o.b.trace("[playlist-loader]: playlist request ongoing");o.b.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case k.a.MANIFEST:r=l.manifestLoadingMaxRetry,i=l.manifestLoadingTimeOut,n=l.manifestLoadingRetryDelay,a=l.manifestLoadingMaxRetryTimeout;break;case k.a.LEVEL:case k.a.AUDIO_TRACK:case k.a.SUBTITLE_TRACK:r=0,i=l.levelLoadingTimeOut;break;default:r=l.levelLoadingMaxRetry,i=l.levelLoadingTimeOut,n=l.levelLoadingRetryDelay,a=l.levelLoadingMaxRetryTimeout}if((u=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part)&&(t.type===k.a.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===k.a.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===k.a.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var d=s.partTarget,c=s.targetduration;d&&c&&(i=Math.min(1e3*Math.max(3*d,.8*c),i))}var f={timeout:i,maxRetry:r,retryDelay:n,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,f,g)},e.loadsuccess=function(t,e,r,i){if(void 0===i&&(i=null),r.isSidxRequest)return this.handleSidxRequest(t,r),void this.handlePlaylistLoaded(t,e,r,i);this.resetInternalLoader(r.type);var n=t.data;0===n.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,r,i):this.handleMasterPlaylist(t,e,r,i)):this.handleManifestParsingError(t,r,"no EXTM3U delimiter",i)},e.loaderror=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!1,t)},e.loadtimeout=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!0)},e.handleMasterPlaylist=function(t,e,r,i){var n=this.hls,s=t.data,l=_(t,r),u=L.parseMasterPlaylist(s,l),h=u.levels,d=u.sessionData;if(h.length){var c=h.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),f=h.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),g=L.parseMasterPlaylistMedia(s,l,"AUDIO",c),p=L.parseMasterPlaylistMedia(s,l,"SUBTITLES",f),m=L.parseMasterPlaylistMedia(s,l,"CLOSED-CAPTIONS");if(g.length)g.some((function(t){return!t.url}))||!h[0].audioCodec||h[0].attrs.AUDIO||(o.b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v({}),bitrate:0,url:""}));n.trigger(a.a.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:p,captions:m,url:l,stats:e,networkDetails:i,sessionData:d})}else this.handleManifestParsingError(t,r,"no level found in manifest",i)},e.handleTrackOrLevelPlaylist=function(t,e,r,i){var o=this.hls,l=r.id,u=r.level,h=r.type,d=_(t,r),c=Object(n.a)(l)?l:0,f=Object(n.a)(u)?u:c,g=function(t){switch(t.type){case k.a.AUDIO_TRACK:return k.b.AUDIO;case k.a.SUBTITLE_TRACK:return k.b.SUBTITLE;default:return k.b.MAIN}}(r),p=L.parseLevelPlaylist(t.data,d,f,g,c);if(p.fragments.length){if(h===k.a.MANIFEST){var m={attrs:new v({}),bitrate:0,details:p,name:"",url:d};o.trigger(a.a.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:d,stats:e,networkDetails:i,sessionData:null})}if(e.parsing.end=performance.now(),p.needSidxRanges){var y,T=null===(y=p.fragments[0].initSegment)||void 0===y?void 0:y.url;this.load({url:T,isSidxRequest:!0,type:h,level:u,levelDetails:p,id:l,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else r.levelDetails=p,this.handlePlaylistLoaded(t,e,r,i)}else o.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},e.handleSidxRequest=function(t,e){var r=Object(l.g)(new Uint8Array(t.data));if(r){var i=r.references,n=e.levelDetails;i.forEach((function(t,e){var i=t.info,a=n.fragments[e];0===a.byteRange.length&&a.setByteRange(String(1+i.end-i.start)+"@"+String(i.start)),a.initSegment&&a.initSegment.setByteRange(String(r.moovEndOffset)+"@0")}))}},e.handleManifestParsingError=function(t,e,r,i){this.hls.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.MANIFEST_PARSING_ERROR,fatal:e.type===k.a.MANIFEST,url:t.url,reason:r,response:t,context:e,networkDetails:i})},e.handleNetworkError=function(t,e,r,i){void 0===r&&(r=!1),o.b.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var n=s.a.UNKNOWN,l=!1,u=this.getInternalLoader(t);switch(t.type){case k.a.MANIFEST:n=r?s.a.MANIFEST_LOAD_TIMEOUT:s.a.MANIFEST_LOAD_ERROR,l=!0;break;case k.a.LEVEL:n=r?s.a.LEVEL_LOAD_TIMEOUT:s.a.LEVEL_LOAD_ERROR,l=!1;break;case k.a.AUDIO_TRACK:n=r?s.a.AUDIO_TRACK_LOAD_TIMEOUT:s.a.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case k.a.SUBTITLE_TRACK:n=r?s.a.SUBTITLE_TRACK_LOAD_TIMEOUT:s.a.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(t.type);var h={type:s.b.NETWORK_ERROR,details:n,fatal:l,url:t.url,loader:u,context:t,networkDetails:e};i&&(h.response=i),this.hls.trigger(a.a.ERROR,h)},e.handlePlaylistLoaded=function(t,e,r,i){var n=r.type,s=r.level,o=r.id,l=r.groupId,u=r.loader,h=r.levelDetails,d=r.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),n){case k.a.MANIFEST:case k.a.LEVEL:this.hls.trigger(a.a.LEVEL_LOADED,{details:h,level:s||0,id:o||0,stats:e,networkDetails:i,deliveryDirectives:d});break;case k.a.AUDIO_TRACK:this.hls.trigger(a.a.AUDIO_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:d});break;case k.a.SUBTITLE_TRACK:this.hls.trigger(a.a.SUBTITLE_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:d})}}else this.handleManifestParsingError(t,r,"invalid target duration",i)},t}(),C=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(a.a.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(a.a.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var r=e.frag,i=r.type,n=this.loaders[i];if(r.decryptdata){var s=r.decryptdata.uri;if(s!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(n&&(o.b.warn("abort previous key loader for type:"+i),n.abort()),!s)return void o.b.warn("key uri is falsy");var u=l.loader,h=r.loader=this.loaders[i]=new u(l);this.decrypturl=s,this.decryptkey=null;var d={url:s,frag:r,responseType:"arraybuffer"},c={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};h.load(d,c,f)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(a.a.KEY_LOADED,{frag:r}))}else o.b.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,r){var i=r.frag;i.decryptdata?(this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(a.a.KEY_LOADED,{frag:i})):o.b.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),delete this.loaders[r.type],this.hls.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.loadtimeout=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),delete this.loaders[r.type],this.hls.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},t}();function w(t,e){var r;try{r=new Event("addtrack")}catch(t){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function O(t,e){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(r){o.b.debug("[texttrack-utils]: "+r);var i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}"disabled"===r&&(t.mode=r)}function x(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var r=t.cues.length;r--;)t.removeCue(t.cues[r]);"disabled"===e&&(t.mode=e)}function P(t,e,r){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var n=function(t,e,r){var i=[],n=function(t,e){if(e<t[0].startTime)return 0;var r=t.length-1;if(e>t[r].endTime)return-1;var i=0,n=r;for(;i<=n;){var a=Math.floor((n+i)/2);if(e<t[a].startTime)n=a-1;else{if(!(e>t[a].startTime&&i<r))return a;i=a+1}}return t[i].startTime-e<e-t[n].startTime?i:n}(t,e);if(n>-1)for(var a=n,s=t.length;a<s;a++){var o=t[a];if(o.startTime>=e&&o.endTime<=r)i.push(o);else if(o.startTime>r)return i}return i}(t.cues,e,r),a=0;a<n.length;a++)t.removeCue(n[a]);"disabled"===i&&(t.mode=i)}var M=r(7),F=function(){function t(t){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e.destroy=function(){this._unregisterListeners()},e._registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},e._unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},e.onMediaAttached=function(t,e){this.media=e.media},e.onMediaDetaching=function(){this.id3Track&&(x(this.id3Track),this.id3Track=null,this.media=null)},e.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var r=t[e];if("metadata"===r.kind&&"id3"===r.label)return w(r,this.media),r}return this.media.addTextTrack("metadata","id3")}},e.onFragParsingMetadata=function(t,e){if(this.media){var r=e.frag,i=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<i.length;a++){var s=M.c(i[a].data);if(s){var o=i[a].pts,l=a<i.length-1?i[a+1].pts:r.end;l-o<=0&&(l=o+.25);for(var u=0;u<s.length;u++){var h=s[u];if(!M.e(h)){var d=new n(o,l,"");d.value=h,this.id3Track.addCue(d)}}}}}},e.onBufferFlushing=function(t,e){var r=e.startOffset,i=e.endOffset,n=e.type;if(!n||"audio"===n){var a=this.id3Track;a&&P(a,r,i)}},t}();function N(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var U,B=function(){function t(t){var e=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var e,r,i,n=t.prototype;return n.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},n.registerListeners=function(){this.hls.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(a.a.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(a.a.ERROR,this.onError,this)},n.unregisterListeners=function(){this.hls.off(a.a.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(a.a.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(a.a.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(a.a.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(a.a.ERROR,this.onError)},n.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},n.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},n.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},n.onLevelUpdated=function(t,e){var r=e.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},n.onError=function(t,e){e.details===s.a.BUFFER_STALLED_ERROR&&(this.stallCount++,o.b.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},n.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var r=this.computeLatency();if(null!==r){this._latency=r;var i=this.config,n=i.lowLatencyMode,a=i.maxLiveSyncPlaybackRate;if(n&&1!==a){var s=this.targetLatency;if(null!==s){var o=r-s,l=o<Math.min(this.maxLatency,s+e.targetduration);if(e.live&&l&&o>.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,a)),h=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;t.playbackRate=Math.min(u,Math.max(1,h))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},n.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},n.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,r=t.partHoldBack,i=t.targetduration,n=this.config,a=n.liveSyncDuration,s=n.liveSyncDurationCount,o=n.lowLatencyMode,l=this.hls.userConfig,u=o&&r||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==a?a:s*i);var h=i;return u+Math.min(1*this.stallCount,h)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,r=this.levelDetails;if(null===t||null===e||null===r)return null;var i=r.edge,n=t-e-this.edgeStalled,a=i-r.totalduration,s=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,n),s)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var r=t.buffered.length;return r?t.buffered.end(r-1):e.edge-this.currentTime}}])&&N(e.prototype,r),i&&N(e,i),t}();function G(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}!function(t){t.No="",t.Yes="YES",t.v2="v2"}(U||(U={}));var K=function(){function t(t,e,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=r}return t.prototype.addDirectives=function(t){var e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.toString()},t}(),j=function(){function t(t){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(t){return t})).join(",").replace(/\.[^.,]+/g,"")}var e,r,i;return e=t,(r=[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(t){var e=t%this.url.length;this._urlId!==e&&(this.details=void 0,this._urlId=e)}}])&&G(e.prototype,r),i&&G(e,i),t}();function H(t,e,r){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(r);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(r)}}function V(t){var e={};t.forEach((function(t){var r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++}))}function W(t,e){var r=e.startPTS;if(Object(n.a)(r)){var i,a=0;e.sn>t.sn?(a=r-t.start,i=t):(a=t.start-r,i=e),i.duration!==a&&(i.duration=a)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration}else e.start=Math.max(t.start-e.duration,0)}function Y(t,e,r,i,a,s){i-r<=0&&(o.b.warn("Fragment should have a positive duration",e),i=r+e.duration,s=a+e.duration);var l=r,u=i,h=e.startPTS,d=e.endPTS;if(Object(n.a)(h)){var c=Math.abs(h-r);Object(n.a)(e.deltaPTS)?e.deltaPTS=Math.max(c,e.deltaPTS):e.deltaPTS=c,l=Math.max(r,h),r=Math.min(r,h),a=Math.min(a,e.startDTS),u=Math.min(i,d),i=Math.max(i,d),s=Math.max(s,e.endDTS)}e.duration=i-r;var f=r-e.start;e.appendedPTS=i,e.start=e.startPTS=r,e.maxStartPTS=l,e.startDTS=a,e.endPTS=i,e.minEndPTS=u,e.endDTS=s;var g,v=e.sn;if(!t||v<t.startSN||v>t.endSN)return 0;var p=v-t.startSN,m=t.fragments;for(m[p]=e,g=p;g>0;g--)W(m[g],m[g-1]);for(g=p;g<m.length-1;g++)W(m[g],m[g+1]);return t.fragmentHint&&W(m[m.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,f}function q(t,e){for(var r=null,i=t.fragments,a=i.length-1;a>=0;a--){var s=i[a].initSegment;if(s){r=s;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var l,u=0;(function(t,e,r){for(var i=e.skippedSegments,n=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(i?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=n;u<=a;u++){var h=l[s+u],d=o[u];i&&!d&&u<i&&(d=e.fragments[u]=h),h&&d&&r(h,d)}}(t,e,(function(t,i){t.relurl&&(u=t.cc-i.cc),Object(n.a)(t.startPTS)&&Object(n.a)(t.endPTS)&&(i.start=i.startPTS=t.startPTS,i.startDTS=t.startDTS,i.appendedPTS=t.appendedPTS,i.maxStartPTS=t.maxStartPTS,i.endPTS=t.endPTS,i.endDTS=t.endDTS,i.minEndPTS=t.minEndPTS,i.duration=t.endPTS-t.startPTS,i.duration&&(l=i),e.PTSKnown=e.alignedSliding=!0),i.elementaryStreams=t.elementaryStreams,i.loader=t.loader,i.stats=t.stats,i.urlId=t.urlId,t.initSegment&&(i.initSegment=t.initSegment,r=t.initSegment)})),r)&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach((function(t){var e;t.initSegment&&t.initSegment.relurl!==(null===(e=r)||void 0===e?void 0:e.relurl)||(t.initSegment=r)}));if(e.skippedSegments&&(e.deltaUpdateFailed=e.fragments.some((function(t){return!t})),e.deltaUpdateFailed)){o.b.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=e.skippedSegments;h--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}var d=e.fragments;if(u){o.b.warn("discontinuity sliding from playlist, take drift into account");for(var c=0;c<d.length;c++)d[c].cc+=u}e.skippedSegments&&(e.startCC=e.fragments[0].cc),function(t,e,r){if(t&&e)for(var i=0,n=0,a=t.length;n<=a;n++){var s=t[n],o=e[n+i];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?r(s,o):i--}}(t.partList,e.partList,(function(t,e){e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),l?Y(e,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):X(t,e),d.length&&(e.totalduration=e.edge-d[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;var f=e.advancedDateTime;if(e.advanced&&f){var g=e.edge;e.driftStart||(e.driftStartTime=f,e.driftStart=g),e.driftEndTime=f,e.driftEnd=g}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function X(t,e){var r=e.startSN+e.skippedSegments-t.startSN,i=t.fragments;r<0||r>=i.length||z(e,i[r].start)}function z(t,e){if(e){for(var r=t.fragments,i=t.skippedSegments;i<r.length;i++)r[i].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}var Q=function(){function t(t,e){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=o.b.log.bind(o.b,e+":"),this.warn=o.b.warn.bind(o.b,e+":"),this.hls=t}var e=t.prototype;return e.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},e.onError=function(t,e){e.fatal&&e.type===s.b.NETWORK_ERROR&&this.clearTimer()},e.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},e.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},e.stopLoad=function(){this.canLoad=!1,this.clearTimer()},e.switchParams=function(t,e){var r=null==e?void 0:e.renditionReports;if(r)for(var i=0;i<r.length;i++){var a=r[i],s=""+a.URI;if(s===t.substr(-s.length)){var o=parseInt(a["LAST-MSN"]),l=parseInt(a["LAST-PART"]);if(e&&this.hls.config.lowLatencyMode){var u=Math.min(e.age-e.partTarget,e.targetduration);void 0!==l&&u>e.partTarget&&(l+=1)}if(Object(n.a)(o))return new K(o,Object(n.a)(l)?l:void 0,U.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,r){var i=this,n=e.details,a=e.stats,s=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(n.advancedDateTime=Date.now()-s,n.live||null!=r&&r.live){if(n.reloaded(r),r&&this.log("live playlist "+t+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),r&&n.fragments.length>0&&q(r,n),!this.canLoad||!n.live)return;var o,l=void 0,u=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var h=this.hls.config.lowLatencyMode,d=n.lastPartSn,c=n.endSN,f=n.lastPartIndex,g=d===c;-1!==f?(l=g?c+1:d,u=g?h?0:f:f+1):l=c+1;var v=n.age,p=v+n.ageHeader,m=Math.min(p-n.partTarget,1.5*n.targetduration);if(m>0){if(r&&m>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+m+" with playlist age: "+n.age),m=0;else{var y=Math.floor(m/n.targetduration);if(l+=y,void 0!==u)u+=Math.round(m%n.targetduration/n.partTarget);this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+m+" skip sn "+y+" to part "+u)}n.tuneInGoal=m}if(o=this.getDeliveryDirectives(n,e.deliveryDirectives,l,u),h||!g)return void this.loadPlaylist(o)}else o=this.getDeliveryDirectives(n,e.deliveryDirectives,l,u);var T=function(t,e){var r,i=1e3*t.levelTargetDuration,n=i/2,a=t.age,s=a>0&&a<3*i,o=e.loading.end-e.loading.start,l=t.availabilityDelay;if(!1===t.updated)if(s){var u=333*t.misses;r=Math.max(Math.min(n,2*o),u),t.availabilityDelay=(t.availabilityDelay||0)+r}else r=n;else s?(l=Math.min(l||i/2,a),t.availabilityDelay=l,r=l+i-a):r=i-o;return Math.round(r)}(n,a);void 0!==l&&n.canBlockReload&&(T-=n.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout((function(){return i.loadPlaylist(o)}),T)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,r,i){var n=function(t,e){var r=t.canSkipUntil,i=t.canSkipDateRanges,n=t.endSN;return r&&(void 0!==e?e-n:0)<r?i?U.v2:U.Yes:U.No}(t,r);return null!=e&&e.skip&&t.deltaUpdateFailed&&(r=e.msn,i=e.part,n=U.No),new K(r,i,n)},e.retryLoadingOrFail=function(t){var e,r=this,i=this.hls.config,n=this.retryCount<i.levelLoadingMaxRetry;if(n)if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return n},t}();function $(){return($=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}function J(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Z(t,e){return(Z=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var tt,et=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),rt=function(t){var e,r;function i(e){var r;return(r=t.call(this,e,"[level-controller]")||this)._levels=[],r._firstLevel=-1,r._startLevel=void 0,r.currentLevelIndex=-1,r.manualLevelIndex=-1,r.onParsedComplete=void 0,r._registerListeners(),r}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,Z(e,r);var n,o,l,u=i.prototype;return u._registerListeners=function(){var t=this.hls;t.on(a.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(a.a.FRAG_LOADED,this.onFragLoaded,this),t.on(a.a.ERROR,this.onError,this)},u._unregisterListeners=function(){var t=this.hls;t.off(a.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(a.a.FRAG_LOADED,this.onFragLoaded,this),t.off(a.a.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},u.startLoad=function(){this._levels.forEach((function(t){t.loadError=0})),t.prototype.startLoad.call(this)},u.onManifestLoaded=function(t,e){var r,i,n=[],o=[],l=[],u={},h=!1,d=!1,c=!1;if(e.levels.forEach((function(t){var e=t.attrs;h=h||!(!t.width||!t.height),d=d||!!t.videoCodec,c=c||!!t.audioCodec,et&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0);var r=t.bitrate+"-"+t.attrs.RESOLUTION+"-"+t.attrs.CODECS;(i=u[r])?i.url.push(t.url):(i=new j(t),u[r]=i,n.push(i)),e&&(e.AUDIO&&H(i,"audio",e.AUDIO),e.SUBTITLES&&H(i,"text",e.SUBTITLES))})),(h||d)&&c&&(n=n.filter((function(t){var e=t.videoCodec,r=t.width,i=t.height;return!!e||!(!r||!i)}))),n=n.filter((function(t){var e=t.audioCodec,r=t.videoCodec;return(!e||m(e,"audio"))&&(!r||m(r,"video"))})),e.audioTracks&&V(o=e.audioTracks.filter((function(t){return!t.audioCodec||m(t.audioCodec,"audio")}))),e.subtitles&&V(l=e.subtitles),n.length>0){r=n[0].bitrate,n.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=n;for(var f=0;f<n.length;f++)if(n[f].bitrate===r){this._firstLevel=f,this.log("manifest loaded, "+n.length+" level(s) found, first bitrate: "+r);break}var g=c&&!d,v={levels:n,audioTracks:o,subtitleTracks:l,firstLevel:this._firstLevel,stats:e.stats,audio:c,video:d,altAudio:!g&&o.some((function(t){return!!t.url}))};this.hls.trigger(a.a.MANIFEST_PARSED,v),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(e,r){if(t.prototype.onError.call(this,e,r),!r.fatal){var i=r.context,n=this._levels[this.currentLevelIndex];if(i&&(i.type===k.a.AUDIO_TRACK&&n.audioGroupIds&&i.groupId===n.audioGroupIds[n.urlId]||i.type===k.a.SUBTITLE_TRACK&&n.textGroupIds&&i.groupId===n.textGroupIds[n.urlId]))this.redundantFailover(this.currentLevelIndex);else{var a,o=!1,l=!0;switch(r.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:if(r.frag){var u=this._levels[r.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(a=r.frag.level)):a=r.frag.level}break;case s.a.LEVEL_LOAD_ERROR:case s.a.LEVEL_LOAD_TIMEOUT:i&&(i.deliveryDirectives&&(l=!1),a=i.level),o=!0;break;case s.a.REMUX_ALLOC_ERROR:a=r.level,o=!0}void 0!==a&&this.recoverLevel(r,a,o,l)}}},u.recoverLevel=function(t,e,r,i){var n=t.details,a=this._levels[e];if(a.loadError++,r){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(i){var s=a.url.length;if(s>1&&a.loadError<s)t.levelRetry=!0,this.redundantFailover(e);else if(-1===this.manualLevelIndex){var o=0===e?this._levels.length-1:e-1;this.currentLevelIndex!==o&&0===this._levels[o].loadError&&(this.warn(n+": switch to "+o),t.levelRetry=!0,this.hls.nextAutoLevel=o)}}},u.redundantFailover=function(t){var e=this._levels[t],r=e.url.length;if(r>1){var i=(e.urlId+1)%r;this.warn("Switching to redundant URL-id "+i),this._levels.forEach((function(t){t.urlId=i})),this.level=t}},u.onFragLoaded=function(t,e){var r=e.frag;if(void 0!==r&&r.type===k.b.MAIN){var i=this._levels[r.level];void 0!==i&&(i.fragmentError=0,i.loadError=0)}},u.onLevelLoaded=function(t,e){var r,i,n=e.level,a=e.details,s=this._levels[n];if(!s)return this.warn("Invalid level index "+n),void(null!==(i=e.deliveryDirectives)&&void 0!==i&&i.skip&&(a.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(n,e,s.details)):null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(t,e){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var i=-1,n=this.hls.audioTracks[e.id].groupId,a=0;a<r.audioGroupIds.length;a++)if(r.audioGroupIds[a]===n){i=a;break}i!==r.urlId&&(r.urlId=i,this.startLoad())}},u.loadPlaylist=function(t){var e=this.currentLevelIndex,r=this._levels[e];if(this.canLoad&&r&&r.url.length>0){var i=r.urlId,n=r.url[i];if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+i+" "+n),this.clearTimer(),this.hls.trigger(a.a.LEVEL_LOADING,{url:n,level:e,id:i,deliveryDirectives:t||null})}},u.removeLevel=function(t,e){var r=function(t,r){return r!==e},i=this._levels.filter((function(i,n){return n!==t||i.url.length>1&&void 0!==e&&(i.url=i.url.filter(r),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(r)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(r)),i.urlId=0,!0)})).map((function(t,e){var r=t.details;return null!=r&&r.fragments&&r.fragments.forEach((function(t){t.level=e})),t}));this._levels=i,this.hls.trigger(a.a.LEVELS_UPDATED,{levels:i})},n=i,(o=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==t||null===(e=r[t])||void 0===e||!e.details)){if(t<0||t>=r.length){var i=t<0;if(this.hls.trigger(a.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.LEVEL_SWITCH_ERROR,level:t,fatal:i,reason:"invalid level idx"}),i)return;t=Math.min(t,r.length-1)}this.clearTimer();var n=this.currentLevelIndex,o=r[n],l=r[t];this.log("switching to level "+t+" from "+n),this.currentLevelIndex=t;var u=$({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(a.a.LEVEL_SWITCHING,u);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==o?void 0:o.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&J(n.prototype,o),l&&J(n,l),i}(Q);!function(t){t.NOT_LOADED="NOT_LOADED",t.BACKTRACKED="BACKTRACKED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(tt||(tt={}));var it=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(a.a.BUFFER_APPENDED,this.onBufferAppended,this),t.on(a.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(a.a.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(a.a.BUFFER_APPENDED,this.onBufferAppended,this),t.off(a.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(a.a.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===k.b.MAIN){var r=this.activeFragment,i=this.activeParts;if(!r)return null;if(i)for(var n=i.length;n--;){var a=i[n],s=a?a.end:r.appendedPTS;if(a.start<=t&&void 0!==s&&t<=s)return n>9&&(this.activeParts=i.slice(n-9)),a}else if(r.start<=t&&void 0!==r.appendedPTS&&t<=r.appendedPTS)return r}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var r=this.fragments,i=Object.keys(r),n=i.length;n--;){var a=r[i[n]];if((null==a?void 0:a.body.type)===e&&a.buffered){var s=a.body;if(s.start<=t&&t<=s.end)return s}}return null},e.detectEvictedFragments=function(t,e,r){var i=this;Object.keys(this.fragments).forEach((function(n){var a=i.fragments[n];if(a)if(a.buffered){var s=a.range[t];s&&s.time.some((function(t){var r=!i.isTimeBuffered(t.startPTS,t.endPTS,e);return r&&i.removeFragment(a.body),r}))}else a.body.type===r&&i.removeFragment(a.body)}))},e.detectPartialFragments=function(t){var e=this,r=this.timeRanges,i=t.frag,n=t.part;if(r&&"initSegment"!==i.sn){var a=at(i),s=this.fragments[a];s&&(Object.keys(r).forEach((function(t){var a=i.elementaryStreams[t];if(a){var o=r[t],l=null!==n||!0===a.partial;s.range[t]=e.getBufferedTimes(i,n,l,o)}})),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body))}},e.fragBuffered=function(t){var e=at(t),r=this.fragments[e];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},e.getBufferedTimes=function(t,e,r,i){for(var n={time:[],partial:r},a=e?e.start:t.start,s=e?e.end:t.end,o=t.minEndPTS||s,l=t.maxStartPTS||a,u=0;u<i.length;u++){var h=i.start(u)-this.bufferPadding,d=i.end(u)+this.bufferPadding;if(l>=h&&o<=d){n.time.push({startPTS:Math.max(a,i.start(u)),endPTS:Math.min(s,i.end(u))});break}if(a<d&&s>h)n.partial=!0,n.time.push({startPTS:Math.max(a,i.start(u)),endPTS:Math.min(s,i.end(u))});else if(s<=h)break}return n},e.getPartialFragment=function(t){var e,r,i,n=null,a=0,s=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach((function(l){var u=o[l];u&&nt(u)&&(r=u.body.start-s,i=u.body.end+s,t>=r&&t<=i&&(e=Math.min(t-r,i-t),a<=e&&(n=u.body,a=e)))})),n},e.getState=function(t){var e=at(t),r=this.fragments[e];return r?r.buffered?nt(r)?tt.PARTIAL:tt.OK:r.backtrack?tt.BACKTRACKED:tt.APPENDING:tt.NOT_LOADED},e.backtrack=function(t,e){var r=at(t),i=this.fragments[r];if(!i||i.backtrack)return null;var n=i.backtrack=e||i.loaded;return i.loaded=null,n},e.getBacktrackData=function(t){var e=at(t),r=this.fragments[e];if(r){var i,n=r.backtrack;if(null!=n&&null!==(i=n.payload)&&void 0!==i&&i.byteLength)return n;this.removeFragment(t)}return null},e.isTimeBuffered=function(t,e,r){for(var i,n,a=0;a<r.length;a++){if(i=r.start(a)-this.bufferPadding,n=r.end(a)+this.bufferPadding,t>=i&&e<=n)return!0;if(e<=i)return!1}return!1},e.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!i){var n=at(r);this.fragments[n]={body:r,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var r=this,i=e.frag,n=e.part,a=e.timeRanges;if(i.type===k.b.MAIN)if(this.activeFragment=i,n){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(n)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach((function(t){var e=a[t];if(r.detectEvictedFragments(t,e),!n)for(var s=0;s<e.length;s++)i.appendedPTS=Math.max(e.end(s),i.appendedPTS||0)}))},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=at(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,r){var i=this;Object.keys(this.fragments).forEach((function(n){var a=i.fragments[n];if(a&&a.buffered){var s=a.body;s.type===r&&s.start<e&&s.end>t&&i.removeFragment(s)}}))},e.removeFragment=function(t){var e=at(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function nt(t){var e,r;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(r=t.range.audio)||void 0===r?void 0:r.partial))}function at(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}var st=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}(),ot={length:0,start:function(){return 0},end:function(){return 0}},lt=function(){function t(){}return t.isBuffered=function(e,r){try{if(e)for(var i=t.getBuffered(e),n=0;n<i.length;n++)if(r>=i.start(n)&&r<=i.end(n))return!0}catch(t){}return!1},t.bufferInfo=function(e,r,i){try{if(e){var n,a=t.getBuffered(e),s=[];for(n=0;n<a.length;n++)s.push({start:a.start(n),end:a.end(n)});return this.bufferedInfo(s,r,i)}}catch(t){}return{len:0,start:r,end:r,nextStart:void 0}},t.bufferedInfo=function(t,e,r){e=Math.max(0,e),t.sort((function(t,e){var r=t.start-e.start;return r||e.end-t.end}));var i=[];if(r)for(var n=0;n<t.length;n++){var a=i.length;if(a){var s=i[a-1].end;t[n].start-s<r?t[n].end>s&&(i[a-1].end=t[n].end):i.push(t[n])}else i.push(t[n])}else i=t;for(var o,l=0,u=e,h=e,d=0;d<i.length;d++){var c=i[d].start,f=i[d].end;if(e+r>=c&&e<f)u=c,l=(h=f)-e;else if(e+r<c){o=c;break}}return{len:l,start:u||0,end:h||0,nextStart:o}},t.getBuffered=function(t){try{return t.buffered}catch(t){return o.b.log("failed to get media.buffered",t),ot}},t}(),ut=function(t,e,r,i,n,a){void 0===i&&(i=0),void 0===n&&(n=-1),void 0===a&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=r,this.size=i,this.part=n,this.partial=a};function ht(t,e){if(t){var r=t.start+e;t.start=t.startPTS=r,t.endPTS=r+t.duration}}function dt(t,e){for(var r=e.fragments,i=0,n=r.length;i<n;i++)ht(r[i],t);e.fragmentHint&&ht(e.fragmentHint,t),e.alignedSliding=!0}function ct(t,e,r){e&&(!function(t,e,r){if(function(t,e,r){return!(!e.details||!(r.endCC>r.startCC||t&&t.cc<r.startCC))}(t,r,e)){var i=function(t,e){var r=t.fragments,i=e.fragments;if(i.length&&r.length){var n=function(t,e){for(var r=null,i=0,n=t.length;i<n;i++){var a=t[i];if(a&&a.cc===e){r=a;break}}return r}(r,i[0].cc);if(n&&(!n||n.startPTS))return n;o.b.log("No frag in previous level to align on")}else o.b.log("No fragments to align")}(r.details,e);i&&Object(n.a)(i.start)&&(o.b.log("Adjusting PTS using last level due to CC increase within current level "+e.url),dt(i.start,e))}}(t,r,e),!r.alignedSliding&&e.details&&function(t,e){if(!e.fragments.length||!t.hasProgramDateTime||!e.hasProgramDateTime)return;var r=e.fragments[0].programDateTime,i=t.fragments[0].programDateTime,a=(i-r)/1e3+e.fragments[0].start;a&&Object(n.a)(a)&&(o.b.log("Adjusting PTS using programDateTime delta "+(i-r)+"ms, sliding:"+a.toFixed(3)+" "+t.url+" "),dt(a,t))}(r,e.details),r.alignedSliding||!e.details||r.skippedSegments||X(e.details,r))}function ft(t,e){var r=t.programDateTime;if(r){var i=(r-e)/1e3;t.start=t.startPTS=i,t.endPTS=i+t.duration}}function gt(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var r=e.fragments[0].programDateTime-1e3*e.fragments[0].start;t.fragments.forEach((function(t){ft(t,r)})),t.fragmentHint&&ft(t.fragmentHint,r),t.alignedSliding=!0}}var vt={search:function(t,e){for(var r=0,i=t.length-1,n=null,a=null;r<=i;){var s=e(a=t[n=(r+i)/2|0]);if(s>0)r=n+1;else{if(!(s<0))return a;i=n-1}}return null}};function pt(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=null;if(t?n=e[t.sn-e[0].sn+1]||null:0===r&&0===e[0].start&&(n=e[0]),n&&0===mt(r,i,n))return n;var a=vt.search(e,mt.bind(null,r,i));return a||n}function mt(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0);var i=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=t?1:r.start-i>t&&r.start?-1:0}function yt(t,e,r){var i=1e3*Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-i>t}function Tt(t){var e="function"==typeof Map?new Map:void 0;return(Tt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return bt(t,arguments,Lt(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),St(i,t)})(t)}function bt(t,e,r){return(bt=Et()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&St(n,r.prototype),n}).apply(null,arguments)}function Et(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function St(t,e){return(St=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Lt(t){return(Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var At=Math.pow(2,17),Rt=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var r=this,i=t.url;if(!i)return Promise.reject(new kt({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var n=this.config,a=n.fLoader,o=n.loader;return new Promise((function(i,l){r.loader&&r.loader.destroy();var u=r.loader=t.loader=a?new a(n):new o(n),h=Dt(t),d={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:At};t.stats=u.stats,u.load(h,d,{onSuccess:function(e,n,a,s){r.resetLoader(t,u),i({frag:t,part:null,payload:e.data,networkDetails:s})},onError:function(e,i,n){r.resetLoader(t,u),l(new kt({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:n}))},onAbort:function(e,i,n){r.resetLoader(t,u),l(new kt({type:s.b.NETWORK_ERROR,details:s.a.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:n}))},onTimeout:function(e,i,n){r.resetLoader(t,u),l(new kt({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:n}))},onProgress:function(r,i,n,a){e&&e({frag:t,part:null,payload:n,networkDetails:a})}})}))},e.loadPart=function(t,e,r){var i=this;this.abort();var n=this.config,a=n.fLoader,o=n.loader;return new Promise((function(l,u){i.loader&&i.loader.destroy();var h=i.loader=t.loader=a?new a(n):new o(n),d=Dt(t,e),c={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:At};e.stats=h.stats,h.load(d,c,{onSuccess:function(n,a,s,o){i.resetLoader(t,h),i.updateStatsFromPart(t,e);var u={frag:t,part:e,payload:n.data,networkDetails:o};r(u),l(u)},onError:function(r,n,a){i.resetLoader(t,h),u(new kt({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:r,networkDetails:a}))},onAbort:function(r,n,a){t.stats.aborted=e.stats.aborted,i.resetLoader(t,h),u(new kt({type:s.b.NETWORK_ERROR,details:s.a.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:a}))},onTimeout:function(r,n,a){i.resetLoader(t,h),u(new kt({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:a}))}})}))},e.updateStatsFromPart=function(t,e){var r=t.stats,i=e.stats,n=i.total;if(r.loaded+=i.loaded,n){var a=Math.round(t.duration/e.duration),s=Math.min(Math.round(r.loaded/n),a),o=(a-s)*Math.round(r.loaded/s);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);var l=r.loading,u=i.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function Dt(t,e){void 0===e&&(e=null);var r=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},a=r.byteRangeStartOffset,s=r.byteRangeEndOffset;return Object(n.a)(a)&&Object(n.a)(s)&&(i.rangeStart=a,i.rangeEnd=s),i}var kt=function(t){var e,r;function i(e){for(var r,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];return(r=t.call.apply(t,[this].concat(n))||this).data=void 0,r.data=e,r}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,St(e,r),i}(Tt(Error)),_t=r(15),It={toString:function(t){for(var e="",r=t.length,i=0;i<r;i++)e+="["+t.start(i).toFixed(3)+","+t.end(i).toFixed(3)+"]";return e}};function Ct(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function wt(t,e){return(wt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ot="STOPPED",xt="IDLE",Pt="KEY_LOADING",Mt="FRAG_LOADING",Ft="FRAG_LOADING_WAITING_RETRY",Nt="WAITING_TRACK",Ut="PARSING",Bt="PARSED",Gt="BACKTRACKING",Kt="ENDED",jt="ERROR",Ht="WAITING_INIT_PTS",Vt="WAITING_LEVEL",Wt=function(t){var e,r;function i(e,r,i){var n;return(n=t.call(this)||this).hls=void 0,n.fragPrevious=null,n.fragCurrent=null,n.fragmentTracker=void 0,n.transmuxer=null,n._state=Ot,n.media=void 0,n.mediaBuffer=void 0,n.config=void 0,n.bitrateTest=!1,n.lastCurrentTime=0,n.nextLoadPosition=0,n.startPosition=0,n.loadedmetadata=!1,n.fragLoadError=0,n.retryDate=0,n.levels=null,n.fragmentLoader=void 0,n.levelLastLoaded=null,n.startFragRequested=!1,n.decrypter=void 0,n.initPTS=[],n.onvseeking=null,n.onvended=null,n.logPrefix="",n.log=void 0,n.warn=void 0,n.logPrefix=i,n.log=o.b.log.bind(o.b,i+":"),n.warn=o.b.warn.bind(o.b,i+":"),n.hls=e,n.fragmentLoader=new Rt(e.config),n.fragmentTracker=r,n.config=e.config,n.decrypter=new _t.a(e,e.config),e.on(a.a.KEY_LOADED,n.onKeyLoaded,function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)),n}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,wt(e,r);var u,h,d,c=i.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(t){},c.stopLoad=function(){this.fragmentLoader.abort();var t=this.fragCurrent;t&&this.fragmentTracker.removeFragment(t),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Ot},c._streamEnded=function(t,e){var r=this.fragCurrent,i=this.fragmentTracker;if(!e.live&&r&&r.sn===e.endSN&&!t.nextStart){var n=i.getState(r);return n===tt.PARTIAL||n===tt.OK}return!1},c.onMediaAttached=function(t,e){var r=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),r.addEventListener("seeking",this.onvseeking),r.addEventListener("ended",this.onvended);var i=this.config;this.levels&&i.autoStartLoad&&this.state===Ot&&this.startLoad(i.startPosition)},c.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,r=this.media,i=this.mediaBuffer,a=this.state,s=r?r.currentTime:0,o=lt.bufferInfo(i||r,s,t.maxBufferHole);if(this.log("media seeking to "+(Object(n.a)(s)?s.toFixed(3):s)+", state: "+a),a===Kt)this.resetLoadingState();else if(e&&!o.len){var l=t.maxFragLookUpTolerance,u=e.start-l,h=s>e.start+e.duration+l;(s<u||h)&&(h&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.loader.abort()),this.resetLoadingState())}r&&(this.lastCurrentTime=s),this.loadedmetadata||o.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(t,e){if(this.state===Pt&&e.frag===this.fragCurrent&&this.levels){this.state=xt;var r=this.levels[e.frag.level].details;r&&this.loadFragment(e.frag,r,e.frag.start)}},c.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=Ot,this.hls.off(a.a.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(t,e){this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=Pt,this.fragCurrent=t,this.hls.trigger(a.a.KEY_LOADING,{frag:t})},c.loadFragment=function(t,e,r){this._loadFragForPlayback(t,e,r)},c._loadFragForPlayback=function(t,e,r){var i=this;this._doFragLoad(t,e,r,(function(e){if(i.fragContextChanged(t))return i.warn("Fragment "+t.sn+(e.part?" p: "+e.part.index:"")+" of level "+t.level+" was dropped during download."),void i.fragmentTracker.removeFragment(t);t.stats.chunkCount++,i._handleFragmentLoadProgress(e)})).then((function(e){if(e){i.fragLoadError=0;var r=i.state;if(!i.fragContextChanged(t))return"payload"in e&&(i.log("Loaded fragment "+t.sn+" of level "+t.level),i.hls.trigger(a.a.FRAG_LOADED,e),i.state===Gt)?(i.fragmentTracker.backtrack(t,e),void i.resetFragmentLoading(t)):void i._handleFragmentLoadComplete(e);(r===Mt||r===Gt||!i.fragCurrent&&r===Ut)&&(i.fragmentTracker.removeFragment(t),i.state=xt)}})).catch((function(e){i.warn(e),i.resetFragmentLoading(t)}))},c.flushMainBuffer=function(t,e,r){if(void 0===r&&(r=null),t-e){var i={startOffset:t,endOffset:e,type:r};this.fragLoadError=0,this.hls.trigger(a.a.BUFFER_FLUSHING,i)}},c._loadInitSegment=function(t){var e=this;this._doFragLoad(t).then((function(r){if(!r||e.fragContextChanged(t)||!e.levels)throw new Error("init load aborted");return r})).then((function(r){var i=e.hls,n=r.payload,s=t.decryptdata;if(n&&n.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){var o=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(n),s.key.buffer,s.iv.buffer).then((function(e){var n=self.performance.now();return i.trigger(a.a.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:n}}),r.payload=e,r}))}return r})).then((function(r){var i=e.fragCurrent,n=e.hls,s=e.levels;if(!s)throw new Error("init load aborted, missing levels");s[t.level].details;var o=t.stats;e.state=xt,e.fragLoadError=0,t.data=new Uint8Array(r.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),r.frag===i&&n.trigger(a.a.FRAG_BUFFERED,{stats:o,frag:i,part:null,id:t.type}),e.tick()})).catch((function(r){e.warn(r),e.resetFragmentLoading(t)}))},c.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},c.fragBufferedComplete=function(t,e){var r=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+It.toString(lt.getBuffered(r))),this.state=xt,this.tick()},c._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var r=t.frag,i=t.part,n=t.partsLoaded,a=!n||0===n.length||n.some((function(t){return!t})),s=new ut(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!a);e.flush(s)}},c._handleFragmentLoadProgress=function(t){},c._doFragLoad=function(t,e,r,i){var s=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");if(r=Math.max(t.start,r||0),this.config.lowLatencyMode&&e){var o=e.partList;if(o&&i){r>t.end&&e.fragmentHint&&(t=e.fragmentHint);var l=this.getNextPart(o,t,r);if(l>-1){var u=o[l];return this.log("Loading part sn: "+t.sn+" p: "+u.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+l+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=u.start+u.duration,this.state=Mt,this.hls.trigger(a.a.FRAG_LOADING,{frag:t,part:o[l],targetBufferTime:r}),this.doFragPartsLoad(t,o,l,i).catch((function(t){return s.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(o,r))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),Object(n.a)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Mt,this.hls.trigger(a.a.FRAG_LOADING,{frag:t,targetBufferTime:r}),this.fragmentLoader.load(t,i).catch((function(t){return s.handleFragLoadError(t)}))},c.doFragPartsLoad=function(t,e,r,i){var n=this;return new Promise((function(s,o){var l=[];!function r(u){var h=e[u];n.fragmentLoader.loadPart(t,h,i).then((function(i){l[h.index]=i;var o=i.part;n.hls.trigger(a.a.FRAG_LOADED,i);var d=e[u+1];if(!d||d.fragment!==t)return s({frag:t,part:o,partsLoaded:l});r(u+1)})).catch(o)}(r)}))},c.handleFragLoadError=function(t){var e=t.data;return e&&e.details===s.a.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(a.a.ERROR,e),null},c._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===Ut){var r=e.frag,i=e.part,n=e.level,a=self.performance.now();r.stats.parsing.end=a,i&&(i.stats.parsing.end=a),this.updateLevelTiming(r,i,n,t.partial)}else this.fragCurrent||(this.state=xt)},c.getCurrentContext=function(t){var e=this.levels,r=t.level,i=t.sn,n=t.part;if(!e||!e[r])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+r+". The current chunk will not be buffered."),null;var a=e[r],s=n>-1?function(t,e,r){if(!t||!t.details)return null;var i=t.details.partList;if(i)for(var n=i.length;n--;){var a=i[n];if(a.index===r&&a.fragment.sn===e)return a}return null}(a,i,n):null,o=s?s.fragment:function(t,e,r){if(!t||!t.details)return null;var i=t.details,n=i.fragments[e-i.startSN];return n||((n=i.fragmentHint)&&n.sn===e?n:e<i.startSN&&r&&r.sn===e?r:null)}(a,i,this.fragCurrent);return o?{frag:o,part:s,level:a}:null},c.bufferFragmentData=function(t,e,r,i){if(t&&this.state===Ut){var n=t.data1,s=t.data2,o=n;if(n&&s&&(o=Object(l.a)(n,s)),o&&o.length){var u={type:t.type,frag:e,part:r,chunkMeta:i,parent:e.type,data:o};this.hls.trigger(a.a.BUFFER_APPENDING,u),t.dropped&&t.independent&&!r&&this.flushBufferGap(e)}}},c.flushBufferGap=function(t){var e=this.media;if(e)if(lt.isBuffered(e,e.currentTime)){var r=e.currentTime,i=lt.bufferInfo(e,r,0),n=t.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),s=Math.max(Math.min(t.start-a,i.end-a),r+a);t.start-s>a&&this.flushMainBuffer(s,t.start)}else this.flushMainBuffer(0,t.start)},c.getFwdBufferInfo=function(t,e){var r=this.config,i=this.getLoadPosition();if(!Object(n.a)(i))return null;var a=lt.bufferInfo(t,i,r.maxBufferHole);if(0===a.len&&void 0!==a.nextStart){var s=this.fragmentTracker.getBufferedFrag(i,e);if(s&&a.nextStart<s.end)return lt.bufferInfo(t,i,Math.max(a.nextStart,r.maxBufferHole))}return a},c.getMaxBufferLength=function(t){var e,r=this.config;return e=t?Math.max(8*r.maxBufferSize/t,r.maxBufferLength):r.maxBufferLength,Math.min(e,r.maxMaxBufferLength)},c.reduceMaxBufferLength=function(t){var e=this.config,r=t||e.maxBufferLength;return e.maxMaxBufferLength>=r&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},c.getNextFragment=function(t,e){var r,i,n=e.fragments,a=n.length;if(!a)return null;var s,o=this.config,l=n[0].start;if(e.live){var u=o.initialLiveManifestSize;if(a<u)return this.warn("Not enough fragments to start playback (have: "+a+", need: "+u+")"),null;e.PTSKnown||this.startFragRequested||-1!==this.startPosition||(s=this.getInitialLiveFragment(e,n),this.startPosition=s?this.hls.liveSyncPosition||s.start:t)}else t<=l&&(s=n[0]);if(!s){var h=o.lowLatencyMode?e.partEnd:e.fragmentEnd;s=this.getFragmentAtPosition(t,h,e)}return null===(r=s)||void 0===r||!r.initSegment||null!==(i=s)&&void 0!==i&&i.initSegment.data||this.bitrateTest||(s=s.initSegment),s},c.getNextPart=function(t,e,r){for(var i=-1,n=!1,a=!0,s=0,o=t.length;s<o;s++){var l=t[s];if(a=a&&!l.independent,i>-1&&r<l.start)break;var u=l.loaded;!u&&(n||l.independent||a)&&l.fragment===e&&(i=s),n=u}return i},c.loadedEndOfParts=function(t,e){var r=t[t.length-1];return r&&e>r.start&&r.loaded},c.getInitialLiveFragment=function(t,e){var r=this.fragPrevious,i=null;if(r){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),i=function(t,e,r){if(null===e||!Array.isArray(t)||!t.length||!Object(n.a)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;r=r||0;for(var i=0;i<t.length;++i){var a=t[i];if(yt(e,r,a))return a}return null}(e,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){var a=r.sn+1;if(a>=t.startSN&&a<=t.endSN){var s=e[a-t.startSN];r.cc===s.cc&&(i=s,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=function(t,e){return vt.search(t,(function(t){return t.cc<e?1:t.cc>e?-1:0}))}(e,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(i=this.getFragmentAtPosition(o,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i},c.getFragmentAtPosition=function(t,e,r){var i,n=this.config,a=this.fragPrevious,s=r.fragments,o=r.endSN,l=r.fragmentHint,u=n.maxFragLookUpTolerance,h=!!(n.lowLatencyMode&&r.partList&&l);(h&&l&&!this.bitrateTest&&(s=s.concat(l),o=l.sn),t<e)?i=pt(a,s,t,t>e-u?0:u):i=s[s.length-1];if(i){var d=i.sn-r.startSN,c=a&&i.level===a.level,f=s[d+1];if(this.fragmentTracker.getState(i)===tt.BACKTRACKED){i=null;for(var g=d;s[g]&&this.fragmentTracker.getState(s[g])===tt.BACKTRACKED;)i=a?s[g--]:s[--g];i||(i=f)}else a&&i.sn===a.sn&&!h&&c&&(i.sn<o&&this.fragmentTracker.getState(f)!==tt.OK?(this.log("SN "+i.sn+" just loaded, load next one: "+f.sn),i=f):i=null)}return i},c.synchronizeToLiveEdge=function(t){var e=this.config,r=this.media;if(r){var i=this.hls.liveSyncPosition,n=r.currentTime,a=t.fragments[0].start,s=t.edge,o=n>=a-e.maxFragLookUpTolerance&&n<=s;if(null!==i&&r.duration>i&&(n<i||!o)){var l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!o&&r.readyState<4||n<s-l)&&(this.loadedmetadata||(this.nextLoadPosition=i),r.readyState&&(this.warn("Playback: "+n.toFixed(3)+" is located too far from the end of live sliding playlist: "+s+", reset currentTime to : "+i.toFixed(3)),r.currentTime=i))}}},c.alignPlaylists=function(t,e){var r=this.levels,i=this.levelLastLoaded,a=this.fragPrevious,s=null!==i?r[i]:null,o=t.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;var l=t.fragments[0].start,u=!e,h=t.alignedSliding&&Object(n.a)(l);if(u||!h&&!l){ct(a,s,t);var d=t.fragments[0].start;return this.log("Live playlist sliding: "+d.toFixed(2)+" start-sn: "+(e?e.startSN:"na")+"->"+t.startSN+" prev-sn: "+(a?a.sn:"na")+" fragments: "+o),d}return l},c.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},c.setStartPosition=function(t,e){var r=this.startPosition;if(r<e&&(r=-1),-1===r||-1===this.lastCurrentTime){var i=t.startTimeOffset;Object(n.a)(i)?(r=e+i,i<0&&(r+=t.totalduration),r=Math.min(Math.max(e,r),e+t.totalduration),this.log("Start time offset "+i+" found in playlist, adjust startPosition to "+r),this.startPosition=r):t.live?r=this.hls.liveSyncPosition||e:this.startPosition=r=0,this.lastCurrentTime=r}this.nextLoadPosition=r},c.getLoadPosition=function(){var t=this.media,e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e},c.handleFragLoadAborted=function(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn("Fragment "+t.sn+(e?" part"+e.index:"")+" of level "+t.level+" was aborted"),this.resetFragmentLoading(t))},c.resetFragmentLoading=function(t){this.fragCurrent&&this.fragContextChanged(t)||(this.state=xt)},c.onFragmentOrKeyLoadError=function(t,e){if(!e.fatal){var r=e.frag;if(r&&r.type===t){this.fragCurrent;var i=this.config;if(this.fragLoadError+1<=i.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(r.level))return;var n=Math.min(Math.pow(2,this.fragLoadError)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);this.warn("Fragment "+r.sn+" of "+t+" "+r.level+" failed to load, retrying in "+n+"ms"),this.retryDate=self.performance.now()+n,this.fragLoadError++,this.state=Ft}else e.levelRetry?(t===k.b.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=xt):(o.b.error(e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.stopLoad(),this.state=jt)}}},c.afterBufferFlushed=function(t,e,r){if(t){var i=lt.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,i,r),this.state===Kt&&this.resetLoadingState()}},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=xt},c.resetLiveStartWhenNotLoaded=function(t){if(!this.loadedmetadata){this.startFragRequested=!1;var e=this.levels?this.levels[t].details:null;if(null!=e&&e.live)return this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(t,e,r,i){var n=this,s=r.details;Object.keys(t.elementaryStreams).reduce((function(e,o){var l=t.elementaryStreams[o];if(l){var u=l.endPTS-l.startPTS;if(u<=0)return n.warn("Could not parse fragment "+t.sn+" "+o+" duration reliably ("+u+") resetting transmuxer to fallback to playlist timing"),n.resetTransmuxer(),e||!1;var h=i?0:Y(s,t,l.startPTS,l.endPTS,l.startDTS,l.endDTS);return n.hls.trigger(a.a.LEVEL_PTS_UPDATED,{details:s,level:r,drift:h,type:o,frag:t,start:l.startPTS,end:l.endPTS}),!0}return e}),!1)?(this.state=Bt,this.hls.trigger(a.a.FRAG_PARSED,{frag:t,part:e})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},u=i,(h=[{key:"state",get:function(){return this._state},set:function(t){var e=this._state;e!==t&&(this._state=t,this.log(e+"->"+t))}}])&&Ct(u.prototype,h),d&&Ct(u,d),i}(st);function Yt(){return self.MediaSource||self.WebKitMediaSource}function qt(){return self.SourceBuffer||self.WebKitSourceBuffer}var Xt=r(18),zt=r(10),Qt=r(14),$t=Yt()||{isTypeSupported:function(){return!1}},Jt=function(){function t(t,e,r,i){var n=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=t,this.id=e,this.onTransmuxComplete=r,this.onFlush=i;var l=t.config,u=function(e,r){(r=r||{}).frag=n.frag,r.id=n.id,t.trigger(e,r)};this.observer=new Qt.EventEmitter,this.observer.on(a.a.FRAG_DECRYPTED,u),this.observer.on(a.a.ERROR,u);var h={mp4:$t.isTypeSupported("video/mp4"),mpeg:$t.isTypeSupported("audio/mpeg"),mp3:$t.isTypeSupported('audio/mp4; codecs="mp3"')},d=navigator.vendor;if(l.enableWorker&&"undefined"!=typeof Worker){var c;o.b.log("demuxing in webworker");try{c=this.worker=Xt(19),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(e){t.trigger(a.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},c.postMessage({cmd:"init",typeSupported:h,vendor:d,id:e,config:JSON.stringify(l)})}catch(t){o.b.warn("Error in worker:",t),o.b.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new zt.c(this.observer,h,l,d,e),this.worker=null}}else this.transmuxer=new zt.c(this.observer,h,l,d,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},e.push=function(t,e,r,i,n,a,s,l,u,h){var d,c,f=this;u.transmuxing.start=self.performance.now();var g=this.transmuxer,v=this.worker,p=a?a.start:n.start,m=n.decryptdata,y=this.frag,T=!(y&&n.cc===y.cc),b=!(y&&u.level===y.level),E=y?u.sn-y.sn:-1,S=this.part?u.part-this.part.index:1,L=!b&&(1===E||0===E&&1===S),A=self.performance.now();(b||E||0===n.stats.parsing.start)&&(n.stats.parsing.start=A),!a||!S&&L||(a.stats.parsing.start=A);var R=!(y&&(null===(d=n.initSegment)||void 0===d?void 0:d.url)===(null===(c=y.initSegment)||void 0===c?void 0:c.url)),D=new zt.b(T,L,l,b,p,R);if(!L||T||R){o.b.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+T+"\n trackSwitch: "+b+"\n contiguous: "+L+"\n accurateTimeOffset: "+l+"\n timeOffset: "+p+"\n initSegmentChange: "+R);var k=new zt.a(r,i,e,s,h);this.configureTransmuxer(k)}if(this.frag=n,this.part=a,v)v.postMessage({cmd:"demux",data:t,decryptdata:m,chunkMeta:u,state:D},t instanceof ArrayBuffer?[t]:[]);else if(g){var _=g.push(t,m,u,D);Object(zt.d)(_)?_.then((function(t){f.handleTransmuxComplete(t)})):this.handleTransmuxComplete(_)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var r=this.transmuxer,i=this.worker;if(i)i.postMessage({cmd:"flush",chunkMeta:t});else if(r){var n=r.flush(t);Object(zt.d)(n)?n.then((function(r){e.handleFlushResult(r,t)})):this.handleFlushResult(n,t)}},e.handleFlushResult=function(t,e){var r=this;t.forEach((function(t){r.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,r=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):r&&r.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}(),Zt=function(){function t(t,e,r,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=r,this.hls=i}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,r=this.media,i=this.stalled,n=r.currentTime,a=r.seeking,s=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,n===t){if((l||s)&&(this.stalled=null),!r.paused&&!r.ended&&0!==r.playbackRate&&lt.getBuffered(r).length){var u=lt.bufferInfo(r,n,0),h=u.len>0,d=u.nextStart||0;if(h||d){if(a){var c=u.len>2,f=!d||d-n>2&&!this.fragmentTracker.getPartialFragment(n);if(c||f)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var g,v=Math.max(d,u.start||0)-n,p=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,m=(null==p||null===(g=p.details)||void 0===g?void 0:g.live)?2*p.details.targetduration:2;if(v>0&&v<=m)return void this._trySkipBufferHole(null)}var y=self.performance.now();if(null!==i){var T=y-i;!a&&T>=250&&this._reportStall(u.len);var b=lt.bufferInfo(r,n,e.maxBufferHole);this._tryFixBufferStall(b,T)}else this.stalled=y}}}else if(this.moved=!0,null!==i){if(this.stallReported){var E=self.performance.now()-i;o.b.warn("playback not stuck anymore @"+n+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var r=this.config,i=this.fragmentTracker,n=this.media.currentTime,a=i.getPartialFragment(n);if(a&&this._trySkipBufferHole(a))return;t.len>r.maxBufferHole&&e>1e3*r.highBufferWatchdogPeriod&&(o.b.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},e._reportStall=function(t){var e=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,o.b.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,r=this.hls,i=this.media,n=i.currentTime,l=0,u=lt.getBuffered(i),h=0;h<u.length;h++){var d=u.start(h);if(n+e.maxBufferHole>=l&&n<d){var c=Math.max(d+.05,i.currentTime+.1);return o.b.warn("skipping hole, adjusting currentTime from "+n+" to "+c),this.moved=!0,this.stalled=null,i.currentTime=c,t&&r.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+c,frag:t}),c}l=u.end(h)}return 0},e._tryNudgeBuffer=function(){var t=this.config,e=this.hls,r=this.media,i=r.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<t.nudgeMaxRetry){var l=i+n*t.nudgeOffset;o.b.warn("Nudging 'currentTime' from "+i+" to "+l),r.currentTime=l,e.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.b.error("Playhead still not moving while enough data buffered @"+i+" after "+t.nudgeMaxRetry+" nudges"),e.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_STALLED_ERROR,fatal:!0})},t}();function te(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ee(t,e){return(ee=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var re=function(t){var e,r;function i(e,r){var i;return(i=t.call(this,e,r,"[stream-controller]")||this).audioCodecSwap=!1,i.gapController=null,i.level=-1,i._forceStartLoad=!1,i.altAudio=!1,i.audioOnly=!1,i.fragPlaying=null,i.onvplaying=null,i.onvseeked=null,i.fragLastKbps=0,i.stalled=!1,i.couldBacktrack=!1,i.audioCodecSwitch=!1,i.videoBuffer=null,i._registerListeners(),i}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,ee(e,r);var l,h,d,c=i.prototype;return c._registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.a.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(a.a.ERROR,this.onError,this),t.on(a.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(a.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(a.a.BUFFER_CREATED,this.onBufferCreated,this),t.on(a.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(a.a.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(a.a.FRAG_BUFFERED,this.onFragBuffered,this)},c._unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.a.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(a.a.ERROR,this.onError,this),t.off(a.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(a.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(a.a.BUFFER_CREATED,this.onBufferCreated,this),t.off(a.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(a.a.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(a.a.FRAG_BUFFERED,this.onFragBuffered,this)},c.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},c.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=r.startLevel;-1===i&&(r.config.testBandwidth?(i=0,this.bitrateTest=!0):i=r.nextAutoLevel),this.level=r.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=xt,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=Ot},c.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},c.doTick=function(){switch(this.state){case xt:this.doTickIdle();break;case Vt:var t,e=this.levels,r=this.level,i=null==e||null===(t=e[r])||void 0===t?void 0:t.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=xt;break}break;case Ft:var n,a=self.performance.now(),s=this.retryDate;(!s||a>=s||null!==(n=this.media)&&void 0!==n&&n.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=xt)}this.onTickEnd()},c.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},c.doTickIdle=function(){var t,e,r=this.hls,i=this.levelLastLoaded,n=this.levels,s=this.media,o=r.config,l=r.nextLoadLevel;if(null!==i&&(s||!this.startFragRequested&&o.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&n&&n[l]){var h=n[l];this.level=r.nextLoadLevel=l;var d=h.details;if(!d||this.state===Vt||d.live&&this.levelLastLoaded!==l)this.state=Vt;else{var c=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:s,k.b.MAIN);if(null!==c)if(!(c.len>=this.getMaxBufferLength(h.maxBitrate))){if(this._streamEnded(c,d)){var f={};return this.altAudio&&(f.type="video"),this.hls.trigger(a.a.BUFFER_EOS,f),void(this.state=Kt)}var g=c.end,v=this.getNextFragment(g,d);if(this.couldBacktrack&&!this.fragPrevious&&v&&"initSegment"!==v.sn){var p=v.sn-d.startSN;p>1&&(v=d.fragments[p-1],this.fragmentTracker.removeFragment(v))}if(v&&this.fragmentTracker.getState(v)===tt.OK&&this.nextLoadPosition>g){var m=this.audioOnly&&!this.altAudio?u.a.AUDIO:u.a.VIDEO;this.afterBufferFlushed(s,m,k.b.MAIN),v=this.getNextFragment(this.nextLoadPosition,d)}v&&(!v.initSegment||v.initSegment.data||this.bitrateTest||(v=v.initSegment),"identity"!==(null===(t=v.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=v.decryptdata)&&void 0!==e&&e.key?this.loadFragment(v,d,g):this.loadKey(v,d))}}}},c.loadFragment=function(e,r,i){var n,a=this.fragmentTracker.getState(e);if(this.fragCurrent=e,a===tt.BACKTRACKED){var s=this.fragmentTracker.getBacktrackData(e);if(s)return this._handleFragmentLoadProgress(s),void this._handleFragmentLoadComplete(s);a=tt.NOT_LOADED}a===tt.NOT_LOADED||a===tt.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)):a===tt.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},c.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,k.b.MAIN);return e&&"fragment"in e?e.fragment:e},c.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,k.b.MAIN)},c.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},c.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},c.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var r,i=this.getAppendedFrag(e.currentTime);if(i&&i.start>1&&this.flushMainBuffer(0,i.start-1),!e.paused&&t){var n=t[this.hls.nextLoadLevel],a=this.fragLastKbps;r=a&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*a)+1:0}else r=0;var s=this.getBufferedFrag(e.currentTime+r);if(s){var o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();var l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,h=Math.max(s.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}},c.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===Pt&&(this.state=xt),this.nextLoadPosition=this.getLoadPosition()},c.flushMainBuffer=function(e,r){t.prototype.flushMainBuffer.call(this,e,r,this.altAudio?"video":null)},c.onMediaAttached=function(e,r){t.prototype.onMediaAttached.call(this,e,r);var i=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new Zt(this.config,i,this.fragmentTracker,this.hls)},c.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},c.onMediaPlaying=function(){this.tick()},c.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(n.a)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},c.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(a.a.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},c.onManifestParsed=function(t,e){var r,i,n,a=!1,s=!1;e.levels.forEach((function(t){(r=t.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(a=!0),-1!==r.indexOf("mp4a.40.5")&&(s=!0))})),this.audioCodecSwitch=a&&s&&!("function"==typeof(null==(n=qt())||null===(i=n.prototype)||void 0===i?void 0:i.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},c.onLevelLoading=function(t,e){var r=this.levels;if(r&&this.state===xt){var i=r[e.level];(!i.details||i.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(i.details))&&(this.state=Vt)}},c.onLevelLoaded=function(t,e){var r,i=this.levels,n=e.level,s=e.details,o=s.totalduration;if(i){this.log("Level "+n+" loaded ["+s.startSN+","+s.endSN+"], cc ["+s.startCC+", "+s.endCC+"] duration:"+o);var l=this.fragCurrent;!l||this.state!==Mt&&this.state!==Ft||l.level!==e.level&&l.loader&&(this.state=xt,l.loader.abort());var u=i[n],h=0;if(s.live||null!==(r=u.details)&&void 0!==r&&r.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;h=this.alignPlaylists(s,u.details)}if(u.details=s,this.levelLastLoaded=n,this.hls.trigger(a.a.LEVEL_UPDATED,{details:s,level:n}),this.state===Vt){if(this.waitForCdnTuneIn(s))return;this.state=xt}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,h),this.tick()}else this.warn("Levels were reset while loading level "+n)},c._handleFragmentLoadProgress=function(t){var e,r=t.frag,i=t.part,n=t.payload,a=this.levels;if(a){var s=a[r.level],o=s.details;if(o){var l=s.videoCodec,u=o.PTSKnown||!o.live,h=null===(e=r.initSegment)||void 0===e?void 0:e.data,d=this._getAudioCodec(s),c=this.transmuxer=this.transmuxer||new Jt(this.hls,k.b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,g=-1!==f,v=new ut(r.level,r.sn,r.stats.chunkCount,n.byteLength,f,g),p=this.initPTS[r.cc];c.push(n,h,d,l,r,i,o.totalduration,u,v,p)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},c.onAudioTrackSwitching=function(t,e){var r=this.altAudio,i=!!e.url,n=e.id;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;r&&o.trigger(a.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),o.trigger(a.a.AUDIO_TRACK_SWITCHED,{id:n})}},c.onAudioTrackSwitched=function(t,e){var r=e.id,i=!!this.hls.audioTracks[r].url;if(i){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=i,this.tick()},c.onBufferCreated=function(t,e){var r,i,n=e.tracks,a=!1;for(var s in n){var o=n[s];if("main"===o.id){if(i=s,r=o,"video"===s){var l=n[s];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&r?(this.log("Alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},c.onFragBuffered=function(t,e){var r=e.frag,i=e.part;if(!r||r.type===k.b.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===Bt&&(this.state=xt));var n=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}},c.onError=function(t,e){switch(e.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(k.b.MAIN,e);break;case s.a.LEVEL_LOAD_ERROR:case s.a.LEVEL_LOAD_TIMEOUT:this.state!==jt&&(e.fatal?(this.warn(""+e.details),this.state=jt):e.levelRetry||this.state!==Vt||(this.state=xt));break;case s.a.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===Ut||this.state===Bt)){var r=!0,i=this.getFwdBufferInfo(this.media,k.b.MAIN);i&&i.len>.5&&(r=!this.reduceMaxBufferLength(i.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},c.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var r=lt.getBuffered(t);!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},c.onFragLoadEmergencyAborted=function(){this.state=xt,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},c.onBufferFlushed=function(t,e){var r=e.type;if(r!==u.a.AUDIO||this.audioOnly&&!this.altAudio){var i=(r===u.a.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,r,k.b.MAIN)}},c.onLevelsUpdated=function(t,e){this.levels=e.levels},c.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},c.seekToStartPos=function(){var t=this.media,e=t.currentTime,r=this.startPosition;if(r>=0&&e<r){if(t.seeking)return void o.b.log("could not seek to "+r+", already seeking at "+e);var i=lt.getBuffered(t),n=(i.length?i.start(0):0)-r;n>0&&(n<this.config.maxBufferHole||n<this.config.maxFragLookUpTolerance)&&(o.b.log("adjusting start position by "+n+" to match buffer start"),r+=n,this.startPosition=r),this.log("seek to target start position "+r+" from current time "+e),t.currentTime=r}},c._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},c._loadBitrateTestFrag=function(t){var e=this;this._doFragLoad(t).then((function(r){var i=e.hls;if(r&&!i.nextLoadLevel&&!e.fragContextChanged(t)){e.fragLoadError=0,e.state=xt,e.startFragRequested=!1,e.bitrateTest=!1;var n=t.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),i.trigger(a.a.FRAG_LOADED,r)}}))},c._handleTransmuxComplete=function(t){var e,r="main",i=this.hls,s=t.remuxResult,o=t.chunkMeta,l=this.getCurrentContext(o);if(!l)return this.warn("The loading context changed while buffering fragment "+o.sn+" of level "+o.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(o.level);var h=l.frag,d=l.part,c=l.level,f=s.video,g=s.text,v=s.id3,p=s.initSegment,m=this.altAudio?void 0:s.audio;if(!this.fragContextChanged(h)){if(this.state=Ut,p){p.tracks&&(this._bufferInitSegment(c,p.tracks,h,o),i.trigger(a.a.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:r,tracks:p.tracks}));var y=p.initPTS,T=p.timescale;Object(n.a)(y)&&(this.initPTS[h.cc]=y,i.trigger(a.a.INIT_PTS_FOUND,{frag:h,id:r,initPTS:y,timescale:T}))}if(f&&!1!==s.independent){if(c.details){var b=f.startPTS,E=f.endPTS,S=f.startDTS,L=f.endDTS;if(d)d.elementaryStreams[f.type]={startPTS:b,endPTS:E,startDTS:S,endDTS:L};else if(f.firstKeyFrame&&f.independent&&(this.couldBacktrack=!0),f.dropped&&f.independent){if(this.getLoadPosition()+this.config.maxBufferHole<b)return void this.backtrack(h);h.setElementaryStreamInfo(f.type,h.start,E,h.start,L,!0)}h.setElementaryStreamInfo(f.type,b,E,S,L),this.bufferFragmentData(f,h,d,o)}}else if(!1===s.independent)return void this.backtrack(h);if(m){var A=m.startPTS,R=m.endPTS,D=m.startDTS,k=m.endDTS;d&&(d.elementaryStreams[u.a.AUDIO]={startPTS:A,endPTS:R,startDTS:D,endDTS:k}),h.setElementaryStreamInfo(u.a.AUDIO,A,R,D,k),this.bufferFragmentData(m,h,d,o)}if(null!=v&&null!==(e=v.samples)&&void 0!==e&&e.length){var _={frag:h,id:r,samples:v.samples};i.trigger(a.a.FRAG_PARSING_METADATA,_)}if(g){var I={frag:h,id:r,samples:g.samples};i.trigger(a.a.FRAG_PARSING_USERDATA,I)}}},c._bufferInitSegment=function(t,e,r,i){var n=this;if(this.state===Ut){this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;var s=e.audio,o=e.video,l=e.audiovideo;if(s){var u=t.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==s.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==s.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),t.audioCodec&&t.audioCodec!==u&&this.log('Swapping manifest audio codec "'+t.audioCodec+'" for "'+u+'"'),s.levelCodec=u,s.id="main",this.log("Init audio buffer, container:"+s.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(t.audioCodec||"")+"/"+s.codec+"]")}o&&(o.levelCodec=t.videoCodec,o.id="main",this.log("Init video buffer, container:"+o.container+", codecs[level/parsed]=["+(t.videoCodec||"")+"/"+o.codec+"]")),l&&this.log("Init audiovideo buffer, container:"+l.container+", codecs[level/parsed]=["+(t.attrs.CODECS||"")+"/"+l.codec+"]"),this.hls.trigger(a.a.BUFFER_CODECS,e),Object.keys(e).forEach((function(t){var s=e[t].initSegment;null!=s&&s.byteLength&&n.hls.trigger(a.a.BUFFER_APPENDING,{type:t,data:s,frag:r,part:null,chunkMeta:i,parent:r.type})})),this.tick()}},c.backtrack=function(t){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(t);var e=this.fragmentTracker.backtrack(t);this.fragPrevious=null,this.nextLoadPosition=t.start,e?this.resetFragmentLoading(t):this.state=Gt},c.checkFragmentChanged=function(){var t=this.media,e=null;if(t&&t.readyState>1&&!1===t.seeking){var r=t.currentTime;if(lt.isBuffered(t,r)?e=this.getAppendedFrag(r):lt.isBuffered(t,r+.1)&&(e=this.getAppendedFrag(r+.1)),e){var i=this.fragPlaying,n=e.level;i&&e.sn===i.sn&&i.level===n&&e.urlId===i.urlId||(this.hls.trigger(a.a.FRAG_CHANGED,{frag:e}),i&&i.level===n||this.hls.trigger(a.a.LEVEL_SWITCHED,{level:n}),this.fragPlaying=e)}}},l=i,(h=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&te(l.prototype,h),d&&te(l,d),i}(Wt),ie=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=r}var e=t.prototype;return e.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}(),ne=function(){function t(t,e,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ie(t),this.fast_=new ie(e)}var e=t.prototype;return e.update=function(t,e){var r=this.slow_,i=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new ie(t,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new ie(e,i.getEstimate(),i.getTotalWeight()))},e.sample=function(t,e){var r=(t=Math.max(t,this.minDelayMs_))/1e3,i=8*e/r;this.fast_.sample(r,i),this.slow_.sample(r,i)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();function ae(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var se=function(){function t(t){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;var e=t.config;this.bwEstimator=new ne(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}var e,r,i,l=t.prototype;return l.registerListeners=function(){var t=this.hls;t.on(a.a.FRAG_LOADING,this.onFragLoading,this),t.on(a.a.FRAG_LOADED,this.onFragLoaded,this),t.on(a.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.a.ERROR,this.onError,this)},l.unregisterListeners=function(){var t=this.hls;t.off(a.a.FRAG_LOADING,this.onFragLoading,this),t.off(a.a.FRAG_LOADED,this.onFragLoaded,this),t.off(a.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.a.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(t,e){var r,i=e.frag;i.type===k.b.MAIN&&(this.timer||(this.fragCurrent=i,this.partCurrent=null!=(r=e.part)?r:null,this.timer=self.setInterval(this.onCheck,100)))},l.onLevelLoaded=function(t,e){var r=this.hls.config;e.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,i=r.autoLevelEnabled,s=r.config,l=r.media;if(t&&l){var u=e?e.stats:t.stats,h=e?e.duration:t.duration;if(u.aborted)return o.b.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);if(i&&!l.paused&&l.playbackRate&&l.readyState){var d=performance.now()-u.loading.start,c=Math.abs(l.playbackRate);if(!(d<=500*h/c)){var f=r.levels,g=r.minAutoLevel,v=f[t.level],p=u.total||Math.max(u.loaded,Math.round(h*v.maxBitrate/8)),m=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),y=(p-u.loaded)/m,T=l.currentTime,b=(lt.bufferInfo(l,T,s.maxBufferHole).end-T)/c;if(!(b>=2*h/c||y<=b)){var E,S=Number.POSITIVE_INFINITY;for(E=t.level-1;E>g;E--){if((S=h*f[E].maxBitrate/(6.4*m))<b)break}if(!(S>=y)){var L=this.bwEstimator.getEstimate();o.b.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+E+"\n Current BW estimate: "+(Object(n.a)(L)?(L/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+y.toFixed(3)+" s\n Estimated load time for the next fragment: "+S.toFixed(3)+" s\n Time to underbuffer: "+b.toFixed(3)+" s"),r.nextLoadLevel=E,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),r.trigger(a.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:u})}}}}}},l.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if(r.type===k.b.MAIN&&Object(n.a)(r.sn)){var s=i?i.stats:r.stats,o=i?i.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[r.level],u=(l.loaded?l.loaded.bytes:0)+s.loaded,h=(l.loaded?l.loaded.duration:0)+o;l.loaded={bytes:u,duration:h},l.realBitrate=Math.round(8*u/h)}if(r.bitrateTest){var d={stats:s,frag:r,part:i,id:r.type};this.onFragBuffered(a.a.FRAG_BUFFERED,d),r.bitrateTest=!1}}},l.onFragBuffered=function(t,e){var r=e.frag,i=e.part,n=i?i.stats:r.stats;if(!n.aborted&&r.type===k.b.MAIN&&"initSegment"!==r.sn){var a=n.parsing.end-n.loading.start;this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},l.onError=function(t,e){switch(e.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,i=r.maxAutoLevel,n=r.config,a=r.minAutoLevel,s=r.media,l=e?e.duration:t?t.duration:0,u=s?s.currentTime:0,h=s&&0!==s.playbackRate?Math.abs(s.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,c=(lt.bufferInfo(s,u,n.maxBufferHole).end-u)/h,f=this.findBestLevel(d,a,i,c,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(f>=0)return f;o.b.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,p=n.abrBandWidthUpFactor;if(!c){var m=this.bitrateTestDelay;if(m)g=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-m,o.b.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=p=1}return f=this.findBestLevel(d,a,i,c+g,v,p),Math.max(f,0)},l.findBestLevel=function(t,e,r,i,n,a){for(var s,l=this.fragCurrent,u=this.partCurrent,h=this.lastLoadedFragLevel,d=this.hls.levels,c=d[h],f=!(null==c||null===(s=c.details)||void 0===s||!s.live),g=null==c?void 0:c.codecSet,v=u?u.duration:l?l.duration:0,p=r;p>=e;p--){var m=d[p];if(m&&(!g||m.codecSet===g)){var y=m.details,T=(u?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||v,b=void 0;b=p<=h?n*t:a*t;var E=d[p].maxBitrate,S=E*T/b;if(o.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+p+"/"+Math.round(b)+"/"+E+"/"+T+"/"+i+"/"+S),b>E&&(!S||f&&!this.bitrateTestDelay||S<i))return p}}return-1},e=t,(r=[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this.bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var r=this.getNextABRAutoLevel();return-1!==t&&(r=Math.min(t,r)),r},set:function(t){this._nextAutoLevel=t}}])&&ae(e.prototype,r),i&&ae(e,i),t}(),oe=r(13);function le(){return(le=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}function ue(t,e){return(ue=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var he=function(t){var e,r;function i(e,r){var i;return(i=t.call(this,e,r,"[audio-stream-controller]")||this).videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i._registerListeners(),i}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,ue(e,r);var l=i.prototype;return l.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},l._registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.a.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(a.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(a.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(a.a.ERROR,this.onError,this),t.on(a.a.BUFFER_RESET,this.onBufferReset,this),t.on(a.a.BUFFER_CREATED,this.onBufferCreated,this),t.on(a.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(a.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(a.a.FRAG_BUFFERED,this.onFragBuffered,this)},l._unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.a.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(a.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(a.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(a.a.ERROR,this.onError,this),t.off(a.a.BUFFER_RESET,this.onBufferReset,this),t.off(a.a.BUFFER_CREATED,this.onBufferCreated,this),t.off(a.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(a.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(a.a.FRAG_BUFFERED,this.onFragBuffered,this)},l.onInitPtsFound=function(t,e){var r=e.frag,i=e.id,n=e.initPTS;if("main"===i){var a=r.cc;this.initPTS[r.cc]=n,this.log("InitPTS for cc: "+a+" found from main: "+n),this.videoTrackCC=a,this.state===Ht&&this.tick()}},l.startLoad=function(t){if(!this.levels)return this.startPosition=t,void(this.state=Ot);var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=xt):(this.loadedmetadata=!1,this.state=Nt),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},l.doTick=function(){switch(this.state){case xt:this.doTickIdle();break;case Nt:var e,r=this.levels,i=this.trackId,n=null==r||null===(e=r[i])||void 0===e?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=Ht}break;case Ft:var a,s=performance.now(),l=this.retryDate;(!l||s>=l||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=xt);break;case Ht:var u=this.waitingData;if(u){var h=u.frag,d=u.part,c=u.cache,f=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Mt;var g={frag:h,part:d,payload:c.flush(),networkDetails:null};this._handleFragmentLoadProgress(g),f&&t.prototype._handleFragmentLoadComplete.call(this,g)}else if(this.videoTrackCC!==this.waitingVideoCC)o.b.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var v=this.getLoadPosition(),p=lt.bufferInfo(this.mediaBuffer,v,this.config.maxBufferHole);mt(p.end,this.config.maxFragLookUpTolerance,h)<0&&(o.b.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+p.end+" is needed"),this.clearWaitingFragment())}}else this.state=xt}this.onTickEnd()},l.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=xt)},l.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},l.doTickIdle=function(){var t,e,r=this.hls,i=this.levels,n=this.media,s=this.trackId,o=r.config;if(i&&i[s]&&(n||!this.startFragRequested&&o.startFragPrefetch)){var l=i[s].details;if(!l||l.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(l))this.state=Nt;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.a.AUDIO,k.b.AUDIO));var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,k.b.AUDIO);if(null!==h){var d=h.len,c=this.getMaxBufferLength(),f=this.audioSwitch;if(!(d>=c)||f){if(!f&&this._streamEnded(h,l))return r.trigger(a.a.BUFFER_EOS,{type:"audio"}),void(this.state=Kt);var g=l.fragments[0].start,v=h.end;if(f){var p=this.getLoadPosition();v=p,l.PTSKnown&&p<g&&(h.end>g||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=g+.05)}var m=this.getNextFragment(v,l);m?"identity"!==(null===(t=m.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=m.decryptdata)&&void 0!==e&&e.key?this.loadFragment(m,l,v):this.loadKey(m,l):this.bufferFlushed=!0}}}}},l.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),r=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,k.b.MAIN);return null===r?e:Math.max(e,r.len)},l.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(t,e){var r=e.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(t){return new j(t)}))},l.onAudioTrackSwitching=function(t,e){var r=!!e.url;this.trackId=e.id;var i=this.fragCurrent;null!=i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=xt):this.state=Ot,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(t,e){this.mainDetails=e.details},l.onAudioTrackLoaded=function(t,e){var r,i=this.levels,n=e.details,a=e.id;if(i){this.log("Track "+a+" loaded ["+n.startSN+","+n.endSN+"],duration:"+n.totalduration);var s=i[a],o=0;if(n.live||null!==(r=s.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(n.fragments[0]||(n.deltaUpdateFailed=!0),n.deltaUpdateFailed||!l)return;!s.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(gt(n,l),o=n.fragments[0].start):o=this.alignPlaylists(n,s.details)}s.details=n,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(s.details,o),this.state!==Nt||this.waitForCdnTuneIn(n)||(this.state=xt),this.tick()}else this.warn("Audio tracks were reset while loading level "+a)},l._handleFragmentLoadProgress=function(t){var e,r=t.frag,i=t.part,n=t.payload,a=this.config,s=this.trackId,l=this.levels;if(l){var u=l[s],h=u.details,d=a.defaultAudioCodec||u.audioCodec||"mp4a.40.2",c=this.transmuxer;c||(c=this.transmuxer=new Jt(this.hls,k.b.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var f=this.initPTS[r.cc],g=null===(e=r.initSegment)||void 0===e?void 0:e.data;if(void 0!==f){var v=i?i.index:-1,p=-1!==v,m=new ut(r.level,r.sn,r.stats.chunkCount,n.byteLength,v,p);c.push(n,g,d,"",r,i,h.totalduration,!1,m,f)}else{o.b.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+h.startSN+" ,"+h.endSN+"],track "+s),(this.waitingData=this.waitingData||{frag:r,part:i,cache:new oe.a,complete:!1}).cache.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=Ht}}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},l._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(t,e){var r=e.tracks.audio;r&&(this.mediaBuffer=r.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},l.onFragBuffered=function(t,e){var r=e.frag,i=e.part;r.type===k.b.AUDIO&&(this.fragContextChanged(r)?this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==r.sn&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(a.a.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,i)))},l.onError=function(e,r){switch(r.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(k.b.AUDIO,r);break;case s.a.AUDIO_TRACK_LOAD_ERROR:case s.a.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==jt&&this.state!==Ot&&(this.state=r.fatal?jt:xt,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case s.a.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===Ut||this.state===Bt)){var i=!0,n=this.getFwdBufferInfo(this.mediaBuffer,k.b.AUDIO);n&&n.len>.5&&(i=!this.reduceMaxBufferLength(n.len)),i&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},l.onBufferFlushed=function(t,e){e.type===u.a.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(t){var e,r="audio",i=this.hls,n=t.remuxResult,s=t.chunkMeta,o=this.getCurrentContext(s);if(!o)return this.warn("The loading context changed while buffering fragment "+s.sn+" of level "+s.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(s.level);var l=o.frag,h=o.part,d=n.audio,c=n.text,f=n.id3,g=n.initSegment;if(!this.fragContextChanged(l)){if(this.state=Ut,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,l,s),i.trigger(a.a.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:r,tracks:g.tracks})),d){var v=d.startPTS,p=d.endPTS,m=d.startDTS,y=d.endDTS;h&&(h.elementaryStreams[u.a.AUDIO]={startPTS:v,endPTS:p,startDTS:m,endDTS:y}),l.setElementaryStreamInfo(u.a.AUDIO,v,p,m,y),this.bufferFragmentData(d,l,h,s)}if(null!=f&&null!==(e=f.samples)&&void 0!==e&&e.length){var T=le({frag:l,id:r},f);i.trigger(a.a.FRAG_PARSING_METADATA,T)}if(c){var b=le({frag:l,id:r},c);i.trigger(a.a.FRAG_PARSING_USERDATA,b)}}},l._bufferInitSegment=function(t,e,r){if(this.state===Ut){t.video&&delete t.video;var i=t.audio;if(i){i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:"+i.container+", codecs[parsed]=["+i.codec+"]"),this.hls.trigger(a.a.BUFFER_CODECS,t);var n=i.initSegment;if(null!=n&&n.byteLength){var s={type:"audio",frag:e,part:null,chunkMeta:r,parent:e.type,data:n};this.hls.trigger(a.a.BUFFER_APPENDING,s)}this.tick()}}},l.loadFragment=function(e,r,i){var a=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||a===tt.NOT_LOADED||a===tt.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):r.live&&!Object(n.a)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=Ht):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)))},l.completeAudioSwitch=function(){var e=this.hls,r=this.media,i=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(a.a.AUDIO_TRACK_SWITCHED,{id:i})},i}(Wt);function de(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ce(t,e){return(ce=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var fe=function(t){var e,r;function i(e){var r;return(r=t.call(this,e,"[audio-track-controller]")||this).tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,ce(e,r);var n,o,l,u=i.prototype;return u.registerListeners=function(){var t=this.hls;t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(a.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(a.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(a.a.ERROR,this.onError,this)},u.unregisterListeners=function(){var t=this.hls;t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(a.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(a.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(a.a.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},u.onManifestParsed=function(t,e){this.tracks=e.audioTracks||[]},u.onAudioTrackLoaded=function(t,e){var r=e.id,i=e.details,n=this.tracksInGroup[r];if(n){var a=n.details;n.details=e.details,this.log("audioTrack "+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,a))}else this.warn("Invalid audio track id "+r)},u.onLevelLoading=function(t,e){this.switchLevel(e.level)},u.onLevelSwitching=function(t,e){this.switchLevel(e.level)},u.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.audioGroupIds){var r=e.audioGroupIds[e.urlId];if(this.groupId!==r){this.groupId=r;var i=this.tracks.filter((function(t){return!r||t.groupId===r}));this.selectDefaultTrack&&!i.some((function(t){return t.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var n={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(a.a.AUDIO_TRACKS_UPDATED,n),this.selectInitialTrack()}}},u.onError=function(e,r){t.prototype.onError.call(this,e,r),!r.fatal&&r.context&&r.context.type===k.a.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},u.setAudioTrack=function(t){var e=this.tracksInGroup;if(t<0||t>=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=e[this.trackId];this.log("Now switching to audio-track index "+t);var i=e[t],n=i.id,s=i.groupId,o=void 0===s?"":s,l=i.name,u=i.type,h=i.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(a.a.AUDIO_TRACK_SWITCHING,{id:n,groupId:o,name:l,type:u,url:h}),!i.details||i.details.live){var d=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(d)}}},u.selectInitialTrack=function(){this.tracksInGroup;var t=this.trackName,e=this.findTrackId(t)||this.findTrackId();-1!==e?this.setAudioTrack(e):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},u.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r<e.length;r++){var i=e[r];if((!this.selectDefaultTrack||i.default)&&(!t||t===i.name))return i.id}return-1},u.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var r=e.id,i=e.groupId,n=e.url;if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(a.a.AUDIO_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null})}},n=i,(o=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}])&&de(n.prototype,o),l&&de(n,l),i}(Q);function ge(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ve(t,e){return(ve=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var pe=function(t){var e,r;function i(e,r){var i;return(i=t.call(this,e,r,"[subtitle-stream-controller]")||this).levels=[],i.currentTrackId=-1,i.tracksBuffered=[],i.mainDetails=null,i._registerListeners(),i}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,ve(e,r);var n,s,l,u=i.prototype;return u.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},u._registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(a.a.ERROR,this.onError,this),t.on(a.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(a.a.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(a.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(a.a.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},u._unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(a.a.ERROR,this.onError,this),t.off(a.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(a.a.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(a.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(a.a.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},u.startLoad=function(){this.stopLoad(),this.state=xt,this.setInterval(500),this.tick()},u.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},u.onLevelLoaded=function(t,e){this.mainDetails=e.details},u.onSubtitleFragProcessed=function(t,e){var r=e.frag,i=e.success;if(this.fragPrevious=r,this.state=xt,i){var n=this.tracksBuffered[this.currentTrackId];if(n){for(var a,s=r.start,o=0;o<n.length;o++)if(s>=n[o].start&&s<=n[o].end){a=n[o];break}var l=r.start+r.duration;a?a.end=l:(a={start:s,end:l},n.push(a)),this.fragmentTracker.fragBuffered(r)}}},u.onBufferFlushing=function(t,e){var r=e.startOffset,i=e.endOffset;if(0===r&&i!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,a=this.levels;if(!a.length||!a[n]||!a[n].details)return;var s=i-a[n].details.targetduration;if(s<=0)return;e.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((function(t){for(var e=0;e<t.length;)if(t[e].end<=s)t.shift();else{if(!(t[e].start<s))break;t[e].start=s,e++}})),this.fragmentTracker.removeFragmentsInRange(r,s,k.b.SUBTITLE)}},u.onError=function(t,e){var r,i=e.frag;i&&i.type===k.b.SUBTITLE&&(null!==(r=this.fragCurrent)&&void 0!==r&&r.loader&&this.fragCurrent.loader.abort(),this.state=xt)},u.onSubtitleTracksUpdated=function(t,e){var r=this,i=e.subtitleTracks;this.tracksBuffered=[],this.levels=i.map((function(t){return new j(t)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(t){r.tracksBuffered[t.id]=[]})),this.mediaBuffer=null},u.onSubtitleTrackSwitch=function(t,e){if(this.currentTrackId=e.id,this.levels.length&&-1!==this.currentTrackId){var r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}else this.clearInterval()},u.onSubtitleTrackLoaded=function(t,e){var r,i=e.details,n=e.id,a=this.currentTrackId,s=this.levels;if(s.length){var o=s[a];if(!(n>=s.length||n!==a)&&o){if(this.mediaBuffer=this.mediaBufferTimeRanges,i.live||null!==(r=o.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(i.deltaUpdateFailed||!l)return;var u=l.fragments[0];if(o.details)0===this.alignPlaylists(i,o.details)&&u&&z(i,u.start);else i.hasProgramDateTime&&l.hasProgramDateTime?gt(i,l):u&&z(i,u.start)}if(o.details=i,this.levelLastLoaded=n,this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===xt)pt(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}},u._handleFragmentLoadComplete=function(t){var e=t.frag,r=t.payload,i=e.decryptdata,n=this.hls;if(!this.fragContextChanged(e)&&r&&r.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var s=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).then((function(t){var r=performance.now();n.trigger(a.a.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:s,tdecrypt:r}})}))}},u.doTick=function(){if(this.media){if(this.state===xt){var t,e=this.currentTrackId,r=this.levels;if(!r.length||!r[e]||!r[e].details)return;var i=r[e].details,n=i.targetduration,s=this.config,l=this.media,u=lt.bufferedInfo(this.mediaBufferTimeRanges,l.currentTime-n,s.maxBufferHole),h=u.end;if(u.len>this.getMaxBufferLength()+n)return;var d,c=i.fragments,f=c.length,g=i.edge,v=this.fragPrevious;if(h<g)!(d=pt(v,c,h,s.maxFragLookUpTolerance))&&v&&v.start<c[0].start&&(d=c[0]);else d=c[f-1];null!==(t=d)&&void 0!==t&&t.encrypted?(o.b.log("Loading key for "+d.sn),this.state=Pt,this.hls.trigger(a.a.KEY_LOADING,{frag:d})):d&&this.fragmentTracker.getState(d)===tt.NOT_LOADED&&this.loadFragment(d,i,h)}}else this.state=xt},u.loadFragment=function(e,r,i){this.fragCurrent=e,t.prototype.loadFragment.call(this,e,r,i)},n=i,(s=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}])&&ge(n.prototype,s),l&&ge(n,l),i}(Wt);function me(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ye(t,e){return(ye=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Te(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];"subtitles"===i.kind&&i.label&&e.push(t[r])}return e}var be,Ee=function(t){var e,r;function i(e){var r;return(r=t.call(this,e,"[subtitle-track-controller]")||this).media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,ye(e,r);var n,s,o,l=i.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,t.prototype.destroy.call(this)},l.registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(a.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(a.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(a.a.ERROR,this.onError,this)},l.unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(a.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(a.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(a.a.ERROR,this.onError,this)},l.onMediaAttached=function(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},l.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},l.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Te(this.media.textTracks).forEach((function(t){x(t)})),this.subtitleTrack=-1,this.media=null)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},l.onSubtitleTrackLoaded=function(t,e){var r=e.id,i=e.details,n=this.trackId,a=this.tracksInGroup[n];if(a){var s=a.details;a.details=e.details,this.log("subtitle track "+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,s))}else this.warn("Invalid subtitle track id "+r)},l.onLevelLoading=function(t,e){this.switchLevel(e.level)},l.onLevelSwitching=function(t,e){this.switchLevel(e.level)},l.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var r=e.textGroupIds[e.urlId];if(this.groupId!==r){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,n=this.tracks.filter((function(t){return!r||t.groupId===r}));this.tracksInGroup=n;var s=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r;var o={subtitleTracks:n};this.log("Updating subtitle tracks, "+n.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(a.a.SUBTITLE_TRACKS_UPDATED,o),-1!==s&&this.setSubtitleTrack(s,i)}}},l.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r<e.length;r++){var i=e[r];if((!this.selectDefaultTrack||i.default)&&(!t||t===i.name))return i.id}return-1},l.onError=function(e,r){t.prototype.onError.call(this,e,r),!r.fatal&&r.context&&r.context.type===k.a.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},l.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var r=e.id,i=e.groupId,n=e.url;if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+r),this.hls.trigger(a.a.SUBTITLE_TRACK_LOADING,{url:n,id:r,groupId:i,deliveryDirectives:t||null})}},l.toggleTrackModes=function(t){var e=this,r=this.media,i=this.subtitleDisplay,n=this.trackId;if(r){var a=Te(r.textTracks),s=a.filter((function(t){return t.groupId===e.groupId}));if(-1===t)[].slice.call(a).forEach((function(t){t.mode="disabled"}));else{var o=s[n];o&&(o.mode="disabled")}var l=s[t];l&&(l.mode=i?"showing":"hidden")}},l.setSubtitleTrack=function(t,e){var r,i=this.tracksInGroup;if(this.media){if(this.trackId!==t&&this.toggleTrackModes(t),!(this.trackId===t&&(-1===t||null!==(r=i[t])&&void 0!==r&&r.details)||t<-1||t>=i.length)){this.clearTimer();var n=i[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,n){var s=n.id,o=n.groupId,l=void 0===o?"":o,u=n.name,h=n.type,d=n.url;this.hls.trigger(a.a.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:u,type:h,url:d});var c=this.switchParams(n.url,null==e?void 0:e.details);this.loadPlaylist(c)}else this.hls.trigger(a.a.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=Te(this.media.textTracks),r=0;r<e.length;r++)if("hidden"===e[r].mode)t=r;else if("showing"===e[r].mode){t=r;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)}},n=i,(s=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}])&&me(n.prototype,s),o&&me(n,o),i}(Q),Se=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var r=this.queues[e];r.push(t),1===r.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,r=new Promise((function(t){e=t})),i={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(i,t),r},e.executeNext=function(t){var e=this.buffers,r=this.queues,i=e[t],n=r[t];if(n.length){var a=n[0];try{a.execute()}catch(e){o.b.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(e),i&&i.updating||(n.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}(),Le=Yt(),Ae=/([ha]vc.)(?:\.[^.,]+)+/,Re=function(){function t(t){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=e.hls,r=e.media,i=e.mediaSource;o.b.log("[buffer-controller]: Media source opened"),r&&(e.updateMediaElementDuration(),t.trigger(a.a.MEDIA_ATTACHED,{media:r})),i&&i.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){o.b.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){o.b.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.a.BUFFER_RESET,this.onBufferReset,this),t.on(a.a.BUFFER_APPENDING,this.onBufferAppending,this),t.on(a.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(a.a.BUFFER_EOS,this.onBufferEos,this),t.on(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(a.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(a.a.FRAG_PARSED,this.onFragParsed,this),t.on(a.a.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.a.BUFFER_RESET,this.onBufferReset,this),t.off(a.a.BUFFER_APPENDING,this.onBufferAppending,this),t.off(a.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(a.a.BUFFER_EOS,this.onBufferEos,this),t.off(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(a.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(a.a.FRAG_PARSED,this.onFragParsed,this),t.off(a.a.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new Se(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,o.b.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var r=this.media=e.media;if(r&&Le){var i=this.mediaSource=new Le;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(i),this._objectUrl=r.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,r=this._objectUrl;if(e){if(o.b.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){o.b.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(r&&self.URL.revokeObjectURL(r),t.src===r?(t.removeAttribute("src"),t.load()):o.b.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(a.a.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var r=t.sourceBuffer[e];try{r&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(r),t.sourceBuffer[e]=void 0)}catch(t){o.b.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var r=this,i=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(i){var n=r.tracks[t];if(n&&"function"==typeof n.buffer.changeType){var a=e[t],s=a.codec,o=a.levelCodec,l=a.container;if((n.levelCodec||n.codec).replace(Ae,"$1")!==(o||s).replace(Ae,"$1")){var u=l+";codecs="+(o||s);r.appendChangeType(t,u)}}}else r.pendingTracks[t]=e[t]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var r=this,i=this.operationQueue,n={execute:function(){var n=r.sourceBuffer[t];n&&(o.b.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),n.changeType(e)),i.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){o.b.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};i.append(n,t)},e.onBufferAppending=function(t,e){var r=this,i=this.hls,n=this.operationQueue,l=this.tracks,u=e.data,h=e.type,d=e.frag,c=e.part,f=e.chunkMeta,g=f.buffering[h],v=self.performance.now();g.start=v;var p=d.stats.buffering,m=c?c.stats.buffering:null;0===p.start&&(p.start=v),m&&0===m.start&&(m.start=v);var y=l.audio,T="audio"===h&&1===f.id&&"audio/mpeg"===(null==y?void 0:y.container),b={execute:function(){if(g.executeStart=self.performance.now(),T){var t=r.sourceBuffer[h];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(o.b.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}r.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===p.first&&(p.first=t),m&&0===m.first&&(m.first=t);var e=r.sourceBuffer,i={};for(var n in e)i[n]=lt.getBuffered(e[n]);r.appendError=0,r.hls.trigger(a.a.BUFFER_APPENDED,{type:h,frag:d,part:c,chunkMeta:f,parent:d.type,timeRanges:i})},onError:function(t){o.b.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",t);var e={type:s.b.MEDIA_ERROR,parent:d.type,details:s.a.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=s.a.BUFFER_FULL_ERROR:(r.appendError++,e.details=s.a.BUFFER_APPEND_ERROR,r.appendError>i.config.appendErrorMaxRetry&&(o.b.error("[buffer-controller]: Failed "+i.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),i.trigger(a.a.ERROR,e)}};n.append(b,h)},e.onBufferFlushing=function(t,e){var r=this,i=this.operationQueue,n=function(t){return{execute:r.removeExecutor.bind(r,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(a.a.BUFFER_FLUSHED,{type:t})},onError:function(e){o.b.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?i.append(n(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){i.append(n(t),t)}))},e.onFragParsed=function(t,e){var r=this,i=e.frag,n=e.part,s=[],l=n?n.elementaryStreams:i.elementaryStreams;l[u.a.AUDIOVIDEO]?s.push("audiovideo"):(l[u.a.AUDIO]&&s.push("audio"),l[u.a.VIDEO]&&s.push("video"));0===s.length&&o.b.warn("Fragments must have at least one ElementaryStreamType set. type: "+i.type+" level: "+i.level+" sn: "+i.sn),this.blockBuffers((function(){var t=self.performance.now();i.stats.buffering.end=t,n&&(n.stats.buffering.end=t);var e=n?n.stats:i.stats;r.hls.trigger(a.a.FRAG_BUFFERED,{frag:i,part:n,stats:e,id:i.type})}),s)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var r=this;this.getSourceBufferTypes().reduce((function(t,i){var n=r.sourceBuffer[i];return e.type&&e.type!==i||n&&!n.ended&&(n.ended=!0,o.b.log("[buffer-controller]: "+i+" sourceBuffer now EOS")),t&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var t=r.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var r=e.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,r=this.media,i=this.sourceBuffer;if(r&&null!==e){var s=this.getSourceBufferTypes();if(s.length){var o=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(n.a)(o)&&!(o<0)){var l=r.currentTime,u=e.levelTargetDuration,h=Math.max(o,u),d=Math.floor(l/u)*u-h;s.forEach((function(r){var n=i[r];if(n){var s=lt.getBuffered(n);s.length>0&&d>s.start(0)&&(t.trigger(a.a.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(a.a.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(a.a.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:r}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,r=this.media,i=this.mediaSource,a=t.fragments[0].start+t.totalduration,s=r.duration,l=Object(n.a)(i.duration)?i.duration:0;t.live&&e.config.liveDurationInfinity?(o.b.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(t)):(a>l&&a>s||!Object(n.a)(s))&&(o.b.log("[buffer-controller]: Updating Media Source duration to "+a.toFixed(3)),i.duration=a)}},e.updateSeekableRange=function(t){var e=this.mediaSource,r=t.fragments;if(r.length&&t.live&&null!=e&&e.setLiveSeekableRange){var i=Math.max(0,r[0].start),n=Math.max(i,i+t.totalduration);e.setLiveSeekableRange(i,n)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,r=this.pendingTracks,i=Object.keys(r).length;if(i&&!t||2===i){this.createSourceBuffers(r),this.pendingTracks={};var n=this.getSourceBufferTypes();if(0===n.length)return void this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});n.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var i=0;for(var n in t)if(!e[n]){var l=t[n];if(!l)throw Error("source buffer exists for track "+n+", however track does not");var u=l.levelCodec||l.codec,h=l.container+";codecs="+u;o.b.log("[buffer-controller]: creating sourceBuffer("+h+")");try{var d=e[n]=r.addSourceBuffer(h),c=n;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[n]={buffer:d,codec:u,container:l.container,levelCodec:l.levelCodec,id:l.id},i++}catch(t){o.b.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:h})}}i&&this.hls.trigger(a.a.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){o.b.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(t);r&&r.onError(e)},e.removeExecutor=function(t,e,r){var i=this.media,a=this.mediaSource,s=this.operationQueue,l=this.sourceBuffer[t];if(!i||!a||!l)return o.b.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(t);var u=Object(n.a)(i.duration)?i.duration:1/0,h=Object(n.a)(a.duration)?a.duration:1/0,d=Math.max(0,e),c=Math.min(r,u,h);c>d?(o.b.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+t+" SourceBuffer"),l.remove(d,c)):s.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var r=this.operationQueue,i=this.sourceBuffer[e];if(!i)return o.b.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(e);i.ended=!1,i.appendBuffer(t)},e.blockBuffers=function(t,e){var r=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return o.b.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var i=this.operationQueue,n=e.map((function(t){return i.appendBlocker(t)}));Promise.all(n).then((function(){t(),e.forEach((function(t){var e=r.sourceBuffer[t];e&&e.updating||i.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,r){var i=this.sourceBuffer[t];if(i){var n=r.bind(this,t);this.listeners[t].push({event:e,listener:n}),i.addEventListener(e,n)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}(),De={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},ke=function(t){var e=t;return De.hasOwnProperty(t)&&(e=De[t]),String.fromCharCode(e)},_e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ie={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ce={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},we={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Oe=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(be||(be={}));var xe=function(){function t(){this.time=null,this.verboseLevel=be.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&o.b.log(this.time+" ["+t+"] "+e)},t}(),Pe=function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].toString(16));return e},Me=function(){function t(t,e,r,i,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=e||!1,this.italics=r||!1,this.background=i||"black",this.flash=n||!1}var e=t.prototype;return e.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},e.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],r=0;r<e.length;r++){var i=e[r];t.hasOwnProperty(i)&&(this[i]=t[i])}},e.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},e.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},e.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},e.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),Fe=function(){function t(t,e,r,i,n,a){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new Me(e,r,i,n,a)}var e=t.prototype;return e.reset=function(){this.uchar=" ",this.penState.reset()},e.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},e.setPenState=function(t){this.penState.copy(t)},e.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},e.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},e.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),Ne=function(){function t(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var e=0;e<100;e++)this.chars.push(new Fe);this.logger=t,this.pos=0,this.currPenState=new Me}var e=t.prototype;return e.equals=function(t){for(var e=!0,r=0;r<100;r++)if(!this.chars[r].equals(t.chars[r])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<100;e++)this.chars[e].copy(t.chars[e])},e.isEmpty=function(){for(var t=!0,e=0;e<100;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},e.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(be.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(be.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r<e+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(e)},e.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},e.insertChar=function(t){t>=144&&this.backSpace();var e=ke(t);this.pos>=100?this.logger.log(be.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,r=0;r<100;r++){var i=this.chars[r].uchar;" "!==i&&(e=!1),t.push(i)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),Ue=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new Ne(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,r=0;r<15;r++)if(!this.rows[r].equals(t.rows[r])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(be.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(be.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var r=0;r<15;r++)this.rows[r].clear();var i=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){var a=n.rows[i].cueStartTime,s=this.logger.time;if(a&&null!==s&&a<s)for(var o=0;o<this.nrRollUpRows;o++)this.rows[e-this.nrRollUpRows+o+1].copy(n.rows[i+o])}}this.currRow=e;var l=this.rows[this.currRow];if(null!==t.indent){var u=t.indent,h=Math.max(u-1,0);l.setCursor(t.indent),t.color=l.chars[h].penState.foreground}var d={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(d)},e.setBkgData=function(t){this.logger.log(be.INFO,"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},e.setRollUpRows=function(t){this.nrRollUpRows=t},e.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(be.TEXT,this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(be.INFO,"Rolling up")}else this.logger.log(be.DEBUG,"roll_up but nrRollUpRows not set yet")},e.getDisplayText=function(t){t=t||!1;for(var e=[],r="",i=-1,n=0;n<15;n++){var a=this.rows[n].getTextString();a&&(i=n+1,t?e.push("Row "+i+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},e.getTextAndFormat=function(){return this.rows},t}(),Be=function(){function t(t,e,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new Ue(r),this.nonDisplayedMemory=new Ue(r),this.lastOutputScreen=new Ue(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(be.INFO,"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(be.INFO,r+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(be.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},e.ccRCL=function(){this.logger.log(be.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},e.ccBS=function(){this.logger.log(be.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},e.ccAOF=function(){},e.ccAON=function(){},e.ccDER=function(){this.logger.log(be.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},e.ccRU=function(t){this.logger.log(be.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},e.ccFON=function(){this.logger.log(be.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},e.ccRDC=function(){this.logger.log(be.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},e.ccTR=function(){this.logger.log(be.INFO,"TR"),this.setMode("MODE_TEXT")},e.ccRTD=function(){this.logger.log(be.INFO,"RTD"),this.setMode("MODE_TEXT")},e.ccEDM=function(){this.logger.log(be.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},e.ccCR=function(){this.logger.log(be.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},e.ccENM=function(){this.logger.log(be.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},e.ccEOC=function(){if(this.logger.log(be.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(be.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},e.ccTO=function(t){this.logger.log(be.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},e.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(be.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}();function Ge(t,e,r){r.a=t,r.b=e}function Ke(t,e,r){return r.a===t&&r.b===e}var je=function(){function t(t,e,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var i=new xe;this.channels=[null,new Be(t,e,i),new Be(t+1,r,i)],this.cmdHistory={a:null,b:null},this.logger=i}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var r,i,n,a=!1;this.logger.time=t;for(var s=0;s<e.length;s+=2)if(i=127&e[s],n=127&e[s+1],0!==i||0!==n){if(this.logger.log(be.DATA,"["+Pe([e[s],e[s+1]])+"] -> ("+Pe([i,n])+")"),(r=this.parseCmd(i,n))||(r=this.parseMidrow(i,n)),r||(r=this.parsePAC(i,n)),r||(r=this.parseBackgroundAttributes(i,n)),!r&&(a=this.parseChars(i,n))){var o=this.currentChannel;if(o&&o>0)this.channels[o].insertChars(a);else this.logger.log(be.WARNING,"No channel found yet. TEXT-MODE?")}r||a||this.logger.log(be.WARNING,"Couldn't parse cleaned data "+Pe([i,n])+" orig: "+Pe([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var r=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;if(Ke(t,e,r))return Ge(null,null,r),this.logger.log(be.DEBUG,"Repeated command ("+Pe([t,e])+") is dropped"),!0;var i=20===t||21===t||23===t?1:2,n=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?n.ccRCL():33===e?n.ccBS():34===e?n.ccAOF():35===e?n.ccAON():36===e?n.ccDER():37===e?n.ccRU(2):38===e?n.ccRU(3):39===e?n.ccRU(4):40===e?n.ccFON():41===e?n.ccRDC():42===e?n.ccTR():43===e?n.ccRTD():44===e?n.ccEDM():45===e?n.ccCR():46===e?n.ccENM():47===e&&n.ccEOC():n.ccTO(e-32),Ge(t,e,r),this.currentChannel=i,!0},e.parseMidrow=function(t,e){var r=0;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currentChannel)return this.logger.log(be.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[r];return!!i&&(i.ccMIDROW(e),this.logger.log(be.DEBUG,"MIDROW ("+Pe([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var r,i=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;if(Ke(t,e,i))return Ge(null,null,i),!0;var n=t<=23?1:2;r=e>=64&&e<=95?1===n?_e[t]:Ce[t]:1===n?Ie[t]:we[t];var a=this.channels[n];return!!a&&(a.setPAC(this.interpretPAC(r,e)),Ge(t,e,i),this.currentChannel=n,!0)},e.interpretPAC=function(t,e){var r,i={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},e.parseChars=function(t,e){var r,i,n=null,a=null;(t>=25?(r=2,a=t-8):(r=1,a=t),a>=17&&a<=19)?(i=17===a?e+80:18===a?e+112:e+144,this.logger.log(be.INFO,"Special char '"+ke(i)+"' in channel "+r),n=[i]):t>=32&&t<=127&&(n=0===e?[t]:[t,e]);if(n){var s=Pe(n);this.logger.log(be.DEBUG,"Char codes = "+s.join(",")),Ge(t,e,this.cmdHistory)}return n},e.parseBackgroundAttributes=function(t,e){var r;if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;var i={};16===t||24===t?(r=Math.floor((e-32)/2),i.background=Oe[r],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0));var n=t<=23?1:2;return this.channels[n].setBkgData(i),Ge(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var e=this.channels[t];e&&e.reset()}this.cmdHistory={a:null,b:null}},e.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++){var r=this.channels[e];r&&r.cueSplitAtTime(t)}},t}(),He=function(){function t(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}var e=t.prototype;return e.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},e.newCue=function(t,e,r){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[],this.startTime=null},t}(),Ve=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function r(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var r=e.toLowerCase();return!!~t.indexOf(r)&&r}function i(t){return r(e,t)}function n(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)t[s]=a[s]}return t}function a(e,a,s){var o=this,l={enumerable:!0};o.hasBeenReset=!1;var u="",h=!1,d=e,c=a,f=s,g=null,v="",p=!0,m="auto",y="start",T=50,b="middle",E=50,S="middle";Object.defineProperty(o,"id",n({},l,{get:function(){return u},set:function(t){u=""+t}})),Object.defineProperty(o,"pauseOnExit",n({},l,{get:function(){return h},set:function(t){h=!!t}})),Object.defineProperty(o,"startTime",n({},l,{get:function(){return d},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",n({},l,{get:function(){return c},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");c=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",n({},l,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",n({},l,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",n({},l,{get:function(){return v},set:function(e){var i=function(e){return r(t,e)}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");v=i,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",n({},l,{get:function(){return p},set:function(t){p=!!t,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",n({},l,{get:function(){return m},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",n({},l,{get:function(){return y},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",n({},l,{get:function(){return T},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",n({},l,{get:function(){return b},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",n({},l,{get:function(){return E},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",n({},l,{get:function(){return S},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}(),We=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function Ye(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+parseFloat(i||0)}var r=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?e(r[2],r[3],0,r[4]):e(r[1],r[2],r[3],r[4]):null}var qe=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,r){for(var i=0;i<r.length;++i)if(e===r[i]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var r=parseFloat(e);if(r>=0&&r<=100)return this.set(t,r),!0}return!1},t}();function Xe(t,e,r,i){var n=i?t.split(i):[t];for(var a in n)if("string"==typeof n[a]){var s=n[a].split(r);if(2===s.length)e(s[0],s[1])}}var ze=new Ve(0,0,""),Qe="middle"===ze.align?"middle":"center";function $e(t,e,r){var i=t;function n(){var e=Ye(t);if(null===e)throw new Error("Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}if(a(),e.startTime=n(),a(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);t=t.substr(3),a(),e.endTime=n(),a(),function(t,e){var i=new qe;Xe(t,(function(t,e){var n;switch(t){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===e){i.set(t,r[a].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":n=e.split(","),i.integer(t,n[0]),i.percent(t,n[0])&&i.set("snapToLines",!1),i.alt(t,n[0],["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",Qe,"end"]);break;case"position":n=e.split(","),i.percent(t,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",Qe,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",Qe,"end","left","right"])}}),/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var n=i.get("line","auto");"auto"===n&&-1===ze.line&&(n=-1),e.line=n,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",Qe);var a=i.get("position","auto");"auto"===a&&50===ze.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function Je(t){return t.replace(/<br(?: \/)?>/gi,"\n")}var Ze=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new We,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function r(){var t=e.buffer,r=0;for(t=Je(t);r<t.length&&"\r"!==t[r]&&"\n"!==t[r];)++r;var i=t.substr(0,r);return"\r"===t[r]&&++r,"\n"===t[r]&&++r,e.buffer=t.substr(r),i}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var i="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var n=(i=r()).match(/^()?WEBVTT([ \t].*)?$/);if(!n||!n[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var a=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(a?a=!1:i=r(),e.state){case"HEADER":/:/.test(i)?Xe(i,(function(t,e){}),/:/):i||(e.state="ID");continue;case"NOTE":i||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){e.state="NOTE";break}if(!i)continue;if(e.cue=new Ve(0,0,""),e.state="CUE",-1===i.indexOf("--\x3e")){e.cue.id=i;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{$e(i,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var s=-1!==i.indexOf("--\x3e");if(!i||s&&(a=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=i;continue;case"BADCUE":i||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(t){this.onparsingerror&&this.onparsingerror(t)}return this.onflush&&this.onflush(),this},t}(),tr=r(8),er=r(16),rr=/\r\n|\n\r|\n|\r/g,ir=function(t,e,r){return void 0===r&&(r=0),t.substr(r,e.length)===e},nr=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return(e>>>0).toString()};function ar(t,e,r){return nr(t.toString())+nr(e.toString())+nr(r)}function sr(t,e,r,i,a,s,o,l){var u,h=new Ze,d=Object(M.f)(new Uint8Array(t)).trim().replace(rr,"\n").split("\n"),c=[],f=Object(tr.a)(e,r),g="00:00.000",v=0,p=0,m=!0,y=!1;h.oncue=function(t){var e=i[a],r=i.ccOffset,n=(v-f)/9e4;if(null!=e&&e.new&&(void 0!==p?r=i.ccOffset=e.start:function(t,e,r){var i=t[e],n=t[i.prevCC];if(!n||!n.new&&i.new)return t.ccOffset=t.presentationOffset=i.start,void(i.new=!1);for(;null!==(a=n)&&void 0!==a&&a.new;){var a;t.ccOffset+=i.start-n.start,i.new=!1,n=t[(i=n).prevCC]}t.presentationOffset=r}(i,a,n)),n&&(r=n-i.presentationOffset),y){var o=t.endTime-t.startTime,l=Object(er.b)(9e4*(t.startTime+r-p),9e4*s)/9e4;t.startTime=l,t.endTime=l+o}var u=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(u)),t.id||(t.id=ar(t.startTime,t.endTime,u)),t.endTime>0&&c.push(t)},h.onparsingerror=function(t){u=t},h.onflush=function(){u?l(u):o(c)},d.forEach((function(t){if(m){if(ir(t,"X-TIMESTAMP-MAP=")){m=!1,y=!0,t.substr(16).split(",").forEach((function(t){ir(t,"LOCAL:")?g=t.substr(6):ir(t,"MPEGTS:")&&(v=parseInt(t.substr(7)))}));try{p=function(t){var e=parseInt(t.substr(-3)),r=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),a=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(n.a)(e)&&Object(n.a)(r)&&Object(n.a)(i)&&Object(n.a)(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*r,e+=6e4*i,e+=36e5*a}(g)/1e3}catch(t){y=!1,u=t}return}""===t&&(m=!1)}h.parse(t+"\n")})),h.flush()}function or(){return(or=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}var lr=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,ur=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,hr={left:"start",center:"center",right:"end",start:"start",end:"end"};function dr(t,e,r,i,n){var a=Object(l.b)(new Uint8Array(t),["mdat"]);if(0!==a.length){var s=a[0],o=Object(M.f)(new Uint8Array(t,s.start,s.end-s.start)),u=Object(tr.c)(e,1,r);try{i(function(t,e){var r=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(i).reduce((function(t,e){return t[e]=r.getAttribute("ttp:"+e)||i[e],t}),{}),a="preserve"!==r.getAttribute("xml:space"),s=fr(cr(r,"styling","style")),o=fr(cr(r,"layout","region")),l=cr(r,"body","[begin]");return[].map.call(l,(function(t){var r=function t(e,r){return[].slice.call(e.childNodes).reduce((function(e,i,n){var a;return"br"===i.nodeName&&n?e+"\n":null!==(a=i.childNodes)&&void 0!==a&&a.length?t(i,r):r?e+i.textContent.trim().replace(/\s+/g," "):e+i.textContent}),"")}(t,a);if(!r||!t.hasAttribute("begin"))return null;var i=pr(t.getAttribute("begin"),n),l=pr(t.getAttribute("dur"),n),u=pr(t.getAttribute("end"),n);if(null===i)throw vr(t);if(null===u){if(null===l)throw vr(t);u=i+l}var h=new Ve(i-e,u-e,r);h.id=ar(h.startTime,h.endTime,h.text);var d=o[t.getAttribute("region")],c=s[t.getAttribute("style")];h.position=10,h.size=80;var f=function(t,e){var r="http://www.w3.org/ns/ttml#styling";return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(i,n){var a=gr(e,r,n)||gr(t,r,n);return a&&(i[n]=a),i}),{})}(d,c),g=f.textAlign;if(g){var v=hr[g];v&&(h.lineAlign=v),h.align=g}return or(h,f),h})).filter((function(t){return null!==t}))}(o,u))}catch(t){n(t)}}else n(new Error("Could not parse IMSC1 mdat"))}function cr(t,e,r){var i=t.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(r)):[]}function fr(t){return t.reduce((function(t,e){var r=e.getAttribute("xml:id");return r&&(t[r]=e),t}),{})}function gr(t,e,r){return t.hasAttributeNS(e,r)?t.getAttributeNS(e,r):null}function vr(t){return new Error("Could not parse ttml timestamp "+t)}function pr(t,e){if(!t)return null;var r=Ye(t);return null===r&&(lr.test(t)?r=function(t,e){var r=lr.exec(t),i=(0|r[4])+(0|r[5])/e.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+i/e.frameRate}(t,e):ur.test(t)&&(r=function(t,e){var r=ur.exec(t),i=Number(r[1]);switch(r[2]){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}(t,e))),r}var mr=function(){function t(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var e=new He(this,"textTrack1"),r=new He(this,"textTrack2"),i=new He(this,"textTrack3"),n=new He(this,"textTrack4");this.cea608Parser1=new je(1,e,r),this.cea608Parser2=new je(3,i,n)}t.on(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(a.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(a.a.FRAG_LOADING,this.onFragLoading,this),t.on(a.a.FRAG_LOADED,this.onFragLoaded,this),t.on(a.a.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(a.a.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(a.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(a.a.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=t.prototype;return e.destroy=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(a.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(a.a.FRAG_LOADING,this.onFragLoading,this),t.off(a.a.FRAG_LOADED,this.onFragLoaded,this),t.off(a.a.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(a.a.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(a.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(a.a.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(t,e,r,i,n){for(var s,o,l,u,h=!1,d=n.length;d--;){var c=n[d],f=(s=c[0],o=c[1],l=e,u=r,Math.min(o,u)-Math.max(s,l));if(f>=0&&(c[0]=Math.min(c[0],e),c[1]=Math.max(c[1],r),h=!0,f/(r-e)>.5))return}if(h||n.push([e,r]),this.config.renderTextTracksNatively){var g=this.captionsTracks[t];this.Cues.newCue(g,e,r,i)}else{var v=this.Cues.newCue(null,e,r,i);this.hls.trigger(a.a.CUES_PARSED,{type:"captions",cues:v,track:t})}},e.onInitPtsFound=function(t,e){var r=this,i=e.frag,n=e.id,s=e.initPTS,o=e.timescale,l=this.unparsedVttFrags;"main"===n&&(this.initPTS[i.cc]=s,this.timescale[i.cc]=o),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){r.onFragLoaded(a.a.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r<e.textTracks.length;r++){var i=e.textTracks[r];if(i[t])return i}return null},e.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},e.createNativeTrack=function(t){if(!this.captionsTracks[t]){var e=this.captionsProperties,r=this.captionsTracks,i=this.media,n=e[t],a=n.label,s=n.languageCode,o=this.getExistingTrack(t);if(o)r[t]=o,x(r[t]),w(r[t],i);else{var l=this.createTextTrack("captions",a,s);l&&(l[t]=!0,r[t]=l)}}},e.createNonNativeTrack=function(t){if(!this.nonNativeCaptionsTracks[t]){var e=this.captionsProperties[t];if(e){var r={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=r,this.hls.trigger(a.a.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}}},e.createTextTrack=function(t,e,r){var i=this.media;if(i)return i.addTextTrack(t,e,r)},e.onMediaAttaching=function(t,e){this.media=e.media,this._cleanTracks()},e.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach((function(e){x(t[e]),delete t[e]})),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var r=0;r<e.length;r++)x(e[r])}},e.onSubtitleTracksUpdated=function(t,e){var r=this;this.textTracks=[];var i=e.subtitleTracks||[],n=i.some((function(t){return"stpp.ttml.im1t"===t.textCodec}));if(this.config.enableWebVTT||n&&this.config.enableIMSC1){var s=this.tracks&&i&&this.tracks.length===i.length;if(this.tracks=i||[],this.config.renderTextTracksNatively){var o=this.media?this.media.textTracks:[];this.tracks.forEach((function(t,e){var i;if(e<o.length){for(var n=null,a=0;a<o.length;a++)if(yr(o[a],t)){n=o[a];break}n&&(i=n)}i?x(i):(i=r.createTextTrack("subtitles",t.name,t.lang))&&(i.mode="disabled"),i&&(i.groupId=t.groupId,r.textTracks.push(i))}))}else if(!s&&this.tracks&&this.tracks.length){var l=this.tracks.map((function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}}));this.hls.trigger(a.a.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},e.onManifestLoaded=function(t,e){var r=this;this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((function(t){var e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(e){var i="textTrack"+e[1],n=r.captionsProperties[i];n&&(n.label=t.name,t.lang&&(n.languageCode=t.lang),n.media=t)}}))},e.onFragLoading=function(t,e){var r=this.cea608Parser1,i=this.cea608Parser2,n=this.lastSn,a=this.lastPartIndex;if(this.enabled&&r&&i&&e.frag.type===k.b.MAIN){var s,o,l=e.frag.sn,u=null!=(s=null==e||null===(o=e.part)||void 0===o?void 0:o.index)?s:-1;l===n+1||l===n&&u===a+1||(r.reset(),i.reset()),this.lastSn=l,this.lastPartIndex=u}},e.onFragLoaded=function(t,e){var r=e.frag,i=e.payload,s=this.initPTS,o=this.unparsedVttFrags;if(r.type===k.b.SUBTITLE)if(i.byteLength){if(!Object(n.a)(s[r.cc]))return o.push(e),void(s.length&&this.hls.trigger(a.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Missing initial subtitle PTS")}));var l=r.decryptdata;if(null==l||null==l.key||"AES-128"!==l.method){var u=this.tracks[r.level],h=this.vttCCs;h[r.cc]||(h[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),u&&"stpp.ttml.im1t"===u.textCodec?this._parseIMSC1(r,i):this._parseVTTs(r,i,h)}}else this.hls.trigger(a.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(t,e){var r=this,i=this.hls;dr(e,this.initPTS[t.cc],this.timescale[t.cc],(function(e){r._appendCues(e,t.level),i.trigger(a.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(e){o.b.log("Failed to parse IMSC1: "+e),i.trigger(a.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))},e._parseVTTs=function(t,e,r){var i=this,n=this.hls;sr(e,this.initPTS[t.cc],this.timescale[t.cc],r,t.cc,t.start,(function(e){i._appendCues(e,t.level),n.trigger(a.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(r){i._fallbackToIMSC1(t,e),o.b.log("Failed to parse VTT cue: "+r),n.trigger(a.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:r})}))},e._fallbackToIMSC1=function(t,e){var r=this,i=this.tracks[t.level];i.textCodec||dr(e,this.initPTS[t.cc],this.timescale[t.cc],(function(){i.textCodec="stpp.ttml.im1t",r._parseIMSC1(t,e)}),(function(){i.textCodec="wvtt"}))},e._appendCues=function(t,e){var r=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[e];if("disabled"===i.mode)return;t.forEach((function(t){return O(i,t)}))}else{var n=this.tracks[e].default?"default":"subtitles"+e;r.trigger(a.a.CUES_PARSED,{type:"subtitles",cues:t,track:n})}},e.onFragDecrypted=function(t,e){var r=e.frag;if(r.type===k.b.SUBTITLE){if(!Object(n.a)(this.initPTS[r.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(a.a.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var r=this.cea608Parser1,i=this.cea608Parser2;if(this.enabled&&r&&i)for(var n=0;n<e.samples.length;n++){var a=e.samples[n].bytes;if(a){var s=this.extractCea608Data(a);r.addData(e.samples[n].pts,s[0]),i.addData(e.samples[n].pts,s[1])}}},e.onBufferFlushing=function(t,e){var r=e.startOffset,i=e.endOffset,n=e.endOffsetSubtitles,a=e.type,s=this.media;if(s&&!(s.currentTime<i)){if(!a||"video"===a){var o=this.captionsTracks;Object.keys(o).forEach((function(t){return P(o[t],r,i)}))}if(this.config.renderTextTracksNatively&&0===r&&void 0!==n){var l=this.textTracks;Object.keys(l).forEach((function(t){return P(l[t],r,n)}))}}},e.extractCea608Data=function(t){for(var e=31&t[0],r=2,i=[[],[]],n=0;n<e;n++){var a=t[r++],s=127&t[r++],o=127&t[r++],l=3&a;0===s&&0===o||0!=(4&a)&&(0!==l&&1!==l||(i[l].push(s),i[l].push(o)))}return i},t}();function yr(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function Tr(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var br,Er=function(){function t(t){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e,r,i,n=t.prototype;return n.setStreamController=function(t){this.streamController=t},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var t=this.hls;t.on(a.a.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var t=this.hls;t.off(a.a.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(e,r){t.isLevelAllowed(r.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(r.droppedLevel)},n.onMediaAttaching=function(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null},n.onManifestParsed=function(t,e){var r=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,r.config.capLevelToPlayerSize&&e.video&&this.startCapping()},n.onBufferCodecs=function(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},n.getMaxLevel=function(e){var r=this,i=this.hls.levels;if(!i.length)return-1;var n=i.filter((function(i,n){return t.isLevelAllowed(n,r.restrictedLevels)&&n<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var r=t.getBoundingClientRect();e.width=r.width,e.height=r.height,e.width||e.height||(e.width=r.right-r.left||t.width||0,e.height=r.bottom-r.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,r){if(!t||!t.length)return-1;for(var i,n,a=t.length-1,s=0;s<t.length;s+=1){var o=t[s];if((o.width>=e||o.height>=r)&&(i=o,!(n=t[s+1])||i.width!==n.width||i.height!==n.height)){a=s;break}}return a},e=t,i=[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(t){}return t}}],(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*t.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*t.contentScaleFactor}}])&&Tr(e.prototype,r),i&&Tr(e,i),t}(),Sr=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(a.a.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var r=this.hls.config;if(r.capLevelOnFPSDrop){var i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&"function"==typeof i.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,r){var i=performance.now();if(e){if(this.lastTime){var n=i-this.lastTime,s=r-this.lastDroppedFrames,l=e-this.lastDecodedFrames,u=1e3*s/n,h=this.hls;if(h.trigger(a.a.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:r}),u>0&&s>h.config.fpsDroppedMonitoringThreshold*l){var d=h.currentLevel;o.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===h.autoLevelCapping||h.autoLevelCapping>=d)&&(d-=1,h.trigger(a.a.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:h.currentLevel}),h.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();!function(t){t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready"}(br||(br={}));var Lr="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function Ar(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Rr,Dr,kr,_r=function(){function t(t){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=t,this._config=t.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var e,r,i,n=t.prototype;return n.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},n._registerListeners=function(){this.hls.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(a.a.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this)},n._unregisterListeners=function(){this.hls.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(a.a.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this)},n.getLicenseServerUrl=function(t){switch(t){case br.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+t+'"')},n._attemptKeySystemAccess=function(t,e,r){var i=this,n=function(t,e,r,i){switch(t){case br.WIDEVINE:return function(t,e,r){var i={audioCapabilities:[],videoCapabilities:[]};return t.forEach((function(t){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:r.audioRobustness||""})})),e.forEach((function(t){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:r.videoRobustness||""})})),[i]}(e,r,i);default:throw new Error("Unknown key-system: "+t)}}(t,e,r,this._drmSystemOptions);o.b.log("Requesting encrypted media key-system access");var a=this.requestMediaKeySystemAccess(t,n);this.mediaKeysPromise=a.then((function(e){return i._onMediaKeySystemAccessObtained(t,e)})),a.catch((function(e){o.b.error('Failed to obtain key-system "'+t+'" access:',e)}))},n._onMediaKeySystemAccessObtained=function(t,e){var r=this;o.b.log('Access for key-system "'+t+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:t};this._mediaKeysList.push(i);var n=Promise.resolve().then((function(){return e.createMediaKeys()})).then((function(e){return i.mediaKeys=e,o.b.log('Media-keys created for key-system "'+t+'"'),r._onMediaKeysCreated(),e}));return n.catch((function(t){o.b.error("Failed to create media-keys:",t)})),n},n._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach((function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),t._onNewMediaKeySession(e.mediaKeysSession))}))},n._onNewMediaKeySession=function(t){var e=this;o.b.log("New key-system session "+t.sessionId),t.addEventListener("message",(function(r){e._onKeySessionMessage(t,r.message)}),!1)},n._onKeySessionMessage=function(t,e){o.b.log("Got EME message event, creating license request"),this._requestLicense(e,(function(e){o.b.log("Received license data (length: "+(e?e.byteLength:e)+"), updating key-session"),t.update(e)}))},n.onMediaEncrypted=function(t){var e=this;if(o.b.log('Media is encrypted using "'+t.initDataType+'" init data type'),!this.mediaKeysPromise)return o.b.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_KEYS,fatal:!0});var r=function(r){e._media&&(e._attemptSetMediaKeys(r),e._generateRequestWithPreferredKeySession(t.initDataType,t.initData))};this.mediaKeysPromise.then(r).catch(r)},n._attemptSetMediaKeys=function(t){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return o.b.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_KEYS,fatal:!0});o.b.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},n._generateRequestWithPreferredKeySession=function(t,e){var r=this,i=this._mediaKeysList[0];if(!i)return o.b.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(i.mediaKeysSessionInitialized)o.b.warn("Key-Session already initialized but requested again");else{var n=i.mediaKeysSession;if(!n)return o.b.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!e)return o.b.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});o.b.log('Generating key-session request for "'+t+'" init data type'),i.mediaKeysSessionInitialized=!0,n.generateRequest(t,e).then((function(){o.b.debug("Key-session generation succeeded")})).catch((function(t){o.b.error("Error generating key-session request:",t),r.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},n._createLicenseXhr=function(t,e,r){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,t,e,r);var n=this._licenseXhrSetup;if(n)try{n.call(this.hls,i,t),n=void 0}catch(t){o.b.error(t)}try{i.readyState||i.open("POST",t,!0),n&&n.call(this.hls,i,t)}catch(t){throw new Error("issue setting up KeySystem license XHR "+t)}return i},n._onLicenseRequestReadyStageChange=function(t,e,r,i){switch(t.readyState){case 4:if(200===t.status){this._requestLicenseFailureCount=0,o.b.log("License request succeeded");var n=t.response,l=this._licenseResponseCallback;if(l)try{n=l.call(this.hls,t,e)}catch(t){o.b.error(t)}i(n)}else{if(o.b.error("License Request XHR failed ("+e+"). Status: "+t.status+" ("+t.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var u=3-this._requestLicenseFailureCount+1;o.b.warn("Retrying license request, "+u+" attempts left"),this._requestLicense(r,i)}}},n._generateLicenseRequestChallenge=function(t,e){switch(t.mediaKeySystemDomain){case br.WIDEVINE:return e}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},n._requestLicense=function(t,e){o.b.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return o.b.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var i=this.getLicenseServerUrl(r.mediaKeySystemDomain),n=this._createLicenseXhr(i,t,e);o.b.log("Sending license request to URL: "+i);var l=this._generateLicenseRequestChallenge(r,t);n.send(l)}catch(t){o.b.error("Failure requesting DRM license: "+t),this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(t,e){if(this._emeEnabled){var r=e.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},n.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},n.onManifestParsed=function(t,e){if(this._emeEnabled){var r=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),i=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(br.WIDEVINE,r,i)}},e=t,(r=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&Ar(e.prototype,r),i&&Ar(e,i),t}();function Ir(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Cr(t,e,r){return e&&Ir(t.prototype,e),r&&Ir(t,r),t}function wr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Or(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Or(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Or(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function xr(){return(xr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(Rr||(Rr={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(Dr||(Dr={})),function(t){t.VOD="v",t.LIVE="l"}(kr||(kr={}));var Pr=function(){function t(e){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(t){try{r.apply(t,{ot:Rr.MANIFEST,su:!r.initialized})}catch(t){o.b.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(t){try{var e=t.frag,i=r.hls.levels[e.level],n=r.getObjectType(e),a={d:1e3*e.duration,ot:n};n!==Rr.VIDEO&&n!==Rr.AUDIO&&n!=Rr.MUXED||(a.br=i.bitrate/1e3,a.tb=r.getTopBandwidth(n)/1e3,a.bl=r.getBufferLength(n)),r.apply(t,a)}catch(t){o.b.warn("Could not generate segment CMCD data.",t)}},this.hls=e;var i=this.config=e.config,n=i.cmcd;null!=n&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||t.uuid(),this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.registerListeners())}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(a.a.MEDIA_DETACHED,this.onMediaDetached,this),t.on(a.a.BUFFER_CREATED,this.onBufferCreated,this)},e.unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(a.a.MEDIA_DETACHED,this.onMediaDetached,this),t.off(a.a.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},e.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},e.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},e.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},e.onBufferCreated=function(t,e){var r,i;this.audioBuffer=null===(r=e.tracks.audio)||void 0===r?void 0:r.buffer,this.videoBuffer=null===(i=e.tracks.video)||void 0===i?void 0:i.buffer},e.createData=function(){var t;return{v:1,sf:Dr.HLS,sid:this.sid,cid:this.cid,pr:null===(t=this.media)||void 0===t?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},e.apply=function(e,r){void 0===r&&(r={}),xr(r,this.createData());var i=r.ot===Rr.INIT||r.ot===Rr.VIDEO||r.ot===Rr.MUXED;if(this.starved&&i&&(r.bs=!0,r.su=!0,this.starved=!1),null==r.su&&(r.su=this.buffering),this.useHeaders){var n=t.toHeaders(r);if(!Object.keys(n).length)return;e.headers||(e.headers={}),xr(e.headers,n)}else{var a=t.toQuery(r);if(!a)return;e.url=t.appendQueryToUri(e.url,a)}},e.getObjectType=function(t){var e=t.type;return"subtitle"===e?Rr.TIMED_TEXT:"initSegment"===t.sn?Rr.INIT:"audio"===e?Rr.AUDIO:"main"===e?this.hls.audioTracks.length?Rr.VIDEO:Rr.MUXED:void 0},e.getTopBandwidth=function(t){var e,r=0,i=this.hls;if(t===Rr.AUDIO)e=i.audioTracks;else{var n=i.maxAutoLevel,a=n>-1?n+1:i.levels.length;e=i.levels.slice(0,a)}for(var s,o=wr(e);!(s=o()).done;){var l=s.value;l.bitrate>r&&(r=l.bitrate)}return r>0?r:NaN},e.getBufferLength=function(t){var e=this.hls.media,r=t===Rr.AUDIO?this.audioBuffer:this.videoBuffer;return r&&e?1e3*lt.bufferInfo(r,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,r,i){e(t),this.loader.load(t,r,i)},Cr(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,r,i){e(t),this.loader.load(t,r,i)},Cr(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,r=[],i=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},n=function(t){return Math.round(t)},a=function(t){return 100*n(t/100)},s={br:n,d:n,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:n},o=wr(Object.keys(t||{}).sort());!(e=o()).done;){var l=e.value,u=t[l];if(i(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=s[l];h&&(u=h(u));var d=typeof u,c=void 0;c="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),r.push(c)}}return r.join(",")},t.toHeaders=function(e){for(var r={},i=["Object","Request","Session","Status"],n=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},s=0,o=Object.keys(e);s<o.length;s++){var l=o[s];n[null!=a[l]?a[l]:1][l]=e[l]}for(var u=0;u<n.length;u++){var h=t.serialize(n[u]);h&&(r["CMCD-"+i[u]]=h)}return r},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(t,e){if(!e)return t;var r=t.includes("?")?"&":"?";return""+t+r+e},t}(),Mr=r(12),Fr=/^age:\s*[\d.]+\s*$/m,Nr=function(){function t(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t?t.xhrSetup:null,this.stats=new Mr.a,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(t,e,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=r,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t=this.config,e=this.context;if(t){var r=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;var n=this.xhrSetup;try{if(n)try{n(r,e.url)}catch(t){r.open("GET",e.url,!0),n(r,e.url)}r.readyState||r.open("GET",e.url,!0);var a=this.context.headers;if(a)for(var s in a)r.setRequestHeader(s,a[s])}catch(t){return void this.callbacks.onError({code:r.status,text:t.message},e,r)}e.rangeEnd&&r.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=e.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),r.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,r=this.stats;if(t&&e){var i=e.readyState,n=this.config;if(!r.aborted&&i>=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===i){e.onreadystatechange=null,e.onprogress=null;var a=e.status;if(a>=200&&a<300){var s,l;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),l="arraybuffer"===t.responseType?(s=e.response).byteLength:(s=e.responseText).length,r.loaded=r.total=l,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(r,t,s,e),!this.callbacks)return;var h={url:e.responseURL,data:s};this.callbacks.onSuccess(h,r,t,e)}else r.retry>=n.maxRetry||a>=400&&a<499?(o.b.error(a+" while loading "+t.url),this.callbacks.onError({code:a,text:e.statusText},t,e)):(o.b.warn(a+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)}},e.loadtimeout=function(){o.b.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&Fr.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();function Ur(t){var e="function"==typeof Map?new Map:void 0;return(Ur=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return Br(t,arguments,jr(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Kr(i,t)})(t)}function Br(t,e,r){return(Br=Gr()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&Kr(n,r.prototype),n}).apply(null,arguments)}function Gr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Kr(t,e){return(Kr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function jr(t){return(jr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Hr(){return(Hr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}var Vr=function(){function t(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||Wr,this.controller=new self.AbortController,this.stats=new Mr.a}var e=t.prototype;return e.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},e.abortInternal=function(){var t=this.response;t&&t.ok||(this.stats.aborted=!0,this.controller.abort())},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},e.load=function(t,e,r){var i=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var s=function(t,e){var r={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Hr({},t.headers))};t.rangeEnd&&r.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return r}(t,this.controller.signal),o=r.onProgress,l="arraybuffer"===t.responseType,u=l?"byteLength":"length";this.context=t,this.config=e,this.callbacks=r,this.request=this.fetchSetup(t,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){i.abortInternal(),r.onTimeout(a,t,i.response)}),e.timeout),self.fetch(this.request).then((function(r){if(i.response=i.loader=r,!r.ok){var s=r.status,u=r.statusText;throw new Yr(u||"fetch, bad network response",s,r)}return a.loading.first=Math.max(self.performance.now(),a.loading.start),a.total=parseInt(r.headers.get("Content-Length")||"0"),o&&Object(n.a)(e.highWaterMark)?i.loadProgressively(r,a,t,e.highWaterMark,o):l?r.arrayBuffer():r.text()})).then((function(s){var l=i.response;self.clearTimeout(i.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first),a.loaded=a.total=s[u];var h={url:l.url,data:s};o&&!Object(n.a)(e.highWaterMark)&&o(a,t,s,l),r.onSuccess(h,a,t,l)})).catch((function(e){if(self.clearTimeout(i.requestTimeout),!a.aborted){var n=e.code||0;r.onError({code:n,text:e.message},t,e.details)}}))},e.getCacheAge=function(){var t=null;if(this.response){var e=this.response.headers.get("age");t=e?parseFloat(e):null}return t},e.loadProgressively=function(t,e,r,i,n){void 0===i&&(i=0);var a=new oe.a,s=t.body.getReader();return function o(){return s.read().then((function(s){if(s.done)return a.dataLength&&n(e,r,a.flush(),t),Promise.resolve(new ArrayBuffer(0));var l=s.value,u=l.length;return e.loaded+=u,u<i||a.dataLength?(a.push(l),a.dataLength>=i&&n(e,r,a.flush(),t)):n(e,r,l,t),o()})).catch((function(){return Promise.reject()}))}()},t}();function Wr(t,e){return new self.Request(t.url,e)}var Yr=function(t){var e,r;function i(e,r,i){var n;return(n=t.call(this,e)||this).code=void 0,n.details=void 0,n.code=r,n.details=i,n}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,Kr(e,r),i}(Ur(Error)),qr=Vr,Xr=/\s/;function zr(){return(zr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}function Qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function $r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qr(Object(r),!0).forEach((function(e){Jr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Jr(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Zr=$r($r({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:Nr,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:se,bufferController:Re,capLevelController:Er,fpsController:Sr,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:Lr,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},{cueHandler:{newCue:function(t,e,r,i){for(var n,a,s,o,l,u=[],h=self.VTTCue||self.TextTrackCue,d=0;d<i.rows.length;d++)if(s=!0,o=0,l="",!(n=i.rows[d]).isEmpty()){for(var c=0;c<n.chars.length;c++)Xr.test(n.chars[c].uchar)&&s?o++:(l+=n.chars[c].uchar,s=!1);n.cueStartTime=e,e===r&&(r+=1e-4),o>=16?o--:o++;var f=Je(l.trim()),g=ar(e,r,f);t&&t.cues&&t.cues.getCueById(g)||((a=new h(e,r,f)).id=g,a.line=d+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*o/32)),u.push(a))}return t&&u.length&&(u.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),u.forEach((function(e){return O(t,e)}))),u}},enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:pe,subtitleTrackController:Ee,timelineController:mr,audioStreamController:he,audioTrackController:fe,emeController:_r,cmcdController:Pr});function ti(t){var e=t.loader;e!==qr&&e!==Nr?(o.b.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}()&&(t.loader=qr,t.progressive=!0,t.enableSoftwareAES=!0,o.b.log("[config]: Progressive streaming enabled, using FetchLoader"))}function ei(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var ri=function(){function t(e){void 0===e&&(e={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Qt.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var r=this.config=function(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return zr({},t,e)}(t.DefaultConfig,e);this.userConfig=e,Object(o.a)(r.debug),this._autoLevelCapping=-1,r.progressive&&ti(r);var i=r.abrController,n=r.bufferController,a=r.capLevelController,s=r.fpsController,l=this.abrController=new i(this),u=this.bufferController=new n(this),h=this.capLevelController=new a(this),d=new s(this),c=new I(this),f=new C(this),g=new F(this),v=this.levelController=new rt(this),p=new it(this),m=this.streamController=new re(this,p);h.setStreamController(m),d.setStreamController(m);var y=[v,m];this.networkControllers=y;var T=[c,f,l,u,h,d,g,p];this.audioTrackController=this.createController(r.audioTrackController,null,y),this.createController(r.audioStreamController,p,y),this.subtitleTrackController=this.createController(r.subtitleTrackController,null,y),this.createController(r.subtitleStreamController,p,y),this.createController(r.timelineController,null,T),this.emeController=this.createController(r.emeController,null,T),this.cmcdController=this.createController(r.cmcdController,null,T),this.latencyController=this.createController(B,null,T),this.coreComponents=T}t.isSupported=function(){return function(){var t=Yt();if(!t)return!1;var e=qt(),r=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!r&&!!i}()};var e,r,n,l=t.prototype;return l.createController=function(t,e,r){if(t){var i=e?new t(this,e):new t(this);return r&&r.push(i),i}return null},l.on=function(t,e,r){void 0===r&&(r=this),this._emitter.on(t,e,r)},l.once=function(t,e,r){void 0===r&&(r=this),this._emitter.once(t,e,r)},l.removeAllListeners=function(t){this._emitter.removeAllListeners(t)},l.off=function(t,e,r,i){void 0===r&&(r=this),this._emitter.off(t,e,r,i)},l.listeners=function(t){return this._emitter.listeners(t)},l.emit=function(t,e,r){return this._emitter.emit(t,e,r)},l.trigger=function(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){o.b.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.trigger(a.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.INTERNAL_EXCEPTION,fatal:!1,event:t,error:e})}return!1},l.listenerCount=function(t){return this._emitter.listenerCount(t)},l.destroy=function(){o.b.log("destroy"),this.trigger(a.a.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(t){return t.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(t){return t.destroy()})),this.coreComponents.length=0},l.attachMedia=function(t){o.b.log("attachMedia"),this._media=t,this.trigger(a.a.MEDIA_ATTACHING,{media:t})},l.detachMedia=function(){o.b.log("detachMedia"),this.trigger(a.a.MEDIA_DETACHING,void 0),this._media=null},l.loadSource=function(t){this.stopLoad();var e=this.media,r=this.url,n=this.url=i.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});o.b.log("loadSource:"+n),e&&r&&r!==n&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(e)),this.trigger(a.a.MANIFEST_LOADING,{url:t})},l.startLoad=function(t){void 0===t&&(t=-1),o.b.log("startLoad("+t+")"),this.networkControllers.forEach((function(e){e.startLoad(t)}))},l.stopLoad=function(){o.b.log("stopLoad"),this.networkControllers.forEach((function(t){t.stopLoad()}))},l.swapAudioCodec=function(){o.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},l.recoverMediaError=function(){o.b.log("recoverMediaError");var t=this._media;this.detachMedia(),t&&this.attachMedia(t)},l.removeLevel=function(t,e){void 0===e&&(e=0),this.levelController.removeLevel(t,e)},e=t,n=[{key:"version",get:function(){return"1.1.3"}},{key:"Events",get:function(){return a.a}},{key:"ErrorTypes",get:function(){return s.b}},{key:"ErrorDetails",get:function(){return s.a}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:Zr},set:function(e){t.defaultConfig=e}}],(r=[{key:"levels",get:function(){var t=this.levelController.levels;return t||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){o.b.log("set currentLevel:"+t),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){o.b.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){o.b.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){o.b.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){o.b.log("set startLevel:"+t),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(t){var e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){this._autoLevelCapping!==t&&(o.b.log("set autoLevelCapping:"+t),this._autoLevelCapping=t)}},{key:"bandwidthEstimate",get:function(){var t=this.abrController.bwEstimator;return t?t.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var r=t.length,i=0;i<r;i++)if(t[i].maxBitrate>e)return i;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&ei(e.prototype,r),n&&ei(e,n),t}();ri.defaultConfig=void 0}]).default}));
 
1
+ "undefined"!=typeof window&&function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=20)}([function(t,e,i){"use strict";var r;i.d(e,"a",(function(){return r})),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(r||(r={}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return l}));var r=function(){},n={trace:r,debug:r,log:r,warn:r,info:r,error:r},a=n;function s(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):r}function o(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];i.forEach((function(e){a[e]=t[e]?t[e].bind(t):s(e)}))}(t,"debug","log","info","warn","error");try{a.log()}catch(t){a=n}}else a=n}var l=n},function(t,e,i){"use strict";var r,n;i.d(e,"b",(function(){return r})),i.d(e,"a",(function(){return n})),function(t){t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError"}(r||(r={})),function(t){t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown"}(n||(n={}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var r=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)};Number.MAX_SAFE_INTEGER},function(t,e,i){"use strict";var r,n;i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return n})),function(t){t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack"}(r||(r={})),function(t){t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle"}(n||(n={}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return l})),i.d(e,"c",(function(){return g})),i.d(e,"k",(function(){return v})),i.d(e,"h",(function(){return p})),i.d(e,"e",(function(){return m})),i.d(e,"d",(function(){return y})),i.d(e,"f",(function(){return b})),i.d(e,"l",(function(){return E})),i.d(e,"b",(function(){return S})),i.d(e,"j",(function(){return L})),i.d(e,"i",(function(){return D})),i.d(e,"g",(function(){return R}));var r=i(9),n=i(6),a=i(7),s=Math.pow(2,32)-1,o=[].push,l={video:1,audio:2,id3:3,text:4};function u(t){return String.fromCharCode.apply(null,t)}function h(t,e){var i=t[e]<<8|t[e+1];return i<0?65536+i:i}function d(t,e){var i=c(t,e);return i<0?4294967296+i:i}function c(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function f(t,e,i){t[e]=i>>24,t[e+1]=i>>16&255,t[e+2]=i>>8&255,t[e+3]=255&i}function g(t,e){var i=[];if(!e.length)return i;for(var r=t.byteLength,n=0;n<r;){var a=d(t,n),s=a>1?n+a:r;if(u(t.subarray(n+4,n+8))===e[0])if(1===e.length)i.push(t.subarray(n+8,s));else{var l=g(t.subarray(n+8,s),e.slice(1));l.length&&o.apply(i,l)}n=s}return i}function v(t){var e=[],i=t[0],r=8,n=d(t,r);r+=4;r+=0===i?8:16,r+=2;var a=t.length+0,s=h(t,r);r+=2;for(var o=0;o<s;o++){var l=r,u=d(t,l);l+=4;var c=2147483647&u;if(1===(2147483648&u)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var f=d(t,l);l+=4,e.push({referenceSize:c,subsegmentDuration:f,info:{duration:f/n,start:a,end:a+c-1}}),a+=c,r=l+=4}return{earliestPresentationTime:0,timescale:n,version:i,referencesCount:s,references:e}}function p(t){for(var e=[],i=g(t,["moov","trak"]),r=0;r<i.length;r++){var a=i[r],s=g(a,["tkhd"])[0];if(s){var o=s[0],l=0===o?12:20,h=d(s,l),c=g(a,["mdia","mdhd"])[0];if(c){var f=d(c,l=0===(o=c[0])?12:20),v=g(a,["mdia","hdlr"])[0];if(v){var p=u(v.subarray(8,12)),m={soun:n.a.AUDIO,vide:n.a.VIDEO}[p];if(m){var y=g(a,["mdia","minf","stbl","stsd"])[0],T=void 0;y&&(T=u(y.subarray(12,16))),e[h]={timescale:f,type:m},e[m]={timescale:f,id:h,codec:T}}}}}}return g(t,["moov","mvex","trex"]).forEach((function(t){var i=d(t,4),r=e[i];r&&(r.default={duration:d(t,12),flags:d(t,20)})})),e}function m(t,e){return g(e,["moof","traf"]).reduce((function(e,i){var r=g(i,["tfdt"])[0],n=r[0],a=g(i,["tfhd"]).reduce((function(e,i){var a=d(i,4),s=t[a];if(s){var o=d(r,4);1===n&&(o*=Math.pow(2,32),o+=d(r,8));var l=o/(s.timescale||9e4);if(isFinite(l)&&(null===e||l<e))return l}return e}),null);return null!==a&&isFinite(a)&&(null===e||a<e)?a:e}),null)||0}function y(t,e){for(var i=0,r=0,a=0,s=g(t,["moof","traf"]),o=0;o<s.length;o++){var l=s[o],u=g(l,["tfhd"])[0],h=e[d(u,4)];if(h){var c=h.default,f=d(u,0)|(null==c?void 0:c.flags),p=null==c?void 0:c.duration;8&f&&(p=d(u,2&f?12:8));for(var m=h.timescale||9e4,y=g(l,["trun"]),b=0;b<y.length;b++){if(!(i=T(y[b]))&&p)i=p*d(y[b],4);h.type===n.a.VIDEO?r+=i/m:h.type===n.a.AUDIO&&(a+=i/m)}}}if(0===r&&0===a){for(var E=0,S=g(t,["sidx"]),L=0;L<S.length;L++){var A=v(S[L]);null!=A&&A.references&&(E+=A.references.reduce((function(t,e){return t+e.info.duration||0}),0))}return E}return r||a}function T(t){var e=d(t,0),i=8;1&e&&(i+=4),4&e&&(i+=4);for(var r=0,n=d(t,4),a=0;a<n;a++){if(256&e)r+=d(t,i),i+=4;512&e&&(i+=4),1024&e&&(i+=4),2048&e&&(i+=4)}return r}function b(t,e,i){g(e,["moof","traf"]).forEach((function(e){g(e,["tfhd"]).forEach((function(r){var n=d(r,4),a=t[n];if(a){var o=a.timescale||9e4;g(e,["tfdt"]).forEach((function(t){var e=t[0],r=d(t,4);if(0===e)r-=i*o,f(t,4,r=Math.max(r,0));else{r*=Math.pow(2,32),r+=d(t,8),r-=i*o,r=Math.max(r,0);var n=Math.floor(r/(s+1)),a=Math.floor(r%(s+1));f(t,4,n),f(t,8,a)}}))}}))}))}function E(t){var e={valid:null,remainder:null},i=g(t,["moof"]);if(!i)return e;if(i.length<2)return e.remainder=t,e;var n=i[i.length-1];return e.valid=Object(r.a)(t,0,n.byteOffset-8),e.remainder=Object(r.a)(t,n.byteOffset-8),e}function S(t,e){var i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function L(t,e){var i=[],r=e.samples,a=e.timescale,s=e.id,o=!1;return g(r,["moof"]).map((function(l){var u=l.byteOffset-8;g(l,["traf"]).map((function(l){var h=g(l,["tfdt"]).map((function(t){var e=t[0],i=d(t,4);return 1===e&&(i*=Math.pow(2,32),i+=d(t,8)),i/a}))[0];return void 0!==h&&(t=h),g(l,["tfhd"]).map((function(h){var f=d(h,4),v=16777215&d(h,0),p=0,m=0!=(16&v),y=0,T=0!=(32&v),b=8;f===s&&(0!=(1&v)&&(b+=8),0!=(2&v)&&(b+=4),0!=(8&v)&&(p=d(h,b),b+=4),m&&(y=d(h,b),b+=4),T&&(b+=4),"video"===e.type&&(o=function(t){if(!t)return!1;var e=t.indexOf("."),i=e<0?t:t.substring(0,e);return"hvc1"===i||"hev1"===i||"dvh1"===i||"dvhe"===i}(e.codec)),g(l,["trun"]).map((function(s){var l=s[0],h=16777215&d(s,0),f=0!=(1&h),g=0,v=0!=(4&h),m=0!=(256&h),T=0,b=0!=(512&h),E=0,S=0!=(1024&h),L=0!=(2048&h),R=0,k=d(s,4),_=8;f&&(g=d(s,_),_+=4),v&&(_+=4);for(var I=g+u,O=0;O<k;O++){if(m?(T=d(s,_),_+=4):T=p,b?(E=d(s,_),_+=4):E=y,S&&(_+=4),L&&(R=0===l?d(s,_):c(s,_),_+=4),e.type===n.a.VIDEO)for(var C=0;C<E;){var w=d(r,I),x=31&r[I+=4];if(A(o,x))D(r.subarray(I,I+w),t+R/a,i);I+=w,C+=w+4}t+=T/a}})))}))}))})),i}function A(t,e){return t?39===e||40===e:6===e}function D(t,e,i){var r=function(t){var e=t.byteLength,i=[],r=1;for(;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return t;var n=e-i.length,a=new Uint8Array(n),s=0;for(r=0;r<n;s++,r++)s===i[0]&&(s++,i.shift()),a[r]=t[s];return a}(t),n=0;n++;for(var s=0,o=0,l=!1,u=0;n<r.length;){s=0;do{if(n>=r.length)break;s+=u=r[n++]}while(255===u);o=0;do{if(n>=r.length)break;o+=u=r[n++]}while(255===u);var c=r.length-n;if(!l&&4===s&&n<r.length){if(l=!0,181===r[n++]){var f=h(r,n);if(n+=2,49===f){var g=d(r,n);if(n+=4,1195456820===g){var v=r[n++];if(3===v){var p=r[n++],m=64&p,y=m?2+3*(31&p):0,T=new Uint8Array(y);if(m){T[0]=p;for(var b=1;b<y;b++)T[b]=r[n++]}i.push({type:v,payloadType:s,pts:e,bytes:T})}}}}}else if(5===s&&o<c){if(l=!0,o>16){for(var E=[],S=0;S<16;S++){var L=r[n++].toString(16);E.push(1==L.length?"0"+L:L),3!==S&&5!==S&&7!==S&&9!==S||E.push("-")}for(var A=o-16,D=new Uint8Array(A),R=0;R<A;R++)D[R]=r[n++];i.push({payloadType:s,pts:e,uuid:E.join(""),userData:Object(a.f)(D),userDataBytes:D})}}else if(o<c)n+=o;else if(o>c)break}}function R(t){var e=t[0],i="",r="",n=0,a=0,s=0,o=0,l=0,h=0;if(0===e){for(;"\0"!==u(t.subarray(h,h+1));)i+=u(t.subarray(h,h+1)),h+=1;for(i+=u(t.subarray(h,h+1)),h+=1;"\0"!==u(t.subarray(h,h+1));)r+=u(t.subarray(h,h+1)),h+=1;r+=u(t.subarray(h,h+1)),h+=1,n=d(t,12),a=d(t,16),o=d(t,20),l=d(t,24),h=28}else if(1===e){n=d(t,h+=4);var c=d(t,h+=4),f=d(t,h+=4);for(h+=4,s=Math.pow(2,32)*c+f,Number.isSafeInteger(s)||(s=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=d(t,h),l=d(t,h+=4),h+=4;"\0"!==u(t.subarray(h,h+1));)i+=u(t.subarray(h,h+1)),h+=1;for(i+=u(t.subarray(h,h+1)),h+=1;"\0"!==u(t.subarray(h,h+1));)r+=u(t.subarray(h,h+1)),h+=1;r+=u(t.subarray(h,h+1)),h+=1}return{schemeIdUri:i,value:r,timeScale:n,presentationTime:s,presentationTimeDelta:a,eventDuration:o,id:l,payload:t.subarray(h,t.byteLength)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return g})),i.d(e,"c",(function(){return v}));var r,n=i(3),a=i(12),s=i(1),o=i(17),l=i(14);function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function h(t,e){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,i){return e&&d(t.prototype,e),i&&d(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}!function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"}(r||(r={}));var f=function(){function t(t){var e;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((e={})[r.AUDIO]=null,e[r.VIDEO]=null,e[r.AUDIOVIDEO]=null,e),this.baseurl=t}return t.prototype.setByteRange=function(t,e){var i=t.split("@",2),r=[];1===i.length?r[0]=e?e.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r},c(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(a.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(t){this._url=t}}]),t}(),g=function(t){function e(e,i){var r;return(r=t.call(this,i)||this)._decryptdata=null,r.rawProgramDateTime=null,r.programDateTime=null,r.tagList=[],r.duration=0,r.sn=0,r.levelkey=void 0,r.type=void 0,r.loader=null,r.level=-1,r.cc=0,r.startPTS=void 0,r.endPTS=void 0,r.appendedPTS=void 0,r.startDTS=void 0,r.endDTS=void 0,r.start=0,r.deltaPTS=void 0,r.maxStartPTS=void 0,r.minEndPTS=void 0,r.stats=new l.a,r.urlId=0,r.data=void 0,r.bitrateTest=!1,r.title=null,r.initSegment=null,r.type=e,r}u(e,t);var i=e.prototype;return i.createInitializationVector=function(t){for(var e=new Uint8Array(16),i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e},i.setDecryptDataFromLevelKey=function(t,e){var i=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((i=o.a.fromURI(t.uri)).method=t.method,i.iv=this.createInitializationVector(e),i.keyFormat="identity"),i},i.setElementaryStreamInfo=function(t,e,i,r,n,a){void 0===a&&(a=!1);var s=this.elementaryStreams,o=s[t];o?(o.startPTS=Math.min(o.startPTS,e),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,n)):s[t]={startPTS:e,endPTS:i,startDTS:r,endDTS:n,partial:a}},i.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[r.AUDIO]=null,t[r.VIDEO]=null,t[r.AUDIOVIDEO]=null},c(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&s.b.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.a)(this.programDateTime))return null;var t=Object(n.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(f),v=function(t){function e(e,i,r,n,a){var s;(s=t.call(this,r)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new l.a,s.duration=e.decimalFloatingPoint("DURATION"),s.gap=e.bool("GAP"),s.independent=e.bool("INDEPENDENT"),s.relurl=e.enumeratedString("URI"),s.fragment=i,s.index=n;var o=e.enumeratedString("BYTERANGE");return o&&s.setByteRange(o,a),a&&(s.fragOffset=a.fragOffset+a.duration),s}return u(e,t),c(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(f)},function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"a",(function(){return l})),i.d(e,"d",(function(){return u})),i.d(e,"e",(function(){return h})),i.d(e,"c",(function(){return c})),i.d(e,"f",(function(){return y}));var r,n=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},a=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},s=function(t,e){for(var i=e,r=0;n(t,e);){r+=10,r+=o(t,e+6),a(t,e+10)&&(r+=10),e+=r}if(r>0)return t.subarray(i,i+r)},o=function(t,e){var i=0;return i=(127&t[e])<<21,i|=(127&t[e+1])<<14,i|=(127&t[e+2])<<7,i|=127&t[e+3]},l=function(t,e){return n(t,e)&&o(t,e+6)+10<=t.length-e},u=function(t){for(var e=c(t),i=0;i<e.length;i++){var r=e[i];if(h(r))return m(r)}},h=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},d=function(t){var e=String.fromCharCode(t[0],t[1],t[2],t[3]),i=o(t,4);return{type:e,size:i,data:t.subarray(10,10+i)}},c=function(t){for(var e=0,i=[];n(t,e);){for(var r=o(t,e+6),s=(e+=10)+r;e+8<s;){var l=d(t.subarray(e)),u=f(l);u&&i.push(u),e+=l.size+10}a(t,e)&&(e+=10)}return i},f=function(t){return"PRIV"===t.type?g(t):"W"===t.type[0]?p(t):v(t)},g=function(t){if(!(t.size<2)){var e=y(t.data,!0),i=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:i.buffer}}},v=function(t){if(!(t.size<2)){if("TXXX"===t.type){var e=1,i=y(t.data.subarray(e),!0);e+=i.length+1;var r=y(t.data.subarray(e));return{key:t.type,info:i,data:r}}var n=y(t.data.subarray(1));return{key:t.type,data:n}}},p=function(t){if("WXXX"===t.type){if(t.size<2)return;var e=1,i=y(t.data.subarray(e),!0);e+=i.length+1;var r=y(t.data.subarray(e));return{key:t.type,info:i,data:r}}var n=y(t.data);return{key:t.type,data:n}},m=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),i=1&e[3],r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,i&&(r+=47721858.84),Math.round(r)}},y=function(t,e){void 0===e&&(e=!1);var i=T();if(i){var r=i.decode(t);if(e){var n=r.indexOf("\0");return-1!==n?r.substring(0,n):r}return r.replace(/\0/g,"")}for(var a,s,o,l=t.length,u="",h=0;h<l;){if(0===(a=t[h++])&&e)return u;if(0!==a&&3!==a)switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(a);break;case 12:case 13:s=t[h++],u+=String.fromCharCode((31&a)<<6|63&s);break;case 14:s=t[h++],o=t[h++],u+=String.fromCharCode((15&a)<<12|(63&s)<<6|(63&o)<<0)}}return u};function T(){return r||void 0===self.TextDecoder||(r=new self.TextDecoder("utf-8")),r}},function(t,e,i){"use strict";var r;i.d(e,"a",(function(){return r})),function(t){t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3"}(r||(r={}))},function(t,e,i){"use strict";function r(t,e,i){return Uint8Array.prototype.slice?t.slice(e,i):new Uint8Array(Array.prototype.slice.call(t,e,i))}i.d(e,"a",(function(){return r}))},function(t,e,i){"use strict";i.d(e,"c",(function(){return it})),i.d(e,"d",(function(){return nt})),i.d(e,"a",(function(){return at})),i.d(e,"b",(function(){return st}));var r=i(0),n=i(2),a=i(16),s=i(3),o=i(7),l=i(8);function u(t,e){return void 0===t&&(t=""),void 0===e&&(e=9e4),{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}var h=i(5),d=i(9),c=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(t){this.initPTS=t,this.resetContiguity()},e.resetContiguity=function(){this.basePTS=null,this.frameIndex=0},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,i){},e.demux=function(t,e){this.cachedData&&(t=Object(h.b)(this.cachedData,t),this.cachedData=null);var i,r,n=o.b(t,0),a=n?n.length:0,c=this._audioTrack,g=this._id3Track,v=n?o.d(n):void 0,p=t.length;for((null===this.basePTS||0===this.frameIndex&&Object(s.a)(v))&&(this.basePTS=f(v,e,this.initPTS)),n&&n.length>0&&g.samples.push({pts:this.basePTS,dts:this.basePTS,data:n,type:l.a.audioId3}),r=this.basePTS;a<p;){if(this.canParse(t,a)){var m=this.appendFrame(c,t,a);m?(this.frameIndex++,r=m.sample.pts,i=a+=m.length):a=p}else o.a(t,a)?(n=o.b(t,a),g.samples.push({pts:r,dts:r,data:n,type:l.a.audioId3}),i=a+=n.length):a++;if(a===p&&i!==p){var y=Object(d.a)(t,i);this.cachedData?this.cachedData=Object(h.b)(this.cachedData,y):this.cachedData=y}}return{audioTrack:c,videoTrack:u(),id3Track:g,textTrack:u()}},e.demuxSampleAes=function(t,e,i){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},e.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:u(),id3Track:this._id3Track,textTrack:u()}},e.destroy=function(){},t}(),f=function(t,e,i){return Object(s.a)(t)?90*t:9e4*e+(i||0)},g=c,v=i(1);function p(t,e){return 255===t[e]&&240==(246&t[e+1])}function m(t,e){return 1&t[e+1]?7:9}function y(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function T(t,e){return e+1<t.length&&p(t,e)}function b(t,e){if(T(t,e)){var i=m(t,e);if(e+i>=t.length)return!1;var r=y(t,e);if(r<=i)return!1;var n=e+r;return n===t.length||T(t,n)}return!1}function E(t,e,i,a,s){if(!t.samplerate){var o=function(t,e,i,a){var s,o,l,u,h=navigator.userAgent.toLowerCase(),d=a,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[i+2])>>>6);var f=(60&e[i+2])>>>2;if(!(f>c.length-1))return l=(1&e[i+2])<<2,l|=(192&e[i+3])>>>6,v.b.log("manifest codec:"+a+", ADTS type:"+s+", samplingIndex:"+f),/firefox/i.test(h)?f>=6?(s=5,u=new Array(4),o=f-3):(s=2,u=new Array(2),o=f):-1!==h.indexOf("android")?(s=2,u=new Array(2),o=f):(s=5,u=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&f>=6?o=f-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(f>=6&&1===l||/vivaldi/i.test(h))||!a&&1===l)&&(s=2,u=new Array(2)),o=f)),u[0]=s<<3,u[0]|=(14&f)>>1,u[1]|=(1&f)<<7,u[1]|=l<<3,5===s&&(u[1]|=(14&o)>>1,u[2]=(1&o)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:c[f],channelCount:l,codec:"mp4a.40."+s,manifestCodec:d};t.trigger(r.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+f})}(e,i,a,s);if(!o)return;t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,v.b.log("parsed codec:"+t.codec+", rate:"+o.samplerate+", channels:"+o.channelCount)}}function S(t){return 9216e4/t}function L(t,e,i,r,n){var a,s=r+n*S(t.samplerate),o=function(t,e){var i=m(t,e);if(e+i<=t.length){var r=y(t,e)-i;if(r>0)return{headerLength:i,frameLength:r}}}(e,i);if(o){var l=o.frameLength,u=o.headerLength,h=u+l,d=Math.max(0,i+h-e.length);d?(a=new Uint8Array(h-u)).set(e.subarray(i+u,e.length),0):a=e.subarray(i+u,i+h);var c={unit:a,pts:s};return d||t.samples.push(c),{sample:c,length:h,missing:d}}var f=e.length-i;return(a=new Uint8Array(f)).set(e.subarray(i,e.length),0),{sample:{unit:a,pts:s},length:f,missing:-1}}function A(t,e){return(A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var D=function(t){var e,i;function r(e,i){var r;return(r=t.call(this)||this).observer=void 0,r.config=void 0,r.observer=e,r.config=i,r}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,A(e,i);var n=r.prototype;return n.resetInitSegment=function(e,i,r,n){t.prototype.resetInitSegment.call(this,e,i,r,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:i,duration:n,inputTimeScale:9e4,dropped:0}},r.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,i=t.length;e<i;e++)if(b(t,e))return v.b.log("ADTS sync word found !"),!0;return!1},n.canParse=function(t,e){return function(t,e){return function(t,e){return e+5<t.length}(t,e)&&p(t,e)&&y(t,e)<=t.length-e}(t,e)},n.appendFrame=function(t,e,i){E(t,this.observer,e,i,t.manifestCodec);var r=L(t,e,i,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r},r}(g),R=/\/emsg[-/]ID3/i,k=function(){function t(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}var e=t.prototype;return e.resetTimeStamp=function(){},e.resetInitSegment=function(t,e,i,r){var n=Object(h.h)(t),a=this.videoTrack=u("video",1),s=this.audioTrack=u("audio",1),o=this.txtTrack=u("text",1);if(this.id3Track=u("id3",1),this.timeOffset=0,n.video){var l=n.video,d=l.id,c=l.timescale,f=l.codec;a.id=d,a.timescale=o.timescale=c,a.codec=f}if(n.audio){var g=n.audio,v=g.id,p=g.timescale,m=g.codec;s.id=v,s.timescale=p,s.codec=m}o.id=h.a.text,a.sampleDuration=0,a.duration=s.duration=r},e.resetContiguity=function(){},t.probe=function(t){return t=t.length>16384?t.subarray(0,16384):t,Object(h.c)(t,["moof"]).length>0},e.demux=function(t,e){this.timeOffset=e;var i=t,r=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Object(h.b)(this.remainderData,t));var a=Object(h.l)(i);this.remainderData=a.remainder,r.samples=a.valid||new Uint8Array}else r.samples=i;var s=this.extractID3Track(r,e);return n.samples=Object(h.j)(e,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}},e.flush=function(){var t=this.timeOffset,e=this.videoTrack,i=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;var r=this.extractID3Track(e,this.timeOffset);return i.samples=Object(h.j)(t,e),{videoTrack:e,audioTrack:u(),id3Track:r,textTrack:u()}},e.extractID3Track=function(t,e){var i=this.id3Track;if(t.samples.length){var r=Object(h.c)(t.samples,["emsg"]);r&&r.forEach((function(t){var r=Object(h.g)(t);if(R.test(r.schemeIdUri)){var n=Object(s.a)(r.presentationTime)?r.presentationTime/r.timeScale:e+r.presentationTimeDelta/r.timeScale,a=r.payload;i.samples.push({data:a,len:a.byteLength,dts:n,pts:n,type:l.a.emsg})}}))}return i},e.demuxSampleAes=function(t,e,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}(),_=null,I=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function x(t,e,i,r,n){if(!(i+24>e.length)){var a=P(e,i);if(a&&i+a.frameLength<=e.length){var s=r+n*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:e.subarray(i,i+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}}function P(t,e){var i=t[e+1]>>3&3,r=t[e+1]>>1&3,n=t[e+2]>>4&15,a=t[e+2]>>2&3;if(1!==i&&0!==n&&15!==n&&3!==a){var s=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*I[14*(3===i?3-r:3===r?3:4)+n-1],u=O[3*(3===i?0:2===i?1:2)+a],h=3===o?1:2,d=C[i][r],c=w[r],f=8*d*c,g=Math.floor(d*l/u+s)*c;if(null===_){var v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);_=v?parseInt(v[1]):0}return!!_&&_<=87&&2===r&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:u,channelCount:h,frameLength:g,samplesPerFrame:f}}}function F(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function M(t,e){return e+1<t.length&&F(t,e)}function N(t,e){if(e+1<t.length&&F(t,e)){var i=P(t,e),r=4;null!=i&&i.frameLength&&(r=i.frameLength);var n=e+r;return n===t.length||M(t,n)}return!1}var U=function(){function t(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var e=t.prototype;return e.loadWord=function(){var t=this.data,e=this.bytesAvailable,i=t.byteLength-e,r=new Uint8Array(4),n=Math.min(4,e);if(0===n)throw new Error("no bytes available");r.set(t.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n},e.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;return t>32&&v.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?i<<e|this.readBits(e):i},e.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,i=8,r=0;r<t;r++)0!==i&&(i=(e+this.readEG()+256)%256),e=0===i?e:i},e.readSPS=function(){var t,e,i,r=0,n=0,a=0,s=0,o=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),h=this.readBoolean.bind(this),d=this.skipBits.bind(this),c=this.skipEG.bind(this),f=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);o();var v=o();if(l(5),d(3),o(),f(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){var p=u();if(3===p&&d(1),f(),f(),d(1),h())for(e=3!==p?8:12,i=0;i<e;i++)h()&&g(i<6?16:64)}f();var m=u();if(0===m)u();else if(1===m)for(d(1),c(),c(),t=u(),i=0;i<t;i++)c();f(),d(1);var y=u(),T=u(),b=l(1);0===b&&d(1),d(1),h()&&(r=u(),n=u(),a=u(),s=u());var E=[1,1];if(h()&&h())switch(o()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[o()<<8|o(),o()<<8|o()]}return{width:Math.ceil(16*(y+1)-2*r-2*n),height:(2-b)*(T+1)*16-(b?2:4)*(a+s),pixelRatio:E}},e.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}(),B=function(){function t(t,e,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new a.a(t,e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,e)},e.decryptAacSample=function(t,e,i,r){var n=t[e].unit;if(!(n.length<=16)){var a=n.subarray(16,n.length-n.length%16),s=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),o=this;this.decryptBuffer(s,(function(a){var s=new Uint8Array(a);n.set(s,16),r||o.decryptAacSamples(t,e+1,i)}))}},e.decryptAacSamples=function(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(t,e,i,r),!r)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e),r=0,n=32;n<t.length-16;n+=160,r+=16)i.set(t.subarray(n,n+16),r);return i},e.getAvcDecryptedUnit=function(t,e){for(var i=new Uint8Array(e),r=0,n=32;n<t.length-16;n+=160,r+=16)t.set(i.subarray(r,r+16),n);return t},e.decryptAvcSample=function(t,e,i,r,n,a){var s=Y(n.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,(function(o){n.data=l.getAvcDecryptedUnit(s,o),a||l.decryptAvcSamples(t,e,i+1,r)}))},e.decryptAvcSamples=function(t,e,i,r){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,i=0){if(e>=t.length)return void r();for(var n=t[e].units;!(i>=n.length);i++){var a=n[i];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(t,e,i,r,a,s),!s)return}}}},t}();function G(){return(G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function j(t,e,i,r){return{key:t,frame:!1,pts:e,dts:i,units:[],debug:r,length:0}}function K(t,e){return(31&t[e+10])<<8|t[e+11]}function H(t,e,i,r){var n={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},a=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<a;){var s=(31&t[e+1])<<8|t[e+2];switch(t[e]){case 207:if(!r){v.b.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===n.audio&&(n.audio=s);break;case 21:-1===n.id3&&(n.id3=s);break;case 219:if(!r){v.b.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===n.avc&&(n.avc=s);break;case 3:case 4:!0!==i.mpeg&&!0!==i.mp3?v.b.log("MPEG audio found, not supported in this browser"):-1===n.audio&&(n.audio=s,n.segmentCodec="mp3");break;case 36:v.b.warn("Unsupported HEVC stream type found")}e+=5+((15&t[e+3])<<8|t[e+4])}return n}function V(t){var e,i,r,n,a,s=0,o=t.data;if(!t||0===t.size)return null;for(;o[0].length<19&&o.length>1;){var l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(1===((e=o[0])[0]<<16)+(e[1]<<8)+e[2]){if((i=(e[4]<<8)+e[5])&&i>t.size-6)return null;var u=e[7];192&u&&(n=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&u?n-(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(v.b.warn(Math.round((n-a)/9e4)+"s delta between PTS and DTS, align them"),n=a):a=n);var h=(r=e[8])+9;if(t.size<=h)return null;t.size-=h;for(var d=new Uint8Array(t.size),c=0,f=o.length;c<f;c++){var g=(e=o[c]).byteLength;if(h){if(h>g){h-=g;continue}e=e.subarray(h),g-=h,h=0}d.set(e,s),s+=g}return i&&(i-=r+3),{data:d,pts:n,dts:a,len:i}}return null}function W(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var i=e.samples,r=i.length;if(!r)return void e.dropped++;var n=i[r-1];t.pts=n.pts,t.dts=n.dts}e.samples.push(t)}t.debug.length&&v.b.log(t.pts+"/"+t.dts+":"+t.debug)}function Y(t){for(var e=t.byteLength,i=[],r=1;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return t;var n=e-i.length,a=new Uint8Array(n),s=0;for(r=0;r<n;s++,r++)s===i[0]&&(s++,i.shift()),a[r]=t[s];return a}var q=function(){function t(t,e,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=i}t.probe=function(t){return 71===t[0]&&71===t[188]},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:h.a[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,i,r,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video"),this._audioTrack=t.createTrack("audio",n),this._id3Track=t.createTrack("id3"),this._txtTrack=t.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=r,this._duration=n},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,i=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null},e.demux=function(t,e,i,a){var s;void 0===i&&(i=!1),void 0===a&&(a=!1),i||(this.sampleAes=null);var o=this._avcTrack,l=this._audioTrack,u=this._id3Track,d=this._txtTrack,c=o.pid,f=o.pesData,g=l.pid,p=u.pid,m=l.pesData,y=u.pesData,T=null,b=this.pmtParsed,E=this._pmtId,S=t.length;if(this.remainderData&&(S=(t=Object(h.b)(this.remainderData,t)).length,this.remainderData=null),S<188&&!a)return this.remainderData=t,{audioTrack:l,videoTrack:o,id3Track:u,textTrack:d};(S-=S%188)<t.byteLength&&!a&&(this.remainderData=new Uint8Array(t.buffer,S,t.buffer.byteLength-S));for(var L=0,A=0;A<S;A+=188)if(71===t[A]){var D=!!(64&t[A+1]),R=((31&t[A+1])<<8)+t[A+2],k=void 0;if((48&t[A+3])>>4>1){if((k=A+5+t[A+4])===A+188)continue}else k=A+4;switch(R){case c:D&&(f&&(s=V(f))&&this.parseAVCPES(o,d,s,!1),f={data:[],size:0}),f&&(f.data.push(t.subarray(k,A+188)),f.size+=A+188-k);break;case g:if(D){if(m&&(s=V(m)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,s);break;case"mp3":this.parseMPEGPES(l,s)}m={data:[],size:0}}m&&(m.data.push(t.subarray(k,A+188)),m.size+=A+188-k);break;case p:D&&(y&&(s=V(y))&&this.parseID3PES(u,s),y={data:[],size:0}),y&&(y.data.push(t.subarray(k,A+188)),y.size+=A+188-k);break;case 0:D&&(k+=t[k]+1),E=this._pmtId=K(t,k);break;case E:D&&(k+=t[k]+1);var _=H(t,k,this.typeSupported,i);(c=_.avc)>0&&(o.pid=c),(g=_.audio)>0&&(l.pid=g,l.segmentCodec=_.segmentCodec),(p=_.id3)>0&&(u.pid=p),null===T||b||(v.b.log("unknown PID '"+T+"' in TS found"),T=null),b=this.pmtParsed=!0;break;case 17:case 8191:break;default:T=R}}else L++;L>0&&this.observer.emit(r.a.ERROR,r.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+L+" TS packet/s that do not start with 0x47"}),o.pesData=f,l.pesData=m,u.pesData=y;var I={audioTrack:l,videoTrack:o,id3Track:u,textTrack:d};return a&&this.extractRemainingSamples(I),I},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,i=t.audioTrack,r=t.videoTrack,n=t.id3Track,a=t.textTrack,s=r.pesData,o=i.pesData,l=n.pesData;if(s&&(e=V(s))?(this.parseAVCPES(r,a,e,!0),r.pesData=null):r.pesData=s,o&&(e=V(o))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,e);break;case"mp3":this.parseMPEGPES(i,e)}i.pesData=null}else null!=o&&o.size&&v.b.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=o;l&&(e=V(l))?(this.parseID3PES(n,e),n.pesData=null):n.pesData=l},e.demuxSampleAes=function(t,e,i){var r=this.demux(t,i,!0,!this.config.progressive),n=this.sampleAes=new B(this.observer,this.config,e);return this.decrypt(r,n)},e.decrypt=function(t,e){return new Promise((function(i){var r=t.audioTrack,n=t.videoTrack;r.samples&&"aac"===r.segmentCodec?e.decryptAacSamples(r.samples,0,(function(){n.samples?e.decryptAvcSamples(n.samples,0,0,(function(){i(t)})):i(t)})):n.samples&&e.decryptAvcSamples(n.samples,0,0,(function(){i(t)}))}))},e.destroy=function(){this._duration=0},e.parseAVCPES=function(t,e,i,r){var n,a=this,s=this.parseAVCNALu(t,i.data),o=this.avcSample,l=!1;i.data=null,o&&s.length&&!t.audFound&&(W(o,t),o=this.avcSample=j(!1,i.pts,i.dts,"")),s.forEach((function(r){switch(r.type){case 1:n=!0,o||(o=a.avcSample=j(!0,i.pts,i.dts,"")),o.frame=!0;var s=r.data;if(l&&s.length>4){var u=new U(s).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(o.key=!0)}break;case 5:n=!0,o||(o=a.avcSample=j(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:n=!0,Object(h.i)(Y(r.data),i.pts,e.samples);break;case 7:if(n=!0,l=!0,!t.sps){var d=new U(r.data).readSPS();t.width=d.width,t.height=d.height,t.pixelRatio=d.pixelRatio,t.sps=[r.data],t.duration=a._duration;for(var c=r.data.subarray(1,4),f="avc1.",g=0;g<3;g++){var v=c[g].toString(16);v.length<2&&(v="0"+v),f+=v}t.codec=f}break;case 8:n=!0,t.pps||(t.pps=[r.data]);break;case 9:n=!1,t.audFound=!0,o&&W(o,t),o=a.avcSample=j(!1,i.pts,i.dts,"");break;case 12:n=!0;break;default:n=!1,o&&(o.debug+="unknown NAL "+r.type+" ")}o&&n&&o.units.push(r)})),r&&o&&(W(o,t),this.avcSample=null)},e.getLastNalUnit=function(t){var e,i,r=this.avcSample;if(r&&0!==r.units.length||(r=t[t.length-1]),null!==(e=r)&&void 0!==e&&e.units){var n=r.units;i=n[n.length-1]}return i},e.parseAVCNALu=function(t,e){var i,r,n=e.byteLength,a=t.naluState||0,s=a,o=[],l=0,u=-1,h=0;for(-1===a&&(u=0,h=31&e[0],a=0,l=1);l<n;)if(i=e[l++],a)if(1!==a)if(i)if(1===i){if(u>=0){var d={data:e.subarray(u,l-a-1),type:h};o.push(d)}else{var c=this.getLastNalUnit(t.samples);if(c&&(s&&l<=4-s&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-s)),(r=l-a-1)>0)){var f=new Uint8Array(c.data.byteLength+r);f.set(c.data,0),f.set(e.subarray(0,r),c.data.byteLength),c.data=f,c.state=0}}l<n?(u=l,h=31&e[l],a=0):a=-1}else a=0;else a=3;else a=i?0:2;else a=i?0:1;if(u>=0&&a>=0){var g={data:e.subarray(u,n),type:h,state:a};o.push(g)}if(0===o.length){var v=this.getLastNalUnit(t.samples);if(v){var p=new Uint8Array(v.data.byteLength+e.byteLength);p.set(v.data,0),p.set(e,v.data.byteLength),v.data=p}}return t.naluState=a,o},e.parseAACPES=function(t,e){var i,a,s,o,l,u=0,h=this.aacOverFlow,d=e.data;if(h){this.aacOverFlow=null;var c=h.missing,f=h.sample.unit.byteLength;if(-1===c){var g=new Uint8Array(f+d.byteLength);g.set(h.sample.unit,0),g.set(d,f),d=g}else{var p=f-c;h.sample.unit.set(d.subarray(0,c),p),t.samples.push(h.sample),u=h.missing}}for(i=u,a=d.length;i<a-1&&!T(d,i);i++);if(i!==u&&(i<a-1?(s="AAC PES did not start with ADTS header,offset:"+i,o=!1):(s="no ADTS header found in AAC PES",o=!0),v.b.warn("parsing error:"+s),this.observer.emit(r.a.ERROR,r.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:o,reason:s}),o))return;if(E(t,this.observer,d,i,this.audioCodec),void 0!==e.pts)l=e.pts;else{if(!h)return void v.b.warn("[tsdemuxer]: AAC PES unknown PTS");var m=S(t.samplerate);l=h.sample.pts+m}for(var y,b=0;i<a;){if(i+=(y=L(t,d,i,l,b)).length,y.missing){this.aacOverFlow=y;break}for(b++;i<a-1&&!T(d,i);i++);}},e.parseMPEGPES=function(t,e){var i=e.data,r=i.length,n=0,a=0,s=e.pts;if(void 0!==s)for(;a<r;)if(M(i,a)){var o=x(t,i,a,s,n);if(!o)break;a+=o.length,n++}else a++;else v.b.warn("[tsdemuxer]: MPEG PES unknown PTS")},e.parseID3PES=function(t,e){if(void 0!==e.pts){var i=G({},e,{type:this._avcTrack?l.a.emsg:l.a.audioId3});t.samples.push(i)}else v.b.warn("[tsdemuxer]: ID3 PES unknown PTS")},t}();function z(t,e){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var X=function(t){var e,i;function r(){return t.apply(this,arguments)||this}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,z(e,i);var n=r.prototype;return n.resetInitSegment=function(e,i,r,n){t.prototype.resetInitSegment.call(this,e,i,r,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:i,duration:n,inputTimeScale:9e4,dropped:0}},r.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,i=t.length;e<i;e++)if(N(t,e))return v.b.log("MPEG Audio sync word found !"),!0;return!1},n.canParse=function(t,e){return function(t,e){return F(t,e)&&4<=t.length-e}(t,e)},n.appendFrame=function(t,e,i){if(null!==this.basePTS)return x(t,e,i,this.basePTS,this.frameIndex)},r}(g),Q=i(13),$=i(6);function J(t,e){var i=null==t?void 0:t.codec;return i&&i.length>4?i:"hvc1"===i||"hev1"===i?"hvc1.1.c.L120.90":"av01"===i?"av01.0.04M.08":"avc1"===i||e===$.a.VIDEO?"avc1.42e01e":"mp4a.40.5"}var Z,tt=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndTime=null},e.resetNextTimestamp=function(){this.lastEndTime=null},e.resetInitSegment=function(t,e,i){this.audioCodec=e,this.videoCodec=i,this.generateInitSegment(t),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,i=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Object(h.h)(t);e||(e=J(r.audio,$.a.AUDIO)),i||(i=J(r.video,$.a.VIDEO));var n={};r.audio&&r.video?n.audiovideo={container:"video/mp4",codec:e+","+i,initSegment:t,id:"main"}:r.audio?n.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:r.video?n.video={container:"video/mp4",codec:i,initSegment:t,id:"main"}:v.b.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},e.remux=function(t,e,i,r,n){var a,o=this.initPTS,l=this.lastEndTime,u={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};Object(s.a)(l)||(l=this.lastEndTime=n||0);var d=e.samples;if(!d||!d.length)return u;var c={initPTS:void 0,timescale:1},f=this.initData;if(f&&f.length||(this.generateInitSegment(d),f=this.initData),!f||!f.length)return v.b.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(c.tracks=this.initTracks,this.emitInitSegment=!1);var g=Object(h.e)(f,d);Object(s.a)(o)||(this.initPTS=c.initPTS=o=g-n);var p=Object(h.d)(d,f),m=t?g-o:l,y=m+p;Object(h.f)(f,d,o),p>0?this.lastEndTime=y:(v.b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var T=!!f.audio,b=!!f.video,E="";T&&(E+="audio"),b&&(E+="video");var S={data1:d,startPTS:m,startDTS:m,endPTS:y,endDTS:y,type:E,hasAudio:T,hasVideo:b,nb:1,dropped:0};u.audio="audio"===S.type?S:void 0,u.video="audio"!==S.type?S:void 0,u.initSegment=c;var L=null!=(a=this.initPTS)?a:0;return u.id3=Object(Q.b)(i,n,L,L),r.samples.length&&(u.text=Object(Q.c)(r,n,L)),u},t}();try{Z=self.performance.now.bind(self.performance)}catch(t){v.b.debug("Unable to use Performance API on this environment"),Z=self.Date.now}var et=[{demux:q,remux:Q.a},{demux:k,remux:tt},{demux:D,remux:Q.a},{demux:X,remux:Q.a}],it=function(){function t(t,e,i,r,n){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=i,this.vendor=r,this.id=n}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,i,r){var n=this,a=i.transmuxing;a.executeStart=Z();var s=new Uint8Array(t),o=this.config,l=this.currentTransmuxState,u=this.transmuxConfig;r&&(this.currentTransmuxState=r);var h=r||l,d=h.contiguous,c=h.discontinuity,f=h.trackSwitch,g=h.accurateTimeOffset,v=h.timeOffset,p=h.initSegmentChange,m=u.audioCodec,y=u.videoCodec,T=u.defaultInitPts,b=u.duration,E=u.initSegmentData;(c||f||p)&&this.resetInitSegment(E,m,y,b),(c||p)&&this.resetInitialTimestamp(T),d||this.resetContiguity();var S=function(t,e){var i=null;t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(i=e);return i}(s,e);if(S&&"AES-128"===S.method){var L=this.getDecrypter();if(!o.enableSoftwareAES)return this.decryptionPromise=L.webCryptoDecrypt(s,S.key.buffer,S.iv.buffer).then((function(t){var e=n.push(t,null,i);return n.decryptionPromise=null,e})),this.decryptionPromise;var A=L.softwareDecrypt(s,S.key.buffer,S.iv.buffer);if(!A)return a.executeEnd=Z(),rt(i);s=new Uint8Array(A)}this.needsProbing(s,c,f)&&this.configureTransmuxer(s,u);var D=this.transmux(s,S,v,g,i),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,a.executeEnd=Z(),D},e.flush=function(t){var e=this,i=t.transmuxing;i.executeStart=Z();var a=this.decrypter,s=this.currentTransmuxState,o=this.decryptionPromise;if(o)return o.then((function(){return e.flush(t)}));var l=[],u=s.timeOffset;if(a){var h=a.flush();h&&l.push(this.push(h,null,t))}var d=this.demuxer,c=this.remuxer;if(!d||!c)return this.observer.emit(r.a.ERROR,r.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),i.executeEnd=Z(),[rt(t)];var f=d.flush(u);return nt(f)?f.then((function(i){return e.flushRemux(l,i,t),l})):(this.flushRemux(l,f,t),l)},e.flushRemux=function(t,e,i){var r=e.audioTrack,n=e.videoTrack,a=e.id3Track,s=e.textTrack,o=this.currentTransmuxState,l=o.accurateTimeOffset,u=o.timeOffset;v.b.log("[transmuxer.ts]: Flushed fragment "+i.sn+(i.part>-1?" p: "+i.part:"")+" of level "+i.level);var h=this.remuxer.remux(r,n,a,s,u,l,!0,this.id);t.push({remuxResult:h,chunkMeta:i}),i.transmuxing.executeEnd=Z()},e.resetInitialTimestamp=function(t){var e=this.demuxer,i=this.remuxer;e&&i&&(e.resetTimeStamp(t),i.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,i,r){var n=this.demuxer,a=this.remuxer;n&&a&&(n.resetInitSegment(t,e,i,r),a.resetInitSegment(t,e,i))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,i,r,n){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,i,r,n):this.transmuxUnencrypted(t,i,r,n)},e.transmuxUnencrypted=function(t,e,i,r){var n=this.demuxer.demux(t,e,!1,!this.config.progressive),a=n.audioTrack,s=n.videoTrack,o=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(a,s,o,l,e,i,!1,this.id),chunkMeta:r}},e.transmuxSampleAes=function(t,e,i,r,n){var a=this;return this.demuxer.demuxSampleAes(t,e,i).then((function(t){return{remuxResult:a.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,i,r,!1,a.id),chunkMeta:n}}))},e.configureTransmuxer=function(t,e){for(var i,r=this.config,n=this.observer,a=this.typeSupported,s=this.vendor,o=e.audioCodec,l=e.defaultInitPts,u=e.duration,h=e.initSegmentData,d=e.videoCodec,c=0,f=et.length;c<f;c++)if(et[c].demux.probe(t)){i=et[c];break}i||(v.b.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),i={demux:k,remux:tt});var g=this.demuxer,p=this.remuxer,m=i.remux,y=i.demux;p&&p instanceof m||(this.remuxer=new m(n,r,a,s)),g&&g instanceof y||(this.demuxer=new y(n,r,a),this.probe=y.probe),this.resetInitSegment(h,o,d,u),this.resetInitialTimestamp(l)},e.needsProbing=function(t,e,i){return!this.demuxer||!this.remuxer||e||i},e.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new a.a(this.observer,this.config)),t},t}();var rt=function(t){return{remuxResult:{},chunkMeta:t}};function nt(t){return"then"in t&&t.then instanceof Function}var at=function(t,e,i,r,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=i,this.duration=r,this.defaultInitPts=n},st=function(t,e,i,r,n,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=n,this.initSegmentChange=a}},function(t,e,i){"use strict";i.d(e,"c",(function(){return n})),i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return s}));function r(t,e,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var n=t*e*i;return r?Math.round(n):n}function n(t,e,i,n){return void 0===i&&(i=1),void 0===n&&(n=!1),r(t,e,1/i,n)}function a(t,e){return void 0===e&&(e=!1),r(t,1e3,1/9e4,e)}function s(t,e){return void 0===e&&(e=1),r(t,9e4,1/e)}},function(t,e,i){var r,n,a,s,o;r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(t,e,i){if(i=i||{},t=t.trim(),!(e=e.trim())){if(!i.alwaysNormalize)return t;var r=o.parseURL(t);if(!r)throw new Error("Error trying to parse base URL.");return r.path=o.normalizePath(r.path),o.buildURLFromParts(r)}var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):e;var s=o.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=n.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(u.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var h=s.path,d=h.substring(0,h.lastIndexOf("/")+1)+a.path;u.path=o.normalizePath(d)}else u.path=s.path,a.params||(u.params=s.params,a.query||(u.query=s.query));return null===u.path&&(u.path=i.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(u)},parseURL:function(t){var e=r.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(a,"");t.length!==(t=t.replace(s,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=o},function(t,e,i){"use strict";i.d(e,"a",(function(){return p})),i.d(e,"d",(function(){return m})),i.d(e,"b",(function(){return y})),i.d(e,"c",(function(){return T}));var r=i(3),n=function(){function t(){}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},t}(),a=Math.pow(2,32)-1,s=function(){function t(){}return t.init=function(){var e;for(e in t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:i,audio:r};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,s,l,s,o),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))},t.box=function(t){for(var e=8,i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];for(var a=r.length,s=a;a--;)e+=r[a].byteLength;var o=new Uint8Array(e);for(o[0]=e>>24&255,o[1]=e>>16&255,o[2]=e>>8&255,o[3]=255&e,o.set(t,4),a=0,e=8;a<s;a++)o.set(r[a],e),e+=r[a].byteLength;return o},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,i){i*=e;var r=Math.floor(i/(a+1)),n=Math.floor(i%(a+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,i,r){return t.box(t.types.moof,t.mfhd(e),t.traf(r,i))},t.moov=function(e){for(var i=e.length,r=[];i--;)r[i]=t.trak(e[i]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(t.mvex(e)))},t.mvex=function(e){for(var i=e.length,r=[];i--;)r[i]=t.trex(e[i]);return t.box.apply(null,[t.types.mvex].concat(r))},t.mvhd=function(e,i){i*=e;var r=Math.floor(i/(a+1)),n=Math.floor(i%(a+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,s)},t.sdtp=function(e){var i,r,n=e.samples||[],a=new Uint8Array(4+n.length);for(i=0;i<n.length;i++)r=n[i].flags,a[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return t.box(t.types.sdtp,a)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var i,r,n,a=[],s=[];for(i=0;i<e.sps.length;i++)n=(r=e.sps[i]).byteLength,a.push(n>>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(r));for(i=0;i<e.pps.length;i++)n=(r=e.pps[i]).byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(r));var o=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(s))),l=e.width,u=e.height,h=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,255&h,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var i=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var i=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]))},t.stsd=function(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var i=e.id,r=e.duration*e.timescale,n=e.width,s=e.height,o=Math.floor(r/(a+1)),l=Math.floor(r%(a+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,s>>8&255,255&s,0,0]))},t.traf=function(e,i){var r=t.sdtp(e),n=e.id,s=Math.floor(i/(a+1)),o=Math.floor(i%(a+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,r.length+16+20+8+16+8+8),r)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var i=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,i){var r,n,a,s,o,l,u=e.samples||[],h=u.length,d=12+16*h,c=new Uint8Array(d);for(i+=8+d,c.set(["video"===e.type?1:0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,255&h,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r<h;r++)a=(n=u[r]).duration,s=n.size,o=n.flags,l=n.cts,c.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var i=t.moov(e),r=new Uint8Array(t.FTYP.byteLength+i.byteLength);return r.set(t.FTYP),r.set(i,t.FTYP.byteLength),r},t}();s.types=void 0,s.HDLR_TYPES=void 0,s.STTS=void 0,s.STSC=void 0,s.STCO=void 0,s.STSZ=void 0,s.VMHD=void 0,s.SMHD=void 0,s.STSD=void 0,s.FTYP=void 0,s.DINF=void 0;var o=s,l=i(0),u=i(2),h=i(1),d=i(4),c=i(11);function f(){return(f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}var g=null,v=null,p=function(){function t(t,e,i,r){if(void 0===r&&(r=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=i,this.ISGenerated=!1,null===g){var n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);g=n?parseInt(n[1]):0}if(null===v){var a=navigator.userAgent.match(/Safari\/(\d+)/i);v=a?parseInt(a[1]):0}}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){h.b.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},e.resetNextTimestamp=function(){h.b.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},e.resetInitSegment=function(){h.b.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},e.getVideoStartPts=function(t){var e=!1,i=t.reduce((function(t,i){var r=i.pts-t;return r<-4294967296?(e=!0,m(t,i.pts)):r>0?t:i.pts}),t[0].pts);return e&&h.b.debug("PTS rollover detected"),i},e.remux=function(t,e,i,r,n,a,s,o){var l,u,c,f,g,v,p=n,b=n,E=t.pid>-1,S=e.pid>-1,L=e.samples.length,A=t.samples.length>0,D=s&&L>0||L>1;if((!E||A)&&(!S||D)||this.ISGenerated||s){this.ISGenerated||(c=this.generateIS(t,e,n));var R,k=this.isVideoContiguous,_=-1;if(D&&(_=function(t){for(var e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!k&&this.config.forceKeyFrameOnDiscontinuity))if(v=!0,_>0){h.b.warn("[mp4-remuxer]: Dropped "+_+" out of "+L+" video samples due to a missing keyframe");var I=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(_),e.dropped+=_,R=b+=(e.samples[0].pts-I)/e.inputTimeScale}else-1===_&&(h.b.warn("[mp4-remuxer]: No keyframe found out of "+L+" video samples"),v=!1);if(this.ISGenerated){if(A&&D){var O=this.getVideoStartPts(e.samples),C=(m(t.samples[0].pts,O)-O)/e.inputTimeScale;p+=Math.max(0,C),b+=Math.max(0,-C)}if(A){if(t.samplerate||(h.b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(t,e,n)),u=this.remuxAudio(t,p,this.isAudioContiguous,a,S||D||o===d.b.AUDIO?b:void 0),D){var w=u?u.endPTS-u.startPTS:0;e.inputTimeScale||(h.b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(t,e,n)),l=this.remuxVideo(e,b,k,w)}}else D&&(l=this.remuxVideo(e,b,k,0));l&&(l.firstKeyFrame=_,l.independent=-1!==_,l.firstKeyFramePTS=R)}}return this.ISGenerated&&(i.samples.length&&(g=y(i,n,this._initPTS,this._initDTS)),r.samples.length&&(f=T(r,n,this._initPTS))),{audio:u,video:l,initSegment:c,independent:v,text:f,id3:g}},e.generateIS=function(t,e,i){var n,a,s,l=t.samples,u=e.samples,h=this.typeSupported,d={},c=!Object(r.a)(this._initPTS),f="audio/mp4";if(c&&(n=a=1/0),t.config&&l.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":h.mpeg?(f="audio/mpeg",t.codec=""):h.mp3&&(t.codec="mp3")}d.audio={id:"audio",container:f,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&h.mpeg?new Uint8Array(0):o.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(s=t.inputTimeScale,n=a=l[0].pts-Math.round(s*i))}if(e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:o.initSegment([e]),metadata:{width:e.width,height:e.height}},c)){s=e.inputTimeScale;var g=this.getVideoStartPts(u),v=Math.round(s*i);a=Math.min(a,m(u[0].dts,g)-v),n=Math.min(n,g-v)}if(Object.keys(d).length)return this.ISGenerated=!0,c&&(this._initPTS=n,this._initDTS=a),{tracks:d,initPTS:n,timescale:s}},e.remuxVideo=function(t,e,i,r){var n,a,s=t.inputTimeScale,d=t.samples,p=[],y=d.length,T=this._initPTS,E=this.nextAvcDts,S=8,L=this.videoSampleDuration,A=Number.POSITIVE_INFINITY,D=Number.NEGATIVE_INFINITY,R=!1;i&&null!==E||(E=e*s-(d[0].pts-m(d[0].dts,d[0].pts)));for(var k=0;k<y;k++){var _=d[k];_.pts=m(_.pts-T,E),_.dts=m(_.dts-T,E),_.dts<d[k>0?k-1:k].dts&&(R=!0)}R&&d.sort((function(t,e){var i=t.dts-e.dts,r=t.pts-e.pts;return i||r})),n=d[0].dts;var I=(a=d[d.length-1].dts)-n,O=I?Math.round(I/(y-1)):L||t.inputTimeScale/30;if(i){var C=n-E,w=C>O;if(w||C<-1){w?h.b.warn("AVC: "+Object(c.b)(C,!0)+" ms ("+C+"dts) hole between fragments detected, filling it"):h.b.warn("AVC: "+Object(c.b)(-C,!0)+" ms ("+C+"dts) overlapping between fragments detected"),n=E;var x=d[0].pts-C;d[0].dts=n,d[0].pts=x,h.b.log("Video: First PTS/DTS adjusted: "+Object(c.b)(x,!0)+"/"+Object(c.b)(n,!0)+", delta: "+Object(c.b)(C,!0)+" ms")}}n=Math.max(0,n);for(var P=0,F=0,M=0;M<y;M++){for(var N=d[M],U=N.units,B=U.length,G=0,j=0;j<B;j++)G+=U[j].data.length;F+=G,P+=B,N.length=G,N.dts=Math.max(N.dts,n),A=Math.min(N.pts,A),D=Math.max(N.pts,D)}a=d[y-1].dts;var K,H=F+4*P+8;try{K=new Uint8Array(H)}catch(t){return void this.observer.emit(l.a.ERROR,l.a.ERROR,{type:u.b.MUX_ERROR,details:u.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating video mdat "+H})}var V=new DataView(K.buffer);V.setUint32(0,H),K.set(o.types.mdat,4);for(var W=!1,Y=Number.POSITIVE_INFINITY,q=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,X=Number.NEGATIVE_INFINITY,Q=0;Q<y;Q++){for(var $=d[Q],J=$.units,Z=0,tt=0,et=J.length;tt<et;tt++){var it=J[tt],rt=it.data,nt=it.data.byteLength;V.setUint32(S,nt),S+=4,K.set(rt,S),S+=nt,Z+=4+nt}var at=void 0;if(Q<y-1)L=d[Q+1].dts-$.dts,at=d[Q+1].pts-$.pts;else{var st=this.config,ot=Q>0?$.dts-d[Q-1].dts:O;if(at=Q>0?$.pts-d[Q-1].pts:O,st.stretchShortVideoTrack&&null!==this.nextAudioPts){var lt=Math.floor(st.maxBufferHole*s),ut=(r?A+r*s:this.nextAudioPts)-$.pts;ut>lt?((L=ut-ot)<0?L=ot:W=!0,h.b.log("[mp4-remuxer]: It is approximately "+ut/90+" ms to the next segment; using duration "+L/90+" ms for the last video frame.")):L=ot}else L=ot}var ht=Math.round($.pts-$.dts);Y=Math.min(Y,L),z=Math.max(z,L),q=Math.min(q,at),X=Math.max(X,at),p.push(new b($.key,L,Z,ht))}if(p.length)if(g){if(g<70){var dt=p[0].flags;dt.dependsOn=2,dt.isNonSync=0}}else if(v&&X-q<z-Y&&O/z<.025&&0===p[0].cts){h.b.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var ct=n,ft=0,gt=p.length;ft<gt;ft++){var vt=ct+p[ft].duration,pt=ct+p[ft].cts;if(ft<gt-1){var mt=vt+p[ft+1].cts;p[ft].duration=mt-pt}else p[ft].duration=ft?p[ft-1].duration:O;p[ft].cts=0,ct=vt}}L=W||!L?O:L,this.nextAvcDts=E=a+L,this.videoSampleDuration=L,this.isVideoContiguous=!0;var yt={data1:o.moof(t.sequenceNumber++,n,f({},t,{samples:p})),data2:K,startPTS:A/s,endPTS:(D+L)/s,startDTS:n/s,endDTS:E/s,type:"video",hasAudio:!1,hasVideo:!0,nb:p.length,dropped:t.dropped};return t.samples=[],t.dropped=0,yt},e.remuxAudio=function(t,e,i,r,a){var s=t.inputTimeScale,d=s/(t.samplerate?t.samplerate:s),c="aac"===t.segmentCodec?1024:1152,g=c*d,v=this._initPTS,p="mp3"===t.segmentCodec&&this.typeSupported.mpeg,y=[],T=void 0!==a,E=t.samples,S=p?0:8,L=this.nextAudioPts||-1,A=e*s;if(this.isAudioContiguous=i=i||E.length&&L>0&&(r&&Math.abs(A-L)<9e3||Math.abs(m(E[0].pts-v,A)-L)<20*g),E.forEach((function(t){t.pts=m(t.pts-v,A)})),!i||L<0){if(!(E=E.filter((function(t){return t.pts>=0}))).length)return;L=0===a?0:r&&!T?Math.max(0,A):E[0].pts}if("aac"===t.segmentCodec)for(var D=this.config.maxAudioFramesDrift,R=0,k=L;R<E.length;R++){var _=E[R],I=_.pts,O=I-k,C=Math.abs(1e3*O/s);if(O<=-D*g&&T)0===R&&(h.b.warn("Audio frame @ "+(I/s).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*O/s)+" ms."),this.nextAudioPts=L=k=I);else if(O>=D*g&&C<1e4&&T){var w=Math.round(O/g);(k=I-w*g)<0&&(w--,k+=g),0===R&&(this.nextAudioPts=L=k),h.b.warn("[mp4-remuxer]: Injecting "+w+" audio frame @ "+(k/s).toFixed(3)+"s due to "+Math.round(1e3*O/s)+" ms gap.");for(var x=0;x<w;x++){var P=Math.max(k,0),F=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);F||(h.b.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),F=_.unit.subarray()),E.splice(R,0,{unit:F,pts:P}),k+=g,R++}}_.pts=k,k+=g}for(var M,N=null,U=null,B=0,G=E.length;G--;)B+=E[G].unit.byteLength;for(var j=0,K=E.length;j<K;j++){var H=E[j],V=H.unit,W=H.pts;if(null!==U){y[j-1].duration=Math.round((W-U)/d)}else{if(i&&"aac"===t.segmentCodec&&(W=L),N=W,!(B>0))return;B+=S;try{M=new Uint8Array(B)}catch(t){return void this.observer.emit(l.a.ERROR,l.a.ERROR,{type:u.b.MUX_ERROR,details:u.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}p||(new DataView(M.buffer).setUint32(0,B),M.set(o.types.mdat,4))}M.set(V,S);var Y=V.byteLength;S+=Y,y.push(new b(!0,c,Y,0)),U=W}var q=y.length;if(q){var z=y[y.length-1];this.nextAudioPts=L=U+d*z.duration;var X=p?new Uint8Array(0):o.moof(t.sequenceNumber++,N/d,f({},t,{samples:y}));t.samples=[];var Q=N/s,$=L/s,J={data1:X,data2:M,startPTS:Q,endPTS:$,startDTS:Q,endDTS:$,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,J}},e.remuxEmptyAudio=function(t,e,i,r){var a=t.inputTimeScale,s=a/(t.samplerate?t.samplerate:a),o=this.nextAudioPts,l=(null!==o?o:r.startDTS*a)+this._initDTS,u=r.endDTS*a+this._initDTS,d=1024*s,c=Math.ceil((u-l)/d),f=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(h.b.warn("[mp4-remuxer]: remux empty Audio"),f){for(var g=[],v=0;v<c;v++){var p=l+v*d;g.push({unit:f,pts:p,dts:p})}return t.samples=g,this.remuxAudio(t,e,i,!1)}h.b.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},t}();function m(t,e){var i;if(null===e)return t;for(i=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=i;return t}function y(t,e,i,r){var n=t.samples.length;if(n){for(var a=t.inputTimeScale,s=0;s<n;s++){var o=t.samples[s];o.pts=m(o.pts-i,e*a)/a,o.dts=m(o.dts-r,e*a)/a}var l=t.samples;return t.samples=[],{samples:l}}}function T(t,e,i){var r=t.samples.length;if(r){for(var n=t.inputTimeScale,a=0;a<r;a++){var s=t.samples[a];s.pts=m(s.pts-i,e*n)/n}t.samples.sort((function(t,e){return t.pts-e.pts}));var o=t.samples;return t.samples=[],{samples:o}}}var b=function(t,e,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=i,this.cts=r,this.flags=new E(t)},E=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var r=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},function(t,e,i){"use strict";var r=Object.prototype.hasOwnProperty,n="~";function a(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function o(t,e,i,r,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new s(i,r||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new a:delete t._events[e]}function u(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)r.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},u.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,s=new Array(a);r<a;r++)s[r]=i[r].fn;return s},u.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},u.prototype.emit=function(t,e,i,r,a,s){var o=n?n+t:t;if(!this._events[o])return!1;var l,u,h=this._events[o],d=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),d){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,a),!0;case 6:return h.fn.call(h.context,e,i,r,a,s),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var c,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),d){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,i);break;case 4:h[u].fn.call(h[u].context,e,i,r);break;default:if(!l)for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];h[u].fn.apply(h[u].context,l)}}return!0},u.prototype.on=function(t,e,i){return o(this,t,e,i,!1)},u.prototype.once=function(t,e,i){return o(this,t,e,i,!0)},u.prototype.removeListener=function(t,e,i,r){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return l(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||l(this,a);else{for(var o=0,u=[],h=s.length;o<h;o++)(s[o].fn!==e||r&&!s[o].once||i&&s[o].context!==i)&&u.push(s[o]);u.length?this._events[a]=1===u.length?u[0]:u:l(this,a)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&l(this,e)):(this._events=new a,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u},function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var r=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}(),n=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}(),a=i(9);var s=function(){function t(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),i=new Uint32Array(4),r=0;r<4;r++)i[r]=e.getUint32(4*r);return i},e.initTable=function(){var t=this.sBox,e=this.invSBox,i=this.subMix,r=i[0],n=i[1],a=i[2],s=i[3],o=this.invSubMix,l=o[0],u=o[1],h=o[2],d=o[3],c=new Uint32Array(256),f=0,g=0,v=0;for(v=0;v<256;v++)c[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var p=g^g<<1^g<<2^g<<3^g<<4;p=p>>>8^255&p^99,t[f]=p,e[p]=f;var m=c[f],y=c[m],T=c[y],b=257*c[p]^16843008*p;r[f]=b<<24|b>>>8,n[f]=b<<16|b>>>16,a[f]=b<<8|b>>>24,s[f]=b,b=16843009*T^65537*y^257*m^16843008*f,l[p]=b<<24|b>>>8,u[p]=b<<16|b>>>16,h[p]=b<<8|b>>>24,d[p]=b,f?(f=m^c[c[c[T^m]]],g^=c[c[g]]):f=g=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),i=!0,r=0;r<e.length&&i;)i=e[r]===this.key[r],r++;if(!i){this.key=e;var n=this.keySize=e.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);var a,s,o,l,u=this.ksRows=4*(n+6+1),h=this.keySchedule=new Uint32Array(u),d=this.invKeySchedule=new Uint32Array(u),c=this.sBox,f=this.rcon,g=this.invSubMix,v=g[0],p=g[1],m=g[2],y=g[3];for(a=0;a<u;a++)a<n?o=h[a]=e[a]:(l=o,a%n==0?(l=c[(l=l<<8|l>>>24)>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l],l^=f[a/n|0]<<24):n>6&&a%n==4&&(l=c[l>>>24]<<24|c[l>>>16&255]<<16|c[l>>>8&255]<<8|c[255&l]),h[a]=o=(h[a-n]^l)>>>0);for(s=0;s<u;s++)a=u-s,l=3&s?h[a]:h[a-4],d[s]=s<4||a<=4?l:v[c[l>>>24]]^p[c[l>>>16&255]]^m[c[l>>>8&255]]^y[c[255&l]],d[s]=d[s]>>>0}},e.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},e.decrypt=function(t,e,i){for(var r,n,a,s,o,l,u,h,d,c,f,g,v,p,m=this.keySize+6,y=this.invKeySchedule,T=this.invSBox,b=this.invSubMix,E=b[0],S=b[1],L=b[2],A=b[3],D=this.uint8ArrayToUint32Array_(i),R=D[0],k=D[1],_=D[2],I=D[3],O=new Int32Array(t),C=new Int32Array(O.length),w=this.networkToHostOrderSwap;e<O.length;){for(d=w(O[e]),c=w(O[e+1]),f=w(O[e+2]),g=w(O[e+3]),o=d^y[0],l=g^y[1],u=f^y[2],h=c^y[3],v=4,p=1;p<m;p++)r=E[o>>>24]^S[l>>16&255]^L[u>>8&255]^A[255&h]^y[v],n=E[l>>>24]^S[u>>16&255]^L[h>>8&255]^A[255&o]^y[v+1],a=E[u>>>24]^S[h>>16&255]^L[o>>8&255]^A[255&l]^y[v+2],s=E[h>>>24]^S[o>>16&255]^L[l>>8&255]^A[255&u]^y[v+3],o=r,l=n,u=a,h=s,v+=4;r=T[o>>>24]<<24^T[l>>16&255]<<16^T[u>>8&255]<<8^T[255&h]^y[v],n=T[l>>>24]<<24^T[u>>16&255]<<16^T[h>>8&255]<<8^T[255&o]^y[v+1],a=T[u>>>24]<<24^T[h>>16&255]<<16^T[o>>8&255]<<8^T[255&l]^y[v+2],s=T[h>>>24]<<24^T[o>>16&255]<<16^T[l>>8&255]<<8^T[255&u]^y[v+3],C[e]=w(r^R),C[e+1]=w(s^k),C[e+2]=w(a^_),C[e+3]=w(n^I),R=d,k=c,_=f,I=g,e+=4}return C.buffer},t}(),o=i(1),l=i(5),u=function(){function t(t,e,i){var r=(void 0===i?{}:i).removePKCS7Padding,n=void 0===r||r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=t,this.config=e,this.removePKCS7Padding=n,n)try{var a=self.crypto;a&&(this.subtle=a.subtle||a.webkitSubtle)}catch(t){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var e=t.prototype;return e.destroy=function(){this.observer=null},e.isSync=function(){return this.config.enableSoftwareAES},e.flush=function(){var t=this.currentResult;if(t){var e,i,r,n=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?(i=(e=n).byteLength,(r=i&&new DataView(e.buffer).getUint8(i-1))?Object(a.a)(e,0,i-r):e):n}this.reset()},e.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},e.decrypt=function(t,e,i,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),e,i);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),e,i).then(r)},e.softwareDecrypt=function(t,e,i){var r=this.currentIV,n=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(t=Object(l.b)(o,t),this.remainderData=null);var u=this.getValidChunk(t);if(!u.length)return null;r&&(i=r);var h=this.softwareDecrypter;h||(h=this.softwareDecrypter=new s),h.expandKey(e);var d=n;return this.currentResult=h.decrypt(u.buffer,0,i),this.currentIV=Object(a.a)(u,-16).buffer,d||null},e.webCryptoDecrypt=function(t,e,i){var a=this,s=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new n(s,e)),this.fastAesKey.expandKey().then((function(e){return s?new r(s,i).decrypt(t.buffer,e):Promise.reject(new Error("web crypto not initialized"))})).catch((function(r){return a.onWebCryptoError(r,t,e,i)}))},e.onWebCryptoError=function(t,e,i,r){return o.b.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(e,i,r)},e.getValidChunk=function(t){var e=t,i=t.length-t.length%16;return i!==t.length&&(e=Object(a.a)(t,0,i),this.remainderData=Object(a.a)(t,i)),e},e.logOnce=function(t){this.logEnabled&&(o.b.log("[decrypter.ts]: "+t),this.logEnabled=!1)},t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var r=i(12);function n(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(t,e){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=e?Object(r.buildAbsoluteURL)(t,e,{alwaysNormalize:!0}):t}var e,i,a;return t.fromURL=function(e,i){return new t(e,i)},t.fromURI=function(e){return new t(e)},e=t,(i=[{key:"uri",get:function(){return this._uri}}])&&n(e.prototype,i),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){function r(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i.oe=function(t){throw console.error(t),t};var r=i(i.s=ENTRY_MODULE);return r.default||r}function n(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t,e,r){var a={};a[r]=[];var s=e.toString(),o=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return a;for(var l,u=o[1],h=new RegExp("(\\\\n|\\W)"+n(u)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=h.exec(s);)"dll-reference"!==l[3]&&a[r].push(l[3]);for(h=new RegExp("\\("+n(u)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=h.exec(s);)t[l[2]]||(a[r].push(l[1]),t[l[2]]=i(l[1]).m),a[l[2]]=a[l[2]]||[],a[l[2]].push(l[4]);for(var d,c=Object.keys(a),f=0;f<c.length;f++)for(var g=0;g<a[c[f]].length;g++)d=a[c[f]][g],isNaN(1*d)||(a[c[f]][g]=1*a[c[f]][g]);return a}function s(t){return Object.keys(t).reduce((function(e,i){return e||t[i].length>0}),!1)}t.exports=function(t,e){e=e||{};var n={main:i.m},o=e.all?{main:Object.keys(n.main)}:function(t,e){for(var i={main:[e]},r={main:[]},n={main:{}};s(i);)for(var o=Object.keys(i),l=0;l<o.length;l++){var u=o[l],h=i[u].pop();if(n[u]=n[u]||{},!n[u][h]&&t[u][h]){n[u][h]=!0,r[u]=r[u]||[],r[u].push(h);for(var d=a(t,t[u][h],u),c=Object.keys(d),f=0;f<c.length;f++)i[c[f]]=i[c[f]]||[],i[c[f]]=i[c[f]].concat(d[c[f]])}}return r}(n,t),l="";Object.keys(o).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;o[t][e];)e++;o[t].push(e),n[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+t+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+o[t].map((function(e){return JSON.stringify(e)+": "+n[t][e].toString()})).join(",")+"});\n"})),l=l+"new (("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+o.main.map((function(t){return JSON.stringify(t)+": "+n.main[t].toString()})).join(",")+"}))(self);";var u=new window.Blob([l],{type:"text/javascript"});if(e.bare)return u;var h=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(u),d=new window.Worker(h);return d.objectURL=h,d}},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return o}));var r=i(10),n=i(0),a=i(1),s=i(15);function o(t){var e=new s.EventEmitter,i=function(e,i){t.postMessage({event:e,data:i})};e.on(n.a.FRAG_DECRYPTED,i),e.on(n.a.ERROR,i);t.addEventListener("message",(function(n){var s=n.data;switch(s.cmd){case"init":var o=JSON.parse(s.config);t.transmuxer=new r.c(e,s.typeSupported,o,s.vendor,s.id),Object(a.a)(o.debug),function(){var t=function(t){a.b[t]=function(e){i("workerLog",{logType:t,message:e})}};for(var e in a.b)t(e)}(),i("init",null);break;case"configure":t.transmuxer.configure(s.config);break;case"demux":var u=t.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(r.d)(u)?u.then((function(e){l(t,e)})):l(t,u);break;case"flush":var d=s.chunkMeta,c=t.transmuxer.flush(d);Object(r.d)(c)?c.then((function(e){h(t,e,d)})):h(t,c,d)}}))}function l(t,e){if(!((i=e.remuxResult).audio||i.video||i.text||i.id3||i.initSegment))return!1;var i,r=[],n=e.remuxResult,a=n.audio,s=n.video;return a&&u(r,a),s&&u(r,s),t.postMessage({event:"transmuxComplete",data:e},r),!0}function u(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function h(t,e,i){e.reduce((function(e,i){return l(t,i)||e}),!1)||t.postMessage({event:"transmuxComplete",data:e[0]}),t.postMessage({event:"flush",data:i})}},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return cr}));var r,n=i(12),a=i(3),s=i(0),o=i(2),l=i(1),u=i(5),h=/^(\d+)x(\d+)$/,d=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,c=function(){function t(e){for(var i in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(i)&&(this[i]=e[i])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),r=0;r<e.length/2;r++)i[r]=parseInt(e.slice(2*r,2*r+2),16);return i}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var i=this[t];return i?parseFloat(i):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=h.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,i={};for(d.lastIndex=0;null!==(e=d.exec(t));){var r=e[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),i[e[1]]=r}return i},t}();function f(){return(f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function g(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}!function(t){t.ID="ID",t.CLASS="CLASS",t.START_DATE="START-DATE",t.DURATION="DURATION",t.END_DATE="END-DATE",t.END_ON_NEXT="END-ON-NEXT",t.PLANNED_DURATION="PLANNED-DURATION",t.SCTE35_OUT="SCTE35-OUT",t.SCTE35_IN="SCTE35-IN"}(r||(r={}));var v=function(){function t(t,e){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,e){var i=e.attr;for(var n in i)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]!==i[n]){l.b.warn('DATERANGE tag attribute: "'+n+'" does not match for tags with ID: "'+t.ID+'"'),this._badValueForSameId=n;break}t=f(new c({}),i,t)}if(this.attr=t,this._startDate=new Date(t[r.START_DATE]),r.END_DATE in this.attr){var s=new Date(this.attr[r.END_DATE]);Object(a.a)(s.getTime())&&(this._endDate=s)}}var e,i,n;return e=t,(i=[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var t=this.duration;return null!==t?new Date(this._startDate.getTime()+1e3*t):null}},{key:"duration",get:function(){if(r.DURATION in this.attr){var t=this.attr.decimalFloatingPoint(r.DURATION);if(Object(a.a)(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return r.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(r.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(r.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Object(a.a)(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}])&&g(e.prototype,i),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),p=i(6);function m(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var y=function(){function t(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.dateRanges={},this.url=t}var e,i,r;return t.prototype.reloaded=function(t){if(!t)return this.advanced=!0,void(this.updated=!0);var e=this.lastPartSn-t.lastPartSn,i=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!i||!!e,this.advanced=this.endSN>t.endSN||e>0||0===e&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(i=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(a.a)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&m(e.prototype,i),r&&m(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),T=i(17),b={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function E(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}var S=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,L=/#EXT-X-MEDIA:(.*)/g,A=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),D=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),R=/\.(mp4|m4s|m4v|m4a)$/i;var k=function(){function t(){}return t.findGroup=function(t,e){for(var i=0;i<t.length;i++){var r=t[i];if(r.id===e)return r}},t.convertAVC1ToAVCOTI=function(t){var e=t.split(".");if(e.length>2){var i=e.shift()+".";return i+=parseInt(e.shift()).toString(16),i+=("000"+parseInt(e.shift()).toString(16)).slice(-4)}return t},t.resolve=function(t,e){return n.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,i){var r,n=[],a={},s=!1;for(S.lastIndex=0;null!=(r=S.exec(e));)if(r[1]){var o=new c(r[1]),l={attrs:o,bitrate:o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),name:o.NAME,url:t.resolve(r[2],i)},u=o.decimalResolution("RESOLUTION");u&&(l.width=u.width,l.height=u.height),_((o.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=t.convertAVC1ToAVCOTI(l.videoCodec)),n.push(l)}else if(r[3]){var h=new c(r[3]);h["DATA-ID"]&&(s=!0,a[h["DATA-ID"]]=h)}return{levels:n,sessionData:s?a:null}},t.parseMasterPlaylistMedia=function(e,i,r,n){var a;void 0===n&&(n=[]);var s=[],o=0;for(L.lastIndex=0;null!==(a=L.exec(e));){var l=new c(a[1]);if(l.TYPE===r){var u={attrs:l,bitrate:0,id:o++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:r,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,i):""};if(n.length){var h=t.findGroup(n,u.groupId)||n[0];I(u,h,"audioCodec"),I(u,h,"textCodec")}s.push(u)}}return s},t.parseLevelPlaylist=function(t,e,i,r,s){var o,u,h,d=new y(e),f=d.fragments,g=null,m=0,b=0,E=0,S=0,L=null,k=new p.b(r,e),_=-1,I=!1;for(A.lastIndex=0,d.m3u8=t;null!==(o=A.exec(t));){I&&(I=!1,(k=new p.b(r,e)).start=E,k.sn=m,k.cc=S,k.level=i,g&&(k.initSegment=g,k.rawProgramDateTime=g.rawProgramDateTime,g.rawProgramDateTime=null));var w=o[1];if(w){k.duration=parseFloat(w);var x=(" "+o[2]).slice(1);k.title=x||null,k.tagList.push(x?["INF",w,x]:["INF",w])}else if(o[3])Object(a.a)(k.duration)&&(k.start=E,h&&(k.levelkey=h),k.sn=m,k.level=i,k.cc=S,k.urlId=s,f.push(k),k.relurl=(" "+o[3]).slice(1),O(k,L),L=k,E+=k.duration,m++,b=0,I=!0);else if(o[4]){var P=(" "+o[4]).slice(1);L?k.setByteRange(P,L):k.setByteRange(P)}else if(o[5])k.rawProgramDateTime=(" "+o[5]).slice(1),k.tagList.push(["PROGRAM-DATE-TIME",k.rawProgramDateTime]),-1===_&&(_=f.length);else{if(!(o=o[0].match(D))){l.b.warn("No matches on slow regex match for level playlist!");continue}for(u=1;u<o.length&&void 0===o[u];u++);var F=(" "+o[u]).slice(1),M=(" "+o[u+1]).slice(1),N=o[u+2]?(" "+o[u+2]).slice(1):"";switch(F){case"PLAYLIST-TYPE":d.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":m=d.startSN=parseInt(M);break;case"SKIP":var U=new c(M),B=U.decimalInteger("SKIPPED-SEGMENTS");if(Object(a.a)(B)){d.skippedSegments=B;for(var G=B;G--;)f.unshift(null);m+=B}var j=U.enumeratedString("RECENTLY-REMOVED-DATERANGES");j&&(d.recentlyRemovedDateranges=j.split("\t"));break;case"TARGETDURATION":d.targetduration=parseFloat(M);break;case"VERSION":d.version=parseInt(M);break;case"EXTM3U":break;case"ENDLIST":d.live=!1;break;case"#":(M||N)&&k.tagList.push(N?[M,N]:[M]);break;case"DISCONTINUITY":S++,k.tagList.push(["DIS"]);break;case"GAP":k.tagList.push([F]);break;case"BITRATE":k.tagList.push([F,M]);break;case"DATERANGE":var K=new c(M),H=new v(K,d.dateRanges[K.ID]);H.isValid||d.skippedSegments?d.dateRanges[H.id]=H:l.b.warn('Ignoring invalid DATERANGE tag: "'+M+'"'),k.tagList.push(["EXT-X-DATERANGE",M]);break;case"DISCONTINUITY-SEQUENCE":S=parseInt(M);break;case"KEY":var V,W=new c(M),Y=W.enumeratedString("METHOD"),q=W.URI,z=W.hexadecimalInteger("IV"),X=W.enumeratedString("KEYFORMATVERSIONS"),Q=W.enumeratedString("KEYID"),$=null!=(V=W.enumeratedString("KEYFORMAT"))?V:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf($)>-1){l.b.warn("Keyformat "+$+" is not supported from the manifest");continue}if("identity"!==$)continue;Y&&(h=T.a.fromURL(e,q),q&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Y)>=0&&(h.method=Y,h.keyFormat=$,Q&&(h.keyID=Q),X&&(h.keyFormatVersions=X),h.iv=z));break;case"START":var J=new c(M).decimalFloatingPoint("TIME-OFFSET");Object(a.a)(J)&&(d.startTimeOffset=J);break;case"MAP":var Z=new c(M);if(k.duration){var tt=new p.b(r,e);C(tt,Z,i,h),g=tt,k.initSegment=g,g.rawProgramDateTime&&!k.rawProgramDateTime&&(k.rawProgramDateTime=g.rawProgramDateTime)}else C(k,Z,i,h),g=k,I=!0;break;case"SERVER-CONTROL":var et=new c(M);d.canBlockReload=et.bool("CAN-BLOCK-RELOAD"),d.canSkipUntil=et.optionalFloat("CAN-SKIP-UNTIL",0),d.canSkipDateRanges=d.canSkipUntil>0&&et.bool("CAN-SKIP-DATERANGES"),d.partHoldBack=et.optionalFloat("PART-HOLD-BACK",0),d.holdBack=et.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var it=new c(M);d.partTarget=it.decimalFloatingPoint("PART-TARGET");break;case"PART":var rt=d.partList;rt||(rt=d.partList=[]);var nt=b>0?rt[rt.length-1]:void 0,at=b++,st=new p.c(new c(M),k,e,at,nt);rt.push(st),k.duration+=st.duration;break;case"PRELOAD-HINT":var ot=new c(M);d.preloadHint=ot;break;case"RENDITION-REPORT":var lt=new c(M);d.renditionReports=d.renditionReports||[],d.renditionReports.push(lt);break;default:l.b.warn("line parsed but not handled: "+o)}}}L&&!L.relurl?(f.pop(),E-=L.duration,d.partList&&(d.fragmentHint=L)):d.partList&&(O(k,L),k.cc=S,d.fragmentHint=k);var ut=f.length,ht=f[0],dt=f[ut-1];if((E+=d.skippedSegments*d.targetduration)>0&&ut&&dt){d.averagetargetduration=E/ut;var ct=dt.sn;d.endSN="initSegment"!==ct?ct:0,ht&&(d.startCC=ht.cc,ht.initSegment||d.fragments.every((function(t){return t.relurl&&(e=t.relurl,R.test(null!=(i=null===(r=n.parseURL(e))||void 0===r?void 0:r.path)?i:""));var e,i,r}))&&(l.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(k=new p.b(r,e)).relurl=dt.relurl,k.level=i,k.sn="initSegment",ht.initSegment=k,d.needSidxRanges=!0))}else d.endSN=0,d.startCC=0;return d.fragmentHint&&(E+=d.fragmentHint.duration),d.totalduration=E,d.endCC=S,_>0&&function(t,e){for(var i=t[e],r=e;r--;){var n=t[r];if(!n)return;n.programDateTime=i.programDateTime-1e3*n.duration,i=n}}(f,_),d},t}();function _(t,e){["video","audio","text"].forEach((function(i){var r=t.filter((function(t){return function(t,e){var i=b[e];return!!i&&!0===i[t.slice(0,4)]}(t,i)}));if(r.length){var n=r.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[i+"Codec"]=n.length>0?n[0]:r[0],t=t.filter((function(t){return-1===r.indexOf(t)}))}})),e.unknownCodecs=t}function I(t,e,i){var r=e[i];r&&(t[i]=r)}function O(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(a.a)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}function C(t,e,i,r){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=i,t.sn="initSegment",r&&(t.levelkey=r),t.initSegment=null}var w=i(4);function x(t,e){var i=t.url;return void 0!==i&&0!==i.indexOf("data:")||(i=e.url),i}var P=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.startLoad=function(t){},e.stopLoad=function(){this.destroyInternalLoaders()},e.registerListeners=function(){var t=this.hls;t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(s.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(s.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(s.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(s.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,i=e.pLoader,r=e.loader,n=new(i||r)(e);return t.loader=n,this.loaders[t.type]=n,n},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var i=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.a.MANIFEST,url:i,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var i=e.id,r=e.level,n=e.url,a=e.deliveryDirectives;this.load({id:i,groupId:null,level:r,responseType:"text",type:w.a.LEVEL,url:n,deliveryDirectives:a})},e.onAudioTrackLoading=function(t,e){var i=e.id,r=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:w.a.AUDIO_TRACK,url:n,deliveryDirectives:a})},e.onSubtitleTrackLoading=function(t,e){var i=e.id,r=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:w.a.SUBTITLE_TRACK,url:n,deliveryDirectives:a})},e.load=function(t){var e,i,r,n,a,s,o=this.hls.config,u=this.getInternalLoader(t);if(u){var h=u.context;if(h&&h.url===t.url)return void l.b.trace("[playlist-loader]: playlist request ongoing");l.b.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case w.a.MANIFEST:i=o.manifestLoadingMaxRetry,r=o.manifestLoadingTimeOut,n=o.manifestLoadingRetryDelay,a=o.manifestLoadingMaxRetryTimeout;break;case w.a.LEVEL:case w.a.AUDIO_TRACK:case w.a.SUBTITLE_TRACK:i=0,r=o.levelLoadingTimeOut;break;default:i=o.levelLoadingMaxRetry,r=o.levelLoadingTimeOut,n=o.levelLoadingRetryDelay,a=o.levelLoadingMaxRetryTimeout}if((u=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part)&&(t.type===w.a.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===w.a.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===w.a.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var d=s.partTarget,c=s.targetduration;d&&c&&(r=Math.min(1e3*Math.max(3*d,.8*c),r))}var f={timeout:r,maxRetry:i,retryDelay:n,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,f,g)},e.loadsuccess=function(t,e,i,r){if(void 0===r&&(r=null),i.isSidxRequest)return this.handleSidxRequest(t,i),void this.handlePlaylistLoaded(t,e,i,r);this.resetInternalLoader(i.type);var n=t.data;0===n.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,i,r):this.handleMasterPlaylist(t,e,i,r)):this.handleManifestParsingError(t,i,"no EXTM3U delimiter",r)},e.loaderror=function(t,e,i){void 0===i&&(i=null),this.handleNetworkError(e,i,!1,t)},e.loadtimeout=function(t,e,i){void 0===i&&(i=null),this.handleNetworkError(e,i,!0)},e.handleMasterPlaylist=function(t,e,i,r){var n=this.hls,a=t.data,o=x(t,i),u=k.parseMasterPlaylist(a,o),h=u.levels,d=u.sessionData;if(h.length){var f=h.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),g=h.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),v=k.parseMasterPlaylistMedia(a,o,"AUDIO",f),p=k.parseMasterPlaylistMedia(a,o,"SUBTITLES",g),m=k.parseMasterPlaylistMedia(a,o,"CLOSED-CAPTIONS");if(v.length)v.some((function(t){return!t.url}))||!h[0].audioCodec||h[0].attrs.AUDIO||(l.b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c({}),bitrate:0,url:""}));n.trigger(s.a.MANIFEST_LOADED,{levels:h,audioTracks:v,subtitles:p,captions:m,url:o,stats:e,networkDetails:r,sessionData:d})}else this.handleManifestParsingError(t,i,"no level found in manifest",r)},e.handleTrackOrLevelPlaylist=function(t,e,i,r){var n=this.hls,l=i.id,u=i.level,h=i.type,d=x(t,i),f=Object(a.a)(l)?l:0,g=Object(a.a)(u)?u:f,v=function(t){switch(t.type){case w.a.AUDIO_TRACK:return w.b.AUDIO;case w.a.SUBTITLE_TRACK:return w.b.SUBTITLE;default:return w.b.MAIN}}(i),p=k.parseLevelPlaylist(t.data,d,g,v,f);if(p.fragments.length){if(h===w.a.MANIFEST){var m={attrs:new c({}),bitrate:0,details:p,name:"",url:d};n.trigger(s.a.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:d,stats:e,networkDetails:r,sessionData:null})}if(e.parsing.end=performance.now(),p.needSidxRanges){var y,T=null===(y=p.fragments[0].initSegment)||void 0===y?void 0:y.url;this.load({url:T,isSidxRequest:!0,type:h,level:u,levelDetails:p,id:l,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else i.levelDetails=p,this.handlePlaylistLoaded(t,e,i,r)}else n.trigger(s.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:"number"==typeof i.level?i.level:void 0})},e.handleSidxRequest=function(t,e){var i=new Uint8Array(t.data),r=Object(u.c)(i,["sidx"])[0];if(r){var n=Object(u.k)(r);if(n){var a=n.references,s=e.levelDetails;a.forEach((function(t,e){var r=t.info,n=s.fragments[e];if(0===n.byteRange.length&&n.setByteRange(String(1+r.end-r.start)+"@"+String(r.start)),n.initSegment){var a=Object(u.c)(i,["moov"])[0],o=a?a.length:null;n.initSegment.setByteRange(String(o)+"@0")}}))}}},e.handleManifestParsingError=function(t,e,i,r){this.hls.trigger(s.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.MANIFEST_PARSING_ERROR,fatal:e.type===w.a.MANIFEST,url:t.url,reason:i,response:t,context:e,networkDetails:r})},e.handleNetworkError=function(t,e,i,r){void 0===i&&(i=!1),l.b.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var n=o.a.UNKNOWN,a=!1,u=this.getInternalLoader(t);switch(t.type){case w.a.MANIFEST:n=i?o.a.MANIFEST_LOAD_TIMEOUT:o.a.MANIFEST_LOAD_ERROR,a=!0;break;case w.a.LEVEL:n=i?o.a.LEVEL_LOAD_TIMEOUT:o.a.LEVEL_LOAD_ERROR,a=!1;break;case w.a.AUDIO_TRACK:n=i?o.a.AUDIO_TRACK_LOAD_TIMEOUT:o.a.AUDIO_TRACK_LOAD_ERROR,a=!1;break;case w.a.SUBTITLE_TRACK:n=i?o.a.SUBTITLE_TRACK_LOAD_TIMEOUT:o.a.SUBTITLE_LOAD_ERROR,a=!1}u&&this.resetInternalLoader(t.type);var h={type:o.b.NETWORK_ERROR,details:n,fatal:a,url:t.url,loader:u,context:t,networkDetails:e};r&&(h.response=r),this.hls.trigger(s.a.ERROR,h)},e.handlePlaylistLoaded=function(t,e,i,r){var n=i.type,a=i.level,o=i.id,l=i.groupId,u=i.loader,h=i.levelDetails,d=i.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),n){case w.a.MANIFEST:case w.a.LEVEL:this.hls.trigger(s.a.LEVEL_LOADED,{details:h,level:a||0,id:o||0,stats:e,networkDetails:r,deliveryDirectives:d});break;case w.a.AUDIO_TRACK:this.hls.trigger(s.a.AUDIO_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:r,deliveryDirectives:d});break;case w.a.SUBTITLE_TRACK:this.hls.trigger(s.a.SUBTITLE_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:r,deliveryDirectives:d})}}else this.handleManifestParsingError(t,i,"invalid target duration",r)},t}(),F=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this.registerListeners()}var e=t.prototype;return e.startLoad=function(t){},e.stopLoad=function(){this.destroyInternalLoaders()},e.registerListeners=function(){this.hls.on(s.a.KEY_LOADING,this.onKeyLoading,this)},e.unregisterListeners=function(){this.hls.off(s.a.KEY_LOADING,this.onKeyLoading)},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onKeyLoading=function(t,e){var i=e.frag,r=i.type,n=this.loaders[r];if(i.decryptdata){var a=i.decryptdata.uri;if(a!==this.decrypturl||null===this.decryptkey){var o=this.hls.config;if(n&&(l.b.warn("abort previous key loader for type:"+r),n.abort()),!a)return void l.b.warn("key uri is falsy");var u=o.loader,h=i.loader=this.loaders[r]=new u(o);this.decrypturl=a,this.decryptkey=null;var d={url:a,frag:i,responseType:"arraybuffer"},c={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};h.load(d,c,f)}else this.decryptkey&&(i.decryptdata.key=this.decryptkey,this.hls.trigger(s.a.KEY_LOADED,{frag:i}))}else l.b.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,i){var r=i.frag;r.decryptdata?(this.decryptkey=r.decryptdata.key=new Uint8Array(t.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(s.a.KEY_LOADED,{frag:r})):l.b.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var i=e.frag,r=i.loader;r&&r.abort(),delete this.loaders[i.type],this.hls.trigger(s.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.KEY_LOAD_ERROR,fatal:!1,frag:i,response:t})},e.loadtimeout=function(t,e){var i=e.frag,r=i.loader;r&&r.abort(),delete this.loaders[i.type],this.hls.trigger(s.a.ERROR,{type:o.b.NETWORK_ERROR,details:o.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})},t}();function M(t,e){var i;try{i=new Event("addtrack")}catch(t){(i=document.createEvent("Event")).initEvent("addtrack",!1,!1)}i.track=t,e.dispatchEvent(i)}function N(t,e){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(i){l.b.debug("[texttrack-utils]: "+i);var r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,t.addCue(r)}"disabled"===i&&(t.mode=i)}function U(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var i=t.cues.length;i--;)t.removeCue(t.cues[i]);"disabled"===e&&(t.mode=e)}function B(t,e,i,r){var n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var a=function(t,e,i){var r=[],n=function(t,e){if(e<t[0].startTime)return 0;var i=t.length-1;if(e>t[i].endTime)return-1;var r=0,n=i;for(;r<=n;){var a=Math.floor((n+r)/2);if(e<t[a].startTime)n=a-1;else{if(!(e>t[a].startTime&&r<i))return a;r=a+1}}return t[r].startTime-e<e-t[n].startTime?r:n}(t,e);if(n>-1)for(var a=n,s=t.length;a<s;a++){var o=t[a];if(o.startTime>=e&&o.endTime<=i)r.push(o);else if(o.startTime>i)return r}return r}(t.cues,e,i),s=0;s<a.length;s++)r&&!r(a[s])||t.removeCue(a[s]);"disabled"===n&&(t.mode=n)}var G=i(7),j=i(8);function K(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}function H(t,e){return t.getTime()/1e3-e}var V=function(){function t(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}var e=t.prototype;return e.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},e._registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(s.a.LEVEL_UPDATED,this.onLevelUpdated,this)},e._unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(s.a.LEVEL_UPDATED,this.onLevelUpdated,this)},e.onMediaAttached=function(t,e){this.media=e.media},e.onMediaDetaching=function(){this.id3Track&&(U(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},e.onManifestLoading=function(){this.dateRangeCuesAppended={}},e.createTrack=function(t){var e=this.getID3Track(t.textTracks);return e.mode="hidden",e},e.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var i=t[e];if("metadata"===i.kind&&"id3"===i.label)return M(i,this.media),i}return this.media.addTextTrack("metadata","id3")}},e.onFragParsingMetadata=function(t,e){if(this.media){var i=this.hls.config,r=i.enableEmsgMetadataCues,n=i.enableID3MetadataCues;if(r||n){var a=e.frag,s=e.samples,o=e.details;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var l=o.edge||a.end,u=K(),h=!1,d={},c=0;c<s.length;c++){var f=s[c].type;if((f!==j.a.emsg||r)&&n){var g=G.c(s[c].data);if(g){var v=s[c].pts,p=l;p-v<=0&&(p=v+.25);for(var m=0;m<g.length;m++){var y=g[m];if(!G.e(y)){var T=new u(v,p,"");T.value=y,f&&(T.type=f),this.id3Track.addCue(T),d[y.key]=null,h=!0}}}}}h&&this.updateId3CueEnds(d)}}},e.updateId3CueEnds=function(t){var e,i=null===(e=this.id3Track)||void 0===e?void 0:e.cues;if(i)for(var r=i.length;r--;){var n,a=i[r],s=null===(n=a.value)||void 0===n?void 0:n.key;if(s&&s in t){var o=t[s];o&&a.endTime!==o&&(a.endTime=o),t[s]=a.startTime}}},e.onBufferFlushing=function(t,e){var i=e.startOffset,r=e.endOffset,n=e.type,a=this.id3Track,s=this.hls;if(s){var o=s.config,l=o.enableEmsgMetadataCues,u=o.enableID3MetadataCues;if(a&&(l||u))B(a,i,r,"audio"===n?function(t){return t.type===j.a.audioId3&&u}:"video"===n?function(t){return t.type===j.a.emsg&&l}:function(t){return t.type===j.a.audioId3&&u||t.type===j.a.emsg&&l})}},e.onLevelUpdated=function(t,e){var i=this,n=e.details;if(this.media&&n.hasProgramDateTime&&this.hls.config.enableDateRangeMetadataCues){var s=this.dateRangeCuesAppended,o=this.id3Track,l=n.dateRanges,u=Object.keys(l);if(o)for(var h=Object.keys(s).filter((function(t){return!u.includes(t)})),d=function(t){var e=h[t];Object.keys(s[e].cues).forEach((function(t){o.removeCue(s[e].cues[t])})),delete s[e]},c=h.length;c--;)d(c);var f=n.fragments[n.fragments.length-1];if(0!==u.length&&Object(a.a)(null==f?void 0:f.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var g=f.programDateTime/1e3-f.start,v=n.edge||f.end,p=K(),m=function(t){var e=u[t],n=l[e],a=s[e],o=(null==a?void 0:a.cues)||{},h=(null==a?void 0:a.durationKnown)||!1,d=H(n.startDate,g),c=v,f=n.endDate;if(f)c=H(f,g),h=!0;else if(n.endOnNext&&!h){var m=u.reduce((function(t,e){var i=l[e];return i.class===n.class&&i.id!==e&&i.startDate>n.startDate&&t.push(i),t}),[]).sort((function(t,e){return t.startDate.getTime()-e.startDate.getTime()}))[0];m&&(c=H(m.startDate,g),h=!0)}for(var y,T=Object.keys(n.attr),b=0;b<T.length;b++){var E=T[b];if(E!==r.ID&&E!==r.CLASS&&E!==r.START_DATE&&E!==r.DURATION&&E!==r.END_DATE&&E!==r.END_ON_NEXT){var S=o[E];if(S)h&&!a.durationKnown&&(S.endTime=c);else{var L=n.attr[E];S=new p(d,c,""),E!==r.SCTE35_OUT&&E!==r.SCTE35_IN||(y=L,L=Uint8Array.from(y.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),S.value={key:E,data:L},S.type=j.a.dateRange,i.id3Track.addCue(S),o[E]=S}}}s[e]={cues:o,dateRange:n,durationKnown:h}},y=0;y<u.length;y++)m(y)}}},t}();function W(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Y,q=function(){function t(t){var e=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var e,i,r,n=t.prototype;return n.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},n.registerListeners=function(){this.hls.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(s.a.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(s.a.ERROR,this.onError,this)},n.unregisterListeners=function(){this.hls.off(s.a.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(s.a.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(s.a.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(s.a.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(s.a.ERROR,this.onError)},n.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},n.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},n.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},n.onLevelUpdated=function(t,e){var i=e.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},n.onError=function(t,e){e.details===o.a.BUFFER_STALLED_ERROR&&(this.stallCount++,l.b.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},n.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var i=this.computeLatency();if(null!==i){this._latency=i;var r=this.config,n=r.lowLatencyMode,a=r.maxLiveSyncPlaybackRate;if(n&&1!==a){var s=this.targetLatency;if(null!==s){var o=i-s,l=o<Math.min(this.maxLatency,s+e.targetduration);if(e.live&&l&&o>.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,a)),h=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;t.playbackRate=Math.min(u,Math.max(1,h))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},n.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},n.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(i=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,i=t.partHoldBack,r=t.targetduration,n=this.config,a=n.liveSyncDuration,s=n.liveSyncDurationCount,o=n.lowLatencyMode,l=this.hls.userConfig,u=o&&i||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==a?a:s*r);var h=r;return u+Math.min(1*this.stallCount,h)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,i=this.levelDetails;if(null===t||null===e||null===i)return null;var r=i.edge,n=t-e-this.edgeStalled,a=r-i.totalduration,s=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,n),s)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var i=t.buffered.length;return(i?t.buffered.end(i-1):e.edge)-this.currentTime}}])&&W(e.prototype,i),r&&W(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function z(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}!function(t){t.No="",t.Yes="YES",t.v2="v2"}(Y||(Y={}));var X=function(){function t(t,e,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=i}return t.prototype.addDirectives=function(t){var e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.toString()},t}(),Q=function(){function t(t){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(t){return t})).join(",").replace(/\.[^.,]+/g,"")}var e,i,r;return e=t,(i=[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(t){var e=t%this.url.length;this._urlId!==e&&(this.details=void 0,this._urlId=e)}}])&&z(e.prototype,i),r&&z(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $(){return($=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function J(t,e,i){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(i);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(i)}}function Z(t){var e={};t.forEach((function(t){var i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++}))}function tt(t,e){var i=e.startPTS;if(Object(a.a)(i)){var r,n=0;e.sn>t.sn?(n=i-t.start,r=t):(n=t.start-i,r=e),r.duration!==n&&(r.duration=n)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration}else e.start=Math.max(t.start-e.duration,0)}function et(t,e,i,r,n,s){r-i<=0&&(l.b.warn("Fragment should have a positive duration",e),r=i+e.duration,s=n+e.duration);var o=i,u=r,h=e.startPTS,d=e.endPTS;if(Object(a.a)(h)){var c=Math.abs(h-i);Object(a.a)(e.deltaPTS)?e.deltaPTS=Math.max(c,e.deltaPTS):e.deltaPTS=c,o=Math.max(i,h),i=Math.min(i,h),n=Math.min(n,e.startDTS),u=Math.min(r,d),r=Math.max(r,d),s=Math.max(s,e.endDTS)}e.duration=r-i;var f=i-e.start;e.appendedPTS=r,e.start=e.startPTS=i,e.maxStartPTS=o,e.startDTS=n,e.endPTS=r,e.minEndPTS=u,e.endDTS=s;var g,v=e.sn;if(!t||v<t.startSN||v>t.endSN)return 0;var p=v-t.startSN,m=t.fragments;for(m[p]=e,g=p;g>0;g--)tt(m[g],m[g-1]);for(g=p;g<m.length-1;g++)tt(m[g],m[g+1]);return t.fragmentHint&&tt(m[m.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,f}function it(t,e){for(var i=null,r=t.fragments,n=r.length-1;n>=0;n--){var s=r[n].initSegment;if(s){i=s;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var o,u=0;(function(t,e,i){for(var r=e.skippedSegments,n=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(r?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=n;u<=a;u++){var h=l[s+u],d=o[u];r&&!d&&u<r&&(d=e.fragments[u]=h),h&&d&&i(h,d)}}(t,e,(function(t,r){t.relurl&&(u=t.cc-r.cc),Object(a.a)(t.startPTS)&&Object(a.a)(t.endPTS)&&(r.start=r.startPTS=t.startPTS,r.startDTS=t.startDTS,r.appendedPTS=t.appendedPTS,r.maxStartPTS=t.maxStartPTS,r.endPTS=t.endPTS,r.endDTS=t.endDTS,r.minEndPTS=t.minEndPTS,r.duration=t.endPTS-t.startPTS,r.duration&&(o=r),e.PTSKnown=e.alignedSliding=!0),r.elementaryStreams=t.elementaryStreams,r.loader=t.loader,r.stats=t.stats,r.urlId=t.urlId,t.initSegment&&(r.initSegment=t.initSegment,i=t.initSegment)})),i)&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach((function(t){var e;t.initSegment&&t.initSegment.relurl!==(null===(e=i)||void 0===e?void 0:e.relurl)||(t.initSegment=i)}));if(e.skippedSegments)if(e.deltaUpdateFailed=e.fragments.some((function(t){return!t})),e.deltaUpdateFailed){l.b.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=e.skippedSegments;h--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}else e.canSkipDateRanges&&(e.dateRanges=function(t,e,i){var r=$({},t);i&&i.forEach((function(t){delete r[t]}));return Object.keys(e).forEach((function(t){var i=new v(e[t].attr,r[t]);i.isValid?r[t]=i:l.b.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(e[t].attr)+'"')})),r}(t.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));var d=e.fragments;if(u){l.b.warn("discontinuity sliding from playlist, take drift into account");for(var c=0;c<d.length;c++)d[c].cc+=u}e.skippedSegments&&(e.startCC=e.fragments[0].cc),function(t,e,i){if(t&&e)for(var r=0,n=0,a=t.length;n<=a;n++){var s=t[n],o=e[n+r];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?i(s,o):r--}}(t.partList,e.partList,(function(t,e){e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),o?et(e,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):rt(t,e),d.length&&(e.totalduration=e.edge-d[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;var f=e.advancedDateTime;if(e.advanced&&f){var g=e.edge;e.driftStart||(e.driftStartTime=f,e.driftStart=g),e.driftEndTime=f,e.driftEnd=g}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function rt(t,e){var i=e.startSN+e.skippedSegments-t.startSN,r=t.fragments;i<0||i>=r.length||nt(e,r[i].start)}function nt(t,e){if(e){for(var i=t.fragments,r=t.skippedSegments;r<i.length;r++)i[r].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}var at=function(){function t(t,e){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=l.b.log.bind(l.b,e+":"),this.warn=l.b.warn.bind(l.b,e+":"),this.hls=t}var e=t.prototype;return e.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},e.onError=function(t,e){e.fatal&&e.type===o.b.NETWORK_ERROR&&this.clearTimer()},e.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},e.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},e.stopLoad=function(){this.canLoad=!1,this.clearTimer()},e.switchParams=function(t,e){var i=null==e?void 0:e.renditionReports;if(i)for(var r=0;r<i.length;r++){var n=i[r],s=""+n.URI;if(s===t.slice(-s.length)){var o=parseInt(n["LAST-MSN"]),l=parseInt(n["LAST-PART"]);if(e&&this.hls.config.lowLatencyMode){var u=Math.min(e.age-e.partTarget,e.targetduration);void 0!==l&&u>e.partTarget&&(l+=1)}if(Object(a.a)(o))return new X(o,Object(a.a)(l)?l:void 0,Y.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,i){var r=this,n=e.details,a=e.stats,s=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(n.advancedDateTime=Date.now()-s,n.live||null!=i&&i.live){if(n.reloaded(i),i&&this.log("live playlist "+t+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),i&&n.fragments.length>0&&it(i,n),!this.canLoad||!n.live)return;var o,l=void 0,u=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var h=this.hls.config.lowLatencyMode,d=n.lastPartSn,c=n.endSN,f=n.lastPartIndex,g=d===c;-1!==f?(l=g?c+1:d,u=g?h?0:f:f+1):l=c+1;var v=n.age,p=v+n.ageHeader,m=Math.min(p-n.partTarget,1.5*n.targetduration);if(m>0){if(i&&m>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+m+" with playlist age: "+n.age),m=0;else{var y=Math.floor(m/n.targetduration);if(l+=y,void 0!==u)u+=Math.round(m%n.targetduration/n.partTarget);this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+m+" skip sn "+y+" to part "+u)}n.tuneInGoal=m}if(o=this.getDeliveryDirectives(n,e.deliveryDirectives,l,u),h||!g)return void this.loadPlaylist(o)}else o=this.getDeliveryDirectives(n,e.deliveryDirectives,l,u);var T=function(t,e){var i,r=1e3*t.levelTargetDuration,n=r/2,a=t.age,s=a>0&&a<3*r,o=e.loading.end-e.loading.start,l=t.availabilityDelay;if(!1===t.updated)if(s){var u=333*t.misses;i=Math.max(Math.min(n,2*o),u),t.availabilityDelay=(t.availabilityDelay||0)+i}else i=n;else s?(l=Math.min(l||r/2,a),t.availabilityDelay=l,i=l+r-a):i=r-o;return Math.round(i)}(n,a);void 0!==l&&n.canBlockReload&&(T-=n.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout((function(){return r.loadPlaylist(o)}),T)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,i,r){var n=function(t,e){var i=t.canSkipUntil,r=t.canSkipDateRanges,n=t.endSN;return i&&(void 0!==e?e-n:0)<i?r?Y.v2:Y.Yes:Y.No}(t,i);return null!=e&&e.skip&&t.deltaUpdateFailed&&(i=e.msn,r=e.part,n=Y.No),new X(i,r,n)},e.retryLoadingOrFail=function(t){var e,i=this,r=this.hls.config,n=this.retryCount<r.levelLoadingMaxRetry;if(n)if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return i.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return n},t}();function st(){return(st=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function ot(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function lt(t,e){return(lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var ut,ht=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),dt=function(t){var e,i;function r(e){var i;return(i=t.call(this,e,"[level-controller]")||this)._levels=[],i._firstLevel=-1,i._startLevel=void 0,i.currentLevelIndex=-1,i.manualLevelIndex=-1,i.onParsedComplete=void 0,i._registerListeners(),i}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,lt(e,i);var n,a,l,u=r.prototype;return u._registerListeners=function(){var t=this.hls;t.on(s.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(s.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(s.a.FRAG_LOADED,this.onFragLoaded,this),t.on(s.a.ERROR,this.onError,this)},u._unregisterListeners=function(){var t=this.hls;t.off(s.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(s.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(s.a.FRAG_LOADED,this.onFragLoaded,this),t.off(s.a.ERROR,this.onError,this)},u.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},u.startLoad=function(){this._levels.forEach((function(t){t.loadError=0})),t.prototype.startLoad.call(this)},u.onManifestLoaded=function(t,e){var i,r,n=[],a=[],l=[],u={},h=!1,d=!1,c=!1;if(e.levels.forEach((function(t){var e=t.attrs;h=h||!(!t.width||!t.height),d=d||!!t.videoCodec,c=c||!!t.audioCodec,ht&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0);var i=t.bitrate+"-"+t.attrs.RESOLUTION+"-"+t.attrs.CODECS;(r=u[i])?r.url.push(t.url):(r=new Q(t),u[i]=r,n.push(r)),e&&(e.AUDIO&&J(r,"audio",e.AUDIO),e.SUBTITLES&&J(r,"text",e.SUBTITLES))})),(h||d)&&c&&(n=n.filter((function(t){var e=t.videoCodec,i=t.width,r=t.height;return!!e||!(!i||!r)}))),n=n.filter((function(t){var e=t.audioCodec,i=t.videoCodec;return(!e||E(e,"audio"))&&(!i||E(i,"video"))})),e.audioTracks&&Z(a=e.audioTracks.filter((function(t){return!t.audioCodec||E(t.audioCodec,"audio")}))),e.subtitles&&Z(l=e.subtitles),n.length>0){i=n[0].bitrate,n.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=n;for(var f=0;f<n.length;f++)if(n[f].bitrate===i){this._firstLevel=f,this.log("manifest loaded, "+n.length+" level(s) found, first bitrate: "+i);break}var g=c&&!d,v={levels:n,audioTracks:a,subtitleTracks:l,firstLevel:this._firstLevel,stats:e.stats,audio:c,video:d,altAudio:!g&&a.some((function(t){return!!t.url}))};this.hls.trigger(s.a.MANIFEST_PARSED,v),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,reason:"no level with compatible codecs found in manifest"})},u.onError=function(e,i){var r;if(t.prototype.onError.call(this,e,i),!i.fatal){var n=i.context,a=this._levels[this.currentLevelIndex];if(n&&(n.type===w.a.AUDIO_TRACK&&a.audioGroupIds&&n.groupId===a.audioGroupIds[a.urlId]||n.type===w.a.SUBTITLE_TRACK&&a.textGroupIds&&n.groupId===a.textGroupIds[a.urlId]))this.redundantFailover(this.currentLevelIndex);else{var s,l=!1,u=!0;switch(i.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:if(i.frag){var h=i.frag.type===w.b.MAIN?i.frag.level:this.currentLevelIndex,d=this._levels[h];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=h)):s=h}break;case o.a.LEVEL_LOAD_ERROR:case o.a.LEVEL_LOAD_TIMEOUT:n&&(n.deliveryDirectives&&(u=!1),s=n.level),l=!0;break;case o.a.REMUX_ALLOC_ERROR:s=null!=(r=i.level)?r:this.currentLevelIndex,l=!0}void 0!==s&&this.recoverLevel(i,s,l,u)}}},u.recoverLevel=function(t,e,i,r){var n=t.details,a=this._levels[e];if(a.loadError++,i){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(r){var s=a.url.length;if(s>1&&a.loadError<s)t.levelRetry=!0,this.redundantFailover(e);else if(-1===this.manualLevelIndex){for(var o=-1,l=this._levels,u=l.length;u--;){var h=(u+this.currentLevelIndex)%l.length;if(h!==this.currentLevelIndex&&0===l[h].loadError){o=h;break}}o>-1&&this.currentLevelIndex!==o&&(this.warn(n+": switch to "+o),t.levelRetry=!0,this.hls.nextAutoLevel=o)}}},u.redundantFailover=function(t){var e=this._levels[t],i=e.url.length;if(i>1){var r=(e.urlId+1)%i;this.warn("Switching to redundant URL-id "+r),this._levels.forEach((function(t){t.urlId=r})),this.level=t}},u.onFragLoaded=function(t,e){var i=e.frag;if(void 0!==i&&i.type===w.b.MAIN){var r=this._levels[i.level];void 0!==r&&(r.fragmentError=0,r.loadError=0)}},u.onLevelLoaded=function(t,e){var i,r,n=e.level,a=e.details,s=this._levels[n];if(!s)return this.warn("Invalid level index "+n),void(null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(n,e,s.details)):null!==(i=e.deliveryDirectives)&&void 0!==i&&i.skip&&(a.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(t,e){var i=this.hls.levels[this.currentLevelIndex];if(i&&i.audioGroupIds){for(var r=-1,n=this.hls.audioTracks[e.id].groupId,a=0;a<i.audioGroupIds.length;a++)if(i.audioGroupIds[a]===n){r=a;break}r!==i.urlId&&(i.urlId=r,this.startLoad())}},u.loadPlaylist=function(t){var e=this.currentLevelIndex,i=this._levels[e];if(this.canLoad&&i&&i.url.length>0){var r=i.urlId,n=i.url[r];if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+r+" "+n),this.clearTimer(),this.hls.trigger(s.a.LEVEL_LOADING,{url:n,level:e,id:r,deliveryDirectives:t||null})}},u.removeLevel=function(t,e){var i=function(t,i){return i!==e},r=this._levels.filter((function(r,n){return n!==t||r.url.length>1&&void 0!==e&&(r.url=r.url.filter(i),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(i)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(i)),r.urlId=0,!0)})).map((function(t,e){var i=t.details;return null!=i&&i.fragments&&i.fragments.forEach((function(t){t.level=e})),t}));this._levels=r,this.hls.trigger(s.a.LEVELS_UPDATED,{levels:r})},n=r,(a=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,i=this._levels;if(0!==i.length&&(this.currentLevelIndex!==t||null===(e=i[t])||void 0===e||!e.details)){if(t<0||t>=i.length){var r=t<0;if(this.hls.trigger(s.a.ERROR,{type:o.b.OTHER_ERROR,details:o.a.LEVEL_SWITCH_ERROR,level:t,fatal:r,reason:"invalid level idx"}),r)return;t=Math.min(t,i.length-1)}this.clearTimer();var n=this.currentLevelIndex,a=i[n],l=i[t];this.log("switching to level "+t+" from "+n),this.currentLevelIndex=t;var u=st({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(s.a.LEVEL_SWITCHING,u);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==a?void 0:a.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&ot(n.prototype,a),l&&ot(n,l),Object.defineProperty(n,"prototype",{writable:!1}),r}(at);!function(t){t.NOT_LOADED="NOT_LOADED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(ut||(ut={}));var ct=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(s.a.BUFFER_APPENDED,this.onBufferAppended,this),t.on(s.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(s.a.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(s.a.BUFFER_APPENDED,this.onBufferAppended,this),t.off(s.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(s.a.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===w.b.MAIN){var i=this.activeFragment,r=this.activeParts;if(!i)return null;if(r)for(var n=r.length;n--;){var a=r[n],s=a?a.end:i.appendedPTS;if(a.start<=t&&void 0!==s&&t<=s)return n>9&&(this.activeParts=r.slice(n-9)),a}else if(i.start<=t&&void 0!==i.appendedPTS&&t<=i.appendedPTS)return i}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var i=this.fragments,r=Object.keys(i),n=r.length;n--;){var a=i[r[n]];if((null==a?void 0:a.body.type)===e&&a.buffered){var s=a.body;if(s.start<=t&&t<=s.end)return s}}return null},e.detectEvictedFragments=function(t,e,i){var r=this;Object.keys(this.fragments).forEach((function(n){var a=r.fragments[n];if(a)if(a.buffered){var s=a.range[t];s&&s.time.some((function(t){var i=!r.isTimeBuffered(t.startPTS,t.endPTS,e);return i&&r.removeFragment(a.body),i}))}else a.body.type===i&&r.removeFragment(a.body)}))},e.detectPartialFragments=function(t){var e=this,i=this.timeRanges,r=t.frag,n=t.part;if(i&&"initSegment"!==r.sn){var a=gt(r),s=this.fragments[a];s&&(Object.keys(i).forEach((function(t){var a=r.elementaryStreams[t];if(a){var o=i[t],l=null!==n||!0===a.partial;s.range[t]=e.getBufferedTimes(r,n,l,o)}})),s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body))}},e.fragBuffered=function(t){var e=gt(t),i=this.fragments[e];i&&(i.loaded=null,i.buffered=!0)},e.getBufferedTimes=function(t,e,i,r){for(var n={time:[],partial:i},a=e?e.start:t.start,s=e?e.end:t.end,o=t.minEndPTS||s,l=t.maxStartPTS||a,u=0;u<r.length;u++){var h=r.start(u)-this.bufferPadding,d=r.end(u)+this.bufferPadding;if(l>=h&&o<=d){n.time.push({startPTS:Math.max(a,r.start(u)),endPTS:Math.min(s,r.end(u))});break}if(a<d&&s>h)n.partial=!0,n.time.push({startPTS:Math.max(a,r.start(u)),endPTS:Math.min(s,r.end(u))});else if(s<=h)break}return n},e.getPartialFragment=function(t){var e,i,r,n=null,a=0,s=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach((function(l){var u=o[l];u&&ft(u)&&(i=u.body.start-s,r=u.body.end+s,t>=i&&t<=r&&(e=Math.min(t-i,r-t),a<=e&&(n=u.body,a=e)))})),n},e.getState=function(t){var e=gt(t),i=this.fragments[e];return i?i.buffered?ft(i)?ut.PARTIAL:ut.OK:ut.APPENDING:ut.NOT_LOADED},e.isTimeBuffered=function(t,e,i){for(var r,n,a=0;a<i.length;a++){if(r=i.start(a)-this.bufferPadding,n=i.end(a)+this.bufferPadding,t>=r&&e<=n)return!0;if(e<=r)return!1}return!1},e.onFragLoaded=function(t,e){var i=e.frag,r=e.part;if("initSegment"!==i.sn&&!i.bitrateTest&&!r){var n=gt(i);this.fragments[n]={body:i,loaded:e,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var i=this,r=e.frag,n=e.part,a=e.timeRanges;if(r.type===w.b.MAIN)if(this.activeFragment=r,n){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(n)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach((function(t){var e=a[t];if(i.detectEvictedFragments(t,e),!n)for(var s=0;s<e.length;s++)r.appendedPTS=Math.max(e.end(s),r.appendedPTS||0)}))},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=gt(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,i){var r=this;Object.keys(this.fragments).forEach((function(n){var a=r.fragments[n];if(a&&a.buffered){var s=a.body;s.type===i&&s.start<e&&s.end>t&&r.removeFragment(s)}}))},e.removeFragment=function(t){var e=gt(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function ft(t){var e,i;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(i=t.range.audio)||void 0===i?void 0:i.partial))}function gt(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}var vt=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}(),pt={length:0,start:function(){return 0},end:function(){return 0}},mt=function(){function t(){}return t.isBuffered=function(e,i){try{if(e)for(var r=t.getBuffered(e),n=0;n<r.length;n++)if(i>=r.start(n)&&i<=r.end(n))return!0}catch(t){}return!1},t.bufferInfo=function(e,i,r){try{if(e){var n,a=t.getBuffered(e),s=[];for(n=0;n<a.length;n++)s.push({start:a.start(n),end:a.end(n)});return this.bufferedInfo(s,i,r)}}catch(t){}return{len:0,start:i,end:i,nextStart:void 0}},t.bufferedInfo=function(t,e,i){e=Math.max(0,e),t.sort((function(t,e){var i=t.start-e.start;return i||e.end-t.end}));var r=[];if(i)for(var n=0;n<t.length;n++){var a=r.length;if(a){var s=r[a-1].end;t[n].start-s<i?t[n].end>s&&(r[a-1].end=t[n].end):r.push(t[n])}else r.push(t[n])}else r=t;for(var o,l=0,u=e,h=e,d=0;d<r.length;d++){var c=r[d].start,f=r[d].end;if(e+i>=c&&e<f)u=c,l=(h=f)-e;else if(e+i<c){o=c;break}}return{len:l,start:u||0,end:h||0,nextStart:o}},t.getBuffered=function(t){try{return t.buffered}catch(t){return l.b.log("failed to get media.buffered",t),pt}},t}(),yt=function(t,e,i,r,n,a){void 0===r&&(r=0),void 0===n&&(n=-1),void 0===a&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=i,this.size=r,this.part=n,this.partial=a};function Tt(t,e){if(t){var i=t.start+e;t.start=t.startPTS=i,t.endPTS=i+t.duration}}function bt(t,e){for(var i=e.fragments,r=0,n=i.length;r<n;r++)Tt(i[r],t);e.fragmentHint&&Tt(e.fragmentHint,t),e.alignedSliding=!0}function Et(t,e,i){e&&(!function(t,e,i){if(function(t,e,i){return!(!e.details||!(i.endCC>i.startCC||t&&t.cc<i.startCC))}(t,i,e)){var r=function(t,e){var i=t.fragments,r=e.fragments;if(r.length&&i.length){var n=function(t,e){for(var i=null,r=0,n=t.length;r<n;r++){var a=t[r];if(a&&a.cc===e){i=a;break}}return i}(i,r[0].cc);if(n&&(!n||n.startPTS))return n;l.b.log("No frag in previous level to align on")}else l.b.log("No fragments to align")}(i.details,e);r&&Object(a.a)(r.start)&&(l.b.log("Adjusting PTS using last level due to CC increase within current level "+e.url),bt(r.start,e))}}(t,i,e),!i.alignedSliding&&e.details&&function(t,e){if(!e.fragments.length||!t.hasProgramDateTime||!e.hasProgramDateTime)return;var i=e.fragments[0].programDateTime,r=t.fragments[0].programDateTime,n=(r-i)/1e3+e.fragments[0].start;n&&Object(a.a)(n)&&(l.b.log("Adjusting PTS using programDateTime delta "+(r-i)+"ms, sliding:"+n.toFixed(3)+" "+t.url+" "),bt(n,t))}(i,e.details),i.alignedSliding||!e.details||i.skippedSegments||rt(e.details,i))}function St(t,e){var i=t.programDateTime;if(i){var r=(i-e)/1e3;t.start=t.startPTS=r,t.endPTS=r+t.duration}}function Lt(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var i=e.fragments[0].programDateTime-1e3*e.fragments[0].start;t.fragments.forEach((function(t){St(t,i)})),t.fragmentHint&&St(t.fragmentHint,i),t.alignedSliding=!0}}var At={search:function(t,e){for(var i=0,r=t.length-1,n=null,a=null;i<=r;){var s=e(a=t[n=(i+r)/2|0]);if(s>0)i=n+1;else{if(!(s<0))return a;r=n-1}}return null}};function Dt(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=null;if(t?n=e[t.sn-e[0].sn+1]||null:0===i&&0===e[0].start&&(n=e[0]),n&&0===Rt(i,r,n))return n;var a=At.search(e,Rt.bind(null,i,r));return a||n}function Rt(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0);var r=Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=t?1:i.start-r>t&&i.start?-1:0}function kt(t,e,i){var r=1e3*Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>t}function _t(t){var e="function"==typeof Map?new Map:void 0;return(_t=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return It(t,arguments,wt(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ct(r,t)})(t)}function It(t,e,i){return(It=Ot()?Reflect.construct.bind():function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&Ct(n,i.prototype),n}).apply(null,arguments)}function Ot(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Ct(t,e){return(Ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function wt(t){return(wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xt=Math.pow(2,17),Pt=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var i=this,r=t.url;if(!r)return Promise.reject(new Mt({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(r?"part list":"url")));this.abort();var n=this.config,a=n.fLoader,s=n.loader;return new Promise((function(r,l){i.loader&&i.loader.destroy();var u=i.loader=t.loader=a?new a(n):new s(n),h=Ft(t),d={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:"initSegment"===t.sn?1/0:xt};t.stats=u.stats,u.load(h,d,{onSuccess:function(e,n,a,s){i.resetLoader(t,u),r({frag:t,part:null,payload:e.data,networkDetails:s})},onError:function(e,r,n){i.resetLoader(t,u),l(new Mt({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:n}))},onAbort:function(e,r,n){i.resetLoader(t,u),l(new Mt({type:o.b.NETWORK_ERROR,details:o.a.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:n}))},onTimeout:function(e,r,n){i.resetLoader(t,u),l(new Mt({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:n}))},onProgress:function(i,r,n,a){e&&e({frag:t,part:null,payload:n,networkDetails:a})}})}))},e.loadPart=function(t,e,i){var r=this;this.abort();var n=this.config,a=n.fLoader,s=n.loader;return new Promise((function(l,u){r.loader&&r.loader.destroy();var h=r.loader=t.loader=a?new a(n):new s(n),d=Ft(t,e),c={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:xt};e.stats=h.stats,h.load(d,c,{onSuccess:function(n,a,s,o){r.resetLoader(t,h),r.updateStatsFromPart(t,e);var u={frag:t,part:e,payload:n.data,networkDetails:o};i(u),l(u)},onError:function(i,n,a){r.resetLoader(t,h),u(new Mt({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:i,networkDetails:a}))},onAbort:function(i,n,a){t.stats.aborted=e.stats.aborted,r.resetLoader(t,h),u(new Mt({type:o.b.NETWORK_ERROR,details:o.a.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:a}))},onTimeout:function(i,n,a){r.resetLoader(t,h),u(new Mt({type:o.b.NETWORK_ERROR,details:o.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:a}))}})}))},e.updateStatsFromPart=function(t,e){var i=t.stats,r=e.stats,n=r.total;if(i.loaded+=r.loaded,n){var a=Math.round(t.duration/e.duration),s=Math.min(Math.round(i.loaded/n),a),o=(a-s)*Math.round(i.loaded/s);i.total=i.loaded+o}else i.total=Math.max(i.loaded,i.total);var l=i.loading,u=r.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function Ft(t,e){void 0===e&&(e=null);var i=e||t,r={frag:t,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},n=i.byteRangeStartOffset,s=i.byteRangeEndOffset;return Object(a.a)(n)&&Object(a.a)(s)&&(r.rangeStart=n,r.rangeEnd=s),r}var Mt=function(t){var e,i;function r(e){for(var i,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return(i=t.call.apply(t,[this].concat(n))||this).data=void 0,i.data=e,i}return i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,Ct(e,i),r}(_t(Error)),Nt=i(16),Ut={toString:function(t){for(var e="",i=t.length,r=0;r<i;r++)e+="["+t.start(r).toFixed(3)+","+t.end(r).toFixed(3)+"]";return e}};function Bt(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jt(t,e){return(jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Kt="STOPPED",Ht="IDLE",Vt="KEY_LOADING",Wt="FRAG_LOADING",Yt="FRAG_LOADING_WAITING_RETRY",qt="WAITING_TRACK",zt="PARSING",Xt="PARSED",Qt="ENDED",$t="ERROR",Jt="WAITING_INIT_PTS",Zt="WAITING_LEVEL",te=function(t){var e,i;function r(e,i,r){var n;return(n=t.call(this)||this).hls=void 0,n.fragPrevious=null,n.fragCurrent=null,n.fragmentTracker=void 0,n.transmuxer=null,n._state=Kt,n.media=null,n.mediaBuffer=null,n.config=void 0,n.bitrateTest=!1,n.lastCurrentTime=0,n.nextLoadPosition=0,n.startPosition=0,n.loadedmetadata=!1,n.fragLoadError=0,n.retryDate=0,n.levels=null,n.fragmentLoader=void 0,n.levelLastLoaded=null,n.startFragRequested=!1,n.decrypter=void 0,n.initPTS=[],n.onvseeking=null,n.onvended=null,n.logPrefix="",n.log=void 0,n.warn=void 0,n.logPrefix=r,n.log=l.b.log.bind(l.b,r+":"),n.warn=l.b.warn.bind(l.b,r+":"),n.hls=e,n.fragmentLoader=new Pt(e.config),n.fragmentTracker=i,n.config=e.config,n.decrypter=new Nt.a(e,e.config),e.on(s.a.KEY_LOADED,n.onKeyLoaded,Gt(n)),e.on(s.a.LEVEL_SWITCHING,n.onLevelSwitching,Gt(n)),n}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,jt(e,i);var n,h,d,c=r.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(t){},c.stopLoad=function(){this.fragmentLoader.abort();var t=this.fragCurrent;t&&this.fragmentTracker.removeFragment(t),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Kt},c._streamEnded=function(t,e){var i=this.fragCurrent,r=this.fragmentTracker;if(!e.live&&i&&this.media&&i.sn>=e.endSN&&!t.nextStart){var n=e.partList;if(null!=n&&n.length){var a=n[n.length-1];return mt.isBuffered(this.media,a.start+a.duration/2)}var s=r.getState(i);return s===ut.PARTIAL||s===ut.OK}return!1},c.onMediaAttached=function(t,e){var i=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.state===Kt&&this.startLoad(r.startPosition)},c.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&this.onvseeking&&this.onvended&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,i=this.media,r=this.mediaBuffer,n=this.state,s=i?i.currentTime:0,o=mt.bufferInfo(r||i,s,t.maxBufferHole);if(this.log("media seeking to "+(Object(a.a)(s)?s.toFixed(3):s)+", state: "+n),n===Qt)this.resetLoadingState();else if(e&&!o.len){var l=t.maxFragLookUpTolerance,u=e.start-l,h=s>e.start+e.duration+l;(s<u||h)&&(h&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.loader.abort()),this.resetLoadingState())}i&&(this.lastCurrentTime=s),this.loadedmetadata||o.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(t,e){if(this.state===Vt&&e.frag===this.fragCurrent&&this.levels){this.state=Ht;var i=this.levels[e.frag.level].details;i&&this.loadFragment(e.frag,i,e.frag.start)}},c.onLevelSwitching=function(t,e){this.fragLoadError=0},c.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=Kt,this.hls.off(s.a.KEY_LOADED,this.onKeyLoaded,this),this.hls.off(s.a.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,t.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(t,e){this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=Vt,this.fragCurrent=t,this.hls.trigger(s.a.KEY_LOADING,{frag:t})},c.loadFragment=function(t,e,i){this._loadFragForPlayback(t,e,i)},c._loadFragForPlayback=function(t,e,i){var r=this;this._doFragLoad(t,e,i,(function(e){if(r.fragContextChanged(t))return r.warn("Fragment "+t.sn+(e.part?" p: "+e.part.index:"")+" of level "+t.level+" was dropped during download."),void r.fragmentTracker.removeFragment(t);t.stats.chunkCount++,r._handleFragmentLoadProgress(e)})).then((function(e){if(e){r.fragLoadError=0;var i=r.state;r.fragContextChanged(t)?(i===Wt||!r.fragCurrent&&i===zt)&&(r.fragmentTracker.removeFragment(t),r.state=Ht):("payload"in e&&(r.log("Loaded fragment "+t.sn+" of level "+t.level),r.hls.trigger(s.a.FRAG_LOADED,e)),r._handleFragmentLoadComplete(e))}})).catch((function(e){r.state!==Kt&&r.state!==$t&&(r.warn(e),r.resetFragmentLoading(t))}))},c.flushMainBuffer=function(t,e,i){if(void 0===i&&(i=null),t-e){var r={startOffset:t,endOffset:e,type:i};this.fragLoadError=0,this.hls.trigger(s.a.BUFFER_FLUSHING,r)}},c._loadInitSegment=function(t){var e=this;this._doFragLoad(t).then((function(i){if(!i||e.fragContextChanged(t)||!e.levels)throw new Error("init load aborted");return i})).then((function(i){var r=e.hls,n=i.payload,a=t.decryptdata;if(n&&n.byteLength>0&&a&&a.key&&a.iv&&"AES-128"===a.method){var o=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(n),a.key.buffer,a.iv.buffer).then((function(e){var n=self.performance.now();return r.trigger(s.a.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:n}}),i.payload=e,i}))}return i})).then((function(i){var r=e.fragCurrent,n=e.hls,a=e.levels;if(!a)throw new Error("init load aborted, missing levels");a[t.level].details;var o=t.stats;e.state=Ht,e.fragLoadError=0,t.data=new Uint8Array(i.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),i.frag===r&&n.trigger(s.a.FRAG_BUFFERED,{stats:o,frag:r,part:null,id:t.type}),e.tick()})).catch((function(i){e.state!==Kt&&e.state!==$t&&(e.warn(i),e.resetFragmentLoading(t))}))},c.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},c.fragBufferedComplete=function(t,e){var i=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+(i?Ut.toString(mt.getBuffered(i)):"(detached)")),this.state=Ht,i&&(!this.loadedmetadata&&i.buffered.length&&this.fragCurrent===this.fragPrevious&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},c.seekToStartPos=function(){},c._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var i=t.frag,r=t.part,n=t.partsLoaded,a=!n||0===n.length||n.some((function(t){return!t})),s=new yt(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!a);e.flush(s)}},c._handleFragmentLoadProgress=function(t){},c._doFragLoad=function(t,e,i,r){var n=this;if(void 0===i&&(i=null),!this.levels)throw new Error("frag load aborted, missing levels");if(i=Math.max(t.start,i||0),this.config.lowLatencyMode&&e){var o=e.partList;if(o&&r){i>t.end&&e.fragmentHint&&(t=e.fragmentHint);var l=this.getNextPart(o,t,i);if(l>-1){var u=o[l];return this.log("Loading part sn: "+t.sn+" p: "+u.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+l+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(i.toFixed(3))),this.nextLoadPosition=u.start+u.duration,this.state=Wt,this.hls.trigger(s.a.FRAG_LOADING,{frag:t,part:o[l],targetBufferTime:i}),this.doFragPartsLoad(t,o,l,r).catch((function(t){return n.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(o,i))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(i.toFixed(3))),Object(a.a)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Wt,this.hls.trigger(s.a.FRAG_LOADING,{frag:t,targetBufferTime:i}),this.fragmentLoader.load(t,r).catch((function(t){return n.handleFragLoadError(t)}))},c.doFragPartsLoad=function(t,e,i,r){var n=this;return new Promise((function(a,o){var l=[];!function i(u){var h=e[u];n.fragmentLoader.loadPart(t,h,r).then((function(r){l[h.index]=r;var o=r.part;n.hls.trigger(s.a.FRAG_LOADED,r);var d=e[u+1];if(!d||d.fragment!==t)return a({frag:t,part:o,partsLoaded:l});i(u+1)})).catch(o)}(i)}))},c.handleFragLoadError=function(t){var e=t.data;return e&&e.details===o.a.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(s.a.ERROR,e),null},c._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===zt){var i=e.frag,r=e.part,n=e.level,a=self.performance.now();i.stats.parsing.end=a,r&&(r.stats.parsing.end=a),this.updateLevelTiming(i,r,n,t.partial)}else this.fragCurrent||(this.state=Ht)},c.getCurrentContext=function(t){var e=this.levels,i=t.level,r=t.sn,n=t.part;if(!e||!e[i])return this.warn("Levels object was unset while buffering fragment "+r+" of level "+i+". The current chunk will not be buffered."),null;var a=e[i],s=n>-1?function(t,e,i){if(!t||!t.details)return null;var r=t.details.partList;if(r)for(var n=r.length;n--;){var a=r[n];if(a.index===i&&a.fragment.sn===e)return a}return null}(a,r,n):null,o=s?s.fragment:function(t,e,i){if(!t||!t.details)return null;var r=t.details,n=r.fragments[e-r.startSN];return n||((n=r.fragmentHint)&&n.sn===e?n:e<r.startSN&&i&&i.sn===e?i:null)}(a,r,this.fragCurrent);return o?{frag:o,part:s,level:a}:null},c.bufferFragmentData=function(t,e,i,r){if(t&&this.state===zt){var n=t.data1,a=t.data2,o=n;if(n&&a&&(o=Object(u.b)(n,a)),o&&o.length){var l={type:t.type,frag:e,part:i,chunkMeta:r,parent:e.type,data:o};this.hls.trigger(s.a.BUFFER_APPENDING,l),t.dropped&&t.independent&&!i&&this.flushBufferGap(e)}}},c.flushBufferGap=function(t){var e=this.media;if(e)if(mt.isBuffered(e,e.currentTime)){var i=e.currentTime,r=mt.bufferInfo(e,i,0),n=t.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),s=Math.max(Math.min(t.start-a,r.end-a),i+a);t.start-s>a&&this.flushMainBuffer(s,t.start)}else this.flushMainBuffer(0,t.start)},c.getFwdBufferInfo=function(t,e){var i=this.config,r=this.getLoadPosition();if(!Object(a.a)(r))return null;var n=mt.bufferInfo(t,r,i.maxBufferHole);if(0===n.len&&void 0!==n.nextStart){var s=this.fragmentTracker.getBufferedFrag(r,e);if(s&&n.nextStart<s.end)return mt.bufferInfo(t,r,Math.max(n.nextStart,i.maxBufferHole))}return n},c.getMaxBufferLength=function(t){var e,i=this.config;return e=t?Math.max(8*i.maxBufferSize/t,i.maxBufferLength):i.maxBufferLength,Math.min(e,i.maxMaxBufferLength)},c.reduceMaxBufferLength=function(t){var e=this.config,i=t||e.maxBufferLength;return e.maxMaxBufferLength>=i&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},c.getNextFragment=function(t,e){var i=e.fragments,r=i.length;if(!r)return null;var n,a=this.config,s=i[0].start;if(e.live){var o=a.initialLiveManifestSize;if(r<o)return this.warn("Not enough fragments to start playback (have: "+r+", need: "+o+")"),null;e.PTSKnown||this.startFragRequested||-1!==this.startPosition||(n=this.getInitialLiveFragment(e,i),this.startPosition=n?this.hls.liveSyncPosition||n.start:t)}else t<=s&&(n=i[0]);if(!n){var l=a.lowLatencyMode?e.partEnd:e.fragmentEnd;n=this.getFragmentAtPosition(t,l,e)}return this.mapToInitFragWhenRequired(n)},c.mapToInitFragWhenRequired=function(t){return null==t||!t.initSegment||null!=t&&t.initSegment.data||this.bitrateTest?t:t.initSegment},c.getNextPart=function(t,e,i){for(var r=-1,n=!1,a=!0,s=0,o=t.length;s<o;s++){var l=t[s];if(a=a&&!l.independent,r>-1&&i<l.start)break;var u=l.loaded;!u&&(n||l.independent||a)&&l.fragment===e&&(r=s),n=u}return r},c.loadedEndOfParts=function(t,e){var i=t[t.length-1];return i&&e>i.start&&i.loaded},c.getInitialLiveFragment=function(t,e){var i=this.fragPrevious,r=null;if(i){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+i.programDateTime),r=function(t,e,i){if(null===e||!Array.isArray(t)||!t.length||!Object(a.a)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;i=i||0;for(var r=0;r<t.length;++r){var n=t[r];if(kt(e,i,n))return n}return null}(e,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var n=i.sn+1;if(n>=t.startSN&&n<=t.endSN){var s=e[n-t.startSN];i.cc===s.cc&&(r=s,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=function(t,e){return At.search(t,(function(t){return t.cc<e?1:t.cc>e?-1:0}))}(e,i.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+r.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(r=this.getFragmentAtPosition(o,this.bitrateTest?t.fragmentEnd:t.edge,t))}return r},c.getFragmentAtPosition=function(t,e,i){var r,n=this.config,a=this.fragPrevious,s=i.fragments,o=i.endSN,l=i.fragmentHint,u=n.maxFragLookUpTolerance,h=!!(n.lowLatencyMode&&i.partList&&l);(h&&l&&!this.bitrateTest&&(s=s.concat(l),o=l.sn),t<e)?r=Dt(a,s,t,t>e-u?0:u):r=s[s.length-1];if(r){var d=r.sn-i.startSN;if(a&&r.sn===a.sn&&!h)if(a&&r.level===a.level){var c=s[d+1];r.sn<o&&this.fragmentTracker.getState(c)!==ut.OK?(this.log("SN "+r.sn+" just loaded, load next one: "+c.sn),r=c):r=null}}return r},c.synchronizeToLiveEdge=function(t){var e=this.config,i=this.media;if(i){var r=this.hls.liveSyncPosition,n=i.currentTime,a=t.fragments[0].start,s=t.edge,o=n>=a-e.maxFragLookUpTolerance&&n<=s;if(null!==r&&i.duration>r&&(n<r||!o)){var l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!o&&i.readyState<4||n<s-l)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn("Playback: "+n.toFixed(3)+" is located too far from the end of live sliding playlist: "+s+", reset currentTime to : "+r.toFixed(3)),i.currentTime=r))}}},c.alignPlaylists=function(t,e){var i=this.levels,r=this.levelLastLoaded,n=this.fragPrevious,s=null!==r?i[r]:null,o=t.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;var l=t.fragments[0].start,u=!e,h=t.alignedSliding&&Object(a.a)(l);if(u||!h&&!l){Et(n,s,t);var d=t.fragments[0].start;return this.log("Live playlist sliding: "+d.toFixed(2)+" start-sn: "+(e?e.startSN:"na")+"->"+t.startSN+" prev-sn: "+(n?n.sn:"na")+" fragments: "+o),d}return l},c.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},c.setStartPosition=function(t,e){var i=this.startPosition;if(i<e&&(i=-1),-1===i||-1===this.lastCurrentTime){var r=t.startTimeOffset;Object(a.a)(r)?(i=e+r,r<0&&(i+=t.totalduration),i=Math.min(Math.max(e,i),e+t.totalduration),this.log("Start time offset "+r+" found in playlist, adjust startPosition to "+i),this.startPosition=i):t.live?i=this.hls.liveSyncPosition||e:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i},c.getLoadPosition=function(){var t=this.media,e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e},c.handleFragLoadAborted=function(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn("Fragment "+t.sn+(e?" part"+e.index:"")+" of level "+t.level+" was aborted"),this.resetFragmentLoading(t))},c.resetFragmentLoading=function(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===Yt)||(this.state=Ht)},c.onFragmentOrKeyLoadError=function(t,e){if(!e.fatal){var i=e.frag;if(i&&i.type===t){this.fragCurrent;var r=this.config;if(this.fragLoadError+1<=r.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var n=Math.min(Math.pow(2,this.fragLoadError)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);this.warn("Fragment "+i.sn+" of "+t+" "+i.level+" failed to load, retrying in "+n+"ms"),this.retryDate=self.performance.now()+n,this.fragLoadError++,this.state=Yt}else e.levelRetry?(t===w.b.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=Ht):(l.b.error(e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.stopLoad(),this.state=$t)}}},c.afterBufferFlushed=function(t,e,i){if(t){var r=mt.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,i),this.state===Qt&&this.resetLoadingState()}},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=Ht},c.resetStartWhenNotLoaded=function(t){if(!this.loadedmetadata){this.startFragRequested=!1;var e=this.levels?this.levels[t].details:null;null!=e&&e.live?(this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},c.updateLevelTiming=function(t,e,i,r){var n=this,a=i.details;Object.keys(t.elementaryStreams).reduce((function(e,o){var l=t.elementaryStreams[o];if(l){var u=l.endPTS-l.startPTS;if(u<=0)return n.warn("Could not parse fragment "+t.sn+" "+o+" duration reliably ("+u+")"),e||!1;var h=r?0:et(a,t,l.startPTS,l.endPTS,l.startDTS,l.endDTS);return n.hls.trigger(s.a.LEVEL_PTS_UPDATED,{details:a,level:i,drift:h,type:o,frag:t,start:l.startPTS,end:l.endPTS}),!0}return e}),!1)||(this.warn("Found no media in fragment "+t.sn+" of level "+i.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=Xt,this.hls.trigger(s.a.FRAG_PARSED,{frag:t,part:e})},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},n=r,(h=[{key:"state",get:function(){return this._state},set:function(t){var e=this._state;e!==t&&(this._state=t,this.log(e+"->"+t))}}])&&Bt(n.prototype,h),d&&Bt(n,d),Object.defineProperty(n,"prototype",{writable:!1}),r}(vt);function ee(){return self.MediaSource||self.WebKitMediaSource}function ie(){return self.SourceBuffer||self.WebKitSourceBuffer}var re=i(18),ne=i(10),ae=i(15),se=ee()||{isTypeSupported:function(){return!1}},oe=function(){function t(t,e,i,r){var n=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=t,this.id=e,this.onTransmuxComplete=i,this.onFlush=r;var a=t.config,u=function(e,i){(i=i||{}).frag=n.frag,i.id=n.id,t.trigger(e,i)};this.observer=new ae.EventEmitter,this.observer.on(s.a.FRAG_DECRYPTED,u),this.observer.on(s.a.ERROR,u);var h={mp4:se.isTypeSupported("video/mp4"),mpeg:se.isTypeSupported("audio/mpeg"),mp3:se.isTypeSupported('audio/mp4; codecs="mp3"')},d=navigator.vendor;if(a.enableWorker&&"undefined"!=typeof Worker){var c;l.b.log("demuxing in webworker");try{c=this.worker=re(19),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(e){t.trigger(s.a.ERROR,{type:o.b.OTHER_ERROR,details:o.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},c.postMessage({cmd:"init",typeSupported:h,vendor:d,id:e,config:JSON.stringify(a)})}catch(t){l.b.warn("Error in worker:",t),l.b.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new ne.c(this.observer,h,a,d,e),this.worker=null}}else this.transmuxer=new ne.c(this.observer,h,a,d,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null,this.onwmsg=void 0;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},e.push=function(t,e,i,r,n,a,s,o,u,h){var d,c,f=this;u.transmuxing.start=self.performance.now();var g=this.transmuxer,v=this.worker,p=a?a.start:n.start,m=n.decryptdata,y=this.frag,T=!(y&&n.cc===y.cc),b=!(y&&u.level===y.level),E=y?u.sn-y.sn:-1,S=this.part?u.part-this.part.index:-1,L=0===E&&u.id>1&&u.id===(null==y?void 0:y.stats.chunkCount),A=!b&&(1===E||0===E&&(1===S||L&&S<=0)),D=self.performance.now();(b||E||0===n.stats.parsing.start)&&(n.stats.parsing.start=D),!a||!S&&A||(a.stats.parsing.start=D);var R=!(y&&(null===(d=n.initSegment)||void 0===d?void 0:d.url)===(null===(c=y.initSegment)||void 0===c?void 0:c.url)),k=new ne.b(T,A,o,b,p,R);if(!A||T||R){l.b.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+T+"\n trackSwitch: "+b+"\n contiguous: "+A+"\n accurateTimeOffset: "+o+"\n timeOffset: "+p+"\n initSegmentChange: "+R);var _=new ne.a(i,r,e,s,h);this.configureTransmuxer(_)}if(this.frag=n,this.part=a,v)v.postMessage({cmd:"demux",data:t,decryptdata:m,chunkMeta:u,state:k},t instanceof ArrayBuffer?[t]:[]);else if(g){var I=g.push(t,m,u,k);Object(ne.d)(I)?I.then((function(t){f.handleTransmuxComplete(t)})):this.handleTransmuxComplete(I)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var i=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:t});else if(i){var n=i.flush(t);Object(ne.d)(n)?n.then((function(i){e.handleFlushResult(i,t)})):this.handleFlushResult(n,t)}},e.handleFlushResult=function(t,e){var i=this;t.forEach((function(t){i.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,i=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;case"workerLog":l.b[e.data.logType]&&l.b[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,i.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,i=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):i&&i.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}(),le=function(){function t(t,e,i,r){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=i,this.hls=r}var e=t.prototype;return e.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},e.poll=function(t,e){var i=this.config,r=this.media,n=this.stalled;if(null!==r){var a=r.currentTime,s=r.seeking,o=this.seeking&&!s,u=!this.seeking&&s;if(this.seeking=s,a===t){if((u||o)&&(this.stalled=null),!(r.paused&&!s||r.ended||0===r.playbackRate)&&mt.getBuffered(r).length){var h=mt.bufferInfo(r,a,0),d=h.len>0,c=h.nextStart||0;if(d||c){if(s){var f=h.len>2,g=!c||e&&e.start<=a||c-a>2&&!this.fragmentTracker.getPartialFragment(a);if(f||g)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var v,p=Math.max(c,h.start||0)-a,m=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,y=(null==m||null===(v=m.details)||void 0===v?void 0:v.live)?2*m.details.targetduration:2;if(p>0&&p<=y)return void this._trySkipBufferHole(null)}var T=self.performance.now();if(null!==n){var b=T-n;if(s||!(b>=250)||(this._reportStall(h),this.media)){var E=mt.bufferInfo(r,a,i.maxBufferHole);this._tryFixBufferStall(E,b)}}else this.stalled=T}}}else if(this.moved=!0,null!==n){if(this.stallReported){var S=self.performance.now()-n;l.b.warn("playback not stuck anymore @"+a+", after "+Math.round(S)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}},e._tryFixBufferStall=function(t,e){var i=this.config,r=this.fragmentTracker,n=this.media;if(null!==n){var a=n.currentTime,s=r.getPartialFragment(a);if(s)if(this._trySkipBufferHole(s)||!this.media)return;t.len>i.maxBufferHole&&e>1e3*i.highBufferWatchdogPeriod&&(l.b.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},e._reportStall=function(t){var e=this.hls,i=this.media;!this.stallReported&&i&&(this.stallReported=!0,l.b.warn("Playback stalling at @"+i.currentTime+" due to low buffer ("+JSON.stringify(t)+")"),e.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t.len}))},e._trySkipBufferHole=function(t){var e=this.config,i=this.hls,r=this.media;if(null===r)return 0;for(var n=r.currentTime,a=0,u=mt.getBuffered(r),h=0;h<u.length;h++){var d=u.start(h);if(n+e.maxBufferHole>=a&&n<d){var c=Math.max(d+.05,r.currentTime+.1);return l.b.warn("skipping hole, adjusting currentTime from "+n+" to "+c),this.moved=!0,this.stalled=null,r.currentTime=c,t&&i.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+c,frag:t}),c}a=u.end(h)}return 0},e._tryNudgeBuffer=function(){var t=this.config,e=this.hls,i=this.media,r=this.nudgeRetry;if(null!==i){var n=i.currentTime;if(this.nudgeRetry++,r<t.nudgeMaxRetry){var a=n+(r+1)*t.nudgeOffset;l.b.warn("Nudging 'currentTime' from "+n+" to "+a),i.currentTime=a,e.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else l.b.error("Playhead still not moving while enough data buffered @"+n+" after "+t.nudgeMaxRetry+" nudges"),e.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_STALLED_ERROR,fatal:!0})}},t}();function ue(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function he(t,e){return(he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var de=function(t){var e,i;function r(e,i){var r;return(r=t.call(this,e,i,"[stream-controller]")||this).audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.couldBacktrack=!1,r.backtrackFragment=null,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,he(e,i);var n,l,u,h=r.prototype;return h._registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(s.a.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(s.a.ERROR,this.onError,this),t.on(s.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(s.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(s.a.BUFFER_CREATED,this.onBufferCreated,this),t.on(s.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(s.a.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(s.a.FRAG_BUFFERED,this.onFragBuffered,this)},h._unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(s.a.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(s.a.ERROR,this.onError,this),t.off(s.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(s.a.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(s.a.BUFFER_CREATED,this.onBufferCreated,this),t.off(s.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(s.a.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(s.a.FRAG_BUFFERED,this.onFragBuffered,this)},h.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},h.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=i.startLevel;-1===r&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.nextAutoLevel),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=Ht,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=Kt},h.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},h.doTick=function(){switch(this.state){case Ht:this.doTickIdle();break;case Zt:var t,e=this.levels,i=this.level,r=null==e||null===(t=e[i])||void 0===t?void 0:t.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=Ht;break}break;case Yt:var n,a=self.performance.now(),s=this.retryDate;(!s||a>=s||null!==(n=this.media)&&void 0!==n&&n.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=Ht)}this.onTickEnd()},h.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},h.doTickIdle=function(){var t,e,i=this.hls,r=this.levelLastLoaded,n=this.levels,a=this.media,o=i.config,l=i.nextLoadLevel;if(null!==r&&(a||!this.startFragRequested&&o.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&n&&n[l]){var u=n[l];this.level=i.nextLoadLevel=l;var h=u.details;if(!h||this.state===Zt||h.live&&this.levelLastLoaded!==l)this.state=Zt;else{var d=this.getMainFwdBufferInfo();if(null!==d)if(!(d.len>=this.getMaxBufferLength(u.maxBitrate))){if(this._streamEnded(d,h)){var c={};return this.altAudio&&(c.type="video"),this.hls.trigger(s.a.BUFFER_EOS,c),void(this.state=Qt)}this.backtrackFragment&&this.backtrackFragment.start>d.end&&(this.backtrackFragment=null);var f=this.backtrackFragment?this.backtrackFragment.start:d.end,g=this.getNextFragment(f,h);if(this.couldBacktrack&&!this.fragPrevious&&g&&"initSegment"!==g.sn&&this.fragmentTracker.getState(g)!==ut.OK){var v,m=(null!=(v=this.backtrackFragment)?v:g).sn-h.startSN,y=h.fragments[m-1];y&&g.cc===y.cc&&(g=y,this.fragmentTracker.removeFragment(y))}else this.backtrackFragment&&d.len&&(this.backtrackFragment=null);if(g&&this.fragmentTracker.getState(g)===ut.OK&&this.nextLoadPosition>f){var T=this.audioOnly&&!this.altAudio?p.a.AUDIO:p.a.VIDEO;a&&this.afterBufferFlushed(a,T,w.b.MAIN),g=this.getNextFragment(this.nextLoadPosition,h)}g&&(!g.initSegment||g.initSegment.data||this.bitrateTest||(g=g.initSegment),"identity"!==(null===(t=g.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=g.decryptdata)&&void 0!==e&&e.key?this.loadFragment(g,h,f):this.loadKey(g,h))}}}},h.loadFragment=function(e,i,r){var n,a=this.fragmentTracker.getState(e);this.fragCurrent=e,a===ut.NOT_LOADED?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,i,r)):a===ut.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},h.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,w.b.MAIN);return e&&"fragment"in e?e.fragment:e},h.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,w.b.MAIN)},h.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},h.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},h.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var i,r=this.getAppendedFrag(e.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!e.paused&&t){var n=t[this.hls.nextLoadLevel],a=this.fragLastKbps;i=a&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*a)+1:0}else i=0;var s=this.getBufferedFrag(e.currentTime+i);if(s){var o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();var l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,h=Math.max(s.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}},h.abortCurrentFrag=function(){var t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,null!=t&&t.loader&&t.loader.abort(),this.state){case Vt:case Wt:case Yt:case zt:case Xt:this.state=Ht}this.nextLoadPosition=this.getLoadPosition()},h.flushMainBuffer=function(e,i){t.prototype.flushMainBuffer.call(this,e,i,this.altAudio?"video":null)},h.onMediaAttached=function(e,i){t.prototype.onMediaAttached.call(this,e,i);var r=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new le(this.config,r,this.fragmentTracker,this.hls)},h.onMediaDetaching=function(){var e=this.media;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},h.onMediaPlaying=function(){this.tick()},h.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(a.a)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},h.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(s.a.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},h.onManifestParsed=function(t,e){var i,r,n,a=!1,s=!1;e.levels.forEach((function(t){(i=t.audioCodec)&&(-1!==i.indexOf("mp4a.40.2")&&(a=!0),-1!==i.indexOf("mp4a.40.5")&&(s=!0))})),this.audioCodecSwitch=a&&s&&!("function"==typeof(null==(n=ie())||null===(r=n.prototype)||void 0===r?void 0:r.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},h.onLevelLoading=function(t,e){var i=this.levels;if(i&&this.state===Ht){var r=i[e.level];(!r.details||r.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(r.details))&&(this.state=Zt)}},h.onLevelLoaded=function(t,e){var i,r=this.levels,n=e.level,a=e.details,o=a.totalduration;if(r){this.log("Level "+n+" loaded ["+a.startSN+","+a.endSN+"], cc ["+a.startCC+", "+a.endCC+"] duration:"+o);var l=this.fragCurrent;!l||this.state!==Wt&&this.state!==Yt||l.level!==e.level&&l.loader&&(this.state=Ht,this.backtrackFragment=null,l.loader.abort());var u=r[n],h=0;if(a.live||null!==(i=u.details)&&void 0!==i&&i.live){if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed)return;h=this.alignPlaylists(a,u.details)}if(u.details=a,this.levelLastLoaded=n,this.hls.trigger(s.a.LEVEL_UPDATED,{details:a,level:n}),this.state===Zt){if(this.waitForCdnTuneIn(a))return;this.state=Ht}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,h),this.tick()}else this.warn("Levels were reset while loading level "+n)},h._handleFragmentLoadProgress=function(t){var e,i=t.frag,r=t.part,n=t.payload,a=this.levels;if(a){var s=a[i.level],o=s.details;if(o){var l=s.videoCodec,u=o.PTSKnown||!o.live,h=null===(e=i.initSegment)||void 0===e?void 0:e.data,d=this._getAudioCodec(s),c=this.transmuxer=this.transmuxer||new oe(this.hls,w.b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,g=-1!==f,v=new yt(i.level,i.sn,i.stats.chunkCount,n.byteLength,f,g),p=this.initPTS[i.cc];c.push(n,h,d,l,i,r,o.totalduration,u,v,p)}else this.warn("Dropping fragment "+i.sn+" of level "+i.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered")},h.onAudioTrackSwitching=function(t,e){var i=this.altAudio,r=!!e.url,n=e.id;if(!r){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var a=this.fragCurrent;null!=a&&a.loader&&(this.log("Switching to main audio track, cancel main fragment load"),a.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;i&&o.trigger(s.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),o.trigger(s.a.AUDIO_TRACK_SWITCHED,{id:n})}},h.onAudioTrackSwitched=function(t,e){var i=e.id,r=!!this.hls.audioTracks[i].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()},h.onBufferCreated=function(t,e){var i,r,n=e.tracks,a=!1;for(var s in n){var o=n[s];if("main"===o.id){if(r=s,i=o,"video"===s){var l=n[s];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&i?(this.log("Alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media},h.onFragBuffered=function(t,e){var i=e.frag,r=e.part;if(!i||i.type===w.b.MAIN){if(this.fragContextChanged(i))return this.warn("Fragment "+i.sn+(r?" p: "+r.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===Xt&&(this.state=Ht));var n=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}},h.onError=function(t,e){switch(e.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.b.MAIN,e);break;case o.a.LEVEL_LOAD_ERROR:case o.a.LEVEL_LOAD_TIMEOUT:this.state!==$t&&(e.fatal?(this.warn(""+e.details),this.state=$t):e.levelRetry||this.state!==Zt||(this.state=Ht));break;case o.a.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===zt||this.state===Xt)){var i=!0,r=this.getFwdBufferInfo(this.media,w.b.MAIN);r&&r.len>.5&&(i=!this.reduceMaxBufferLength(r.len)),i&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},h.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){if(this.loadedmetadata||!mt.getBuffered(t).length){var i=this.state!==Ht?this.fragCurrent:null;e.poll(this.lastCurrentTime,i)}this.lastCurrentTime=t.currentTime}},h.onFragLoadEmergencyAborted=function(){this.state=Ht,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},h.onBufferFlushed=function(t,e){var i=e.type;if(i!==p.a.AUDIO||this.audioOnly&&!this.altAudio){var r=(i===p.a.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,i,w.b.MAIN)}},h.onLevelsUpdated=function(t,e){this.levels=e.levels},h.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},h.seekToStartPos=function(){var t=this.media;if(t){var e=t.currentTime,i=this.startPosition;if(i>=0&&e<i){if(t.seeking)return void this.log("could not seek to "+i+", already seeking at "+e);var r=mt.getBuffered(t),n=(r.length?r.start(0):0)-i;n>0&&(n<this.config.maxBufferHole||n<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+n+" to match buffer start"),i+=n,this.startPosition=i),this.log("seek to target start position "+i+" from current time "+e),t.currentTime=i}}},h._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},h._loadBitrateTestFrag=function(t){var e=this;t.bitrateTest=!0,this._doFragLoad(t).then((function(i){var r=e.hls;if(i&&!r.nextLoadLevel&&!e.fragContextChanged(t)){e.fragLoadError=0,e.state=Ht,e.startFragRequested=!1,e.bitrateTest=!1;var n=t.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),r.trigger(s.a.FRAG_LOADED,i),t.bitrateTest=!1}}))},h._handleTransmuxComplete=function(t){var e,i="main",r=this.hls,n=t.remuxResult,o=t.chunkMeta,l=this.getCurrentContext(o);if(!l)return this.warn("The loading context changed while buffering fragment "+o.sn+" of level "+o.level+". This chunk will not be buffered."),void this.resetStartWhenNotLoaded(o.level);var u=l.frag,h=l.part,d=l.level,c=n.video,f=n.text,g=n.id3,v=n.initSegment,m=d.details,y=this.altAudio?void 0:n.audio;if(!this.fragContextChanged(u)){if(this.state=zt,v){v.tracks&&(this._bufferInitSegment(d,v.tracks,u,o),r.trigger(s.a.FRAG_PARSING_INIT_SEGMENT,{frag:u,id:i,tracks:v.tracks}));var T=v.initPTS,b=v.timescale;Object(a.a)(T)&&(this.initPTS[u.cc]=T,r.trigger(s.a.INIT_PTS_FOUND,{frag:u,id:i,initPTS:T,timescale:b}))}if(c&&!1!==n.independent){if(m){var E=c.startPTS,S=c.endPTS,L=c.startDTS,A=c.endDTS;if(h)h.elementaryStreams[c.type]={startPTS:E,endPTS:S,startDTS:L,endDTS:A};else if(c.firstKeyFrame&&c.independent&&(this.couldBacktrack=!0),c.dropped&&c.independent){var D=this.getMainFwdBufferInfo();if((D?D.end:this.getLoadPosition())+this.config.maxBufferHole<(c.firstKeyFramePTS?c.firstKeyFramePTS:E)-this.config.maxBufferHole)return void this.backtrack(u);u.setElementaryStreamInfo(c.type,u.start,S,u.start,A,!0)}u.setElementaryStreamInfo(c.type,E,S,L,A),this.backtrackFragment&&(this.backtrackFragment=u),this.bufferFragmentData(c,u,h,o)}}else if(!1===n.independent)return void this.backtrack(u);if(y){var R=y.startPTS,k=y.endPTS,_=y.startDTS,I=y.endDTS;h&&(h.elementaryStreams[p.a.AUDIO]={startPTS:R,endPTS:k,startDTS:_,endDTS:I}),u.setElementaryStreamInfo(p.a.AUDIO,R,k,_,I),this.bufferFragmentData(y,u,h,o)}if(m&&null!=g&&null!==(e=g.samples)&&void 0!==e&&e.length){var O={id:i,frag:u,details:m,samples:g.samples};r.trigger(s.a.FRAG_PARSING_METADATA,O)}if(m&&f){var C={id:i,frag:u,details:m,samples:f.samples};r.trigger(s.a.FRAG_PARSING_USERDATA,C)}}},h._bufferInitSegment=function(t,e,i,r){var n=this;if(this.state===zt){this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;var a=e.audio,o=e.video,l=e.audiovideo;if(a){var u=t.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==a.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==a.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),t.audioCodec&&t.audioCodec!==u&&this.log('Swapping manifest audio codec "'+t.audioCodec+'" for "'+u+'"'),a.levelCodec=u,a.id="main",this.log("Init audio buffer, container:"+a.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(t.audioCodec||"")+"/"+a.codec+"]")}o&&(o.levelCodec=t.videoCodec,o.id="main",this.log("Init video buffer, container:"+o.container+", codecs[level/parsed]=["+(t.videoCodec||"")+"/"+o.codec+"]")),l&&this.log("Init audiovideo buffer, container:"+l.container+", codecs[level/parsed]=["+(t.attrs.CODECS||"")+"/"+l.codec+"]"),this.hls.trigger(s.a.BUFFER_CODECS,e),Object.keys(e).forEach((function(t){var a=e[t].initSegment;null!=a&&a.byteLength&&n.hls.trigger(s.a.BUFFER_APPENDING,{type:t,data:a,frag:i,part:null,chunkMeta:r,parent:i.type})})),this.tick()}},h.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.b.MAIN)},h.backtrack=function(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=Ht},h.checkFragmentChanged=function(){var t=this.media,e=null;if(t&&t.readyState>1&&!1===t.seeking){var i=t.currentTime;if(mt.isBuffered(t,i)?e=this.getAppendedFrag(i):mt.isBuffered(t,i+.1)&&(e=this.getAppendedFrag(i+.1)),e){this.backtrackFragment=null;var r=this.fragPlaying,n=e.level;r&&e.sn===r.sn&&r.level===n&&e.urlId===r.urlId||(this.hls.trigger(s.a.FRAG_CHANGED,{frag:e}),r&&r.level===n||this.hls.trigger(s.a.LEVEL_SWITCHED,{level:n}),this.fragPlaying=e)}}},n=r,(l=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentFrag",get:function(){var t=this.media;return t?this.fragPlaying||this.getAppendedFrag(t.currentTime):null}},{key:"currentProgramDateTime",get:function(){var t=this.media;if(t){var e=t.currentTime,i=this.currentFrag;if(i&&Object(a.a)(e)&&Object(a.a)(i.programDateTime)){var r=i.programDateTime+1e3*(e-i.start);return new Date(r)}}return null}},{key:"currentLevel",get:function(){var t=this.currentFrag;return t?t.level:-1}},{key:"nextBufferedFrag",get:function(){var t=this.currentFrag;return t?this.followingBufferedFrag(t):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&ue(n.prototype,l),u&&ue(n,u),Object.defineProperty(n,"prototype",{writable:!1}),r}(te),ce=function(){function t(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=i}var e=t.prototype;return e.sample=function(t,e){var i=Math.pow(this.alpha_,t);this.estimate_=e*(1-i)+i*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}(),fe=function(){function t(t,e,i){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ce(t),this.fast_=new ce(e)}var e=t.prototype;return e.update=function(t,e){var i=this.slow_,r=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new ce(t,i.getEstimate(),i.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new ce(e,r.getEstimate(),r.getTotalWeight()))},e.sample=function(t,e){var i=(t=Math.max(t,this.minDelayMs_))/1e3,r=8*e/i;this.fast_.sample(i,r),this.slow_.sample(i,r)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();function ge(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ve=function(){function t(t){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;var e=t.config;this.bwEstimator=new fe(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}var e,i,r,n=t.prototype;return n.registerListeners=function(){var t=this.hls;t.on(s.a.FRAG_LOADING,this.onFragLoading,this),t.on(s.a.FRAG_LOADED,this.onFragLoaded,this),t.on(s.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(s.a.ERROR,this.onError,this)},n.unregisterListeners=function(){var t=this.hls;t.off(s.a.FRAG_LOADING,this.onFragLoading,this),t.off(s.a.FRAG_LOADED,this.onFragLoaded,this),t.off(s.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(s.a.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},n.onFragLoading=function(t,e){var i,r=e.frag;r.type===w.b.MAIN&&(this.timer||(this.fragCurrent=r,this.partCurrent=null!=(i=e.part)?i:null,this.timer=self.setInterval(this.onCheck,100)))},n.onLevelLoaded=function(t,e){var i=this.hls.config;e.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},n._abandonRulesCheck=function(){var t=this.fragCurrent,e=this.partCurrent,i=this.hls,r=i.autoLevelEnabled,n=i.config,o=i.media;if(t&&o){var u=e?e.stats:t.stats,h=e?e.duration:t.duration;if(u.aborted)return l.b.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);if(r&&!o.paused&&o.playbackRate&&o.readyState){var d=performance.now()-u.loading.start,c=Math.abs(o.playbackRate);if(!(d<=500*h/c)){var f=i.levels,g=i.minAutoLevel,v=f[t.level],p=u.total||Math.max(u.loaded,Math.round(h*v.maxBitrate/8)),m=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),y=(p-u.loaded)/m,T=o.currentTime,b=(mt.bufferInfo(o,T,n.maxBufferHole).end-T)/c;if(!(b>=2*h/c||y<=b)){var E,S=Number.POSITIVE_INFINITY;for(E=t.level-1;E>g;E--){if((S=h*f[E].maxBitrate/(6.4*m))<b)break}if(!(S>=y)){var L=this.bwEstimator.getEstimate();l.b.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+E+"\n Current BW estimate: "+(Object(a.a)(L)?(L/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+y.toFixed(3)+" s\n Estimated load time for the next fragment: "+S.toFixed(3)+" s\n Time to underbuffer: "+b.toFixed(3)+" s"),i.nextLoadLevel=E,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),i.trigger(s.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:u})}}}}}},n.onFragLoaded=function(t,e){var i=e.frag,r=e.part;if(i.type===w.b.MAIN&&Object(a.a)(i.sn)){var n=r?r.stats:i.stats,o=r?r.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[i.level],u=(l.loaded?l.loaded.bytes:0)+n.loaded,h=(l.loaded?l.loaded.duration:0)+o;l.loaded={bytes:u,duration:h},l.realBitrate=Math.round(8*u/h)}if(i.bitrateTest){var d={stats:n,frag:i,part:r,id:i.type};this.onFragBuffered(s.a.FRAG_BUFFERED,d)}}},n.onFragBuffered=function(t,e){var i=e.frag,r=e.part,n=r?r.stats:i.stats;if(!n.aborted&&i.type===w.b.MAIN&&"initSegment"!==i.sn){var a=n.parsing.end-n.loading.start;this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},n.onError=function(t,e){switch(e.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},n.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},n.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,i=this.hls,r=i.maxAutoLevel,n=i.config,a=i.minAutoLevel,s=i.media,o=e?e.duration:t?t.duration:0,u=s?s.currentTime:0,h=s&&0!==s.playbackRate?Math.abs(s.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,c=(mt.bufferInfo(s,u,n.maxBufferHole).end-u)/h,f=this.findBestLevel(d,a,r,c,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(f>=0)return f;l.b.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=o?Math.min(o,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,p=n.abrBandWidthUpFactor;if(!c){var m=this.bitrateTestDelay;if(m)g=(o?Math.min(o,n.maxLoadingDelay):n.maxLoadingDelay)-m,l.b.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=p=1}return f=this.findBestLevel(d,a,r,c+g,v,p),Math.max(f,0)},n.findBestLevel=function(t,e,i,r,n,a){for(var s,o=this.fragCurrent,u=this.partCurrent,h=this.lastLoadedFragLevel,d=this.hls.levels,c=d[h],f=!(null==c||null===(s=c.details)||void 0===s||!s.live),g=null==c?void 0:c.codecSet,v=u?u.duration:o?o.duration:0,p=i;p>=e;p--){var m=d[p];if(m&&(!g||m.codecSet===g)){var y=m.details,T=(u?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||v,b=void 0;b=p<=h?n*t:a*t;var E=d[p].maxBitrate,S=E*T/b;if(l.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+p+"/"+Math.round(b)+"/"+E+"/"+T+"/"+r+"/"+S),b>E&&(!S||f&&!this.bitrateTestDelay||S<r))return p}}return-1},e=t,(i=[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this.bwEstimator;if(-1!==t&&!e.canEstimate())return t;var i=this.getNextABRAutoLevel();return-1!==t&&this.hls.levels[i].loadError?t:(-1!==t&&(i=Math.min(t,i)),i)},set:function(t){this._nextAutoLevel=t}}])&&ge(e.prototype,i),r&&ge(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),pe=function(){function t(){this.chunks=[],this.dataLength=0}var e=t.prototype;return e.push=function(t){this.chunks.push(t),this.dataLength+=t.length},e.flush=function(){var t,e=this.chunks,i=this.dataLength;return e.length?(t=1===e.length?e[0]:function(t,e){for(var i=new Uint8Array(e),r=0,n=0;n<t.length;n++){var a=t[n];i.set(a,r),r+=a.length}return i}(e,i),this.reset(),t):new Uint8Array(0)},e.reset=function(){this.chunks.length=0,this.dataLength=0},t}();function me(){return(me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function ye(t,e){return(ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Te=function(t){var e,i;function r(e,i){var r;return(r=t.call(this,e,i,"[audio-stream-controller]")||this).videoBuffer=null,r.videoTrackCC=-1,r.waitingVideoCC=-1,r.audioSwitch=!1,r.trackId=-1,r.waitingData=null,r.mainDetails=null,r.bufferFlushed=!1,r.cachedTrackLoadedData=null,r._registerListeners(),r}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,ye(e,i);var n=r.prototype;return n.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},n._registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(s.a.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(s.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(s.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(s.a.ERROR,this.onError,this),t.on(s.a.BUFFER_RESET,this.onBufferReset,this),t.on(s.a.BUFFER_CREATED,this.onBufferCreated,this),t.on(s.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(s.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(s.a.FRAG_BUFFERED,this.onFragBuffered,this)},n._unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(s.a.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(s.a.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(s.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(s.a.ERROR,this.onError,this),t.off(s.a.BUFFER_RESET,this.onBufferReset,this),t.off(s.a.BUFFER_CREATED,this.onBufferCreated,this),t.off(s.a.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(s.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(s.a.FRAG_BUFFERED,this.onFragBuffered,this)},n.onInitPtsFound=function(t,e){var i=e.frag,r=e.id,n=e.initPTS;if("main"===r){var a=i.cc;this.initPTS[i.cc]=n,this.log("InitPTS for cc: "+a+" found from main: "+n),this.videoTrackCC=a,this.state===Jt&&this.tick()}},n.startLoad=function(t){if(!this.levels)return this.startPosition=t,void(this.state=Kt);var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e,this.state=Ht):(this.loadedmetadata=!1,this.state=qt),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},n.doTick=function(){switch(this.state){case Ht:this.doTickIdle();break;case qt:var e,i=this.levels,r=this.trackId,n=null==i||null===(e=i[r])||void 0===e?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=Jt}break;case Yt:var a,s=performance.now(),o=this.retryDate;(!o||s>=o||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Ht);break;case Jt:var l=this.waitingData;if(l){var u=l.frag,h=l.part,d=l.cache,c=l.complete;if(void 0!==this.initPTS[u.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Wt;var f={frag:u,part:h,payload:d.flush(),networkDetails:null};this._handleFragmentLoadProgress(f),c&&t.prototype._handleFragmentLoadComplete.call(this,f)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+u.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var g=this.getLoadPosition(),v=mt.bufferInfo(this.mediaBuffer,g,this.config.maxBufferHole);Rt(v.end,this.config.maxFragLookUpTolerance,u)<0&&(this.log("Waiting fragment cc ("+u.cc+") @ "+u.start+" cancelled because another fragment at "+v.end+" is needed"),this.clearWaitingFragment())}}else this.state=Ht}this.onTickEnd()},n.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Ht)},n.resetLoadingState=function(){this.clearWaitingFragment(),t.prototype.resetLoadingState.call(this)},n.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},n.doTickIdle=function(){var t,e,i=this.hls,r=this.levels,n=this.media,a=this.trackId,o=i.config;if(r&&r[a]&&(n||!this.startFragRequested&&o.startFragPrefetch)){var l=r[a].details;if(!l||l.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(l))this.state=qt;else{var u=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&u&&(this.bufferFlushed=!1,this.afterBufferFlushed(u,p.a.AUDIO,w.b.AUDIO));var h=this.getFwdBufferInfo(u,w.b.AUDIO);if(null!==h){var d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.b.MAIN),c=h.len,f=this.getMaxBufferLength(null==d?void 0:d.len),g=this.audioSwitch;if(!(c>=f)||g){if(!g&&this._streamEnded(h,l))return i.trigger(s.a.BUFFER_EOS,{type:"audio"}),void(this.state=Qt);var v=l.fragments[0].start,m=h.end;if(g&&n){var y=this.getLoadPosition();m=y,l.PTSKnown&&y<v&&(h.end>v||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=v+.05)}if(!(d&&m>d.end+l.targetduration)&&(d&&d.len||!h.len)){var T=this.getNextFragment(m,l);T?"identity"!==(null===(t=T.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=T.decryptdata)&&void 0!==e&&e.key?this.loadFragment(T,l,m):this.loadKey(T,l):this.bufferFlushed=!0}}}}}},n.getMaxBufferLength=function(e){var i=t.prototype.getMaxBufferLength.call(this);return e?Math.max(i,e):i},n.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},n.onAudioTracksUpdated=function(t,e){var i=e.audioTracks;this.resetTransmuxer(),this.levels=i.map((function(t){return new Q(t)}))},n.onAudioTrackSwitching=function(t,e){var i=!!e.url;this.trackId=e.id;var r=this.fragCurrent;null!=r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.audioSwitch=!0,this.state=Ht):this.state=Kt,this.tick()},n.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},n.onLevelLoaded=function(t,e){this.mainDetails=e.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(s.a.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},n.onAudioTrackLoaded=function(t,e){var i;if(null!=this.mainDetails){var r=this.levels,n=e.details,a=e.id;if(r){this.log("Track "+a+" loaded ["+n.startSN+","+n.endSN+"],duration:"+n.totalduration);var s=r[a],o=0;if(n.live||null!==(i=s.details)&&void 0!==i&&i.live){var l=this.mainDetails;if(n.fragments[0]||(n.deltaUpdateFailed=!0),n.deltaUpdateFailed||!l)return;!s.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(Lt(n,l),o=n.fragments[0].start):o=this.alignPlaylists(n,s.details)}s.details=n,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(s.details,o),this.state!==qt||this.waitForCdnTuneIn(n)||(this.state=Ht),this.tick()}else this.warn("Audio tracks were reset while loading level "+a)}else this.cachedTrackLoadedData=e},n._handleFragmentLoadProgress=function(t){var e,i=t.frag,r=t.part,n=t.payload,a=this.config,s=this.trackId,o=this.levels;if(o){var l=o[s],u=l.details,h=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2",d=this.transmuxer;d||(d=this.transmuxer=new oe(this.hls,w.b.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var c=this.initPTS[i.cc],f=null===(e=i.initSegment)||void 0===e?void 0:e.data;if(void 0!==c){var g=r?r.index:-1,v=-1!==g,p=new yt(i.level,i.sn,i.stats.chunkCount,n.byteLength,g,v);d.push(n,f,h,"",i,r,u.totalduration,!1,p,c)}else{this.log("Unknown video PTS for cc "+i.cc+", waiting for video PTS before demuxing audio frag "+i.sn+" of ["+u.startSN+" ,"+u.endSN+"],track "+s),(this.waitingData=this.waitingData||{frag:i,part:r,cache:new pe,complete:!1}).cache.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=Jt}}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered")},n._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},n.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},n.onBufferCreated=function(t,e){var i=e.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer||null)},n.onFragBuffered=function(t,e){var i=e.frag,r=e.part;i.type===w.b.AUDIO&&(this.fragContextChanged(i)?this.warn("Fragment "+i.sn+(r?" p: "+r.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==i.sn&&(this.fragPrevious=i,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(s.a.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(i,r)))},n.onError=function(e,i){switch(i.details){case o.a.FRAG_LOAD_ERROR:case o.a.FRAG_LOAD_TIMEOUT:case o.a.KEY_LOAD_ERROR:case o.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.b.AUDIO,i);break;case o.a.AUDIO_TRACK_LOAD_ERROR:case o.a.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==$t&&this.state!==Kt&&(this.state=i.fatal?$t:Ht,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case o.a.BUFFER_FULL_ERROR:if("audio"===i.parent&&(this.state===zt||this.state===Xt)){var r=!0,n=this.getFwdBufferInfo(this.mediaBuffer,w.b.AUDIO);n&&n.len>.5&&(r=!this.reduceMaxBufferLength(n.len)),r&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},n.onBufferFlushed=function(t,e){e.type===p.a.AUDIO&&(this.bufferFlushed=!0)},n._handleTransmuxComplete=function(t){var e,i="audio",r=this.hls,n=t.remuxResult,a=t.chunkMeta,o=this.getCurrentContext(a);if(!o)return this.warn("The loading context changed while buffering fragment "+a.sn+" of level "+a.level+". This chunk will not be buffered."),void this.resetStartWhenNotLoaded(a.level);var l=o.frag,u=o.part,h=o.level.details,d=n.audio,c=n.text,f=n.id3,g=n.initSegment;if(!this.fragContextChanged(l)&&h){if(this.state=zt,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,l,a),r.trigger(s.a.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:i,tracks:g.tracks})),d){var v=d.startPTS,m=d.endPTS,y=d.startDTS,T=d.endDTS;u&&(u.elementaryStreams[p.a.AUDIO]={startPTS:v,endPTS:m,startDTS:y,endDTS:T}),l.setElementaryStreamInfo(p.a.AUDIO,v,m,y,T),this.bufferFragmentData(d,l,u,a)}if(null!=f&&null!==(e=f.samples)&&void 0!==e&&e.length){var b=me({id:i,frag:l,details:h},f);r.trigger(s.a.FRAG_PARSING_METADATA,b)}if(c){var E=me({id:i,frag:l,details:h},c);r.trigger(s.a.FRAG_PARSING_USERDATA,E)}}},n._bufferInitSegment=function(t,e,i){if(this.state===zt){t.video&&delete t.video;var r=t.audio;if(r){r.levelCodec=r.codec,r.id="audio",this.log("Init audio buffer, container:"+r.container+", codecs[parsed]=["+r.codec+"]"),this.hls.trigger(s.a.BUFFER_CODECS,t);var n=r.initSegment;if(null!=n&&n.byteLength){var a={type:"audio",frag:e,part:null,chunkMeta:i,parent:e.type,data:n};this.hls.trigger(s.a.BUFFER_APPENDING,a)}this.tick()}}},n.loadFragment=function(e,i,r){var n=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||n===ut.NOT_LOADED||n===ut.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):i.live&&!Object(a.a)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=Jt):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,i,r)))},n.completeAudioSwitch=function(){var e=this.hls,i=this.media,r=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(s.a.AUDIO_TRACK_SWITCHED,{id:r})},r}(te);function be(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ee(t,e){return(Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Se=function(t){var e,i;function r(e){var i;return(i=t.call(this,e,"[audio-track-controller]")||this).tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,Ee(e,i);var n,a,l,u=r.prototype;return u.registerListeners=function(){var t=this.hls;t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(s.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(s.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(s.a.ERROR,this.onError,this)},u.unregisterListeners=function(){var t=this.hls;t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(s.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(s.a.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(s.a.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},u.onManifestParsed=function(t,e){this.tracks=e.audioTracks||[]},u.onAudioTrackLoaded=function(t,e){var i=e.id,r=e.details,n=this.tracksInGroup[i];if(n){var a=n.details;n.details=e.details,this.log("audioTrack "+i+" loaded ["+r.startSN+"-"+r.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,e,a))}else this.warn("Invalid audio track id "+i)},u.onLevelLoading=function(t,e){this.switchLevel(e.level)},u.onLevelSwitching=function(t,e){this.switchLevel(e.level)},u.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.audioGroupIds){var i=e.audioGroupIds[e.urlId];if(this.groupId!==i){this.groupId=i;var r=this.tracks.filter((function(t){return!i||t.groupId===i}));this.selectDefaultTrack&&!r.some((function(t){return t.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;var n={audioTracks:r};this.log("Updating audio tracks, "+r.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(s.a.AUDIO_TRACKS_UPDATED,n),this.selectInitialTrack()}}},u.onError=function(e,i){t.prototype.onError.call(this,e,i),!i.fatal&&i.context&&i.context.type===w.a.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},u.setAudioTrack=function(t){var e=this.tracksInGroup;if(t<0||t>=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var i=e[this.trackId];this.log("Now switching to audio-track index "+t);var r=e[t],n=r.id,a=r.groupId,o=void 0===a?"":a,l=r.name,u=r.type,h=r.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(s.a.AUDIO_TRACK_SWITCHING,{id:n,groupId:o,name:l,type:u,url:h}),!r.details||r.details.live){var d=this.switchParams(r.url,null==i?void 0:i.details);this.loadPlaylist(d)}}},u.selectInitialTrack=function(){this.tracksInGroup;var t=this.trackName,e=this.findTrackId(t)||this.findTrackId();-1!==e?this.setAudioTrack(e):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},u.findTrackId=function(t){for(var e=this.tracksInGroup,i=0;i<e.length;i++){var r=e[i];if((!this.selectDefaultTrack||r.default)&&(!t||t===r.name))return r.id}return-1},u.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var i=e.id,r=e.groupId,n=e.url;if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(s.a.AUDIO_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:t||null})}},n=r,(a=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}])&&be(n.prototype,a),l&&be(n,l),Object.defineProperty(n,"prototype",{writable:!1}),r}(at);function Le(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ae(t,e){return(Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var De=function(t){var e,i;function r(e,i){var r;return(r=t.call(this,e,i,"[subtitle-stream-controller]")||this).levels=[],r.currentTrackId=-1,r.tracksBuffered=[],r.mainDetails=null,r._registerListeners(),r}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,Ae(e,i);var n,a,o,l=r.prototype;return l.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},l._registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.on(s.a.ERROR,this.onError,this),t.on(s.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(s.a.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(s.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(s.a.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},l._unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.LEVEL_LOADED,this.onLevelLoaded,this),t.off(s.a.ERROR,this.onError,this),t.off(s.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(s.a.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(s.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(s.a.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this)},l.startLoad=function(){this.stopLoad(),this.state=Ht,this.setInterval(500),this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},l.onLevelLoaded=function(t,e){this.mainDetails=e.details},l.onSubtitleFragProcessed=function(t,e){var i=e.frag,r=e.success;if(this.fragPrevious=i,this.state=Ht,r){var n=this.tracksBuffered[this.currentTrackId];if(n){for(var a,s=i.start,o=0;o<n.length;o++)if(s>=n[o].start&&s<=n[o].end){a=n[o];break}var l=i.start+i.duration;a?a.end=l:(a={start:s,end:l},n.push(a)),this.fragmentTracker.fragBuffered(i)}}},l.onBufferFlushing=function(t,e){var i=e.startOffset,r=e.endOffset;if(0===i&&r!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,a=this.levels;if(!a.length||!a[n]||!a[n].details)return;var s=r-a[n].details.targetduration;if(s<=0)return;e.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((function(t){for(var e=0;e<t.length;)if(t[e].end<=s)t.shift();else{if(!(t[e].start<s))break;t[e].start=s,e++}})),this.fragmentTracker.removeFragmentsInRange(i,s,w.b.SUBTITLE)}},l.onError=function(t,e){var i,r=e.frag;r&&r.type===w.b.SUBTITLE&&(null!==(i=this.fragCurrent)&&void 0!==i&&i.loader&&this.fragCurrent.loader.abort(),this.state=Ht)},l.onSubtitleTracksUpdated=function(t,e){var i=this,r=e.subtitleTracks;this.tracksBuffered=[],this.levels=r.map((function(t){return new Q(t)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(t){i.tracksBuffered[t.id]=[]})),this.mediaBuffer=null},l.onSubtitleTrackSwitch=function(t,e){if(this.currentTrackId=e.id,this.levels.length&&-1!==this.currentTrackId){var i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(500)}else this.clearInterval()},l.onSubtitleTrackLoaded=function(t,e){var i,r=e.details,n=e.id,a=this.currentTrackId,s=this.levels;if(s.length){var o=s[a];if(!(n>=s.length||n!==a)&&o){if(this.mediaBuffer=this.mediaBufferTimeRanges,r.live||null!==(i=o.details)&&void 0!==i&&i.live){var l=this.mainDetails;if(r.deltaUpdateFailed||!l)return;var u=l.fragments[0];if(o.details)0===this.alignPlaylists(r,o.details)&&u&&nt(r,u.start);else r.hasProgramDateTime&&l.hasProgramDateTime?Lt(r,l):u&&nt(r,u.start)}if(o.details=r,this.levelLastLoaded=n,this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===Ht)Dt(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}},l._handleFragmentLoadComplete=function(t){var e=t.frag,i=t.payload,r=e.decryptdata,n=this.hls;if(!this.fragContextChanged(e)&&i&&i.byteLength>0&&r&&r.key&&r.iv&&"AES-128"===r.method){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).then((function(t){var i=performance.now();n.trigger(s.a.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:a,tdecrypt:i}})}))}},l.doTick=function(){if(this.media){if(this.state===Ht){var t=this.currentTrackId,e=this.levels;if(!e.length||!e[t]||!e[t].details)return;var i=e[t].details,r=i.targetduration,n=this.config,a=this.media,s=mt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a.currentTime-r,n.maxBufferHole),o=s.end;if(s.len>this.getMaxBufferLength()+r)return;var l,u=i.fragments,h=u.length,d=i.edge,c=this.fragPrevious;if(o<d){var f=n.maxFragLookUpTolerance;!(l=Dt(c,u,Math.max(u[0].start,o),f))&&c&&c.start<u[0].start&&(l=u[0])}else l=u[h-1];if(!(l=this.mapToInitFragWhenRequired(l)))return;if(this.fragmentTracker.getState(l)!==ut.NOT_LOADED)return;l.encrypted?this.loadKey(l,i):this.loadFragment(l,i,o)}}else this.state=Ht},l.loadFragment=function(e,i,r){this.fragCurrent=e,"initSegment"===e.sn?this._loadInitSegment(e):t.prototype.loadFragment.call(this,e,i,r)},n=r,(a=[{key:"mediaBufferTimeRanges",get:function(){return new Re(this.tracksBuffered[this.currentTrackId]||[])}}])&&Le(n.prototype,a),o&&Le(n,o),Object.defineProperty(n,"prototype",{writable:!1}),r}(te),Re=function(t){this.buffered=void 0;var e=function(e,i,r){if((i>>>=0)>r-1)throw new DOMException("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+i+") is greater than the maximum bound ("+r+")");return t[i][e]};this.buffered={get length(){return t.length},end:function(i){return e("end",i,t.length)},start:function(i){return e("start",i,t.length)}}};function ke(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _e(t,e){return(_e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ie(t){for(var e=[],i=0;i<t.length;i++){var r=t[i];"subtitles"===r.kind&&r.label&&e.push(t[i])}return e}var Oe,Ce=function(t){var e,i;function r(e){var i;return(i=t.call(this,e,"[subtitle-track-controller]")||this).media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i._subtitleDisplay=!0,i.registerListeners(),i}i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,_e(e,i);var n,a,o,l=r.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,t.prototype.destroy.call(this)},l.registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(s.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(s.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(s.a.ERROR,this.onError,this)},l.unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(s.a.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(s.a.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(s.a.ERROR,this.onError,this)},l.onMediaAttached=function(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},l.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},l.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),Ie(this.media.textTracks).forEach((function(t){U(t)})),this.subtitleTrack=-1,this.media=null)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},l.onSubtitleTrackLoaded=function(t,e){var i=e.id,r=e.details,n=this.trackId,a=this.tracksInGroup[n];if(a){var s=a.details;a.details=e.details,this.log("subtitle track "+i+" loaded ["+r.startSN+"-"+r.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,e,s))}else this.warn("Invalid subtitle track id "+i)},l.onLevelLoading=function(t,e){this.switchLevel(e.level)},l.onLevelSwitching=function(t,e){this.switchLevel(e.level)},l.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var i=e.textGroupIds[e.urlId];if(this.groupId!==i){var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,n=this.tracks.filter((function(t){return!i||t.groupId===i}));this.tracksInGroup=n;var a=this.findTrackId(null==r?void 0:r.name)||this.findTrackId();this.groupId=i;var o={subtitleTracks:n};this.log("Updating subtitle tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(s.a.SUBTITLE_TRACKS_UPDATED,o),-1!==a&&this.setSubtitleTrack(a,r)}}},l.findTrackId=function(t){for(var e=this.tracksInGroup,i=0;i<e.length;i++){var r=e[i];if((!this.selectDefaultTrack||r.default)&&(!t||t===r.name))return r.id}return-1},l.onError=function(e,i){t.prototype.onError.call(this,e,i),!i.fatal&&i.context&&i.context.type===w.a.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},l.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var i=e.id,r=e.groupId,n=e.url;if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(s.a.SUBTITLE_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:t||null})}},l.toggleTrackModes=function(t){var e=this,i=this.media,r=this.trackId;if(i){var n=Ie(i.textTracks),a=n.filter((function(t){return t.groupId===e.groupId}));if(-1===t)[].slice.call(n).forEach((function(t){t.mode="disabled"}));else{var s=a[r];s&&(s.mode="disabled")}var o=a[t];o&&(o.mode=this.subtitleDisplay?"showing":"hidden")}},l.setSubtitleTrack=function(t,e){var i,r=this.tracksInGroup;if(this.media){if(this.trackId!==t&&this.toggleTrackModes(t),!(this.trackId===t&&(-1===t||null!==(i=r[t])&&void 0!==i&&i.details)||t<-1||t>=r.length)){this.clearTimer();var n=r[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,n){var a=n.id,o=n.groupId,l=void 0===o?"":o,u=n.name,h=n.type,d=n.url;this.hls.trigger(s.a.SUBTITLE_TRACK_SWITCH,{id:a,groupId:l,name:u,type:h,url:d});var c=this.switchParams(n.url,null==e?void 0:e.details);this.loadPlaylist(c)}else this.hls.trigger(s.a.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=Ie(this.media.textTracks),i=0;i<e.length;i++)if("hidden"===e[i].mode)t=i;else if("showing"===e[i].mode){t=i;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)}},n=r,(a=[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}])&&ke(n.prototype,a),o&&ke(n,o),Object.defineProperty(n,"prototype",{writable:!1}),r}(at),we=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var i=this.queues[e];i.push(t),1===i.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,i=new Promise((function(t){e=t})),r={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,t),i},e.executeNext=function(t){var e=this.buffers,i=this.queues,r=e[t],n=i[t];if(n.length){var a=n[0];try{a.execute()}catch(e){l.b.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(e),r&&r.updating||(n.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}(),xe=ee(),Pe=/([ha]vc.)(?:\.[^.,]+)+/,Fe=function(){function t(t){var e=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var t=e.hls,i=e.media,r=e.mediaSource;l.b.log("[buffer-controller]: Media source opened"),i&&(e.updateMediaElementDuration(),t.trigger(s.a.MEDIA_ATTACHED,{media:i})),r&&r.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){l.b.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){l.b.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.a.BUFFER_RESET,this.onBufferReset,this),t.on(s.a.BUFFER_APPENDING,this.onBufferAppending,this),t.on(s.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(s.a.BUFFER_EOS,this.onBufferEos,this),t.on(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(s.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(s.a.FRAG_PARSED,this.onFragParsed,this),t.on(s.a.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.a.BUFFER_RESET,this.onBufferReset,this),t.off(s.a.BUFFER_APPENDING,this.onBufferAppending,this),t.off(s.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(s.a.BUFFER_EOS,this.onBufferEos,this),t.off(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(s.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(s.a.FRAG_PARSED,this.onFragParsed,this),t.off(s.a.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new we(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var i=2;(e.audio&&!e.video||!e.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,l.b.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var i=this.media=e.media;if(i&&xe){var r=this.mediaSource=new xe;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(r),this._objectUrl=i.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,i=this._objectUrl;if(e){if(l.b.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){l.b.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(i&&self.URL.revokeObjectURL(i),t.src===i?(t.removeAttribute("src"),t.load()):l.b.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(s.a.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var i=t.sourceBuffer[e];try{i&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(i),t.sourceBuffer[e]=void 0)}catch(t){l.b.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var i=this,r=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(r){var n=i.tracks[t];if(n&&"function"==typeof n.buffer.changeType){var a=e[t],s=a.id,o=a.codec,u=a.levelCodec,h=a.container,d=a.metadata,c=(n.levelCodec||n.codec).replace(Pe,"$1"),f=(u||o).replace(Pe,"$1");if(c!==f){var g=h+";codecs="+(u||o);i.appendChangeType(t,g),l.b.log("[buffer-controller]: switching codec "+c+" to "+f),i.tracks[t]={buffer:n.buffer,codec:o,container:h,levelCodec:u,metadata:d,id:s}}}}else i.pendingTracks[t]=e[t]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var i=this,r=this.operationQueue,n={execute:function(){var n=i.sourceBuffer[t];n&&(l.b.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),n.changeType(e)),r.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){l.b.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};r.append(n,t)},e.onBufferAppending=function(t,e){var i=this,r=this.hls,n=this.operationQueue,a=this.tracks,u=e.data,h=e.type,d=e.frag,c=e.part,f=e.chunkMeta,g=f.buffering[h],v=self.performance.now();g.start=v;var p=d.stats.buffering,m=c?c.stats.buffering:null;0===p.start&&(p.start=v),m&&0===m.start&&(m.start=v);var y=a.audio,T="audio"===h&&1===f.id&&"audio/mpeg"===(null==y?void 0:y.container),b={execute:function(){if(g.executeStart=self.performance.now(),T){var t=i.sourceBuffer[h];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(l.b.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}i.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===p.first&&(p.first=t),m&&0===m.first&&(m.first=t);var e=i.sourceBuffer,r={};for(var n in e)r[n]=mt.getBuffered(e[n]);i.appendError=0,i.hls.trigger(s.a.BUFFER_APPENDED,{type:h,frag:d,part:c,chunkMeta:f,parent:d.type,timeRanges:r})},onError:function(t){l.b.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",t);var e={type:o.b.MEDIA_ERROR,parent:d.type,details:o.a.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=o.a.BUFFER_FULL_ERROR:(i.appendError++,e.details=o.a.BUFFER_APPEND_ERROR,i.appendError>r.config.appendErrorMaxRetry&&(l.b.error("[buffer-controller]: Failed "+r.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0,r.stopLoad())),r.trigger(s.a.ERROR,e)}};n.append(b,h)},e.onBufferFlushing=function(t,e){var i=this,r=this.operationQueue,n=function(t){return{execute:i.removeExecutor.bind(i,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(s.a.BUFFER_FLUSHED,{type:t})},onError:function(e){l.b.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?r.append(n(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){r.append(n(t),t)}))},e.onFragParsed=function(t,e){var i=this,r=e.frag,n=e.part,a=[],o=n?n.elementaryStreams:r.elementaryStreams;o[p.a.AUDIOVIDEO]?a.push("audiovideo"):(o[p.a.AUDIO]&&a.push("audio"),o[p.a.VIDEO]&&a.push("video"));0===a.length&&l.b.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers((function(){var t=self.performance.now();r.stats.buffering.end=t,n&&(n.stats.buffering.end=t);var e=n?n.stats:r.stats;i.hls.trigger(s.a.FRAG_BUFFERED,{frag:r,part:n,stats:e,id:r.type})}),a)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var i=this;this.getSourceBufferTypes().reduce((function(t,r){var n=i.sourceBuffer[r];return e.type&&e.type!==r||n&&!n.ended&&(n.ended=!0,l.b.log("[buffer-controller]: "+r+" sourceBuffer now EOS")),t&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var t=i.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var i=e.details;i.fragments.length&&(this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,i=this.media,r=this.sourceBuffer;if(i&&null!==e){var n=this.getSourceBufferTypes();if(n.length){var o=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(a.a)(o)&&!(o<0)){var l=i.currentTime,u=e.levelTargetDuration,h=Math.max(o,u),d=Math.floor(l/u)*u-h;n.forEach((function(i){var n=r[i];if(n){var a=mt.getBuffered(n);a.length>0&&d>a.start(0)&&(t.trigger(s.a.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(s.a.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(s.a.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:i}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,i=this.media,r=this.mediaSource,n=t.fragments[0].start+t.totalduration,s=i.duration,o=Object(a.a)(r.duration)?r.duration:0;t.live&&e.config.liveDurationInfinity?(l.b.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(t)):(n>o&&n>s||!Object(a.a)(s))&&(l.b.log("[buffer-controller]: Updating Media Source duration to "+n.toFixed(3)),r.duration=n)}},e.updateSeekableRange=function(t){var e=this.mediaSource,i=t.fragments;if(i.length&&t.live&&null!=e&&e.setLiveSeekableRange){var r=Math.max(0,i[0].start),n=Math.max(r,r+t.totalduration);e.setLiveSeekableRange(r,n)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,i=this.pendingTracks,r=Object.keys(i).length;if(r&&!t||2===r){this.createSourceBuffers(i),this.pendingTracks={};var n=this.getSourceBufferTypes();if(0===n.length)return void this.hls.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});n.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var r=0;for(var n in t)if(!e[n]){var a=t[n];if(!a)throw Error("source buffer exists for track "+n+", however track does not");var u=a.levelCodec||a.codec,h=a.container+";codecs="+u;l.b.log("[buffer-controller]: creating sourceBuffer("+h+")");try{var d=e[n]=i.addSourceBuffer(h),c=n;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[n]={buffer:d,codec:u,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id},r++}catch(t){l.b.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:h})}}r&&this.hls.trigger(s.a.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){l.b.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(s.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(t);i&&i.onError(e)},e.removeExecutor=function(t,e,i){var r=this.media,n=this.mediaSource,s=this.operationQueue,o=this.sourceBuffer[t];if(!r||!n||!o)return l.b.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(t);var u=Object(a.a)(r.duration)?r.duration:1/0,h=Object(a.a)(n.duration)?n.duration:1/0,d=Math.max(0,e),c=Math.min(i,u,h);c>d?(l.b.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+t+" SourceBuffer"),o.remove(d,c)):s.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var i=this.operationQueue,r=this.sourceBuffer[e];if(!r)return l.b.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void i.shiftAndExecuteNext(e);r.ended=!1,r.appendBuffer(t)},e.blockBuffers=function(t,e){var i=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return l.b.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(t);var r=this.operationQueue,n=e.map((function(t){return r.appendBlocker(t)}));Promise.all(n).then((function(){t(),e.forEach((function(t){var e=i.sourceBuffer[t];e&&e.updating||r.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,i){var r=this.sourceBuffer[t];if(r){var n=i.bind(this,t);this.listeners[t].push({event:e,listener:n}),r.addEventListener(e,n)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}(),Me={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Ne=function(t){var e=t;return Me.hasOwnProperty(t)&&(e=Me[t]),String.fromCharCode(e)},Ue={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Be={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Ge={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},je={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Ke=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(Oe||(Oe={}));var He=function(){function t(){this.time=null,this.verboseLevel=Oe.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&l.b.log(this.time+" ["+t+"] "+e)},t}(),Ve=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].toString(16));return e},We=function(){function t(t,e,i,r,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=e||!1,this.italics=i||!1,this.background=r||"black",this.flash=n||!1}var e=t.prototype;return e.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},e.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],i=0;i<e.length;i++){var r=e[i];t.hasOwnProperty(r)&&(this[r]=t[r])}},e.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},e.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},e.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},e.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),Ye=function(){function t(t,e,i,r,n,a){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new We(e,i,r,n,a)}var e=t.prototype;return e.reset=function(){this.uchar=" ",this.penState.reset()},e.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},e.setPenState=function(t){this.penState.copy(t)},e.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},e.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},e.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),qe=function(){function t(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var e=0;e<100;e++)this.chars.push(new Ye);this.logger=t,this.pos=0,this.currPenState=new We}var e=t.prototype;return e.equals=function(t){for(var e=!0,i=0;i<100;i++)if(!this.chars[i].equals(t.chars[i])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<100;e++)this.chars[e].copy(t.chars[e])},e.isEmpty=function(){for(var t=!0,e=0;e<100;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},e.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(Oe.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(Oe.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var i=this.pos+1;i<e+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(e)},e.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},e.insertChar=function(t){t>=144&&this.backSpace();var e=Ne(t);this.pos>=100?this.logger.log(Oe.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,i=0;i<100;i++){var r=this.chars[i].uchar;" "!==r&&(e=!1),t.push(r)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),ze=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new qe(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,i=0;i<15;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(Oe.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(Oe.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var i=0;i<15;i++)this.rows[i].clear();var r=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){var a=n.rows[r].cueStartTime,s=this.logger.time;if(a&&null!==s&&a<s)for(var o=0;o<this.nrRollUpRows;o++)this.rows[e-this.nrRollUpRows+o+1].copy(n.rows[r+o])}}this.currRow=e;var l=this.rows[this.currRow];if(null!==t.indent){var u=t.indent,h=Math.max(u-1,0);l.setCursor(t.indent),t.color=l.chars[h].penState.foreground}var d={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(d)},e.setBkgData=function(t){this.logger.log(Oe.INFO,"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},e.setRollUpRows=function(t){this.nrRollUpRows=t},e.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(Oe.TEXT,this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(Oe.INFO,"Rolling up")}else this.logger.log(Oe.DEBUG,"roll_up but nrRollUpRows not set yet")},e.getDisplayText=function(t){t=t||!1;for(var e=[],i="",r=-1,n=0;n<15;n++){var a=this.rows[n].getTextString();a&&(r=n+1,t?e.push("Row "+r+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i},e.getTextAndFormat=function(){return this.rows},t}(),Xe=function(){function t(t,e,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new ze(i),this.nonDisplayedMemory=new ze(i),this.lastOutputScreen=new ze(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(Oe.INFO,"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(Oe.INFO,i+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(Oe.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},e.ccRCL=function(){this.logger.log(Oe.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},e.ccBS=function(){this.logger.log(Oe.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},e.ccAOF=function(){},e.ccAON=function(){},e.ccDER=function(){this.logger.log(Oe.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},e.ccRU=function(t){this.logger.log(Oe.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},e.ccFON=function(){this.logger.log(Oe.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},e.ccRDC=function(){this.logger.log(Oe.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},e.ccTR=function(){this.logger.log(Oe.INFO,"TR"),this.setMode("MODE_TEXT")},e.ccRTD=function(){this.logger.log(Oe.INFO,"RTD"),this.setMode("MODE_TEXT")},e.ccEDM=function(){this.logger.log(Oe.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},e.ccCR=function(){this.logger.log(Oe.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},e.ccENM=function(){this.logger.log(Oe.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},e.ccEOC=function(){if(this.logger.log(Oe.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(Oe.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},e.ccTO=function(t){this.logger.log(Oe.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},e.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var i=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][i]}this.logger.log(Oe.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}();function Qe(t,e,i){i.a=t,i.b=e}function $e(t,e,i){return i.a===t&&i.b===e}var Je=function(){function t(t,e,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var r=new He;this.channels=[null,new Xe(t,e,r),new Xe(t+1,i,r)],this.cmdHistory={a:null,b:null},this.logger=r}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var i,r,n,a=!1;this.logger.time=t;for(var s=0;s<e.length;s+=2)if(r=127&e[s],n=127&e[s+1],0!==r||0!==n){if(this.logger.log(Oe.DATA,"["+Ve([e[s],e[s+1]])+"] -> ("+Ve([r,n])+")"),(i=this.parseCmd(r,n))||(i=this.parseMidrow(r,n)),i||(i=this.parsePAC(r,n)),i||(i=this.parseBackgroundAttributes(r,n)),!i&&(a=this.parseChars(r,n))){var o=this.currentChannel;if(o&&o>0)this.channels[o].insertChars(a);else this.logger.log(Oe.WARNING,"No channel found yet. TEXT-MODE?")}i||a||this.logger.log(Oe.WARNING,"Couldn't parse cleaned data "+Ve([r,n])+" orig: "+Ve([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var i=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;if($e(t,e,i))return Qe(null,null,i),this.logger.log(Oe.DEBUG,"Repeated command ("+Ve([t,e])+") is dropped"),!0;var r=20===t||21===t||23===t?1:2,n=this.channels[r];return 20===t||21===t||28===t||29===t?32===e?n.ccRCL():33===e?n.ccBS():34===e?n.ccAOF():35===e?n.ccAON():36===e?n.ccDER():37===e?n.ccRU(2):38===e?n.ccRU(3):39===e?n.ccRU(4):40===e?n.ccFON():41===e?n.ccRDC():42===e?n.ccTR():43===e?n.ccRTD():44===e?n.ccEDM():45===e?n.ccCR():46===e?n.ccENM():47===e&&n.ccEOC():n.ccTO(e-32),Qe(t,e,i),this.currentChannel=r,!0},e.parseMidrow=function(t,e){var i=0;if((17===t||25===t)&&e>=32&&e<=47){if((i=17===t?1:2)!==this.currentChannel)return this.logger.log(Oe.ERROR,"Mismatch channel in midrow parsing"),!1;var r=this.channels[i];return!!r&&(r.ccMIDROW(e),this.logger.log(Oe.DEBUG,"MIDROW ("+Ve([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var i,r=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;if($e(t,e,r))return Qe(null,null,r),!0;var n=t<=23?1:2;i=e>=64&&e<=95?1===n?Ue[t]:Ge[t]:1===n?Be[t]:je[t];var a=this.channels[n];return!!a&&(a.setPAC(this.interpretPAC(i,e)),Qe(t,e,r),this.currentChannel=n,!0)},e.interpretPAC=function(t,e){var i,r={color:null,italics:!1,indent:null,underline:!1,row:t};return i=e>95?e-96:e-64,r.underline=1==(1&i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r},e.parseChars=function(t,e){var i,r,n=null,a=null;(t>=25?(i=2,a=t-8):(i=1,a=t),a>=17&&a<=19)?(r=17===a?e+80:18===a?e+112:e+144,this.logger.log(Oe.INFO,"Special char '"+Ne(r)+"' in channel "+i),n=[r]):t>=32&&t<=127&&(n=0===e?[t]:[t,e]);if(n){var s=Ve(n);this.logger.log(Oe.DEBUG,"Char codes = "+s.join(",")),Qe(t,e,this.cmdHistory)}return n},e.parseBackgroundAttributes=function(t,e){var i;if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;var r={};16===t||24===t?(i=Math.floor((e-32)/2),r.background=Ke[i],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0));var n=t<=23?1:2;return this.channels[n].setBkgData(r),Qe(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var e=this.channels[t];e&&e.reset()}this.cmdHistory={a:null,b:null}},e.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++){var i=this.channels[e];i&&i.cueSplitAtTime(t)}},t}(),Ze=function(){function t(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}var e=t.prototype;return e.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},e.newCue=function(t,e,i){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[],this.startTime=null},t}(),ti=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function i(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var i=e.toLowerCase();return!!~t.indexOf(i)&&i}function r(t){return i(e,t)}function n(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)t[s]=a[s]}return t}function a(e,a,s){var o=this,l={enumerable:!0};o.hasBeenReset=!1;var u="",h=!1,d=e,c=a,f=s,g=null,v="",p=!0,m="auto",y="start",T=50,b="middle",E=50,S="middle";Object.defineProperty(o,"id",n({},l,{get:function(){return u},set:function(t){u=""+t}})),Object.defineProperty(o,"pauseOnExit",n({},l,{get:function(){return h},set:function(t){h=!!t}})),Object.defineProperty(o,"startTime",n({},l,{get:function(){return d},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",n({},l,{get:function(){return c},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");c=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",n({},l,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",n({},l,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",n({},l,{get:function(){return v},set:function(e){var r=function(e){return i(t,e)}(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");v=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",n({},l,{get:function(){return p},set:function(t){p=!!t,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",n({},l,{get:function(){return m},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",n({},l,{get:function(){return y},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",n({},l,{get:function(){return T},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",n({},l,{get:function(){return b},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",n({},l,{get:function(){return E},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",n({},l,{get:function(){return S},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}(),ei=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function ii(t){function e(t,e,i,r){return 3600*(0|t)+60*(0|e)+(0|i)+parseFloat(r||0)}var i=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?e(i[2],i[3],0,i[4]):e(i[1],i[2],i[3],i[4]):null}var ri=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,i){for(var r=0;r<i.length;++r)if(e===i[r]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var i=parseFloat(e);if(i>=0&&i<=100)return this.set(t,i),!0}return!1},t}();function ni(t,e,i,r){var n=r?t.split(r):[t];for(var a in n)if("string"==typeof n[a]){var s=n[a].split(i);if(2===s.length)e(s[0],s[1])}}var ai=new ti(0,0,""),si="middle"===ai.align?"middle":"center";function oi(t,e,i){var r=t;function n(){var e=ii(t);if(null===e)throw new Error("Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}if(a(),e.startTime=n(),a(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.slice(3),a(),e.endTime=n(),a(),function(t,e){var r=new ri;ni(t,(function(t,e){var n;switch(t){case"region":for(var a=i.length-1;a>=0;a--)if(i[a].id===e){r.set(t,i[a].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":n=e.split(","),r.integer(t,n[0]),r.percent(t,n[0])&&r.set("snapToLines",!1),r.alt(t,n[0],["auto"]),2===n.length&&r.alt("lineAlign",n[1],["start",si,"end"]);break;case"position":n=e.split(","),r.percent(t,n[0]),2===n.length&&r.alt("positionAlign",n[1],["start",si,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",si,"end","left","right"])}}),/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");var n=r.get("line","auto");"auto"===n&&-1===ai.line&&(n=-1),e.line=n,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",si);var a=r.get("position","auto");"auto"===a&&50===ai.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function li(t){return t.replace(/<br(?: \/)?>/gi,"\n")}var ui=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new ei,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function i(){var t=e.buffer,i=0;for(t=li(t);i<t.length&&"\r"!==t[i]&&"\n"!==t[i];)++i;var r=t.slice(0,i);return"\r"===t[i]&&++i,"\n"===t[i]&&++i,e.buffer=t.slice(i),r}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var r="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var n=(r=i()).match(/^()?WEBVTT([ \t].*)?$/);if(!n||!n[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var a=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(a?a=!1:r=i(),e.state){case"HEADER":/:/.test(r)?ni(r,(function(t,e){}),/:/):r||(e.state="ID");continue;case"NOTE":r||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){e.state="NOTE";break}if(!r)continue;if(e.cue=new ti(0,0,""),e.state="CUE",-1===r.indexOf("--\x3e")){e.cue.id=r;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{oi(r,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var s=-1!==r.indexOf("--\x3e");if(!r||s&&(a=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=r;continue;case"BADCUE":r||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(t){this.onparsingerror&&this.onparsingerror(t)}return this.onflush&&this.onflush(),this},t}(),hi=i(11),di=i(13),ci=/\r\n|\n\r|\n|\r/g,fi=function(t,e,i){return void 0===i&&(i=0),t.slice(i,i+e.length)===e},gi=function(t){for(var e=5381,i=t.length;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()};function vi(t,e,i){return gi(t.toString())+gi(e.toString())+gi(i)}function pi(t,e,i,r,n,s,o,l){var u,h=new ui,d=Object(G.f)(new Uint8Array(t)).trim().replace(ci,"\n").split("\n"),c=[],f=Object(hi.a)(e,i),g="00:00.000",v=0,p=0,m=!0;h.oncue=function(t){var e=r[n],i=r.ccOffset,a=(v-f)/9e4;null!=e&&e.new&&(void 0!==p?i=r.ccOffset=e.start:function(t,e,i){var r=t[e],n=t[r.prevCC];if(!n||!n.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!==(a=n)&&void 0!==a&&a.new;){var a;t.ccOffset+=r.start-n.start,r.new=!1,n=t[(r=n).prevCC]}t.presentationOffset=i}(r,n,a)),a&&(i=a-r.presentationOffset);var o=t.endTime-t.startTime,l=Object(di.d)(9e4*(t.startTime+i-p),9e4*s)/9e4;t.startTime=Math.max(l,0),t.endTime=Math.max(l+o,0);var u=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(u)),t.id||(t.id=vi(t.startTime,t.endTime,u)),t.endTime>0&&c.push(t)},h.onparsingerror=function(t){u=t},h.onflush=function(){u?l(u):o(c)},d.forEach((function(t){if(m){if(fi(t,"X-TIMESTAMP-MAP=")){m=!1,t.slice(16).split(",").forEach((function(t){fi(t,"LOCAL:")?g=t.slice(6):fi(t,"MPEGTS:")&&(v=parseInt(t.slice(7)))}));try{p=function(t){var e=parseInt(t.slice(-3)),i=parseInt(t.slice(-6,-4)),r=parseInt(t.slice(-9,-7)),n=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!(Object(a.a)(e)&&Object(a.a)(i)&&Object(a.a)(r)&&Object(a.a)(n)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*i,e+=6e4*r,e+=36e5*n}(g)/1e3}catch(t){u=t}return}""===t&&(m=!1)}h.parse(t+"\n")})),h.flush()}function mi(){return(mi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}var yi=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ti=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,bi={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ei(t,e,i,r,n){var a=Object(u.c)(new Uint8Array(t),["mdat"]);if(0!==a.length){var s=a.map((function(t){return Object(G.f)(t)})),o=Object(hi.c)(e,1,i);try{s.forEach((function(t){return r(function(t,e){var i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");var r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((function(t,e){return t[e]=i.getAttribute("ttp:"+e)||r[e],t}),{}),a="preserve"!==i.getAttribute("xml:space"),s=Li(Si(i,"styling","style")),o=Li(Si(i,"layout","region")),l=Si(i,"body","[begin]");return[].map.call(l,(function(t){var i=function t(e,i){return[].slice.call(e.childNodes).reduce((function(e,r,n){var a;return"br"===r.nodeName&&n?e+"\n":null!==(a=r.childNodes)&&void 0!==a&&a.length?t(r,i):i?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent}),"")}(t,a);if(!i||!t.hasAttribute("begin"))return null;var r=Ri(t.getAttribute("begin"),n),l=Ri(t.getAttribute("dur"),n),u=Ri(t.getAttribute("end"),n);if(null===r)throw Di(t);if(null===u){if(null===l)throw Di(t);u=r+l}var h=new ti(r-e,u-e,i);h.id=vi(h.startTime,h.endTime,h.text);var d=o[t.getAttribute("region")],c=s[t.getAttribute("style")];h.position=10,h.size=80;var f=function(t,e,i){var r="http://www.w3.org/ns/ttml#styling",n=null,a=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;a&&i.hasOwnProperty(a)&&(n=i[a]);return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(i,a){var s=Ai(e,r,a)||Ai(t,r,a)||Ai(n,r,a);return s&&(i[a]=s),i}),{})}(d,c,s),g=f.textAlign;if(g){var v=bi[g];v&&(h.lineAlign=v),h.align=g}return mi(h,f),h})).filter((function(t){return null!==t}))}(t,o))}))}catch(t){n(t)}}else n(new Error("Could not parse IMSC1 mdat"))}function Si(t,e,i){var r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function Li(t){return t.reduce((function(t,e){var i=e.getAttribute("xml:id");return i&&(t[i]=e),t}),{})}function Ai(t,e,i){return t&&t.hasAttributeNS(e,i)?t.getAttributeNS(e,i):null}function Di(t){return new Error("Could not parse ttml timestamp "+t)}function Ri(t,e){if(!t)return null;var i=ii(t);return null===i&&(yi.test(t)?i=function(t,e){var i=yi.exec(t),r=(0|i[4])+(0|i[5])/e.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/e.frameRate}(t,e):Ti.test(t)&&(i=function(t,e){var i=Ti.exec(t),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}(t,e))),i}var ki=function(){function t(t){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var e=new Ze(this,"textTrack1"),i=new Ze(this,"textTrack2"),r=new Ze(this,"textTrack3"),n=new Ze(this,"textTrack4");this.cea608Parser1=new Je(1,e,i),this.cea608Parser2=new Je(3,r,n)}t.on(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(s.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(s.a.FRAG_LOADING,this.onFragLoading,this),t.on(s.a.FRAG_LOADED,this.onFragLoaded,this),t.on(s.a.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(s.a.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(s.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(s.a.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=t.prototype;return e.destroy=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.a.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(s.a.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(s.a.FRAG_LOADING,this.onFragLoading,this),t.off(s.a.FRAG_LOADED,this.onFragLoaded,this),t.off(s.a.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(s.a.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(s.a.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(s.a.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(s.a.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(t,e,i,r,n){for(var a,o,l,u,h=!1,d=n.length;d--;){var c=n[d],f=(a=c[0],o=c[1],l=e,u=i,Math.min(o,u)-Math.max(a,l));if(f>=0&&(c[0]=Math.min(c[0],e),c[1]=Math.max(c[1],i),h=!0,f/(i-e)>.5))return}if(h||n.push([e,i]),this.config.renderTextTracksNatively){var g=this.captionsTracks[t];this.Cues.newCue(g,e,i,r)}else{var v=this.Cues.newCue(null,e,i,r);this.hls.trigger(s.a.CUES_PARSED,{type:"captions",cues:v,track:t})}},e.onInitPtsFound=function(t,e){var i=this,r=e.frag,n=e.id,a=e.initPTS,o=e.timescale,l=this.unparsedVttFrags;"main"===n&&(this.initPTS[r.cc]=a,this.timescale[r.cc]=o),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){i.onFragLoaded(s.a.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var i=0;i<e.textTracks.length;i++){var r=e.textTracks[i];if(r[t])return r}return null},e.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},e.createNativeTrack=function(t){if(!this.captionsTracks[t]){var e=this.captionsProperties,i=this.captionsTracks,r=this.media,n=e[t],a=n.label,s=n.languageCode,o=this.getExistingTrack(t);if(o)i[t]=o,U(i[t]),M(i[t],r);else{var l=this.createTextTrack("captions",a,s);l&&(l[t]=!0,i[t]=l)}}},e.createNonNativeTrack=function(t){if(!this.nonNativeCaptionsTracks[t]){var e=this.captionsProperties[t];if(e){var i={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=i,this.hls.trigger(s.a.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}}},e.createTextTrack=function(t,e,i){var r=this.media;if(r)return r.addTextTrack(t,e,i)},e.onMediaAttaching=function(t,e){this.media=e.media,this._cleanTracks()},e.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach((function(e){U(t[e]),delete t[e]})),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},e._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var i=0;i<e.length;i++)U(e[i])}},e.onSubtitleTracksUpdated=function(t,e){var i=this;this.textTracks=[];var r=e.subtitleTracks||[],n=r.some((function(t){return"stpp.ttml.im1t"===t.textCodec}));if(this.config.enableWebVTT||n&&this.config.enableIMSC1){var a=this.tracks&&r&&this.tracks.length===r.length;if(this.tracks=r||[],this.config.renderTextTracksNatively){var o=this.media?this.media.textTracks:[];this.tracks.forEach((function(t,e){var r;if(e<o.length){for(var n=null,a=0;a<o.length;a++)if(_i(o[a],t)){n=o[a];break}n&&(r=n)}if(r)U(r);else{var s=i._captionsOrSubtitlesFromCharacteristics(t);(r=i.createTextTrack(s,t.name,t.lang))&&(r.mode="disabled")}r&&(r.groupId=t.groupId,i.textTracks.push(r))}))}else if(!a&&this.tracks&&this.tracks.length){var l=this.tracks.map((function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}}));this.hls.trigger(s.a.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},e._captionsOrSubtitlesFromCharacteristics=function(t){var e;if(null!==(e=t.attrs)&&void 0!==e&&e.CHARACTERISTICS){var i=/transcribes-spoken-dialog/gi.test(t.attrs.CHARACTERISTICS),r=/describes-music-and-sound/gi.test(t.attrs.CHARACTERISTICS);if(i&&r)return"captions"}return"subtitles"},e.onManifestLoaded=function(t,e){var i=this;this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((function(t){var e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(e){var r="textTrack"+e[1],n=i.captionsProperties[r];n&&(n.label=t.name,t.lang&&(n.languageCode=t.lang),n.media=t)}}))},e.onFragLoading=function(t,e){var i=this.cea608Parser1,r=this.cea608Parser2,n=this.lastSn,a=this.lastPartIndex;if(this.enabled&&i&&r&&e.frag.type===w.b.MAIN){var s,o,l=e.frag.sn,u=null!=(s=null==e||null===(o=e.part)||void 0===o?void 0:o.index)?s:-1;l===n+1||l===n&&u===a+1||(i.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=u}},e.onFragLoaded=function(t,e){var i=e.frag,r=e.payload,n=this.initPTS,o=this.unparsedVttFrags;if(i.type===w.b.SUBTITLE)if(r.byteLength){if(!Object(a.a)(n[i.cc]))return o.push(e),void(n.length&&this.hls.trigger(s.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Missing initial subtitle PTS")}));var l=i.decryptdata,u="stats"in e;if(null==l||null==l.key||"AES-128"!==l.method||u){var h=this.tracks[i.level],d=this.vttCCs;d[i.cc]||(d[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),h&&"stpp.ttml.im1t"===h.textCodec?this._parseIMSC1(i,r):this._parseVTTs(i,r,d)}}else this.hls.trigger(s.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(t,e){var i=this,r=this.hls;Ei(e,this.initPTS[t.cc],this.timescale[t.cc],(function(e){i._appendCues(e,t.level),r.trigger(s.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(e){l.b.log("Failed to parse IMSC1: "+e),r.trigger(s.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))},e._parseVTTs=function(t,e,i){var r,n=this,a=this.hls;pi(null!==(r=t.initSegment)&&void 0!==r&&r.data?Object(u.b)(t.initSegment.data,new Uint8Array(e)):e,this.initPTS[t.cc],this.timescale[t.cc],i,t.cc,t.start,(function(e){n._appendCues(e,t.level),a.trigger(s.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(i){n._fallbackToIMSC1(t,e),l.b.log("Failed to parse VTT cue: "+i),a.trigger(s.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:i})}))},e._fallbackToIMSC1=function(t,e){var i=this,r=this.tracks[t.level];r.textCodec||Ei(e,this.initPTS[t.cc],this.timescale[t.cc],(function(){r.textCodec="stpp.ttml.im1t",i._parseIMSC1(t,e)}),(function(){r.textCodec="wvtt"}))},e._appendCues=function(t,e){var i=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[e];if(!r||"disabled"===r.mode)return;t.forEach((function(t){return N(r,t)}))}else{var n=this.tracks[e];if(!n)return;var a=n.default?"default":"subtitles"+e;i.trigger(s.a.CUES_PARSED,{type:"subtitles",cues:t,track:a})}},e.onFragDecrypted=function(t,e){var i=e.frag;if(i.type===w.b.SUBTITLE){if(!Object(a.a)(this.initPTS[i.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(s.a.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var i=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&i&&r)for(var n=0;n<e.samples.length;n++){var a=e.samples[n].bytes;if(a){var s=this.extractCea608Data(a);i.addData(e.samples[n].pts,s[0]),r.addData(e.samples[n].pts,s[1])}}},e.onBufferFlushing=function(t,e){var i=e.startOffset,r=e.endOffset,n=e.endOffsetSubtitles,a=e.type,s=this.media;if(s&&!(s.currentTime<r)){if(!a||"video"===a){var o=this.captionsTracks;Object.keys(o).forEach((function(t){return B(o[t],i,r)}))}if(this.config.renderTextTracksNatively&&0===i&&void 0!==n){var l=this.textTracks;Object.keys(l).forEach((function(t){return B(l[t],i,n)}))}}},e.extractCea608Data=function(t){for(var e=[[],[]],i=31&t[0],r=2,n=0;n<i;n++){var a=t[r++],s=127&t[r++],o=127&t[r++];if(0!==s||0!==o)if(0!=(4&a)){var l=3&a;0!==l&&1!==l||(e[l].push(s),e[l].push(o))}}return e},t}();function _i(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function Ii(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Oi,Ci=function(){function t(t){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e,i,r,n=t.prototype;return n.setStreamController=function(t){this.streamController=t},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var t=this.hls;t.on(s.a.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(s.a.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var t=this.hls;t.off(s.a.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(s.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(s.a.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(e,i){t.isLevelAllowed(i.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(i.droppedLevel)},n.onMediaAttaching=function(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null},n.onManifestParsed=function(t,e){var i=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,i.config.capLevelToPlayerSize&&e.video&&this.startCapping()},n.onBufferCodecs=function(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},n.getMaxLevel=function(e){var i=this,r=this.hls.levels;if(!r.length)return-1;var n=r.filter((function(r,n){return t.isLevelAllowed(n,i.restrictedLevels)&&n<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var i=t.getBoundingClientRect();e.width=i.width,e.height=i.height,e.width||e.height||(e.width=i.right-i.left||t.width||0,e.height=i.bottom-i.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,i){if(!t||!t.length)return-1;for(var r,n,a=t.length-1,s=0;s<t.length;s+=1){var o=t[s];if((o.width>=e||o.height>=i)&&(r=o,!(n=t[s+1])||r.width!==n.width||r.height!==n.height)){a=s;break}}return a},e=t,(i=[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return t}}])&&Ii(e.prototype,i),r&&Ii(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),wi=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(s.a.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(s.a.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var i=this.hls.config;if(i.capLevelOnFPSDrop){var r=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,i){var r=performance.now();if(e){if(this.lastTime){var n=r-this.lastTime,a=i-this.lastDroppedFrames,o=e-this.lastDecodedFrames,u=1e3*a/n,h=this.hls;if(h.trigger(s.a.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:i}),u>0&&a>h.config.fpsDroppedMonitoringThreshold*o){var d=h.currentLevel;l.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===h.autoLevelCapping||h.autoLevelCapping>=d)&&(d-=1,h.trigger(s.a.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:h.currentLevel}),h.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();!function(t){t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready"}(Oi||(Oi={}));var xi="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function Pi(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Fi,Mi,Ni,Ui=function(){function t(t){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=t,this._config=t.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var e,i,r,n=t.prototype;return n.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},n._registerListeners=function(){this.hls.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(s.a.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(s.a.MANIFEST_PARSED,this.onManifestParsed,this)},n._unregisterListeners=function(){this.hls.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(s.a.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(s.a.MANIFEST_PARSED,this.onManifestParsed,this)},n.getLicenseServerUrl=function(t){switch(t){case Oi.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+t+'"')},n._attemptKeySystemAccess=function(t,e,i){var r=this,n=function(t,e,i,r){switch(t){case Oi.WIDEVINE:return function(t,e,i){var r={audioCapabilities:[],videoCapabilities:[]};return t.forEach((function(t){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:i.audioRobustness||""})})),e.forEach((function(t){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:i.videoRobustness||""})})),[r]}(e,i,r);default:throw new Error("Unknown key-system: "+t)}}(t,e,i,this._drmSystemOptions);l.b.log("Requesting encrypted media key-system access");var a=this.requestMediaKeySystemAccess(t,n);this.mediaKeysPromise=a.then((function(e){return r._onMediaKeySystemAccessObtained(t,e)})),a.catch((function(e){l.b.error('Failed to obtain key-system "'+t+'" access:',e)}))},n._onMediaKeySystemAccessObtained=function(t,e){var i=this;l.b.log('Access for key-system "'+t+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:t};this._mediaKeysList.push(r);var n=Promise.resolve().then((function(){return e.createMediaKeys()})).then((function(e){return r.mediaKeys=e,l.b.log('Media-keys created for key-system "'+t+'"'),i._onMediaKeysCreated(),e}));return n.catch((function(t){l.b.error("Failed to create media-keys:",t)})),n},n._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach((function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),t._onNewMediaKeySession(e.mediaKeysSession))}))},n._onNewMediaKeySession=function(t){var e=this;l.b.log("New key-system session "+t.sessionId),t.addEventListener("message",(function(i){e._onKeySessionMessage(t,i.message)}),!1)},n._onKeySessionMessage=function(t,e){l.b.log("Got EME message event, creating license request"),this._requestLicense(e,(function(e){l.b.log("Received license data (length: "+(e?e.byteLength:e)+"), updating key-session"),t.update(e).catch((function(t){l.b.warn("Updating key-session failed: "+t)}))}))},n.onMediaEncrypted=function(t){var e=this;if(l.b.log('Media is encrypted using "'+t.initDataType+'" init data type'),!this.mediaKeysPromise)return l.b.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_KEYS,fatal:!0});var i=function(i){e._media&&(e._attemptSetMediaKeys(i),e._generateRequestWithPreferredKeySession(t.initDataType,t.initData))};this.mediaKeysPromise.then(i).catch(i)},n._attemptSetMediaKeys=function(t){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return l.b.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_KEYS,fatal:!0});l.b.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},n._generateRequestWithPreferredKeySession=function(t,e){var i=this,r=this._mediaKeysList[0];if(!r)return l.b.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(r.mediaKeysSessionInitialized)l.b.warn("Key-Session already initialized but requested again");else{var n=r.mediaKeysSession;if(!n)return l.b.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!e)return l.b.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});l.b.log('Generating key-session request for "'+t+'" init data type'),r.mediaKeysSessionInitialized=!0,n.generateRequest(t,e).then((function(){l.b.debug("Key-session generation succeeded")})).catch((function(t){l.b.error("Error generating key-session request:",t),i.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},n._createLicenseXhr=function(t,e,i){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,t,e,i);var n=this._licenseXhrSetup;if(n)try{n.call(this.hls,r,t),n=void 0}catch(t){l.b.error(t)}try{r.readyState||r.open("POST",t,!0),n&&n.call(this.hls,r,t)}catch(t){throw new Error("issue setting up KeySystem license XHR "+t)}return r},n._onLicenseRequestReadyStageChange=function(t,e,i,r){switch(t.readyState){case 4:if(200===t.status){this._requestLicenseFailureCount=0,l.b.log("License request succeeded");var n=t.response,a=this._licenseResponseCallback;if(a)try{n=a.call(this.hls,t,e)}catch(t){l.b.error(t)}r(n)}else{if(l.b.error("License Request XHR failed ("+e+"). Status: "+t.status+" ("+t.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var u=3-this._requestLicenseFailureCount+1;l.b.warn("Retrying license request, "+u+" attempts left"),this._requestLicense(i,r)}}},n._generateLicenseRequestChallenge=function(t,e){switch(t.mediaKeySystemDomain){case Oi.WIDEVINE:return e}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},n._requestLicense=function(t,e){l.b.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i)return l.b.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var r=this.getLicenseServerUrl(i.mediaKeySystemDomain),n=this._createLicenseXhr(r,t,e);l.b.log("Sending license request to URL: "+r);var a=this._generateLicenseRequestChallenge(i,t);n.send(a)}catch(t){l.b.error("Failure requesting DRM license: "+t),this.hls.trigger(s.a.ERROR,{type:o.b.KEY_SYSTEM_ERROR,details:o.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(t,e){if(this._emeEnabled){var i=e.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)}},n.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},n.onManifestParsed=function(t,e){if(this._emeEnabled){var i=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),r=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(Oi.WIDEVINE,i,r)}},e=t,(i=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&Pi(e.prototype,i),r&&Pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Bi(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gi(t,e,i){return e&&Bi(t.prototype,e),i&&Bi(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function ji(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Ki(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ki(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ki(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r}function Hi(){return(Hi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(Fi||(Fi={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(Mi||(Mi={})),function(t){t.VOD="v",t.LIVE="l"}(Ni||(Ni={}));var Vi=function(){function t(e){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(t){try{i.apply(t,{ot:Fi.MANIFEST,su:!i.initialized})}catch(t){l.b.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(t){try{var e=t.frag,r=i.hls.levels[e.level],n=i.getObjectType(e),a={d:1e3*e.duration,ot:n};n!==Fi.VIDEO&&n!==Fi.AUDIO&&n!=Fi.MUXED||(a.br=r.bitrate/1e3,a.tb=i.getTopBandwidth(n)/1e3,a.bl=i.getBufferLength(n)),i.apply(t,a)}catch(t){l.b.warn("Could not generate segment CMCD data.",t)}},this.hls=e;var r=this.config=e.config,n=r.cmcd;null!=n&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||t.uuid(),this.cid=n.contentId,this.useHeaders=!0===n.useHeaders,this.registerListeners())}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.a.MEDIA_DETACHED,this.onMediaDetached,this),t.on(s.a.BUFFER_CREATED,this.onBufferCreated,this)},e.unregisterListeners=function(){var t=this.hls;t.off(s.a.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.a.MEDIA_DETACHED,this.onMediaDetached,this),t.off(s.a.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},e.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},e.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},e.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},e.onBufferCreated=function(t,e){var i,r;this.audioBuffer=null===(i=e.tracks.audio)||void 0===i?void 0:i.buffer,this.videoBuffer=null===(r=e.tracks.video)||void 0===r?void 0:r.buffer},e.createData=function(){var t;return{v:1,sf:Mi.HLS,sid:this.sid,cid:this.cid,pr:null===(t=this.media)||void 0===t?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},e.apply=function(e,i){void 0===i&&(i={}),Hi(i,this.createData());var r=i.ot===Fi.INIT||i.ot===Fi.VIDEO||i.ot===Fi.MUXED;if(this.starved&&r&&(i.bs=!0,i.su=!0,this.starved=!1),null==i.su&&(i.su=this.buffering),this.useHeaders){var n=t.toHeaders(i);if(!Object.keys(n).length)return;e.headers||(e.headers={}),Hi(e.headers,n)}else{var a=t.toQuery(i);if(!a)return;e.url=t.appendQueryToUri(e.url,a)}},e.getObjectType=function(t){var e=t.type;return"subtitle"===e?Fi.TIMED_TEXT:"initSegment"===t.sn?Fi.INIT:"audio"===e?Fi.AUDIO:"main"===e?this.hls.audioTracks.length?Fi.VIDEO:Fi.MUXED:void 0},e.getTopBandwidth=function(t){var e,i=0,r=this.hls;if(t===Fi.AUDIO)e=r.audioTracks;else{var n=r.maxAutoLevel,a=n>-1?n+1:r.levels.length;e=r.levels.slice(0,a)}for(var s,o=ji(e);!(s=o()).done;){var l=s.value;l.bitrate>i&&(i=l.bitrate)}return i>0?i:NaN},e.getBufferLength=function(t){var e=this.hls.media,i=t===Fi.AUDIO?this.audioBuffer:this.videoBuffer;return i&&e?1e3*mt.bufferInfo(i,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,i=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new i(t)}var r=t.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(t,i,r){e(t),this.loader.load(t,i,r)},Gi(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,i=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new i(t)}var r=t.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(t,i,r){e(t),this.loader.load(t,i,r)},Gi(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,i=[],r=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},n=function(t){return Math.round(t)},a=function(t){return 100*n(t/100)},s={br:n,d:n,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:n},o=ji(Object.keys(t||{}).sort());!(e=o()).done;){var l=e.value,u=t[l];if(r(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=s[l];h&&(u=h(u));var d=typeof u,c=void 0;c="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),i.push(c)}}return i.join(",")},t.toHeaders=function(e){for(var i={},r=["Object","Request","Session","Status"],n=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},s=0,o=Object.keys(e);s<o.length;s++){var l=o[s];n[null!=a[l]?a[l]:1][l]=e[l]}for(var u=0;u<n.length;u++){var h=t.serialize(n[u]);h&&(i["CMCD-"+r[u]]=h)}return i},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(t,e){if(!e)return t;var i=t.includes("?")?"&":"?";return""+t+i+e},t}(),Wi=i(14),Yi=/^age:\s*[\d.]+\s*$/m,qi=function(){function t(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t?t.xhrSetup:null,this.stats=new Wi.a,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(t,e,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=i,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t=this.config,e=this.context;if(t){var i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(i,e.url)}catch(t){i.open("GET",e.url,!0),n(i,e.url)}i.readyState||i.open("GET",e.url,!0);var a=this.context.headers;if(a)for(var s in a)i.setRequestHeader(s,a[s])}catch(t){return void this.callbacks.onError({code:i.status,text:t.message},e,i)}e.rangeEnd&&i.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),i.onreadystatechange=this.readystatechange.bind(this),i.onprogress=this.loadprogress.bind(this),i.responseType=e.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),i.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,i=this.stats;if(t&&e){var r=e.readyState,n=this.config;if(!i.aborted&&r>=2)if(self.clearTimeout(this.requestTimeout),0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start)),4===r){e.onreadystatechange=null,e.onprogress=null;var a=e.status;if(a>=200&&a<300){var s,o;if(i.loading.end=Math.max(self.performance.now(),i.loading.first),o="arraybuffer"===t.responseType?(s=e.response).byteLength:(s=e.responseText).length,i.loaded=i.total=o,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(i,t,s,e),!this.callbacks)return;var h={url:e.responseURL,data:s};this.callbacks.onSuccess(h,i,t,e)}else i.retry>=n.maxRetry||a>=400&&a<499?(l.b.error(a+" while loading "+t.url),this.callbacks.onError({code:a,text:e.statusText},t,e)):(l.b.warn(a+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),i.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)}},e.loadtimeout=function(){l.b.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&Yi.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();function zi(t){var e="function"==typeof Map?new Map:void 0;return(zi=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Xi(t,arguments,Ji(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),$i(r,t)})(t)}function Xi(t,e,i){return(Xi=Qi()?Reflect.construct.bind():function(t,e,i){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(t,r));return i&&$i(n,i.prototype),n}).apply(null,arguments)}function Qi(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function $i(t,e){return($i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ji(t){return(Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Zi(){return(Zi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}var tr=function(){function t(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||er,this.controller=new self.AbortController,this.stats=new Wi.a}var e=t.prototype;return e.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},e.abortInternal=function(){var t=this.response;t&&t.ok||(this.stats.aborted=!0,this.controller.abort())},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},e.load=function(t,e,i){var r=this,n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();var s=function(t,e){var i={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Zi({},t.headers))};t.rangeEnd&&i.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return i}(t,this.controller.signal),o=i.onProgress,l="arraybuffer"===t.responseType,u=l?"byteLength":"length";this.context=t,this.config=e,this.callbacks=i,this.request=this.fetchSetup(t,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){r.abortInternal(),i.onTimeout(n,t,r.response)}),e.timeout),self.fetch(this.request).then((function(i){if(r.response=r.loader=i,!i.ok){var s=i.status,u=i.statusText;throw new ir(u||"fetch, bad network response",s,i)}return n.loading.first=Math.max(self.performance.now(),n.loading.start),n.total=parseInt(i.headers.get("Content-Length")||"0"),o&&Object(a.a)(e.highWaterMark)?r.loadProgressively(i,n,t,e.highWaterMark,o):l?i.arrayBuffer():i.text()})).then((function(s){var l=r.response;self.clearTimeout(r.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first),n.loaded=n.total=s[u];var h={url:l.url,data:s};o&&!Object(a.a)(e.highWaterMark)&&o(n,t,s,l),i.onSuccess(h,n,t,l)})).catch((function(e){if(self.clearTimeout(r.requestTimeout),!n.aborted){var a=e&&e.code||0,s=e?e.message:null;i.onError({code:a,text:s},t,e?e.details:null)}}))},e.getCacheAge=function(){var t=null;if(this.response){var e=this.response.headers.get("age");t=e?parseFloat(e):null}return t},e.loadProgressively=function(t,e,i,r,n){void 0===r&&(r=0);var a=new pe,s=t.body.getReader();return function o(){return s.read().then((function(s){if(s.done)return a.dataLength&&n(e,i,a.flush(),t),Promise.resolve(new ArrayBuffer(0));var l=s.value,u=l.length;return e.loaded+=u,u<r||a.dataLength?(a.push(l),a.dataLength>=r&&n(e,i,a.flush(),t)):n(e,i,l,t),o()})).catch((function(){return Promise.reject()}))}()},t}();function er(t,e){return new self.Request(t.url,e)}var ir=function(t){var e,i;function r(e,i,r){var n;return(n=t.call(this,e)||this).code=void 0,n.details=void 0,n.code=i,n.details=r,n}return i=t,(e=r).prototype=Object.create(i.prototype),e.prototype.constructor=e,$i(e,i),r}(zi(Error)),rr=tr,nr=/\s/;function ar(){return(ar=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}).apply(this,arguments)}function sr(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function or(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sr(Object(i),!0).forEach((function(e){lr(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):sr(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function lr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var ur=or(or({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:qi,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ve,bufferController:Fe,capLevelController:Ci,fpsController:wi,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:xi,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},{cueHandler:{newCue:function(t,e,i,r){for(var n,a,s,o,l,u=[],h=self.VTTCue||self.TextTrackCue,d=0;d<r.rows.length;d++)if(s=!0,o=0,l="",!(n=r.rows[d]).isEmpty()){for(var c=0;c<n.chars.length;c++)nr.test(n.chars[c].uchar)&&s?o++:(l+=n.chars[c].uchar,s=!1);n.cueStartTime=e,e===i&&(i+=1e-4),o>=16?o--:o++;var f=li(l.trim()),g=vi(e,i,f);t&&t.cues&&t.cues.getCueById(g)||((a=new h(e,i,f)).id=g,a.line=d+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*o/32)),u.push(a))}return t&&u.length&&(u.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),u.forEach((function(e){return N(t,e)}))),u}},enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:De,subtitleTrackController:Ce,timelineController:ki,audioStreamController:Te,audioTrackController:Se,emeController:Ui,cmcdController:Vi});function hr(t){var e=t.loader;e!==rr&&e!==qi?(l.b.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}()&&(t.loader=rr,t.progressive=!0,t.enableSoftwareAES=!0,l.b.log("[config]: Progressive streaming enabled, using FetchLoader"))}function dr(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var cr=function(){function t(e){void 0===e&&(e={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new ae.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var i=this.config=function(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return ar({},t,e)}(t.DefaultConfig,e);this.userConfig=e,Object(l.a)(i.debug),this._autoLevelCapping=-1,i.progressive&&hr(i);var r=i.abrController,n=i.bufferController,a=i.capLevelController,s=i.fpsController,o=this.abrController=new r(this),u=this.bufferController=new n(this),h=this.capLevelController=new a(this),d=new s(this),c=new P(this),f=new F(this),g=new V(this),v=this.levelController=new dt(this),p=new ct(this),m=this.streamController=new de(this,p);h.setStreamController(m),d.setStreamController(m);var y=[c,f,v,m];this.networkControllers=y;var T=[o,u,h,d,g,p];this.audioTrackController=this.createController(i.audioTrackController,null,y),this.createController(i.audioStreamController,p,y),this.subtitleTrackController=this.createController(i.subtitleTrackController,null,y),this.createController(i.subtitleStreamController,p,y),this.createController(i.timelineController,null,T),this.emeController=this.createController(i.emeController,null,T),this.cmcdController=this.createController(i.cmcdController,null,T),this.latencyController=this.createController(q,null,T),this.coreComponents=T}t.isSupported=function(){return function(){var t=ee();if(!t)return!1;var e=ie(),i=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!i&&!!r}()};var e,i,r,a=t.prototype;return a.createController=function(t,e,i){if(t){var r=e?new t(this,e):new t(this);return i&&i.push(r),r}return null},a.on=function(t,e,i){void 0===i&&(i=this),this._emitter.on(t,e,i)},a.once=function(t,e,i){void 0===i&&(i=this),this._emitter.once(t,e,i)},a.removeAllListeners=function(t){this._emitter.removeAllListeners(t)},a.off=function(t,e,i,r){void 0===i&&(i=this),this._emitter.off(t,e,i,r)},a.listeners=function(t){return this._emitter.listeners(t)},a.emit=function(t,e,i){return this._emitter.emit(t,e,i)},a.trigger=function(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){l.b.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.trigger(s.a.ERROR,{type:o.b.OTHER_ERROR,details:o.a.INTERNAL_EXCEPTION,fatal:!1,event:t,error:e})}return!1},a.listenerCount=function(t){return this._emitter.listenerCount(t)},a.destroy=function(){l.b.log("destroy"),this.trigger(s.a.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(t){return t.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(t){return t.destroy()})),this.coreComponents.length=0},a.attachMedia=function(t){l.b.log("attachMedia"),this._media=t,this.trigger(s.a.MEDIA_ATTACHING,{media:t})},a.detachMedia=function(){l.b.log("detachMedia"),this.trigger(s.a.MEDIA_DETACHING,void 0),this._media=null},a.loadSource=function(t){this.stopLoad();var e=this.media,i=this.url,r=this.url=n.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});l.b.log("loadSource:"+r),e&&i&&i!==r&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(e)),this.trigger(s.a.MANIFEST_LOADING,{url:t})},a.startLoad=function(t){void 0===t&&(t=-1),l.b.log("startLoad("+t+")"),this.networkControllers.forEach((function(e){e.startLoad(t)}))},a.stopLoad=function(){l.b.log("stopLoad"),this.networkControllers.forEach((function(t){t.stopLoad()}))},a.swapAudioCodec=function(){l.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},a.recoverMediaError=function(){l.b.log("recoverMediaError");var t=this._media;this.detachMedia(),t&&this.attachMedia(t)},a.removeLevel=function(t,e){void 0===e&&(e=0),this.levelController.removeLevel(t,e)},e=t,r=[{key:"version",get:function(){return"1.2.3"}},{key:"Events",get:function(){return s.a}},{key:"ErrorTypes",get:function(){return o.b}},{key:"ErrorDetails",get:function(){return o.a}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:ur},set:function(e){t.defaultConfig=e}}],(i=[{key:"levels",get:function(){var t=this.levelController.levels;return t||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){l.b.log("set currentLevel:"+t),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){l.b.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){l.b.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){l.b.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){l.b.log("set startLevel:"+t),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(t){var e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){this._autoLevelCapping!==t&&(l.b.log("set autoLevelCapping:"+t),this._autoLevelCapping=t)}},{key:"bandwidthEstimate",get:function(){var t=this.abrController.bwEstimator;return t?t.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var i=t.length,r=0;r<i;r++)if(t[r].maxBitrate>=e)return r;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&dr(e.prototype,i),r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();cr.defaultConfig=void 0}]).default}));
2
+ //# sourceMappingURL=hls.min.js.map
flowplayer/modules/analytics.module.js CHANGED
@@ -196,6 +196,7 @@ function fv_player_track( api, ga_id, event, engineType, name, value) {
196
  if( typeof(gtag) != "undefined" ) {
197
  if( is_ga_4( api ) ) {
198
  gtag("event", event, {
 
199
  'video_current_time': api.video.time,
200
  'video_provider': engineType,
201
  'video_duration': api.video.duration,
196
  if( typeof(gtag) != "undefined" ) {
197
  if( is_ga_4( api ) ) {
198
  gtag("event", event, {
199
+ 'video_title': name,
200
  'video_current_time': api.video.time,
201
  'video_provider': engineType,
202
  'video_duration': api.video.duration,
flowplayer/modules/appearance.module.js CHANGED
@@ -52,8 +52,8 @@ flowplayer(function(api, root) {
52
  if(width <= 320) { // remove volue bar on narrow players
53
  root.addClass('no-volume fp-mute');
54
  } else {
55
- if( !had_no_volume ) root.removeClass('no-volume');
56
- if( !had_fp_mute ) root.removeClass('fp-mute');
57
  }
58
  }
59
 
@@ -90,6 +90,8 @@ jQuery(window).on('resize tabsactivate',function(){
90
  }).trigger('resize');
91
 
92
  flowplayer(function(api, root) {
 
 
93
  /*
94
  * Chrome 55>= video download button fix
95
  */
@@ -106,7 +108,6 @@ flowplayer(function(api, root) {
106
  /*
107
  * Splash dimension bugfix
108
  */
109
- root = jQuery(root);
110
  var image_src = root.css('background-image')
111
  if( image_src ) {
112
  image_src = image_src.replace(/url\((['"])?(.*?)\1\)/gi, '$2').split(',');
@@ -123,6 +124,26 @@ flowplayer(function(api, root) {
123
  }
124
 
125
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  });
127
 
128
  /*
@@ -132,7 +153,7 @@ flowplayer(function(api, root) {
132
  $(window).on('resize',function(){
133
  var iframe = $('iframe[id][src][height][width]');
134
  iframe.each(function(){
135
- if( $(this).attr('id').match(/(fv_vimeo_)|(fv_ytplayer_)/) && $(this).width() <= $(this).attr('width') )
136
  $(this).height( $(this).width() * $(this).attr('height') / $(this).attr('width') );
137
  })
138
 
52
  if(width <= 320) { // remove volue bar on narrow players
53
  root.addClass('no-volume fp-mute');
54
  } else {
55
+ if( !had_no_volume && flowplayer.support.volume ) root.removeClass('no-volume');
56
+ if( !had_fp_mute && flowplayer.support.volume ) root.removeClass('fp-mute');
57
  }
58
  }
59
 
90
  }).trigger('resize');
91
 
92
  flowplayer(function(api, root) {
93
+ root = jQuery(root);
94
+
95
  /*
96
  * Chrome 55>= video download button fix
97
  */
108
  /*
109
  * Splash dimension bugfix
110
  */
 
111
  var image_src = root.css('background-image')
112
  if( image_src ) {
113
  image_src = image_src.replace(/url\((['"])?(.*?)\1\)/gi, '$2').split(',');
124
  }
125
 
126
  }
127
+
128
+ /*
129
+ * YouTube player class
130
+ */
131
+ var is_youtube = false;
132
+ jQuery(api.conf.playlist).each( function(k,v) {
133
+ if( v.sources[0].type.match(/youtube/) ) is_youtube = true;
134
+ });
135
+
136
+ if( is_youtube ) {
137
+ root.addClass('is-youtube');
138
+ }
139
+
140
+ api.bind("ready", function (e,api,video) {
141
+ if( video.type == 'video/youtube' ) {
142
+ root.addClass('is-youtube');
143
+ } else {
144
+ root.removeClass('is-youtube');
145
+ }
146
+ });
147
  });
148
 
149
  /*
153
  $(window).on('resize',function(){
154
  var iframe = $('iframe[id][src][height][width]');
155
  iframe.each(function(){
156
+ if( $(this).attr('id').match(/fv_vimeo_/) && $(this).width() <= $(this).attr('width') )
157
  $(this).height( $(this).width() * $(this).attr('height') / $(this).attr('width') );
158
  })
159
 
flowplayer/modules/chromecast.module.js CHANGED
@@ -1,4 +1,4 @@
1
- /*global chrome*/
2
 
3
  // copy of the original function with some mods
4
  flowplayer(function(api, root) {
@@ -298,7 +298,7 @@ flowplayer(function(api, root) {
298
 
299
  jQuery(trigger).show();
300
  } else {
301
- FV_Flowplayer_Pro.log('FV Player: Can\'t find media source suitable for Chromecast!');
302
  jQuery(trigger).hide();
303
  }
304
 
1
+ /*global chrome, fv_player_log*/
2
 
3
  // copy of the original function with some mods
4
  flowplayer(function(api, root) {
298
 
299
  jQuery(trigger).show();
300
  } else {
301
+ fv_player_log('FV Player: Can\'t find media source suitable for Chromecast!');
302
  jQuery(trigger).hide();
303
  }
304
 
flowplayer/modules/flowplayer.min.js CHANGED
@@ -1,6 +1,6 @@
1
  /*!
2
 
3
- Flowplayer v7.2.10 (2022-07-06) | flowplayer.com/license
4
 
5
  */
6
- !function(a){function c(e,t,n,i){for(var r,o=n.slice(),a=(u=e,(c=t).currentTarget=u,c.eventPhase=c.target===c.currentTarget?2:3,c),s=0,l=o.length;s<l&&(handler=o[s],"object"==typeof handler&&"function"==typeof handler.handleEvent?handler.handleEvent(a):handler.call(e,a),!a.stoppedImmediatePropagation);s++);var c,u;return r=!a.stoppedPropagation,i&&r&&e.parentNode?e.parentNode.dispatchEvent(a):!a.defaultPrevented}function r(e,t){return{configurable:!0,get:e,set:t}}function e(e,t,n){var i=I(t||e,n);w(e,"textContent",r(function(){return i.get.call(this)},function(e){i.set.call(this,e)}))}function u(e,t){for(var n=e.length;n--&&e[n]!==t;);return n}function t(){if("BR"===this.tagName)return"\n";for(var e=this.firstChild,t=[];e;)8!==e.nodeType&&7!==e.nodeType&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function o(e){!h&&E.test(document.readyState)&&(h=!h,document.detachEvent(g,o),(e=document.createEvent("Event")).initEvent(m,!0,!0),document.dispatchEvent(e))}function n(e){for(var t;t=this.lastChild;)this.removeChild(t);null!=e&&this.appendChild(document.createTextNode(e))}function f(e,t){return(t=t||a.event).target||(t.target=t.srcElement||t.fromElement||document),t.timeStamp||(t.timeStamp=(new Date).getTime()),t}if(!document.createEvent){var l,d,p,i,s=!0,h=!1,g="onreadystatechange",m="DOMContentLoaded",v="__IE8__"+Math.random(),y=a.Object,w=y.defineProperty||function(e,t,n){e[t]=n.value},b=y.defineProperties||function(t,e){for(var n in e)if(M.call(e,n))try{w(t,n,e[n])}catch(e){a.console&&console.log(n+" failed on object:",t,e.message)}},I=y.getOwnPropertyDescriptor,M=y.prototype.hasOwnProperty,C=a.Element.prototype,A=a.Text.prototype,S=/^[a-z]+$/,E=/loaded|complete/,N={},D=document.createElement("div");e(a.HTMLCommentElement.prototype,C,"nodeValue"),e(a.HTMLScriptElement.prototype,null,"text"),e(A,null,"nodeValue"),e(a.HTMLTitleElement.prototype,null,"text"),w(a.HTMLStyleElement.prototype,"textContent",(i=I(a.CSSStyleSheet.prototype,"cssText"),r(function(){return i.get.call(this.styleSheet)},function(e){i.set.call(this.styleSheet,e)}))),b(C,{textContent:{get:t,set:n},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;t<n;t++)if(1==e[t].nodeType)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(1==e[t].nodeType)return e[t]}},previousElementSibling:{get:function(){for(var e=this.previousSibling;e&&1!=e.nodeType;)e=e.previousSibling;return e}},nextElementSibling:{get:function(){for(var e=this.nextSibling;e&&1!=e.nodeType;)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=1==t[n].nodeType);return e}},addEventListener:{value:function(e,t,n){var i,r=this,o="on"+e,a=r[v]||w(r,v,{value:{}})[v],s=a[o]||(a[o]={}),l=s.h||(s.h=[]);if(!M.call(s,"w")){if(s.w=function(e){return e[v]||c(r,f(0,e),l,!1)},!M.call(N,o))if(S.test(e))try{(i=document.createEventObject())[v]=!0,9!=r.nodeType&&null==r.parentNode&&D.appendChild(r),r.fireEvent(o,i),N[o]=!0}catch(i){for(N[o]=!1;D.hasChildNodes();)D.removeChild(D.firstChild)}else N[o]=!1;(s.n=N[o])&&r.attachEvent(o,s.w)}u(l,t)<0&&l[n?"unshift":"push"](t)}},dispatchEvent:{value:function(e){var t,n=this,i="on"+e.type,r=n[v],o=r&&r[i],a=!!o;return e.target||(e.target=n),a?o.n?n.fireEvent(i,e):c(n,e,o.h,!0):(t=n.parentNode)&&t.dispatchEvent(e),!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var i="on"+e,r=this[v],o=r&&r[i],a=o&&o.h,s=a?u(a,t):-1;-1<s&&a.splice(s,1)}}}),b(A,{addEventListener:{value:C.addEventListener},dispatchEvent:{value:C.dispatchEvent},removeEventListener:{value:C.removeEventListener}}),b(a.XMLHttpRequest.prototype,{addEventListener:{value:function(t,e,n){var i=this,r="on"+t,o=i[v]||w(i,v,{value:{}})[v],a=o[r]||(o[r]={}),s=a.h||(a.h=[]);u(s,e)<0&&(i[r]||(i[r]=function(){var e=document.createEvent("Event");e.initEvent(t,!0,!0),i.dispatchEvent(e)}),s[n?"unshift":"push"](e))}},dispatchEvent:{value:function(e){var t="on"+e.type,n=this[v],i=n&&n[t];return!!i&&(i.n?this.fireEvent(t,e):c(this,e,i.h,!0))}},removeEventListener:{value:C.removeEventListener}}),b(a.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),b(a.HTMLDocument.prototype,{textContent:{get:function(){return 11===this.nodeType?t.call(this):null},set:function(e){11===this.nodeType&&n.call(this,e)}},addEventListener:{value:function(e,t,n){var i=this;C.addEventListener.call(i,e,t,n),s&&e===m&&!E.test(i.readyState)&&(s=!1,i.attachEvent(g,o),a==top&&function t(e){try{i.documentElement.doScroll("left"),o()}catch(e){setTimeout(t,50)}}())}},dispatchEvent:{value:C.dispatchEvent},removeEventListener:{value:C.removeEventListener},createEvent:{value:function(e){var t;if("Event"!==e)throw new Error("unsupported "+e);return(t=document.createEventObject()).timeStamp=(new Date).getTime(),t}}}),b(a.Window.prototype,{getComputedStyle:{value:(l=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,d=/^(top|right|bottom|left)$/,p=/\-([a-z])/g,j.prototype.getPropertyValue=function(e){var t,n,i,r=this._,o=r.style,a=r.currentStyle,s=r.runtimeStyle;return e=("float"===e?"style-float":e).replace(p,L),t=a?a[e]:o[e],l.test(t)&&!d.test(e)&&(n=o.left,(i=s&&s.left)&&(s.left=a.left),o.left="fontSize"===e?"1em":t,t=o.pixelLeft+"px",o.left=n,i&&(s.left=i)),null==t?t:t+""||"auto"},x.prototype.getPropertyValue=function(){return null},function(e,t){return t?new x(e):new j(e)})},addEventListener:{value:function(e,t,n){var i,r=a,o="on"+e;r[o]||(r[o]=function(e){return c(r,f(0,e),i,!1)}),u(i=r[o][v]||(r[o][v]=[]),t)<0&&i[n?"unshift":"push"](t)}},dispatchEvent:{value:function(e){var t=a["on"+e.type];return!t||!1!==t.call(a,e)&&!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var i=(a["on"+e]||y)[v],r=i?u(i,t):-1;-1<r&&i.splice(r,1)}}})}function j(e){this._=e}function x(){}function L(e,t){return t.toUpperCase()}}(this),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).flowplayer=e()}}(function(){return function o(a,s,l){function c(t,e){if(!s[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var r=s[t]={exports:{}};a[t][0].call(r.exports,function(e){return c(a[t][1][e]||e)},r,r.exports,o,a,s,l)}return s[t].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)c(l[e]);return c}({1:[function(e,t,n){"use strict";var i,o=t.exports={},r=e("class-list"),a=window.jQuery,s=e("punycode"),l=e("computed-style");function c(e){return e.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})}o.noop=function(){},o.identity=function(e){return e},o.removeNode=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},o.find=function(e,t){return a?a(e,t).toArray():(t=t||document,Array.prototype.map.call(t.querySelectorAll(e),function(e){return e}))},o.text=function(e,t){e["innerText"in e?"innerText":"textContent"]=t},o.findDirect=function(e,t){return o.find(e,t).filter(function(e){return e.parentNode===t})},o.hasClass=function(e,t){return"string"==typeof e.className&&r(e).contains(t)},o.isSameDomain=function(e){var t=window.location,n=o.createElement("a",{href:e});return t.hostname===n.hostname&&t.protocol===n.protocol&&t.port===n.port},o.css=function(t,n,e){return"object"==typeof n?Object.keys(n).forEach(function(e){o.css(t,e,n[e])}):void 0!==e?""===e?t?t.style.removeProperty(n):void 0:t?t.style.setProperty(n,e):void 0:t?l(t,n):void 0},o.createElement=function(t,n,i){try{var e=document.createElement(t);for(var r in n)n.hasOwnProperty(r)&&("css"===r?o.css(e,n[r]):o.attr(e,r,n[r]));return i&&(e.innerHTML=i),e}catch(e){if(!a)throw e;return a("<"+t+">"+i+"</"+t+">").attr(n)[0]}},o.toggleClass=function(e,t,n){if(e){var i=r(e);void 0===n?i.toggle(t):n?i.add(t):n||i.remove(t)}},o.addClass=function(e,t){return o.toggleClass(e,t,!0)},o.removeClass=function(e,t){return o.toggleClass(e,t,!1)},o.append=function(e,t){return e.appendChild(t),e},o.appendTo=function(e,t){return o.append(t,e),e},o.prepend=function(e,t){e.insertBefore(t,e.firstChild)},o.insertAfter=function(e,t,n){t==o.lastChild(e)&&e.appendChild(n);var i=Array.prototype.indexOf.call(e.children,t);e.insertBefore(n,e.children[i+1])},o.html=function(e,t){(e=e.length?e:[e]).forEach(function(e){e.innerHTML=t})},o.attr=function(t,n,i){if("class"===n&&(n="className"),o.hasOwnOrPrototypeProperty(t,n))try{t[n]=i}catch(e){if(!a)throw e;a(t).attr(n,i)}else!1===i?t.removeAttribute(n):t.setAttribute(n,i);return t},o.prop=function(e,t,n){if(void 0===n)return e&&e[t];e[t]=n},o.offset=function(e){var t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight&&(t={left:100*t.left,right:100*t.right,top:100*t.top,bottom:100*t.bottom,width:100*t.width,height:100*t.height}),t},o.width=function(e,t){if(t)return e.style.width=(""+t).replace(/px$/,"")+"px";var n=o.offset(e).width;return void 0===n?e.offsetWidth:n},o.height=function(e,t){if(t)return e.style.height=(""+t).replace(/px$/,"")+"px";var n=o.offset(e).height;return void 0===n?e.offsetHeight:n},o.lastChild=function(e){return e.children[e.children.length-1]},o.hasParent=function(e,t){for(var n=e.parentElement;n;){if("string"!=typeof t){if(n===t)return!0}else if(o.matches(n,t))return!0;n=n.parentElement}return!1},o.createAbsoluteUrl=function(e){return o.createElement("a",{href:e}).href},o.xhrGet=function(e,t,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===this.readyState)return 400<=this.status?n():void t(this.responseText)},i.open("get",e,!0),i.send()},o.pick=function(t,e){var n={};return e.forEach(function(e){t.hasOwnProperty(e)&&(n[e]=t[e])}),n},o.hostname=function(e){return s.toUnicode(e||window.location.hostname)},o.browser={webkit:"WebkitAppearance"in document.documentElement.style},o.getPrototype=function(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__},o.hasOwnOrPrototypeProperty=function(e,t){for(var n=e;n;){if(Object.prototype.hasOwnProperty.call(n,t))return!0;n=o.getPrototype(n)}return!1},o.matches=function(e,t){var n=Element.prototype;return(n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=0;t[n]&&t[n]!==this;)n++;return!!t[n]}).call(e,t)},void 0!==(i=window.CSSStyleDeclaration.prototype).setAttribute&&(i.setProperty=function(e,t){return this.setAttribute(c(e),String(t))},i.getPropertyValue=function(e){return this.getAttribute(c(e))||null},i.removeProperty=function(e){var t=this.getPropertyValue(e);return this.removeAttribute(c(e)),t})},{"class-list":36,"computed-style":37,punycode:44}],2:[function(e,t,n){"use strict";var c=e("../common");t.exports=function(e,t,n,i){n=n||"opaque";var r="obj"+(""+Math.random()).slice(2,15),o='<object class="fp-engine" id="'+r+'" name="'+r+'" ',a=-1<navigator.userAgent.indexOf("MSIE");o+=a?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+e+'" type="application/x-shockwave-flash">';var s={width:"100%",height:"100%",allowscriptaccess:"always",wmode:n,quality:"high",flashvars:"",movie:e+(a?"?"+r:""),name:r};"transparent"!==n&&(s.bgcolor=i||"#333333"),Object.keys(t).forEach(function(e){s.flashvars+=e+"="+t[e]+"&"}),Object.keys(s).forEach(function(e){o+='<param name="'+e+'" value="'+s[e]+'"/>'}),o+="</object>";var l=c.createElement("div",{},o);return c.find("object",l)},window.attachEvent&&window.attachEvent("onbeforeunload",function(){window.__flash_savedUnloadHandler=window.__flash_unloadHandler=function(){}})},{"../common":1}],3:[function(e,t,n){"use strict";var i,S=e("../flowplayer"),E=e("../common"),N=e("./embed"),D=e("extend-object"),j=e("bean");function x(e){return/^https?:/.test(e)}(i=function(g,m){var v,y,w,b,I=g.conf,M=[],C={engineName:i.engineName,pick:function(i){var e=D({},function(){if(S.support.flashVideo){for(var e,t,n=0;n<i.length;n++)if(t=i[n],/mp4|flv|flash/i.test(t.type)&&(e=t),g.conf.swfHls&&/mpegurl/i.test(t.type)&&(e=t),e&&!/mp4/i.test(e.type))return e;return e}}());if(e)return!e.src||x(e.src)||g.conf.rtmp||e.rtmp||(e.src=E.createAbsoluteUrl(e.src)),e},suspendEngine:function(){b=!0},resumeEngine:function(){b=!1},load:function(n){function e(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D")}v=n,M.forEach(function(e){clearTimeout(e)});function t(){E.removeNode(i)}var i=E.findDirect("video",m)[0]||E.find(".fp-player > video",m)[0],r=n.src,o=x(r);S.support.video&&E.prop(i,"autoplay")&&n.sources.some(function(e){return!!i.canPlayType(e.type)})?j.one(i,"timeupdate",t):t();var a,s=n.rtmp||I.rtmp;if(o||s||(r=E.createAbsoluteUrl(r)),w&&A(n)&&w.data!==E.createAbsoluteUrl(I.swfHls)&&C.unload(),w){["live","preload","loop"].forEach(function(e){n.hasOwnProperty(e)&&w.__set(e,n[e])}),Object.keys(n.flashls||{}).forEach(function(e){w.__set("hls_"+e,n.flashls[e])});var l=!1;if(!o&&s)w.__set("rtmp",s.url||s);else l=!!w.__get("rtmp"),w.__set("rtmp",null);w.__play(r,l||n.rtmp&&n.rtmp!==I.rtmp)}else{y="fpCallback"+(""+Math.random()).slice(3,15),r=e(r);var c={hostname:I.embedded?E.hostname(I.hostname):E.hostname(location.hostname),url:r,callback:y};m.getAttribute("data-origin")&&(c.origin=m.getAttribute("data-origin")),["proxy","key","autoplay","preload","subscribe","live","loop","debug","splash","poster","rtmpt"].forEach(function(e){I.hasOwnProperty(e)&&(c[e]=I[e]),n.hasOwnProperty(e)&&(c[e]=n[e]),(I.rtmp||{}).hasOwnProperty(e)&&(c[e]=(I.rtmp||{})[e]),(n.rtmp||{}).hasOwnProperty(e)&&(c[e]=(n.rtmp||{})[e])}),I.splash&&(c.autoplay=!0),I.rtmp&&(c.rtmp=I.rtmp.url||I.rtmp),n.rtmp&&(c.rtmp=n.rtmp.url||n.rtmp),Object.keys(n.flashls||{}).forEach(function(e){var t=n.flashls[e];c["hls_"+e]=t});var u=void 0!==n.hlsQualities?n.hlsQualities:I.hlsQualities;void 0!==u&&(c.hlsQualities=u?encodeURIComponent(JSON.stringify(u)):u),void 0!==I.bufferTime&&(c.bufferTime=I.bufferTime),void 0!==I.bufferTimeMax&&(c.bufferTimeMax=I.bufferTimeMax),o&&delete c.rtmp,c.rtmp&&(c.rtmp=e(c.rtmp));var f,d=I.bgcolor||E.css(m,"background-color")||"";0===d.indexOf("rgb")?f=function(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}if(!(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/)))return;return"#"+t(e[1])+t(e[2])+t(e[3])}(d):0===d.indexOf("#")&&(f=7===(a=d).length?a:"#"+a.split("").slice(1).map(function(e){return e+e}).join("")),c.initialVolume=g.volumeLevel;var p=A(n)?I.swfHls:I.swf;w=N(p,c,I.wmode,f)[0];var h=E.find(".fp-player",m)[0];E.prepend(h,w),g.off("quality.flashengine").on("quality.flashengine",function(e,t,n){if(void 0!==g.video.hlsQualities?g.video.hlsQualities:g.conf.hlsQualities)try{w.__quality(n)}catch(e){g.debug("Error changing quality in flash engine",e)}}),setTimeout(function(){try{if(!w.PercentLoaded())return g.trigger("error",[g,{code:7,url:I.swf}])}catch(e){}},5e3),M.push(setTimeout(function(){void 0===w.PercentLoaded&&g.trigger("flashdisabled",[g])},15e3)),M.push(setTimeout(function(){void 0===w.PercentLoaded&&g.trigger("flashdisabled",[g,!1])},500)),g.off("resume.flashhack").on("resume.flashhack",function(){var e=setTimeout(function(){var e=w.__status().time,t=setTimeout(function(){g.playing&&!g.loading&&w.__status().time===e&&g.trigger("flashdisabled",[g])},400);M.push(t),g.one("seek.flashhack pause.flashhack load.flashack",function(){clearTimeout(t)})},800);M.push(e),g.one("progress",function(){clearTimeout(e)})}),w.pollInterval=setInterval(function(){if(w&&!b){var e=w.__status?w.__status():null;e&&((g.conf.live||g.live||n.live)&&(n.seekOffset=e.seekOffset,n.duration=e.duration+e.seekOffset),g.playing&&e.time&&e.time!==g.video.time&&g.trigger("progress",[g,e.time]),n.buffer=e.buffer/n.bytes*n.duration,g.trigger("buffer",[g,n.buffer]),!n.buffered&&0<e.time&&(n.buffered=!0,g.trigger("buffered",[g])))}},250),window[y]=function(e,t){var n=v;I.debug&&(0===e.indexOf("debug")&&t&&t.length?console.log.apply(console,["-- "+e].concat(t)):console.log("--",e,t));var i={type:e};switch(e){case"ready":t=D(n,t);break;case"click":i.flash=!0;break;case"keydown":i.which=t;break;case"seek":n.time=t;break;case"status":g.trigger("progress",[g,t.time]),t.buffer<n.bytes&&!n.buffered?(n.buffer=t.buffer/n.bytes*n.duration,g.trigger("buffer",n.buffer)):n.buffered||(n.buffered=!0,g.trigger("buffered"));break;case"metadata":var r=atob(t);t={key:r.substr(10,4),data:r.substr(21)}}"click"===e||"keydown"===e?(i.target=m,j.fire(m,e,[i])):"buffered"!=e&&"unload"!==e?setTimeout(function(){g.trigger(i,[g,t])},1):"unload"===e&&g.trigger(i,[g,t])}}},speed:E.noop,unload:function(){w&&w.__unload&&w.__unload();try{y&&window[y]&&delete window[y]}catch(e){}E.find("object",m).forEach(E.removeNode),w=0,g.off(".flashengine"),g.off(".flashhack"),clearInterval(w.pollInterval),M.forEach(function(e){clearTimeout(e)})}};function A(e){return/application\/x-mpegurl/i.test(e.type)}return["pause","resume","seek","volume"].forEach(function(t){C[t]=function(e){try{g.ready&&(void 0===e?w["__"+t]():w["__"+t](e))}catch(e){if(void 0===w["__"+t])return g.trigger("flashdisabled",[g]);throw e}}}),C}).engineName="flash",i.canPlay=function(e,t){return S.support.flashVideo&&/video\/(mp4|flash|flv)/i.test(e)||S.support.flashVideo&&t.swfHls&&/mpegurl/i.test(e)},S.engines.push(i)},{"../common":1,"../flowplayer":31,"./embed":2,bean:34,"extend-object":39}],4:[function(e,t,n){"use strict";var l,g=e("../flowplayer"),i=g.support,m=g.common,v=g.bean,r=e("./html5-factory");function o(e){return void 0!==window.Hls&&(/mpegurl/.test(e)&&window.Hls.isSupported())}(l=function(d,a){var p,h,s=window.Hls;return r("hlsjs-lite",d,a,o,function(c,u,e){var i=g.extend({recoverMediaError:!0},d.conf.hlsjs,c.hlsjs);d.engine.hls&&d.engine.hls.destroy();var n,r,f=d.engine.hls=new s(i);function o(e){if(d.debug("hlsjs - recovery"),m.removeClass(a,"is-paused"),m.addClass(a,"is-seeking"),v.one(u,"seeked",function(){u.paused&&(m.removeClass(a,"is-poster"),d.poster=!1,u.play()),m.removeClass(a,"is-seeking")}),e)return f.startLoad();var t=performance.now();!n||3e3<t-n?(n=performance.now(),f.recoverMediaError()):(!r||3e3<t-r)&&(r=performance.now(),f.swapAudioCodec(),f.recoverMediaError())}return l.extensions.forEach(function(e){e({hls:f,player:d,root:a,videoTag:u})}),f.loadSource(c.src),e.resume=function(){d.live&&!d.dvr&&(u.currentTime=f.liveSyncPosition||0),u.play()},!(e.seek=function(t){try{d.live||d.dvr?u.currentTime=Math.min(t,f.liveSyncPosition||u.duration-i.livePositionOffset):u.currentTime=t}catch(e){d.debug("Failed to seek to ",t,e)}})===i.bufferWhilePaused&&d.on("pause",function(){f.stopLoad(),d.one("resume",function(){f.startLoad()})}),d.on("quality",function(e,t,n){f.nextLevel=p=n}),f.on(s.Events.MANIFEST_PARSED,function(e,t){var i,r=c.hlsQualities||d.conf.hlsQualities,o={},n=t.levels;if(!1===r)return f.attachMedia(u);if("drive"===r)switch(n.length){case 4:i=[1,2,3];break;case 5:i=[1,2,3,4];break;case 6:i=[1,3,4,5];break;case 7:i=[1,3,5,6];break;case 8:i=[1,3,6,7];break;default:i=n.length<3||n[0].height&&n[2].height&&n[0].height===n[2].height?[]:[1,2]}if(c.qualities=[{value:-1,label:"Auto"}],Array.isArray(r)){var a=r.find(function(e){return-1===e||e.level&&-1===e.level});a?c.qualities[0].label="number"!=typeof a?a.label:c.qualities[0].label:c.qualities=[],i=r.map(function(e){return void 0!==e.level&&(o[e.level]=e.label),void 0!==e.level?e.level:e})}var s=-2;c.qualities=c.qualities.concat(n.map(function(e,t){if(i&&-1===i.indexOf(t))return!1;var n=o[t]||Math.min(e.width,e.height)+"p";return o[t]||"drive"===r||(n+=" ("+Math.round(e.bitrate/1e3)+"k)"),t===p&&(s=t),{value:t,label:n,width:e.width,height:e.height}})).filter(m.identity),d.one("ready",function(){1<c.qualities.length&&(c.width=c.qualities[c.qualities.length-1].width,c.height=c.qualities[c.qualities.length-1].height)});var l=c.quality=-2===s?c.qualities[0].value||-1:s;l!==f.currentLevel&&(f.currentLevel=l),f.attachMedia(u),h&&c.src!==h&&u.play(),h=c.src}),f.on(s.Events.ERROR,function(e,t){if(t.fatal)if(i.recoverNetworkError&&t.type===s.ErrorTypes.NETWORK_ERROR)o(!0);else if(i.recoverMediaError&&t.type===s.ErrorTypes.MEDIA_ERROR)o(!1);else{var n=5;t.type===s.ErrorTypes.NETWORK_ERROR&&(n=2),t.type===s.ErrorTypes.MEDIA_ERROR&&(n=3),f.destroy(),d.trigger("error",[d,{code:n}])}}),d.one("unload",function(){f.destroy()}),{handlers:{error:function(e,t){var n=t.error&&t.error.code;return i.recoverMediaError&&3===n||!n?(e.preventDefault(),o(!1),!0):i.recoverNetworkError&&2===n?(e.preventDefault(),o(!0),!0):void 0}}}})}).canPlay=function(e,t){return!(!1===t.hlsjs||t.clip&&!1===t.clip.hlsjs)&&(!(i.browser.safari&&!(t.clip&&t.clip.hlsjs||t.hlsjs||{}).safari)&&(g.support.video&&o(e)))},l.engineName="hlsjs-lite",l.plugin=function(e){l.extensions.push(e)},l.extensions=[],g.engines.push(l)},{"../flowplayer":31,"./html5-factory":5}],5:[function(e,t,n){var i=e("../flowplayer"),m=i.common,v=i.support,y=i.bean,w=i.extend,r=v.browser.safari&&!v.iOS,b={ended:"finish",pause:"pause",play:"resume",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadedmetadata:r?0:"ready",canplaythrough:r?"ready":0,durationchange:"ready",error:"error",dataunavailable:"error",webkitendfullscreen:!i.support.inlineVideo&&"unload",progress:"buffer"};function I(e,t){return t=t||100,Math.round(e*t)/t}t.exports=function(e,d,p,h,l){var t,c,u,f=m.findDirect("video",p)[0]||m.find(".fp-player > video",p)[0],g=d.conf;return u={engineName:e,pick:function(e){var t=v.video&&e.filter(function(e){return h(e.type)})[0];if(t)return"string"==typeof t.src&&(t.src=m.createAbsoluteUrl(t.src)),t},load:function(e){var t=m.find(".fp-player",p)[0],n=!1;if(f||(f=document.createElement("video"),m.prepend(t,f),f.autoplay=!!g.splash,n=!0),m.addClass(f,"fp-engine"),m.find("track",f).forEach(m.removeNode),f.preload="none",g.nativesubtitles||m.attr(f,"crossorigin",!1),g.disableInline||(f.setAttribute("webkit-playsinline","true"),f.setAttribute("playsinline","true")),v.inlineVideo||m.css(f,{position:"absolute",top:"-9999em"}),v.subtitles&&g.nativesubtitles&&e.subtitles&&e.subtitles.length){m.addClass(f,"native-subtitles");function i(e){var t=f.textTracks;t.length&&(t[0].mode=e)}var r=e.subtitles;r.some(function(e){return!m.isSameDomain(e.src)})&&m.attr(f,"crossorigin","anonymous"),"function"==typeof f.textTracks.addEventListener&&f.textTracks.addEventListener("addtrack",function(){i("disabled"),i("showing")}),r.forEach(function(e){f.appendChild(m.createElement("track",{kind:"subtitles",srclang:e.srclang||"en",label:e.label||"en",src:e.src,default:e.default}))})}y.off(f,"timeupdate",m.noop),y.on(f,"timeupdate",m.noop),m.prop(f,"loop",!1),d.off(".loophack"),(e.loop||g.loop)&&d.on("finish.loophack",function(){d.resume()}),void 0!==c&&(f.volume=c);var o=l(e,f,u);if(g.autoplay||g.splash||e.autoplay){d.debug("Autoplay / Splash setup, try to start video"),f.load();function a(){try{var e=f.play();if(e&&e.catch){var t=function(e){if("AbortError"===e.name&&20===e.code)return n?void 0:f.play().catch(t);if(!g.mutedAutoplay)throw new Error("Unable to autoplay");return d.debug("Play errored, trying muted",e),d.mute(!0,!0),f.play()};e.catch(t).catch(function(){g.autoplay=!1,d.mute(!1,!0),d.trigger("stop",[d])})}}catch(e){d.debug("play() error thrown",e)}}0<f.readyState?a():y.one(f,"canplay",a)}if(u._listeners=function(l,e,c,u){var f=p.getAttribute("data-flowplayer-instance-id");if(l.listeners&&l.listeners.hasOwnProperty(f))return void(l.listeners[f]=c);(l.listeners||(l.listeners={}))[f]=c,y.on(e,"error",function(e){try{h(e.target.getAttribute("type"))&&d.trigger("error",[d,{code:4,video:w(c,{src:l.src,url:l.src})}])}catch(e){}}),d.on("shutdown",function(){y.off(e),y.off(l,".dvrhack"),d.off(".loophack")});function t(e){"metadata"===e.kind&&(e.mode="hidden",e.addEventListener("cuechange",function(){e.activeCues.length&&d.trigger("metadata",[d,e.activeCues[0].value])},!1))}var n={};l&&l.textTracks&&l.textTracks.length&&Array.prototype.forEach.call(l.textTracks,t);l&&l.textTracks&&"function"==typeof l.textTracks.addEventListener&&l.textTracks.addEventListener("addtrack",function(e){t(e.track)},!1);(d.conf.dvr||d.dvr||c.dvr)&&y.on(l,"progress.dvrhack",function(){l.seekable.length&&(d.video.duration=l.seekable.end(null),d.video.seekOffset=l.seekable.start(null),d.trigger("dvrwindow",[d,{start:l.seekable.start(null),end:l.seekable.end(null)}]),l.currentTime>=l.seekable.start(null)||(l.currentTime=l.seekable.start(null)))});return Object.keys(b).forEach(function(a){var s=b[a];if("webkitendfullscreen"===a&&d.conf.disableInline&&(s="unload"),s){function e(e){if(c=l.listeners[f],e.target&&m.hasClass(e.target,"fp-engine")){/progress/.test(s)||d.debug(a,"->",s,e);function t(e){d.trigger(e||s,[d,n])}var n;if((d.ready||/ready|error/.test(s))&&s&&m.find("video",p).length)if("unload"!==s){switch(s){case"ready":if(d.ready&&(d.live||d.dvr)&&(d.video.duration=l.duration),d.ready)return d.debug("Player already ready, not sending duplicate ready event");if(!(l.duration&&l.duration!==1/0||d.live))return d.debug("No duration and VOD setup, not sending ready event");if((n=w(c,{duration:l.duration<Number.MAX_VALUE?l.duration:0,width:l.videoWidth,height:l.videoHeight,url:l.currentSrc})).seekable=n.duration,d.debug("Ready: ",n),d.live||n.duration||v.hlsDuration||"loadeddata"!==a)break;var i=function(){n.duration=l.duration;try{n.seekable=l.seekable&&l.seekable.end(null)}catch(e){}t(),l.removeEventListener("durationchange",i),m.toggleClass(p,"is-live",!1)};l.addEventListener("durationchange",i);var r=function(){d.ready||l.duration||(n.duration=0,m.addClass(p,"is-live"),t()),l.removeEventListener("timeupdate",r)};return void l.addEventListener("timeupdate",r);case"progress":case"seek":if(0<l.currentTime||d.live)n=Math.max(l.currentTime,0);else if("seek"===s&&0===l.currentTime)n=0;else if("progress"==s)return;break;case"buffer":n=[];for(var o=0;o<l.buffered.length;o++)n.push({start:l.buffered.start(o),end:l.buffered.end(o)});l.buffered.length&&l.buffered.end(null)===l.duration&&t("buffered");break;case"speed":n=I(l.playbackRate);break;case"volume":n=I(l.muted?0:l.volume);break;case"error":try{if(u&&u.handlers&&u.handlers.error)if(u.handlers.error(e,l))return;(n=(e.srcElement||e.originalTarget).error).video=w(c,{src:l.src,url:l.src})}catch(e){return}}t()}else d.unload();else"resume"===s&&d.one("ready",function(){setTimeout(function(){t()})})}}p.addEventListener(a,e,!0),n[a]||(n[a]=[]),n[a].push(e)}}),n}(f,m.find("source",f).concat(f),e,o)||u._listeners,!(g.autoplay||g.splash||e.autoplay)){function s(){var e;0<=(e=p.getBoundingClientRect()).top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)+e.height&&e.right<=(window.innerWidth||document.documentElement.clientWidth)+e.width&&(d.debug("player is in viewport, preload"),v.preloadMetadata?f.preload="metadata":f.load(),y.off(document,"scroll.preloadviewport"))}y.off(document,"scroll.preloadviewport"),y.on(document,"scroll.preloadviewport",function(){window.requestAnimationFrame(s)}),s()}},mute:function(e){f.muted=!!e,d.trigger("mute",[d,e]),d.trigger("volume",[d,e?0:f.volume])},pause:function(){f.pause()},resume:function(){f.play()},speed:function(e){f.playbackRate=e},seek:function(e){var t=f.paused||d.finished;try{f.currentTime=e,t&&y.one(f,"seeked",function(){f.pause()})}catch(e){}},volume:function(e){c=e,f&&(f.volume=e)&&u.mute(!1)},unload:function(){y.off(document,"scroll.preloadviewport"),m.find("video.fp-engine",p).forEach(function(e){"MediaSource"in window?e.src=URL.createObjectURL(new MediaSource):e.src="",m.removeNode(e)}),t=clearInterval(t);var e=p.getAttribute("data-flowplayer-instance-id");delete f.listeners[e],f=0,u._listeners&&Object.keys(u._listeners).forEach(function(t){u._listeners[t].forEach(function(e){p.removeEventListener(t,e,!0)})})}}}},{"../flowplayer":31}],6:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=r.common,a=e("./html5-factory"),s=document.createElement("video");function l(e){var t;return/^(video|application)/i.test(e)||(e=/mpegurl/i.test(t=e)?"application/x-mpegurl":t),!!s.canPlayType(e).replace("no","")}(i=function(e,t){return a("html5",e,t,l,function(e,t){t.currentSrc!==e.src?(o.find("source",t).forEach(o.removeNode),t.src=e.src,t.type=e.type):e.autoplay&&t.load()})}).canPlay=function(e){return r.support.video&&l(e)},i.engineName="html5",r.engines.push(i)},{"../flowplayer":31,"./html5-factory":5}],7:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean"),a=window.jQuery;i(function(e,i){e.on("ready",function(){var t=r.find("video.fp-engine",i)[0];t&&(t.setAttribute("x-webkit-airplay","allow"),window.WebKitPlaybackTargetAvailabilityEvent&&(t.addEventListener("webkitplaybacktargetavailabilitychanged",function(e){if("available"===e.availability){var t=r.find(".fp-header",i)[0];r.find(".fp-airplay",t).forEach(r.removeNode);var n=r.createElement("a",{class:"fp-airplay fp-icon",title:"Play on AirPlay device"});t.insertBefore(n,r.find(".fp-fullscreen",t)[0])}}),t.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",function(){var e=r.find(".fp-airplay",i)[0];e&&r.toggleClass(e,"fp-active",t.webkitCurrentPlaybackTargetIsWireless)}),e.one("progress",function(){a(i).find(".fp-airplay").toggle("html5"==e.engine.engineName)})))}),o.on(i,"click",".fp-airplay",function(e){e.preventDefault(),r.find("video.fp-engine",i)[0].webkitShowPlaybackTargetPicker()})})},{"../common":1,"../flowplayer":31,bean:34}],8:[function(e,t,n){"use strict";var i=e("../flowplayer"),l=e("./resolve").TYPE_RE,c=e("scriptjs"),u=e("bean");i(function(i,r){var o,t=i.conf.analytics,a=0,e=0;if(t){"undefined"==typeof _gat&&c("//google-analytics.com/ga.js");var s=function(){var e=_gat._getTracker(t);return e._setAllowLinker(!0),e},n=function(e,t,n){n=n||i.video,a&&"undefined"!=typeof _gat&&(s()._trackEvent("Video / Seconds played",i.engine.engineName+"/"+n.type,n.title||r.getAttribute("title")||n.src.split("/").slice(-1)[0].replace(l,""),Math.round(a/1e3)),a=0,o&&(clearTimeout(o),o=null))};i.bind("load unload",n).bind("progress",function(){i.seeking||(a+=e?new Date-e:0,e=+new Date),o=o||setTimeout(function(){o=null,s()._trackEvent("Flowplayer heartbeat","Heartbeat","",0,!0)},6e5)}).bind("pause",function(){e=0}),i.bind("shutdown",function(){u.off(window,"unload",n)}),u.on(window,"unload",n)}})},{"../flowplayer":31,"./resolve":21,bean:34,scriptjs:45}],9:[function(e,t,n){"use strict";var i=e("../flowplayer"),g=e("../common"),m=e("bean"),v=e("scriptjs");i(function(r,o){if(!1!==r.conf.chromecast){v("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"),window.__onGCastApiAvailable=function(e){var t,n,i;e&&(t=c.applicationId||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,n=new chrome.cast.SessionRequest(t),i=new chrome.cast.ApiConfig(n,u,f),chrome.cast.initialize(i,d,p))};var a,s,l,c=r.conf.chromecast||{};m.on(o,"click",".fp-chromecast",function(e){if(e.preventDefault(),a)return r.trigger("pause",[r]),a.stop(),a=null,void h();r.playing&&r.pause(),chrome.cast.requestSession(function(e){var t=(a=e).receiver.friendlyName;g.html(g.find(".fp-chromecast-engine-status")[0],"Playing on device "+t);var n=new chrome.cast.media.MediaInfo(r.video.src),i=new chrome.cast.media.LoadRequest(n);a.loadMedia(i,function(n){n.addUpdateListener(function(e){if(a){s=s||setInterval(function(){r.trigger("progress",[r,n.getEstimatedTime()])},500),e?(g.toggleClass(o,"is-chromecast",!0),g.toggleClass(l,"fp-active",!0),r.hijack({pause:function(){n.pause()},resume:function(){n.play()},seek:function(e){var t=new chrome.cast.media.SeekRequest;t.currentTime=e,n.seek(t)}})):(h(),r.trigger("finish",[r]));var t=n.playerState;r.paused&&t===chrome.cast.media.PlayerState.PLAYING&&r.trigger("resume",[r]),r.playing&&t===chrome.cast.media.PlayerState.PAUSED&&r.trigger("pause",[r]),g.toggleClass(o,"is-loading",t===chrome.cast.media.PlayerState.BUFFERING)}})},function(){})},function(e){console.error("requestSession error",e)})})}function u(){console.log("sessionListener")}function f(e){e===chrome.cast.ReceiverAvailability.AVAILABLE&&function(){var e=g.find(".fp-header",o)[0];if(!e)return;g.find(".fp-chromecast",e).forEach(g.removeNode),g.find(".fp-chromecast-engine",o).forEach(g.removeNode),l=g.createElement("a",{class:"fp-chromecast fp-icon",title:"Play on Cast device"}),e.insertBefore(l,g.find(".fp-fullscreen",e)[0]);var t=g.createElement("div",{class:"fp-chromecast-engine"}),n=g.createElement("p",{class:"fp-chromecast-engine-status"}),i=g.createElement("p",{class:"fp-chromecast-engine-icon"});t.appendChild(i),t.appendChild(n);var r=g.find(".fp-engine",o)[0];r?r.parentNode.insertBefore(t,r):g.prepend(g.find(".fp-player",o)[0]||o,t)}()}function d(){}function p(){console.log("onError")}function h(){clearInterval(s),s=null,r.release(),g.toggleClass(o,"is-chromecast",!1),g.toggleClass(l,"fp-active",!1)}})},{"../common":1,"../flowplayer":31,bean:34,scriptjs:45}],10:[function(e,t,n){"use strict";var i=e("../flowplayer"),f=e("../common"),d=e("bean");i(function(a,s){var t=/ ?cue\d+ ?/,r=!1;function i(e){s.className=s.className.replace(t," "),0<=e&&f.addClass(s,"cue"+e)}function o(e){i(e.index),a.trigger("cuepoint",[a,e])}var l={},c=-.125;function u(e){var t=e&&!isNaN(e.time)?e.time:e;return t<0&&(t=a.video.duration+t),.125*Math.round(t/.125)}a.on("progress",function(e,t,n){if(!r)for(var i=u(n);c<i;)l[c+=.125]&&l[c].forEach(o)}).on("unload",i).on("beforeseek",function(e){setTimeout(function(){e.defaultPrevented||(r=!0)})}).on("seek",function(e,t,n){i(),c=u(n||0)-.125,r=!1,!n&&l[0]&&l[0].forEach(o)}).on("ready",function(e,t,n){c=-.125;var i=n.cuepoints||a.conf.cuepoints||[];a.setCuepoints(i)}).on("finish",function(){for(var e=u(a.video.duration);c<e;)l[c+=.125]&&l[c].forEach(o);c=-.125}),a.conf.generate_cuepoints&&a.bind("load",function(){f.find(".fp-cuepoint",s).forEach(f.removeNode)}),a.setCuepoints=function(e){return a.cuepoints=[],l={},e.forEach(a.addCuepoint),a},a.addCuepoint=function(e){a.cuepoints||(a.cuepoints=[]),"number"==typeof e&&(e={time:e}),e.index=0;var t=u(e);if(l[t]||(l[t]=[]),l[t].push(e),a.cuepoints.length&&(e.index=Math.max.apply(null,a.cuepoints.map(function(e){return e.index}))+1),a.cuepoints.push(e),a.conf.generate_cuepoints&&!1!==e.visible){var n=a.video.duration,i=f.find(".fp-timeline",s)[0];f.css(i,"overflow","visible");var r=e.time||e;r<0&&(r=n+r);var o=f.createElement("a",{className:"fp-cuepoint fp-cuepoint"+e.index});f.css(o,"left",r/n*100+"%"),i.appendChild(o),d.on(o,"mousedown",function(e){e.preventDefault(),e.stopPropagation(),a.seek(r)})}return a},a.removeCuepoint=function(t){"number"==typeof t&&(t=a.cuepoints.filter(function(e){return e.index===t})[0]);var e=a.cuepoints.indexOf(t),n=u(t);if(-1!==e){a.cuepoints=a.cuepoints.slice(0,e).concat(a.cuepoints.slice(e+1));var i=f.find(".fp-timeline",s)[0];f.find(".fp-cuepoint"+t.index,i).forEach(f.removeNode);var r=l[n].indexOf(t);if(-1!==r)return l[n]=l[n].slice(0,r).concat(l[n].slice(r+1)),a}}})},{"../common":1,"../flowplayer":31,bean:34}],11:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("bean"),l=e("../common"),o=e("./util/clipboard");i(function(a,s){if(!1!==a.conf.embed&&!1!==a.conf.share){var e=l.find(".fp-share-menu",s)[0],t=l.createElement("a",{class:"fp-icon fp-embed",title:"Copy to your site"},"Embed");l.append(e,t),a.embedCode=function(){var e=a.conf.embed||{},t=a.video,n=e.width||t.width||l.width(s),i=e.height||t.height||l.height(s),r=a.conf.ratio,o='<iframe src="'+a.shareUrl(!0)+'" allowfullscreen style="border:none;';return e.width||e.height?(isNaN(n)||(n+="px"),isNaN(i)||(i+="px"),o+"width:"+n+";height:"+i+';"></iframe>'):(r&&!a.conf.adaptiveRatio||(r=i/n),'<div style="position:relative;width:100%;display:inline-block;">'+o+'position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top:'+100*r+'%;"></div></div>')},r.on(s,"click",".fp-embed",function(){o(a.embedCode(),function(){a.message("The embed code is now on your clipboard",2e3)},function(){a.textarea(a.embedCode(),"Copy the code below to embed your video")})})}})},{"../common":1,"../flowplayer":31,"./util/clipboard":30,bean:34}],12:[function(e,t,n){"use strict";t.exports=function(o,s){s=s||document.createElement("div");function n(n,i,r){var o=n.split(".")[0],a=function(e){r&&(s.removeEventListener(o,a),l[n].splice(l[n].indexOf(a),1));var t=[e].concat(c[e.timeStamp+e.type]||[]);i&&i.apply(void 0,t)};s.addEventListener(o,a),l[n]||(l[n]=[]),l[n].push(a)}var l={},c={};o.on=o.bind=function(e,t){return e.split(" ").forEach(function(e){n(e,t)}),o},o.one=function(e,t){return e.split(" ").forEach(function(e){n(e,t,!0)}),o};o.off=o.unbind=function(e){return e.split(" ").forEach(function(e){var i=e.split(".").slice(1),r=e.split(".")[0];Object.keys(l).filter(function(e){var t,n=e.split(".").slice(1);return(!r||0===e.indexOf(r))&&(t=n,0===i.filter(function(e){return-1===t.indexOf(e)}).length)}).forEach(function(e){var t=l[e],n=e.split(".")[0];l[e]=t.filter(function(e){return s.removeEventListener(n,e),!1})})}),o},o.trigger=function(e,t,n){if(e){t=(t||[]).length?t||[]:[t];var i,r=document.createEvent("Event");return i=e.type||e,r.initEvent(i,!1,!0),Object.defineProperty&&(r.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}),c[r.timeStamp+r.type]=t,s.dispatchEvent(r),n?r:o}}},t.exports.EVENTS=["beforeseek","disable","error","finish","fullscreen","fullscreen-exit","load","mute","pause","progress","ready","resume","seek","speed","stop","unload","volume","boot","shutdown"]},{}],13:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),a=e("bean");i(function(e,t){var o=e.conf;if(!1!==o.share&&o.facebook){e.facebook=function(){var e,t,n=screen.height,i=screen.width,r="string"==typeof o.facebook?o.facebook:window.location.toString();e=Math.round(i/2-275),t=0,420<n&&(t=Math.round(n/2-210)),window.open("https://www.facebook.com/sharer.php?s=100&p[url]="+encodeURIComponent(r),"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+e+",top="+t)};var n=r.find(".fp-share-menu",t)[0],i=r.createElement("a",{class:"fp-icon fp-facebook"},"Facebook");r.append(n,i),a.on(t,"click",".fp-facebook",function(){e.facebook()})}})},{"../common":1,"../flowplayer":31,bean:34}],14:[function(e,t,n){"use strict";var s,i=e("../flowplayer"),r=e("bean"),l=e("../common"),c="fullscreen",u="fullscreen-exit",f=i.support.fullscreen;r.on(document,"fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr",function(e){var t=document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||document.msFullscreenElement;if(s||t.parentNode&&t.parentNode.getAttribute("data-flowplayer-instance-id")){var n=s||i(t.parentNode);s=t?n.trigger(c,[n]):(s.trigger(u,[s]),null)}}),i(function(t,n){var i=l.createElement("div",{className:"fp-player"});if(Array.prototype.map.call(n.children,l.identity).forEach(function(e){l.matches(e,".fp-ratio,script")||i.appendChild(e)}),n.appendChild(i),t.conf.fullscreen){var r,o,e,a=window;t.isFullscreen=!1,t.fullscreen=function(e){if(!t.disabled)return void 0===e&&(e=!t.isFullscreen),e&&(r=a.scrollY,o=a.scrollX),f?e?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){"function"==typeof i[e]&&(i[e](Element.ALLOW_KEYBOARD_INPUT),"webkitRequestFullScreen"!==e||document.webkitFullscreenElement||i[e]())}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){"function"==typeof document[e]&&document[e]()}):t.trigger(e?c:u,[t]),t},t.on("mousedown.fs",function(){new Date-e<150&&t.ready&&t.fullscreen(),e=+new Date}),t.on(c,function(){l.addClass(n,"is-fullscreen"),l.toggleClass(n,"fp-minimal-fullscreen",l.hasClass(n,"fp-minimal")),l.removeClass(n,"fp-minimal"),f||l.css(n,"position","fixed"),t.isFullscreen=!0}).on(u,function(){var e;l.toggleClass(n,"fp-minimal",l.hasClass(n,"fp-minimal-fullscreen")),l.removeClass(n,"fp-minimal-fullscreen"),f||"html5"!==t.engine||(e=n.css("opacity")||"",l.css(n,"opacity",0)),f||l.css(n,"position",""),l.removeClass(n,"is-fullscreen"),f||"html5"!==t.engine||setTimeout(function(){n.css("opacity",e)}),t.isFullscreen=!1,a.scrollTo(o,r)}).on("unload",function(){t.isFullscreen&&t.fullscreen()}),t.on("shutdown",function(){s=null,l.removeNode(i)})}})},{"../common":1,"../flowplayer":31,bean:34}],15:[function(e,t,n){"use strict";var l,c,i=e("../flowplayer"),r=e("bean"),u=e("../common");i(function(t,n){t.conf.keyboard&&(r.on(document,"keydown.fp",function(e){if(void 0!==l){var t=l,n=!!t&&c,i=t&&!t.disabled?t:0,r=e.ctrlKey||e.metaKey||e.altKey,o=e.which,a=i&&i.conf;if(!u.hasClass(n,"no-controlbar")&&!u.hasClass(n,"is-cva")&&i&&a.keyboard&&!i.disabled){if(-1!=[63,187,191].indexOf(o))return u.toggleClass(n,"is-help"),!1;if(27==o&&u.hasClass(n,"is-help"))return u.toggleClass(n,"is-help"),!1;if(!r&&i.ready){if(e.preventDefault(),e.shiftKey)return void(39==o?i.speed(!0):37==o?i.speed(!1):78==o?i.next():80==o&&i.prev());if(o<58&&47<o)return i.seekTo(o-48);switch(o){case 38:case 75:i.volume(i.volumeLevel+.15);break;case 40:case 74:i.volume(i.volumeLevel-.15);break;case 39:case 76:i.seeking=!0,i.seek(t.video.time+5);break;case 37:case 72:i.seeking=!0,i.seek(t.video.time-5);break;case 190:i.seekTo();break;case 32:i.toggle();break;case 70:a.fullscreen&&i.fullscreen();break;case 77:i.mute();break;case 81:i.unload();break;case 67:if(!t.video.subtitles||0==t.video.subtitles.length)break;var s=n.querySelector(".fp-dropdown li.active[data-subtitle-index]").dataset.subtitleIndex;void 0===s&&(s=-1),++s>t.video.subtitles.length-1&&(s=-1),t.trigger("subtitles-switched",[s])}}}}}),r.on(n,"mouseenter mouseleave",function(e){(l=t.disabled||"mouseover"!=e.type?0:t)&&(c=n)}))})},{"../common":1,"../flowplayer":31,bean:34}],16:[function(e,t,n){var i=e("../flowplayer"),l=e("../common"),c=e("bean");i(function(a,s){a.showMenu=function(e,t){var n=l.find(".fp-ui",s)[0];l.toggleClass(e,"fp-active",!0),setTimeout(function(){c.one(document,"click",function(){a.hideMenu(e)})});var i=t;if(t&&t.tagName&&(i={left:l.offset(t).left,rightFallbackOffset:l.width(t),top:l.offset(t).top+l.height(t)}),!i)return l.css(e,"top","auto");i.rightFallbackOffset=i.rightFallbackOffset||0;var r=i.top-l.offset(n).top,o=i.left-l.offset(n).left;l.width(e)+o>l.width(n)&&(o=o-l.width(e)+i.rightFallbackOffset),l.height(e)+r>l.height(n)&&(r-=l.height(e)),l.css(e,{top:r+"px",left:o+"px",right:"auto"})},a.hideMenu=function(e){l.toggleClass(e,"fp-active",!1),l.css(e,{top:"-9999em"})}})},{"../common":1,"../flowplayer":31,bean:34}],17:[function(e,t,n){var i=e("../flowplayer"),l=e("../common"),r=e("bean");i(function(e,t){var a=l.find(".fp-header",t)[0],s=l.find(".fp-ui",t)[0];e.message=function(e,t){function n(){l.toggleClass(o,"fp-shown"),setTimeout(function(){var e;e=o,l.removeNode(e)},500)}var i,r,o=(i=e,r=l.createElement("div",{className:"fp-message"},i),s.insertBefore(r,a),setTimeout(function(){l.toggleClass(r,"fp-shown")}),r);return t&&setTimeout(n,t),n},e.textarea=function(e){var t=document.createElement("textarea");t.value=e,t.className="fp-textarea",s.appendChild(t),r.on(document,"click.fptextarea",function(e){if(e.target===t)return t.select();e.stopPropagation(),e.preventDefault(),l.removeNode(t),r.off(document,"click.fptextarea")})}})},{"../common":1,"../flowplayer":31,bean:34}],18:[function(e,t,n){"use strict";var i=e("../flowplayer"),p=/IEMobile/.test(window.navigator.userAgent),h=e("../common"),g=e("bean"),m=e("./ui").format,v=i.support,y=window.navigator.userAgent;(v.touch||p)&&i(function(n,i){var e=v.android,t=e&&!e.firefox,r=/Silk/.test(y),o=e.version||0;if(t&&!p){if(!/Chrome/.test(y)&&o<4||e.samsung&&o<5){var a=n.load;n.load=function(){var e=a.apply(n,arguments);return h.find("video.fp-engine",i)[0].load(),n.trigger("ready",[n,n.video]),e}}var s,l=0,c=function(e){s=setInterval(function(){e.video.time=++l,e.trigger("progress",[e,l])},1e3)};n.on("ready pause unload",function(){s&&(clearInterval(s),s=null)}),n.on("ready",function(){l=0}),n.on("resume",function(e,t){if(t.live)return l?c(t):void n.one("progress",function(e,t,n){0===n&&c(t)})})}v.volume||(h.removeClass(i,"fp-mute"),h.addClass(i,"no-volume")),v.iOS&&h.addClass(i,"fp-mute"),h.addClass(i,"is-touch"),n.sliders&&n.sliders.timeline&&n.sliders.timeline.disableAnimation();var u=!1;g.on(i,"touchmove",function(){u=!0});var f=!0;if(g.on(i,"touchend click",function(e){if(u)u=!1;else{var t=h.find("video.fp-engine",i)[0];if(f&&n.conf.clickToUnMute&&t&&t.muted&&n.conf.autoplay&&(t.muted=!1),f=!1,n.playing&&!h.hasClass(i,"is-mouseover"))return h.addClass(i,"is-mouseover"),h.removeClass(i,"is-mouseout"),e.preventDefault(),void e.stopPropagation();n.playing||n.splash||!h.hasClass(i,"is-mouseout")||h.hasClass(i,"is-mouseover")||setTimeout(function(){n.disabled||n.playing||n.splash||h.find("video.fp-engine",i)[0].play()},400)}}),!v.fullscreen&&n.conf.native_fullscreen&&"function"==typeof h.createElement("video").webkitEnterFullScreen){var d=n.fullscreen;n.fullscreen=function(){var e=h.find("video.fp-engine",i)[0];if(!e)return d.apply(n);n.trigger("fullscreen",[n]),g.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement===e&&(g.off(document,".nativefullscreen"),g.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement||(g.off(document,".nativefullscreen"),n.trigger("fullscreen-exit",[n]))}))}),e.webkitEnterFullScreen(),g.one(e,"webkitendfullscreen",function(){g.off(document,"fullscreenchange.nativefullscreen"),n.trigger("fullscreen-exit",[n]),h.prop(e,"controls",!0),h.prop(e,"controls",!1)})}}(t||r)&&n.bind("ready",function(){var t=h.find("video.fp-engine",i)[0];n.conf.splash&&t.paused&&"hlsjs-lite"!==n.engine.engineName&&(g.one(t,"canplay",function(){t.play()}),t.load()),n.bind("progress.dur",function(){if(!n.live&&!n.conf.live){var e=t.duration;1!==e&&(n.video.duration=e,h.find(".fp-duration",i)[0].innerHTML=m(e),n.unbind("progress.dur"))}})})})},{"../common":1,"../flowplayer":31,"./ui":27,bean:34}],19:[function(e,t,n){"use strict";var i=e("../flowplayer"),o=e("extend-object"),a=e("bean"),g=e("../common"),s=e("./resolve"),l=new s,m=window.jQuery,v=/^#/;i(function(c,u){var f=o({active:"is-active",advance:!0,query:".fp-playlist a"},c.conf),d=f.active,t=g.find(".fp-ui",u)[0],e=g.hasClass(u,"fp-custom-playlist")||!!f.customPlaylist;function n(){return g.find(f.query,p())}function p(){if(!v.test(f.query))return u}function h(){return g.find(f.query+"."+d,p())}function i(){var i=g.find(".fp-playlist",u)[0];if(!i){i=g.createElement("div",{className:"fp-playlist"});var e=g.find(".fp-next,.fp-prev",u);e.length?e[0].parentElement.insertBefore(i,e[0]):g.insertAfter(u,g.find("video",u)[0],i)}i.innerHTML="",c.conf.playlist[0].length&&(c.conf.playlist=c.conf.playlist.map(function(e){if("string"!=typeof e)return{sources:e.map(function(t){var n={};return Object.keys(t).forEach(function(e){n.type=/mpegurl/i.test(e)?"application/x-mpegurl":"video/"+e,n.src=t[e]}),n})};var t=e.split(s.TYPE_RE)[1];return{sources:[{type:"m3u8"===t.toLowerCase()?"application/x-mpegurl":"video/"+t,src:e}]}})),c.conf.playlist.forEach(function(e,t){var n=e.sources[0].src;i.appendChild(g.createElement("a",{href:n,className:c.video.index===t?d:void 0,"data-index":t}))})}g.toggleClass(u,"fp-custom-playlist",e),g.toggleClass(u,"fp-default-playlist",!e),c.play=function(e){if(void 0===e)return c.resume();if("number"==typeof e&&!c.conf.playlist[e])return c;if("number"!=typeof e)return c.load.apply(null,arguments);var t=o({index:e},c.conf.playlist[e]);return c.off("beforeresume.fromfirst"),"number"==typeof e&&e===c.video.index?c.seek(0,function(){c.resume()}):(c.load(t,function(){c.video.index=e}),c)},c.next=function(e){e&&e.preventDefault();var t=c.video.index;return-1!=t&&(t=t===c.conf.playlist.length-1?0:t+1,c.play(t)),c},c.prev=function(e){e&&e.preventDefault();var t=c.video.index;return-1!=t&&(t=0===t?c.conf.playlist.length-1:t-1,c.play(t)),c},c.setPlaylist=function(e,t){return c.conf.playlist=e,t||delete c.video.index,i(),c},c.addPlaylistItem=function(e){return delete c.video.is_last,c.setPlaylist(c.conf.playlist.concat([e]),!0)},c.removePlaylistItem=function(e){var t=c.conf.playlist;return c.setPlaylist(t.slice(0,e).concat(t.slice(e+1)))},a.on(u,"click",".fp-next",c.next),a.on(u,"click",".fp-prev",c.prev),c.off("finish.pl").on("finish.pl",function(e,t){if(void 0===t.conf.advance||t.conf.advance){if(t.video.loop)return t.seek(0,function(){t.resume()});var n=0<=t.video.index?t.video.index+1:void 0;n<t.conf.playlist.length||f.loop?(n=n===t.conf.playlist.length?0:n,g.removeClass(u,"is-finished"),setTimeout(function(){t.play(n)})):1<t.conf.playlist.length&&(t.one("beforeresume.fromfirst",function(e){e.preventDefault(),t.play(0)}),t.one("seek",function(){t.off("beforeresume.fromfirst")}))}});var r=!1;c.conf.playlist.length&&(r=!0,i(),c.conf.clip&&c.conf.clip.sources.length||(c.conf.clip=c.conf.playlist[c.conf.startIndex||0])),n().length&&!r&&(c.conf.playlist=[],delete c.conf.startIndex,n().forEach(function(e){var t=e.href;e.setAttribute("data-index",c.conf.playlist.length);var n=l.resolve(t,c.conf.clip.sources);m&&o(n,m(e).data()),c.conf.playlist.push(n)})),g.find(".fp-prev,.fp-next,.fp-playlist",u).forEach(function(e){t.appendChild(e)}),a.on(v.test(f.query)?document:u,"click",f.query,function(e){e.preventDefault();var t=e.currentTarget,n=Number(t.getAttribute("data-index"));-1!=n&&c.play(n)}),c.on("load",function(e,t,n){if(c.conf.playlist.length){var i,r=h()[0],o=r&&r.getAttribute("data-index"),a=n.index=void 0!==(i=n).index?i.index:void 0!==c.video.index?c.video.index:c.conf.startIndex||0,s=g.find(f.query+'[data-index="'+a+'"]',p())[0],l=a==c.conf.playlist.length-1;r&&g.removeClass(r,d),s&&g.addClass(s,d),g.removeClass(u,"video"+o),g.addClass(u,"video"+a),g.toggleClass(u,"last-video",l),n.index=t.video.index=a,n.is_last=t.video.is_last=l}}).on("unload.pl",function(){c.conf.playlist.length&&(h().forEach(function(e){g.toggleClass(e,d)}),c.conf.playlist.forEach(function(e,t){g.removeClass(u,"video"+t)}),delete c.video.index)}),c.conf.playlist.length&&(c.conf.loop=!1)})},{"../common":1,"../flowplayer":31,"./resolve":21,bean:34,"extend-object":39}],20:[function(e,t,n){var i=e("../flowplayer"),s=e("../common"),l=e("bean");i(function(n,i){var r=s.find(".fp-ui",i)[0],o=s.find(".fp-controls",r)[0];function a(t){s.find(".fp-qsel-menu a",i).forEach(function(e){s.toggleClass(e,"fp-selected",e.getAttribute("data-quality")==t),s.toggleClass(e,"fp-color",e.getAttribute("data-quality")==t)})}l.on(i,"click",".fp-qsel",function(){var e=s.find(".fp-qsel-menu",i)[0];s.hasClass(e,"fp-active")?n.hideMenu():n.showMenu(e)}),l.on(i,"click",".fp-qsel-menu a",function(e){var t=e.target.getAttribute("data-quality");n.quality(t)}),n.quality=function(e){e=isNaN(Number(e))?e:Number(e),n.trigger("quality",[n,e])},n.on("quality",function(e,t,n){a(n,t.video.qualities)}),n.on("ready",function(e,t,n){s.find(".fp-qsel-menu",i).forEach(s.removeNode),s.find(".fp-qsel",i).forEach(s.removeNode),!n.qualities||n.qualities.filter(function(e){return void 0===e.value||-1<e.value}).length<2||(function(e){o.appendChild(s.createElement("strong",{className:"fp-qsel"},"HD"));var i=s.createElement("div",{className:"fp-menu fp-qsel-menu"},"<strong>Quality</strong>");e.forEach(function(e){var t=document.createElement("a"),n=void 0!==e.value?e.value:e;t.setAttribute("data-quality",n),t.innerHTML=e.label||e,i.appendChild(t)}),r.appendChild(i)}(n.qualities,n.quality),a(n.quality,n.qualities))})})},{"../common":1,"../flowplayer":31,bean:34}],21:[function(e,t,n){"use strict";var r=/\.(\w{3,4})(\?.*)?$/i,o=e("extend-object");function i(e){var t=e.attr("src"),n=e.attr("type")||"",i=t.split(r)[1];return n=n.toLowerCase(),o(e.data(),{src:t,suffix:i||n,type:n||i})}t.exports=function(){this.sourcesFromVideoTag=function(e,t){var n=[];return t("source",e).each(function(){n.push(i(t(this)))}),!n.length&&e.length&&n.push(i(e)),n},this.resolve=function(n,e){return n?("string"==typeof n&&((n={src:n,sources:[]}).sources=(e||[]).map(function(e){var t=e.src.split(r)[1];return{type:e.type,src:n.src.replace(r,"."+t+"$2")}})),n instanceof Array&&(n={sources:n.map(function(i){return i.type&&i.src?i:Object.keys(i).reduce(function(e,t){return o(e,{type:/mpegurl/i.test(n=t)?"application/x-mpegurl":"video/"+n,src:i[t]});var n},{})})}),n):{sources:e}}},t.exports.TYPE_RE=r},{"extend-object":39}],22:[function(e,t,n){"use strict";var i=e("../flowplayer"),o=e("../common"),a=e("extend-object"),s=e("bean");i(function(t,e){var n=t.conf;if(!1!==n.share){t.shareUrl=function(e){return e&&n.embed&&n.embed.iframe?n.embed.iframe:"string"==typeof t.conf.share?t.conf.share:(e?"https://flowplayer.com/e/":"https://flowplayer.com/s/")+"?t="+encodeURIComponent(t.video.title||(o.find("title")[0]||{}).innerHTML||"Flowplayer video")+"&c="+encodeURIComponent(btoa(JSON.stringify(a({},t.conf,t.extensions)).replace(/[\u007F-\uFFFF]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)})))+"&r="+encodeURIComponent(window.location.toString())};var i=o.createElement("div",{className:"fp-menu fp-share-menu"},"<strong>Share</strong>");o.find(".fp-ui",e)[0].appendChild(i);var r=o.find(".fp-share",e)[0];s.on(e,"click",".fp-share",function(e){e.preventDefault(),o.hasClass(i,"fp-active")?t.hideMenu():t.showMenu(i,r)})}else o.find(".fp-share",e).forEach(o.removeNode)})},{"../common":1,"../flowplayer":31,bean:34,"extend-object":39}],23:[function(e,t,n){"use strict";var d=e("../flowplayer"),p=e("../common"),h=e("bean"),i=e("./subtitles/parser");d.defaults.subtitleParser=i,d(function(r,o){var a,s,n,l,i,c=!1;function e(e,i,r){c&&(i.cuepoints||[]).forEach(function(e,t){var n=e.subtitle;n&&a!=t&&r>=e.time&&(!n.endTime||r<=n.endTime)&&i.trigger("cuepoint",[i,e])})}d.support.inlineVideo&&(d.support.fullscreen||!r.conf.native_fullscreen)||(r.conf.nativesubtitles=!0),r.ui||(r.ui={}),r.ui.createSubtitleControl=function(e,t){return i=t,n=n||p.createElement("strong",{className:"fp-cc"},"CC"),l=l||p.createElement("div",{className:"fp-menu fp-subtitle-menu"},"<strong>Closed Captions</strong>"),p.find("a",l).forEach(p.removeNode),l.appendChild(p.createElement("a",{"data-subtitle-index":-1},"No subtitles")),(e||[]).forEach(function(e,t){var n=e.srclang||"en",i=e.label||"Default ("+n+")",r=p.createElement("a",{"data-subtitle-index":t},i);l.appendChild(r)}),p.find(".fp-ui",o)[0].appendChild(l),p.find(".fp-controls",o)[0].appendChild(n),p.toggleClass(n,"fp-hidden",!e||!e.length),n},r.ui.setActiveSubtitleItem=function(e){f(e)},h.on(o,"click",".fp-cc",function(){p.hasClass(l,"fp-active")?r.hideMenu():r.showMenu(l)}),h.on(o,"click",".fp-subtitle-menu [data-subtitle-index]",function(e){e.preventDefault();var t=e.target.getAttribute("data-subtitle-index");return i?i(t):"-1"===t?r.disableSubtitles():void r.loadSubtitles(t)});r.on("ready",function(e,t,n){if(t.subtitles=[],s=(s=p.find(".fp-captions",o)[0])||p.appendTo(p.createElement("div",{class:"fp-captions"}),p.find(".fp-player",o)[0]),Array.prototype.forEach.call(s.children,p.removeNode),r.ui.createSubtitleControl(r.video.subtitles),p.removeClass(o,"has-menu"),r.disableSubtitles(),n.subtitles&&n.subtitles.length){var i=n.subtitles.filter(function(e){return e.default})[0];i&&t.loadSubtitles(n.subtitles.indexOf(i))}}),r.showSubtitle=function(e){p.html(s,e),p.addClass(s,"fp-shown")},r.hideSubtitle=function(){p.removeClass(s,"fp-shown")},r.bind("cuepoint",function(e,t,n){c=!1,n.subtitle?(a=n.index,r.showSubtitle(n.subtitle.text)):n.subtitleEnd&&(r.hideSubtitle(),a=n.index)}),r.bind("seek",function(e,t,i){a&&r.cuepoints[a]&&r.cuepoints[a].time>i&&(p.removeClass(s,"fp-shown"),a=null),(r.cuepoints||[]).forEach(function(e,t){var n=e.subtitle;n&&a!=t?i>=e.time&&(!n.endTime||i<=n.endTime)&&r.trigger("cuepoint",[r,e]):e.subtitleEnd&&i>=e.time&&t==a+1&&r.trigger("cuepoint",[r,e])})}),r.on("unload",function(){p.find(".fp-captions",o).forEach(p.removeNode)});function u(e,t){var n=p.find("video.fp-engine",o)[0].textTracks;n.length&&(null===e?[].forEach.call(n,function(e){e.mode=t}):n[e].mode=t)}var f=function(e){p.toggleClass(p.find("a.fp-selected",l)[0],"fp-selected"),p.toggleClass(p.find('a[data-subtitle-index="'+e+'"]',l)[0],"fp-selected")};r.disableSubtitles=function(){return r.subtitles=[],(r.cuepoints||[]).forEach(function(e){(e.subtitle||e.subtitleEnd)&&r.removeCuepoint(e)}),s&&Array.prototype.forEach.call(s.children,p.removeNode),f(-1),d.support.subtitles&&r.conf.nativesubtitles&&"html5"==r.engine.engineName&&u(null,"disabled"),r},r.loadSubtitles=function(e){r.disableSubtitles();var t=r.video.subtitles[e].src;if(t){if(f(e),!d.support.subtitles||!r.conf.nativesubtitles||"html5"!=r.engine.engineName)return p.xhrGet(t,function(e){r.conf.subtitleParser(e).forEach(function(e,t){e.title||(e.title="subtitle"+t);var n={time:e.startTime,subtitle:e,visible:!1};r.subtitles.push(e),r.addCuepoint(n),r.addCuepoint({time:e.endTime,subtitleEnd:e.title,visible:!1}),0!==e.startTime||r.video.time||r.splash||r.trigger("cuepoint",[r,d.extend({},n,{index:0})]),r.splash&&r.one("ready",function(){r.trigger("cuepoint",[r,n])})})},function(){return r.trigger("error-subtitles",[r,{code:8,url:t}]),!1}),r;u(e,"showing")}},h.on(o,"click",".fp-subtitle-menu a[data-subtitle-index]",function(){-1<this.dataset.subtitleIndex&&(c=!0,r.on("progress",e))})})},{"../common":1,"../flowplayer":31,"./subtitles/parser":24,bean:34}],24:[function(e,t,n){t.exports=function(e){var t=/^(([0-9]+:){1,2}[0-9]{2}[,.][0-9]{3}) --\> (([0-9]+:){1,2}[0-9]{2}[,.][0-9]{3})(.*)/;function n(e){var t=e.split(":");return 2==t.length&&t.unshift(0),60*t[0]*60+60*t[1]+parseFloat(t[2].replace(",","."))}for(var i,r,o,a=[],s=0,l=e.split("\n"),c=l.length,u={};s<c;s++)if(r=t.exec(l[s])){for(i=l[s-1],o="<p>"+l[++s]+"</p><br/>";"string"==typeof l[++s]&&l[s].trim()&&s<l.length;)o+="<p>"+l[s]+"</p><br/>";u={title:i,startTime:n(r[1]),endTime:n(r[3]),text:o},a.push(u)}return a}},{}],25:[function(e,t,n){"use strict";var S=e("../flowplayer"),E=e("extend-object");!function(){var e={},t=document.documentElement.style,n=navigator.userAgent.toLowerCase(),i=/(chrome)[ \/]([\w.]+)/.exec(n)||/(safari)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];i[1]&&(e[i[1]]=!0,e.version=i[2]||"0"),e.safari&&(e.version=(/version\/([\w.]+)/.exec(n)||[])[1]);var r,o,a=((o=document.createElement("video")).loop=!0,o.autoplay=!0,o.preload=!0,o),s=navigator.userAgent,l=e.msie||/Trident\/7/.test(s),c=/iPad|MeeGo/.test(s)&&!/CriOS/.test(s),u=/iPad/.test(s)&&/CriOS/.test(s),f=/iP(hone|od)/i.test(s)&&!/iPad/.test(s)&&!/IEMobile/i.test(s),d=/Android/.test(s),p=d&&/Firefox/.test(s),h=d&&/SAMSUNG/.test(s),g=/Silk/.test(s),m=/IEMobile/.test(s),v=m?parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(s)[1],10):0,y=m?parseFloat(/IEMobile\/(\d+\.\d+)/.exec(s)[1],10):0,w=c||f?(r=/iP(ad|hone)(; CPU)? OS (\d+_\d)/.exec(s))&&1<r.length?parseFloat(r[r.length-1].replace("_","."),10):0:0,b=d?parseFloat(/Android\ (\d+(\.\d+)?)/.exec(s)[1],10):0,I=(f||c||u)&&{iPhone:f,iPad:c||u,version:w,chrome:u},M=E(S.support,{browser:e,iOS:I,android:!!d&&{firefox:p,opera:/Opera/.test(s),samsung:h,version:b},subtitles:!!a.addTextTrack,fullscreen:"boolean"==typeof document.webkitFullscreenEnabled?document.webkitFullscreenEnabled:"function"==typeof document.webkitCancelFullScreen&&!/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(s)||document.mozFullScreenEnabled||"function"==typeof document.exitFullscreen||"function"==typeof document.msExitFullscreen,inlineBlock:!(l&&e.version<8),touch:"ontouchstart"in window,dataload:!c&&!f&&!m,flex:"flexWrap"in t||"WebkitFlexWrap"in t||"msFlexWrap"in t,svg:!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,zeropreload:!l&&!d,volume:!(c||f||g||u),cachedVideoTag:!(c||f||u||m),firstframe:!(g||m||p||h||w&&w<10||d&&b<4.4),inlineVideo:(!f||10<=w)&&(!m||8.1<=v&&11<=y)&&(!d||3<=b),hlsDuration:!d&&(!e.safari||c||f||u),seekable:!c&&!u,preloadMetadata:!I&&!e.safari});M.autoplay=M.firstframe,m&&(M.browser.safari=!1);try{var C=navigator.plugins["Shockwave Flash"],A=l?new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version"):C.description;l||C[0].enabledPlugin?((A=A.split(/\D+/)).length&&!A[0]&&(A=A.slice(1)),M.flashVideo=9<A[0]||9==A[0]&&115<=A[3]):M.flashVideo=!1}catch(e){}try{M.video=!!a.canPlayType,M.video&&a.canPlayType("video/mp4")}catch(e){M.video=!1}M.animation=function(){for(var e=["","Webkit","Moz","O","ms","Khtml"],t=document.createElement("p"),n=0;n<e.length;n++)if(void 0!==t.style[e[n]+"AnimationName"])return!0}()}()},{"../flowplayer":31,"extend-object":39}],26:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),s=e("bean");i(function(o,e){var a=o.conf;if(!1!==a.share&&!1!==a.twitter){o.tweet=function(){var e,t,n=screen.height,i=screen.width,r="string"==typeof a.twitter?a.twitter:o.shareUrl();e=Math.round(i/2-275),t=0,420<n&&(t=Math.round(n/2-210)),window.open("https://twitter.com/intent/tweet?url="+encodeURIComponent(r),"intent","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+e+",top="+t)};var t=r.find(".fp-share-menu",e)[0],n=r.createElement("a",{class:"fp-icon fp-twitter"},"Twitter");r.append(t,n),s.on(e,"click",".fp-twitter",function(){o.tweet()})}})},{"../common":1,"../flowplayer":31,bean:34}],27:[function(e,t,n){(function(L){"use strict";var T=e("../flowplayer"),Z=e("../common"),P=e("bean"),k=e("./ui/slider"),Y=e("./ui/bar-slider");function r(e){return 10<=(e=parseInt(e,10))?e:"0"+e}function z(e,t){e=Math.max(e||0,0),e=t?Math.ceil(e):Math.floor(e);var n=Math.floor(e/3600),i=Math.floor(e/60);return e-=60*i,1<=n?n+":"+r(i-=60*n)+":"+r(e):r(i)+":"+r(e)}var G=L("PHN2ZyBjbGFzcz0iZnAtcGxheS1yb3VuZGVkLW91dGxpbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDk5Ljg0NCA5OS44NDM0Ij48ZGVmcz48c3R5bGU+LmZwLWNvbG9yLXBsYXl7b3BhY2l0eTowLjY1O30uY29udHJvbGJ1dHRvbntmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz4KPHRpdGxlPnBsYXktcm91bmRlZC1vdXRsaW5lPC90aXRsZT48cGF0aCBjbGFzcz0iZnAtY29sb3ItcGxheSIgZD0iTTQ5LjkyMTctLjA3OGE1MCw1MCwwLDEsMCw1MCw1MEE1MC4wNTY0LDUwLjA1NjQsMCwwLDAsNDkuOTIxNy0uMDc4WiIvPjxwYXRoIGNsYXNzPSJjb250cm9sYnV0dG9uIiBkPSJNNDEuMDM1OSw3MS4xOWE1LjA0OTIsNS4wNDkyLDAsMCwxLTIuNTU3NS0uNjY3M2MtMS44MDMxLTEuMDQxLTIuNzk1OC0zLjEyNDgtMi43OTU4LTUuODY2NFYzNS4xODg3YzAtMi43NDI5Ljk5MzMtNC44MjcyLDIuNzk3LTUuODY3NiwxLjgwMjUtMS4wNDIyLDQuMTAzNC0uODYsNi40OC41MTQzTDcwLjQ3ODIsNDQuNTY3MmMyLjM3NTEsMS4zNzExLDMuNjgyNiwzLjI3MjUsMy42ODMyLDUuMzU0NXMtMS4zMDc2LDMuOTg0NS0zLjY4MzIsNS4zNTYyTDQ0Ljk1OTIsNzAuMDExNEE3LjkzODQsNy45Mzg0LDAsMCwxLDQxLjAzNTksNzEuMTlabS4wMDY1LTQwLjEyM2EyLjY3OTQsMi42Nzk0LDAsMCwwLTEuMzU4Mi4zNDEzYy0xLjAyNjMuNTkyNi0xLjU5MTIsMS45MzQ5LTEuNTkxMiwzLjc4VjY0LjY1NjNjMCwxLjg0NDkuNTY0OSwzLjE4NjYsMS41OTA2LDMuNzc5MSwxLjAyODEuNTkzMiwyLjQ3MzMuNDEwOCw0LjA3LS41MTJMNjkuMjczLDUzLjE5MDZjMS41OTgzLS45MjI3LDIuNDc4LTIuMDgzOCwyLjQ3OC0zLjI2ODlzLS44OC0yLjM0NDUtMi40NzgtMy4yNjY2TDQzLjc1NCwzMS45MjI3QTUuNTY4NSw1LjU2ODUsMCwwLDAsNDEuMDQyMywzMS4wNjcxWiIgZmlsdGVyPSJ1cmwoI2YxKSIvPjwvc3ZnPgo=","base64"),O=L("PHN2ZyBjbGFzcz0iZnAtcGxheS1yb3VuZGVkLWZpbGwiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogIDxkZWZzPjxzdHlsZT4uYXtmaWxsOiMwMDA7b3BhY2l0eTowLjY1O30uYntmaWxsOiNmZmY7b3BhY2l0eToxLjA7fTwvc3R5bGU+CiAgPC9kZWZzPjx0aXRsZT5wbGF5LXJvdW5kZWQtZmlsbDwvdGl0bGU+CiAgPHBhdGggY2xhc3M9ImZwLWNvbG9yLXBsYXkiIGQ9Ik00OS45MjE3LS4wNzhhNTAsNTAsMCwxLDAsNTAsNTBBNTAuMDU2NCw1MC4wNTY0LDAsMCwwLDQ5LjkyMTctLjA3OFoiLz4KICA8cGF0aCBjbGFzcz0iYiIgZD0iTTM1Ljk0MiwzNS4yMzIzYzAtNC43Mjg5LDMuMzUwNi02LjY2MzcsNy40NDYtNC4yOTcxTDY4LjgzLDQ1LjYyMzVjNC4wOTU2LDIuMzY0LDQuMDk1Niw2LjIzMTksMCw4LjU5NzdMNDMuMzg4LDY4LjkxYy00LjA5NTQsMi4zNjQtNy40NDYuNDMtNy40NDYtNC4yOTc5WiIgZmlsdGVyPSJ1cmwoI2YxKSIvPgogIDwvc3ZnPgogIAo=","base64"),R=L("PHN2ZyBjbGFzcz0iZnAtcGxheS1zaGFycC1maWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxzdHlsZT4uZnAtY29sb3ItcGxheXtvcGFjaXR5OjAuNjU7fS5jb250cm9sYnV0dG9ue2ZpbGw6I2ZmZjt9PC9zdHlsZT4KICA8L2RlZnM+CiAgPHRpdGxlPnBsYXktc2hhcnAtZmlsbDwvdGl0bGU+CiAgPHBhdGggY2xhc3M9ImZwLWNvbG9yLXBsYXkiIGQ9Ik00OS45MjE3LS4wNzhhNTAsNTAsMCwxLDAsNTAsNTBBNTAuMDU2NCw1MC4wNTY0LDAsMCwwLDQ5LjkyMTctLjA3OFoiLz4KICA8cG9seWdvbiBjbGFzcz0iY29udHJvbGJ1dHRvbiIgcG9pbnRzPSI3My42MDEgNTAgMzcuOTY4IDcwLjU3MyAzNy45NjggMjkuNDI3IDczLjYwMSA1MCIgZmlsdGVyPSJ1cmwoI2YxKSIvPgo8L3N2Zz4K","base64"),W=L("PHN2ZyBjbGFzcz0iZnAtcGxheS1zaGFycC1vdXRsaW5lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5OS44NDQgOTkuODQzNCI+PGRlZnM+PHN0eWxlPi5jb250cm9sYnV0dG9uYmd7b3BhY2l0eTowLjY1O30uY29udHJvbGJ1dHRvbntmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz48dGl0bGU+cGxheS1zaGFycC1vdXRsaW5lPC90aXRsZT48cGF0aCBjbGFzcz0iZnAtY29sb3ItcGxheSIgZD0iTTQ5LjkyMTctLjA3OGE1MCw1MCwwLDEsMCw1MCw1MEE1MC4wNTY0LDUwLjA1NjQsMCwwLDAsNDkuOTIxNy0uMDc4WiIvPjxwYXRoIGNsYXNzPSJjb250cm9sYnV0dG9uIiBkPSJNMzYuOTQ0Myw3Mi4yNDczVjI3LjI5MTZMNzUuODc3Niw0OS43N1ptMi4yLTQxLjE0NTVWNjguNDM3MUw3MS40Nzc2LDQ5Ljc3WiIgZmlsdGVyPSJ1cmwoI2YxKSIvPjwvc3ZnPgo=","base64"),U=L("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utcm91bmRlZC1vdXRsaW5lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5OS44NDM0IDk5Ljg0MzQiPjxkZWZzPjxzdHlsZT4uZnAtY29sb3ItcGxheXtvcGFjaXR5OjAuNjU7fS5yZWN0e2ZpbGw6I2ZmZjt9PC9zdHlsZT4KPC9kZWZzPjx0aXRsZT5wYXVzZS1yb3VuZGVkLW91dGxpbmU8L3RpdGxlPjxwYXRoIGNsYXNzPSJmcC1jb2xvci1wbGF5IiBkPSJNNDkuOTIxMi0uMDc4M2E1MCw1MCwwLDEsMCw1MC4wMDA2LDUwQTUwLjA1NjIsNTAuMDU2MiwwLDAsMCw0OS45MjEyLS4wNzgzWiIvPjxnIGNsYXNzPSJjb250cm9sYnV0dG9uIj48cGF0aCBjbGFzcz0icmVjdCIgZD0iTTM5LjAwMzYsNzEuOTcyNmE3LjU2NSw3LjU2NSwwLDAsMS03LjU1Ny03LjU1NnYtMjguOTlhNy41NTY1LDcuNTU2NSwwLDAsMSwxNS4xMTMsMHYyOC45OUE3LjU2NDgsNy41NjQ4LDAsMCwxLDM5LjAwMzYsNzEuOTcyNlptMC00MS45MDRhNS4zNjQ3LDUuMzY0NywwLDAsMC01LjM1OTMsNS4zNTgydjI4Ljk5YTUuMzU4Nyw1LjM1ODcsMCwwLDAsMTAuNzE3NCwwdi0yOC45OUE1LjM2NDUsNS4zNjQ1LDAsMCwwLDM5LjAwMzYsMzAuMDY4NloiIGZpbHRlcj0idXJsKCNmMSkiLz48cGF0aCBjbGFzcz0icmVjdCIgZD0iTTYwLjg0LDcxLjk3MjZhNy41NjQ4LDcuNTY0OCwwLDAsMS03LjU1Ni03LjU1NnYtMjguOTlhNy41NTY1LDcuNTU2NSwwLDAsMSwxNS4xMTMsMHYyOC45OUE3LjU2NSw3LjU2NSwwLDAsMSw2MC44NCw3MS45NzI2Wm0wLTQxLjkwNGE1LjM2NDUsNS4zNjQ1LDAsMCwwLTUuMzU4Miw1LjM1ODJ2MjguOTlhNS4zNTg3LDUuMzU4NywwLDAsMCwxMC43MTc0LDB2LTI4Ljk5QTUuMzY0Nyw1LjM2NDcsMCwwLDAsNjAuODQsMzAuMDY4NloiIGZpbHRlcj0idXJsKCNmMSkiLz48L2c+PC9zdmc+Cg==","base64"),J=L("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utcm91bmRlZC1maWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48ZGVmcz48c3R5bGU+LmZwLWNvbG9yLXBsYXl7b3BhY2l0eTowLjY1O30ucmVjdHtmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz48dGl0bGU+cGF1c2Utcm91bmRlZC1maWxsPC90aXRsZT48cGF0aCBjbGFzcz0iZnAtY29sb3ItcGxheSIgZD0iTTQ5LjkyMTctLjA3OGE1MCw1MCwwLDEsMCw1MCw1MEE1MC4wNTY0LDUwLjA1NjQsMCwwLDAsNDkuOTIxNy0uMDc4WiIvPjxnIGNsYXNzPSJjb250cm9sYnV0dG9uIiBmaWx0ZXI9InVybCgjZjEpIj48cmVjdCBjbGFzcz0icmVjdCIgeD0iMzEuODQ0IiB5PSIyOC4xMjMxIiB3aWR0aD0iMTMuNDM2MiIgaGVpZ2h0PSI0My41OTczIiByeD0iNi43MTgxIiByeT0iNi43MTgxIi8+PHJlY3QgY2xhc3M9InJlY3QiIHg9IjU0LjU2MzgiIHk9IjI4LjEyMzEiIHdpZHRoPSIxMy40MzYyIiBoZWlnaHQ9IjQzLjU5NzMiIHJ4PSI2LjcxODEiIHJ5PSI2LjcxODEiLz48L2c+PC9zdmc+Cg==","base64"),B=L("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utc2hhcnAtZmlsbCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PGRlZnM+PHN0eWxlPi5mcC1jb2xvci1wbGF5e29wYWNpdHk6MC42NTt9LnJlY3R7ZmlsbDojZmZmO308L3N0eWxlPgo8L2RlZnM+PHRpdGxlPnBhdXNlLXNoYXJwLWZpbGw8L3RpdGxlPjxwYXRoIGNsYXNzPSJmcC1jb2xvci1wbGF5IiBkPSJNNDkuOTIxNy0uMDc4YTUwLDUwLDAsMSwwLDUwLDUwQTUwLjA1NjQsNTAuMDU2NCwwLDAsMCw0OS45MjE3LS4wNzhaIi8+PGcgY2xhc3M9ImNvbnRyb2xidXR0b24iIGZpbHRlcj0idXJsKCNmMSkiPjxyZWN0IGNsYXNzPSJyZWN0IiB4PSIzMy41IiB5PSIzMC4xMDQyIiB3aWR0aD0iMTIuMjYzNCIgaGVpZ2h0PSIzOS43OTE3Ii8+PHJlY3QgY2xhc3M9InJlY3QiIHg9IjU0LjIzNjYiIHk9IjMwLjEwNDIiIHdpZHRoPSIxMi4yNjM0IiBoZWlnaHQ9IjM5Ljc5MTciLz48L2c+PC9zdmc+Cg==","base64"),H=L("PHN2ZyBjbGFzcz0iZnAtcGF1c2Utc2hhcnAtb3V0bGluZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgOTkuODQzNCA5OS44NDM0Ij48ZGVmcz48c3R5bGU+LmZwLWNvbG9yLXBsYXl7b3BhY2l0eTowLjY1O30ucmVjdHtmaWxsOiNmZmY7fTwvc3R5bGU+CjwvZGVmcz48dGl0bGU+cGF1c2Utc2hhcnAtb3V0bGluZTwvdGl0bGU+PHBhdGggY2xhc3M9ImZwLWNvbG9yLXBsYXkiIGQ9Ik00OS45MjEyLS4wNzgzYTUwLDUwLDAsMSwwLDUwLjAwMDYsNTBBNTAuMDU2Miw1MC4wNTYyLDAsMCwwLDQ5LjkyMTItLjA3ODNaIi8+PGcgY2xhc3M9ImNvbnRyb2xidXR0b24iIGZpbHRlcj0idXJsKCNmMSkiPjxwYXRoIGNsYXNzPSJyZWN0IiBkPSJNNDYuODcwOSw2OS45NTMxSDMzLjEzODVWMjkuODlINDYuODcwOVpNMzUuMTQxNiw2Ny45NWg5LjcyNjJWMzEuODkzNUgzNS4xNDE2WiIvPjxwYXRoIGNsYXNzPSJyZWN0IiBkPSJNNjYuNzA0Nyw2OS45NTMxSDUyLjk3MjJWMjkuODlINjYuNzA0N1pNNTQuOTc1NCw2Ny45NWg5LjcyNjJWMzEuODkzNUg1NC45NzU0WiIvPjwvZz48L3N2Zz4K","base64"),F=L("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1yb3VuZGVkLW91dGxpbmUiIHdpZHRoPScxMTJweCcgaGVpZ2h0PScxMTJweCcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPgogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijc2IiBoZWlnaHQ9Ijc2IiBmaWxsPSJyZ2JhKDAsMCwwLDApIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgMjUpIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMCwwLDAsLjUpIiBzdHJva2Utd2lkdGg9IjMlIiBjbGFzcz0ic3EiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuMHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4wcyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICAgIDwvY2lyY2xlPgogICAgPGNpcmNsZSBjeD0iMCIgY3k9IjAiIHI9IjEwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCAyNSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgwLDAsMCwuNSkiIHN0cm9rZS13aWR0aD0iMyUiIGNsYXNzPSJzcSI+CiAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZSIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC40cyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjRzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogICAgPC9jaXJjbGU+CiAgICA8Y2lyY2xlIGN4PSIwIiBjeT0iMCIgcj0iMTAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUwIDUwKSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDAsMCwwLC41KSIgc3Ryb2tlLXdpZHRoPSIzJSIgY2xhc3M9InNxIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ic3Ryb2tlIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjhzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgICA8L2NpcmNsZT4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgNTApIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMCwwLDAsLjUpIiBzdHJva2Utd2lkdGg9IjMlIiBjbGFzcz0ic3EiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjEuMnMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS4ycyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICAgIDwvY2lyY2xlPgo8L3N2Zz4K","base64"),V=L("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1yb3VuZGVkLWZpbGwiIHdpZHRoPScxMTJweCcgaGVpZ2h0PScxMTJweCcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPgogICAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9Ijc2IiBoZWlnaHQ9Ijc2IiBmaWxsPSJyZ2JhKDAsMCwwLDApIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgMjUpIiBmaWxsPSJyZ2JhKDAsMCwwLC41KSIgY2xhc3M9InNxIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iZmlsbCIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC4wcyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjBzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogICAgPC9jaXJjbGU+CiAgICA8Y2lyY2xlIGN4PSIwIiBjeT0iMCIgcj0iMTAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUwIDI1KSIgZmlsbD0icmdiYSgwLDAsMCwuNSkiIGNsYXNzPSJzcSI+CiAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImZpbGwiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuNHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC40cyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICAgIDwvY2lyY2xlPgogICAgPGNpcmNsZSBjeD0iMCIgY3k9IjAiIHI9IjEwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCA1MCkiIGZpbGw9InJnYmEoMCwwLDAsLjUpIiBjbGFzcz0ic3EiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjhzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgICA8L2NpcmNsZT4KICAgIDxjaXJjbGUgY3g9IjAiIGN5PSIwIiByPSIxMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjUgNTApIiBmaWxsPSJyZ2JhKDAsMCwwLC41KSIgY2xhc3M9InNxIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iZmlsbCIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMS4ycyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjJzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogICAgPC9jaXJjbGU+Cjwvc3ZnPgo=","base64"),X=L("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1zaGFycC1maWxsIiB3aWR0aD0nMTEycHgnIGhlaWdodD0nMTEycHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNzYiIGhlaWdodD0iNzYiIGZpbGw9InJnYmEoMCwwLDAsMCkiIGNsYXNzPSJiayI+PC9yZWN0PgogIDxyZWN0IHg9Ii0xMCIgeT0iLTEwIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI1IDI1KSIgZmlsbD0icmdiYSgwLDAsMCwuNSkiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjBzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjBzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogIDwvcmVjdD4KICA8cmVjdCB4PSItMTAiIHk9Ii0xMCIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MCAyNSkiIGZpbGw9InJnYmEoMCwwLDAsLjUpIiBjbGFzcz0ic3EiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iZmlsbCIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC40cyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC40cyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICA8L3JlY3Q+CiAgPHJlY3QgeD0iLTEwIiB5PSItMTAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTAgNTApIiBmaWxsPSJyZ2JhKDAsMCwwLC41KSIgY2xhc3M9InNxIj4KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImZpbGwiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuOHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgPC9yZWN0PgogIDxyZWN0IHg9Ii0xMCIgeT0iLTEwIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI1IDUwKSIgZmlsbD0icmdiYSgwLDAsMCwuNSkiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIxLjJzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxLjJzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogIDwvcmVjdD4KPC9zdmc+Cg==","base64"),_=L("PHN2ZyBjbGFzcz0iZnAtbG9hZGluZy1zaGFycC1vdXRsaW5lIiB3aWR0aD0nMTEycHgnIGhlaWdodD0nMTEycHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNzYiIGhlaWdodD0iNzYiIGZpbGw9InJnYmEoMCwwLDAsMCkiIGNsYXNzPSJiayI+PC9yZWN0PgogIDxyZWN0IHg9Ii05IiB5PSItOSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSAyNSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgwLDAsMCwuNSkiIHN0cm9rZS13aWR0aD0iMyUiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjAuMHMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4wcyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICA8L3JlY3Q+CiAgPHJlY3QgeD0iLTkiIHk9Ii05IiB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDUwIDI1KSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDAsMCwwLC41KSIgc3Ryb2tlLXdpZHRoPSIzJSIgY2xhc3M9InNxIj4KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InN0cm9rZSIgZnJvbT0icmdiYSgwLDAsMCwwKSIgdG89InJnYmEoMCwwLDAsLjUpIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgZHVyPSIxLjZzIiBiZWdpbj0iMC40cyIgdmFsdWVzPSJyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwuNSkiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZT4KICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJzY2FsZSIgYWRkaXRpdmU9InN1bSIgZnJvbT0iMC44IiB0bz0iMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwLjRzIiBkdXI9IjEuNnMiIHZhbHVlcz0iMTswLjg7MC44OzE7MSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlVHJhbnNmb3JtPgogIDwvcmVjdD4KICA8cmVjdCB4PSItOSIgeT0iLTkiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTAgNTApIiBmaWxsPSJub25lIiBzdHJva2U9InJnYmEoMCwwLDAsLjUpIiBzdHJva2Utd2lkdGg9IjMlIiBjbGFzcz0ic3EiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ic3Ryb2tlIiBmcm9tPSJyZ2JhKDAsMCwwLDApIiB0bz0icmdiYSgwLDAsMCwuNSkiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjEuNnMiIGJlZ2luPSIwLjhzIiB2YWx1ZXM9InJnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsMCk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLC41KTtyZ2JhKDAsMCwwLC41KSIga2V5VGltZXM9IjA7MC4xOzAuMjswLjQ7MSI+PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InNjYWxlIiBhZGRpdGl2ZT0ic3VtIiBmcm9tPSIwLjgiIHRvPSIxIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuOHMiIGR1cj0iMS42cyIgdmFsdWVzPSIxOzAuODswLjg7MTsxIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+CiAgPC9yZWN0PgogIDxyZWN0IHg9Ii05IiB5PSItOSIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNSA1MCkiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgwLDAsMCwuNSkiIHN0cm9rZS13aWR0aD0iMyUiIGNsYXNzPSJzcSI+CiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJzdHJva2UiIGZyb209InJnYmEoMCwwLDAsMCkiIHRvPSJyZ2JhKDAsMCwwLC41KSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGR1cj0iMS42cyIgYmVnaW49IjEuMnMiIHZhbHVlcz0icmdiYSgwLDAsMCwuNSk7cmdiYSgwLDAsMCwwKTtyZ2JhKDAsMCwwLDApO3JnYmEoMCwwLDAsLjUpO3JnYmEoMCwwLDAsLjUpIiBrZXlUaW1lcz0iMDswLjE7MC4yOzAuNDsxIj48L2FuaW1hdGU+CiAgICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0ic2NhbGUiIGFkZGl0aXZlPSJzdW0iIGZyb209IjAuOCIgdG89IjEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMS4ycyIgZHVyPSIxLjZzIiB2YWx1ZXM9IjE7MC44OzAuODsxOzEiIGtleVRpbWVzPSIwOzAuMTswLjI7MC40OzEiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KICA8L3JlY3Q+Cjwvc3ZnPgo=","base64");T(function(l,a){if(!T.added_svg_filters){T.added_svg_filters=!0;try{var e;document.body.appendChild(e=Z.createElement("div",{},L("PHN2ZyBjbGFzcz0iZnAtZmlsdGVycyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMCAwIj4KICA8ZGVmcz4KICAgIDxmaWx0ZXIgaWQ9ImYxIiB4PSItMjAlIiB5PSItMjAlIiB3aWR0aD0iMjAwJSIgaGVpZ2h0PSIyMDAlIj4KICAgICAgPGZlT2Zmc2V0IHJlc3VsdD0ib2ZmT3V0IiBpbj0iU291cmNlQWxwaGEiIGR4PSIwIiBkeT0iMCIgLz4KICAgICAgPGZlQ29sb3JNYXRyaXggcmVzdWx0PSJtYXRyaXhPdXQiIGluPSJvZmZPdXQiIHR5cGU9Im1hdHJpeCIKICAgICAgdmFsdWVzPSIwLjMgMCAwIDAgMCAwIDAuMyAwIDAgMCAwIDAgMC4zIDAgMCAwIDAgMCAwLjQgMCIgLz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHJlc3VsdD0iYmx1ck91dCIgaW49Im1hdHJpeE91dCIgc3RkRGV2aWF0aW9uPSI0IiAvPgogICAgICA8ZmVCbGVuZCBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJibHVyT3V0IiBtb2RlPSJub3JtYWwiIC8+CiAgICA8L2ZpbHRlcj4KICA8L2RlZnM+Cjwvc3ZnPgo=","base64"))),Z.css(e,{width:0,height:0,overflow:"hidden",position:"absolute",margin:0,padding:0})}catch(e){}}var r,s=l.conf,c=T.support;Z.find(".fp-ratio,.fp-ui",a).forEach(Z.removeNode),Z.addClass(a,"flowplayer"),a.appendChild(Z.createElement("div",{className:"fp-ratio"}));var o=Z.createElement("div",{className:"fp-ui",style:"display: none"},' <div class="fp-waiting"> {{ LOADING_SHARP_OUTLINE }} {{ LOADING_SHARP_FILL }} {{ LOADING_ROUNDED_FILL }} {{ LOADING_ROUNDED_OUTLINE }} </div> <div class="fp-header"> <a class="fp-share fp-icon"></a> <a class="fp-fullscreen fp-icon"></a> <a class="fp-unload fp-icon"></a> </div> <p class="fp-speed-flash"></p> <div class="fp-play fp-visible"> <a class="fp-icon fp-playbtn"></a> {{ PLAY_ROUNDED_FILL }} {{ PLAY_ROUNDED_OUTLINE }} {{ PLAY_SHARP_FILL }} {{ PLAY_SHARP_OUTLINE }} </div> <div class="fp-pause"> <a class="fp-icon fp-playbtn"></a> {{ PAUSE_SHARP_OUTLINE }} {{ PAUSE_SHARP_FILL }} {{ PAUSE_ROUNDED_OUTLINE }} {{ PAUSE_ROUNDED_FILL }} </div> <div class="fp-controls"> <a class="fp-icon fp-playbtn"></a> <span class="fp-elapsed">00:00</span> <div class="fp-timeline fp-bar"> <span class="fp-timestamp"></span> <div class="fp-progress fp-color"></div> </div> <span class="fp-duration"></span> <span class="fp-remaining"></span> <div class="fp-volume"> <a class="fp-icon fp-volumebtn"></a> <div class="fp-volumebar fp-bar-slider"> <em></em><em></em><em></em><em></em><em></em><em></em><em></em> </div> </div> <strong class="fp-speed fp-hidden"></strong> </div>'.replace("{{ PAUSE_ROUNDED_FILL }}",J).replace("{{ PAUSE_ROUNDED_OUTLINE }}",U).replace("{{ PAUSE_SHARP_FILL }}",B).replace("{{ PAUSE_SHARP_OUTLINE }}",H).replace("{{ PLAY_SHARP_OUTLINE }}",W).replace("{{ PLAY_SHARP_FILL }}",R).replace("{{ PLAY_ROUNDED_OUTLINE }}",G).replace("{{ PLAY_ROUNDED_FILL }}",O).replace("{{ LOADING_ROUNDED_OUTLINE }}",F).replace("{{ LOADING_ROUNDED_FILL }}",V).replace("{{ LOADING_SHARP_FILL }}",X).replace("{{ LOADING_SHARP_OUTLINE }}",_).replace(/url\(#/g,"url("+window.location.href.replace(window.location.hash,"").replace(/\#$/g,"")+"#"));function t(e){return Z.find(".fp-"+e,a)[0]}a.appendChild(o),"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(function(){o.style.display=""}):o.style.display="";var n=t("waiting"),u=t("elapsed"),i=t("ratio"),f=t("speed-flash"),d=t("duration"),p=t("remaining"),h=t("timestamp"),g=Z.css(i,"padding-top"),m=t("play"),v=t("pause"),y=t("timeline"),w=k(y,l),b=t("fullscreen"),I=t("volumebar"),M=Y(I,{rtl:l.rtl}),C=Z.hasClass(a,"no-toggle");w.disableAnimation(Z.hasClass(a,"is-touch")),l.sliders=l.sliders||{},l.sliders.timeline=w,l.sliders.volume=M;var A=[];function S(e){Z.css(i,"padding-top",100*e+"%"),c.inlineBlock||Z.height(Z.find("object",a)[0],Z.height(a))}function E(e){e?(Z.addClass(a,"is-mouseover"),Z.removeClass(a,"is-mouseout")):(Z.addClass(a,"is-mouseout"),Z.removeClass(a,"is-mouseover"))}c.svg||Z.html(n,"<p>loading &hellip;</p>"),s.ratio&&S(s.ratio);try{s.fullscreen||Z.removeNode(b)}catch(e){Z.removeNode(b)}l.on("dvrwindow",function(){w.disable(!1)}),l.on("ready",function(e,t,n){var i=t.video.duration;w.disable(t.disabled||!i),s.adaptiveRatio&&!isNaN(n.height/n.width)&&S(n.height/n.width),Z.html([d,p],t.live?"Live":z(i)),Z.toggleClass(a,"is-long",3600<=i),M.slide(t.volumeLevel),"flash"===t.engine.engineName?w.disableAnimation(!0,!0):w.disableAnimation(!1),Z.find(".fp-title",o).forEach(Z.removeNode),n.title&&Z.prepend(o,Z.createElement("div",{className:"fp-message fp-title"},n.title)),Z.toggleClass(a,"has-title",!!n.title)}).on("unload",function(){g||s.splash||Z.css(i,"paddingTop",""),w.slide(0),Z.addClass(m,"fp-visible")}).on("buffer",function(e,t,n){var i=t.video,r=i.buffer/i.duration;!i.seekable&&c.seekable&&w.max(t.conf.live?1/0:r),n&&"number"!=typeof n||(n=[{start:0,end:i.buffer}]);var o=Z.find(".fp-buffer",y);o.length!==n.length&&(o.forEach(Z.removeNode),o=[]),n.forEach(function(e,t){var n=o[t]||Z.createElement("div",{className:"fp-buffer"});Z.css(n,{left:100*e.start/i.duration+"%",width:100*(e.end-e.start)/i.duration+"%"}),Z.prepend(y,n)})}).on("speed",function(e,t,n){t.video.time&&(Z.text(f,n+"x"),Z.addClass(f,"fp-shown"),(A=A.filter(function(e){return clearTimeout(e),!1})).push(setTimeout(function(){Z.addClass(f,"fp-hilite"),A.push(setTimeout(function(){Z.removeClass(f,"fp-hilite"),A.push(setTimeout(function(){Z.removeClass(f,"fp-shown")},300))},1e3))})))}).on("buffered",function(){w.max(1)}).on("progress seek",function(e,t,n){var i=l.video.duration,r=l.video.seekOffset||0,o=((n=n||l.video.time)-r)/(i-r);w.dragging||w.slide(o,l.seeking?0:250),Z.toggleClass(a,"is-live-position",i-n<s.livePositionOffset),Z.html(u,z(n)),Z.html(p,z(i-n,!0))}).on("finish resume seek",function(e){Z.toggleClass(a,"is-finished","finish"==e.type)}).on("resume",function(){Z.addClass(m,"fp-visible"),setTimeout(function(){Z.removeClass(m,"fp-visible")},300)}).on("pause",function(){Z.addClass(v,"fp-visible"),setTimeout(function(){Z.removeClass(v,"fp-visible")},300)}).on("stop",function(){Z.html(u,z(0)),w.slide(0,100)}).on("finish",function(){Z.html(u,z(l.video.duration)),w.slide(1,100),Z.removeClass(a,"is-seeking")}).on("beforeseek",function(){}).on("volume",function(){M.slide(l.volumeLevel)}).on("disable",function(){var e=l.disabled;w.disable(e),M.disable(e),Z.toggleClass(a,"is-disabled",l.disabled)}).on("mute",function(e,t,n){Z.toggleClass(a,"is-muted",n)}).on("error",function(e,t,n){if(Z.removeClass(a,"is-loading"),Z.removeClass(a,"is-seeking"),Z.addClass(a,"is-error"),n){t.error=!0;var i=n.code;(n.message||"").match(/DECODER_ERROR_NOT_SUPPORTED/)&&(i=3);var r=t.message((t.engine&&t.engine.engineName||"html5")+": "+s.errors[i]);Z.removeClass(a,"is-mouseover"),t.one("load progress",function(e){"progress"!=e.type||t.error||r()})}}).one("resume ready",function(){var e=Z.find("video.fp-engine",a)[0];if(e&&(!Z.width(e)||!Z.height(e))){var t=a.style.overflow;a.style.overflow="visible",setTimeout(function(){t?a.style.overflow=t:a.style.removeProperty("overflow")})}}),P.on(a,"mouseenter mouseleave",function(e){if(!C){var t,n="mouseover"==e.type;if(E(n),n){var i=function(){E(!0),t=new Date};l.on("pause.x volume.x",i),P.on(a,"mousemove.x touchmove.x",i),clearInterval(r),r=setInterval(function(){new Date-t>s.mouseoutTimeout&&(E(!1),t=new Date)},100)}else P.off(a,"mousemove.x touchmove.x"),l.off("pause.x volume.x"),clearInterval(r)}}),P.on(a,"mouseleave",function(){(w.dragging||M.dragging)&&(Z.addClass(a,"is-mouseover"),Z.removeClass(a,"is-mouseout"))}),P.on(a,"click.player",function(e){if(!l.disabled)return Z.hasClass(e.target,"fp-ui")||Z.hasClass(e.target,"fp-engine")||e.flash||Z.hasParent(e.target,".fp-play,.fp-pause")?(e.preventDefault&&e.preventDefault(),l.toggle()):void 0}),P.on(a,"mousemove touchmove",".fp-timeline",function(e){var t=e.pageX||e.clientX;!t&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(t=e.originalEvent.touches[0].pageX);var n=t-Z.offset(y).left,i=n/Z.width(y),r=l.video,o=r.duration-(void 0===r.seekOffset?0:r.seekOffset),a=(l.rtl?1-i:i)*o;if(!(i<0)){Z.html(h,z(a));var s=n-Z.width(h)/2;s<0&&(s=0),s>Z.width(y)-Z.width(h)&&(s=!1),!1!==s?Z.css(h,{left:s+"px",right:"auto"}):Z.css(h,{left:"auto",right:"0px"})}}),P.on(a,"contextmenu",function(e){var t=window;if(!Z.hasClass(a,"is-flash-disabled")){var n=Z.find(".fp-context-menu",a)[0];n&&(e.preventDefault(),l.showMenu(n,{left:e.clientX-t.scrollX,top:e.clientY-t.scrollY}),P.on(a,"click",".fp-context-menu",function(e){e.stopPropagation()}))}}),l.on("flashdisabled",function(e,t,n){var i;Z.addClass(a,"is-flash-disabled"),!1!==n&&(i=l.message("Seems something is blocking Adobe Flash from running")),l.one("ready progress",function(){Z.removeClass(a,"is-flash-disabled"),i&&i()})}),s.poster&&Z.css(a,"background-image","url("+s.poster+")");var N=Z.css(a,"background-color"),D="none"!=Z.css(a,"background-image")||N&&"rgba(0, 0, 0, 0)"!=N&&"transparent"!=N;if(D&&!s.splash){s.poster||(s.poster=!0);var j=function(){Z.addClass(a,"is-poster"),Z.addClass(m,"fp-visible"),l.poster=!0,l.on("resume.poster progress.poster beforeseek.poster",function(e){"beforeseek"!==e.type&&!l.playing||(Z.removeClass(a,"is-poster"),Z.removeClass(m,"fp-visible"),l.poster=!1,l.off(".poster"))})};l.on("stop",function(){j()}),l.on("ready",function(e,t,n){n.index||n.autoplay||j()})}function x(){var e=Z.find(".fp-player",a)[0]||a;Z.toggleClass(a,"is-tiny",e.clientWidth<400),Z.toggleClass(a,"is-small",e.clientWidth<600&&400<=e.clientWidth)}"string"==typeof s.splash&&Z.css(a,"background-image","url('"+s.splash+"')"),!D&&l.forcedSplash&&Z.css(a,"background-color","#555"),P.on(a,"click",".fp-toggle, .fp-play, .fp-playbtn",function(){l.disabled||l.toggle()}),P.on(a,"click",".fp-volumebtn",function(){l.mute()}),P.on(a,"click",".fp-fullscreen",function(){l.fullscreen()}),P.on(a,"click",".fp-unload",function(){l.unload()}),P.on(y,"slide",function(e){l.seeking=!0,l.seekTo(10*e)}),P.on(I,"slide",function(e){l.volume(e)}),P.on(a,"click",".fp-duration,.fp-remaining",function(){if(l.dvr)return l.seekTo(10);Z.toggleClass(a,"is-inverted")}),E(C),l.on("shutdown",function(){P.off(y),P.off(I),Z.removeNode(o),Z.find(".fp-ratio",a).forEach(Z.removeNode)}),x(),window.addEventListener("resize",x)}),t.exports.format=z}).call(this,e("buffer").Buffer)},{"../common":1,"../flowplayer":31,"./ui/bar-slider":28,"./ui/slider":29,bean:34,buffer:35}],28:[function(e,t,n){var u=e("bean"),f=e("../../common");t.exports=function(a,e){var r=(e=e||{}).activeClass||"fp-color",o=e.inactiveClass||"fp-grey",t=e.childSelector||"em",s=!!e.rtl,n=!1,l=f.find(t,a).length,i={unload:function(){u.off(a,".barslider")},slide:function(i,e){f.find(t,a).forEach(function(e,t){var n=t/l<i;f.toggleClass(e,r,n),f.toggleClass(e,o,!n)}),e&&u.fire(a,"slide",[i])},disable:function(e){n=e}};return u.on(a,"mousedown.sld touchstart.sld",function(e){e.preventDefault(),n||(i.slide(c(e),!0),u.on(flowplayer.support.touch?a:document,"mousemove.sld touchmove.sld",function(e){e.preventDefault(),i.slide(c(e),!0)}),u.one(document,"mouseup.sld touchup.sld",function(){u.off(flowplayer.support.touch?a:document,"mousemove.sld touchmove.sld")}))}),i;function c(e){var t=e.pageX||e.clientX,n=f.offset(a),i=f.width(a);!t&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(t=e.originalEvent.touches[0].pageX);var r=t-n.left,o=(r=Math.max(0,Math.min(i,r)))/i;return s&&(o=1-o),o}}},{"../../common":1,bean:34}],29:[function(e,t,n){"use strict";var v=e("bean"),y=e("../../common");t.exports=function(o,a){function s(){r=y.offset(o),t=y.width(o),y.height(o),f=t,d=e(i)}function l(e,t){u||e==m.value||i&&!(e<i)||t||(v.fire(o,"slide",[e]),m.value=e)}function c(e){var t=e.pageX||e.clientX;!t&&e.originalEvent&&e.originalEvent.pageX&&(t=e.originalEvent.pageX),!t&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(t=e.originalEvent.touches[0].pageX);var n=t-r.left,i=(n=Math.max(0,Math.min(d||f,n)))/f;return a.rtl&&(i=1-i),g(i,0,!0)}var u,r,t,f,i,d,p=y.lastChild(o),h=!1,g=function(e,t){void 0===t&&(t=0),1<e&&(e=1);var n=Math.round(1e3*e)/10+"%";return(!i||e<=i)&&(h?y.removeClass(p,"animated"):(y.addClass(p,"animated"),y.css(p,"transition-duration",(t||0)+"ms")),y.css(p,"width",n)),e},e=function(e){return Math.max(0,Math.min(f,e*t))},m={max:function(e){i=e},disable:function(e){u=e},slide:function(e,t,n){s(),n&&l(e),g(e,t)},disableAnimation:function(e,t){h=!1!==e,y.toggleClass(o,"no-animation",!!t)}};return s(),v.on(o,"mousedown.sld touchstart",function(e){if(e.preventDefault(),!u){var t=(n=l,i=100,function(){r||(n.apply(this,arguments),r=1,setTimeout(function(){r=0},i))});s(),m.dragging=!0,l(c(e)),v.on(document,"mousemove.sld touchmove.sld",function(e){y.addClass(o,"is-fp-dragging"),e.preventDefault(),t(c(e),a.video.timeline_vtt)}),v.one(document,"mouseup touchend",function(e){a.video.timeline_vtt?(l(c(e)),setTimeout(function(){m.dragging=!1},250)):m.dragging=!1,y.removeClass(o,"is-fp-dragging"),v.off(document,"mousemove.sld touchmove.sld")})}var n,i,r}),m}},{"../../common":1,bean:34}],30:[function(e,t,n){t.exports=function(e,t,n){try{!function(e){var t=document.createElement("textarea");t.value=e,t.style.opacity=0,t.style.position="absolute",document.body.appendChild(t),t.select();var n=document.execCommand("copy");if(document.body.removeChild(t),!n)throw new Error("Unsuccessfull")}(e),t()}catch(e){n(e)}}},{}],31:[function(e,t,n){"use strict";var g=e("extend-object"),m=e("is-function"),v=e("bean"),i=e("./ext/ui/slider"),r=e("./ext/ui/bar-slider"),y=e("./common"),w=e("./ext/events"),b=[],I=[],o=window.onbeforeunload;window.onbeforeunload=function(e){if(b.forEach(function(e){e.conf.splash?e.unload():e.bind("error",function(){y.find(".flowplayer.is-error .fp-message").forEach(y.removeNode)})}),o)return o(e)};var a=/Safari/.exec(navigator.userAgent)&&!/Chrome/.exec(navigator.userAgent),s=/(\d+\.\d+) Safari/.exec(navigator.userAgent),l=s?Number(s[1]):100,M=t.exports=function(e,t,n){if(m(e))return I.push(e);if("number"==typeof e||void 0===e)return b[e||0];if(e.nodeType){if(null!==e.getAttribute("data-flowplayer-instance-id"))return b[e.getAttribute("data-flowplayer-instance-id")];if(!t)return;return u(e,t,n)}if(e.jquery)return M(e[0],t,n);if("string"==typeof e){var i=y.find(e)[0];return i&&M(i,t,n)}};g(M,{version:"7.2.10",engines:[],engine:function(t){return M.engines.filter(function(e){return e.engineName===t})[0]},extensions:[],conf:{},set:function(e,t){"string"==typeof e?M.conf[e]=t:g(M.conf,e)},registerExtension:function(e,t){M.extensions.push([e,t])},support:{},defaults:{debug:!1,disabled:!1,fullscreen:window==window.top,keyboard:!0,ratio:9/16,adaptiveRatio:!1,rtmp:0,proxy:"best",hlsQualities:!0,seekStep:!1,splash:!1,live:!1,livePositionOffset:120,swf:"//releases.flowplayer.org/7.2.10/flowplayer.swf",swfHls:"//releases.flowplayer.org/7.2.10/flowplayerhls.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,mouseoutTimeout:5e3,mutedAutoplay:!0,clickToUnMute:!0,volume:1,errors:["","Video loading aborted","Network error","Video not properly encoded","Video file not found","Unsupported video","Skin not found","SWF file not found","Subtitles not found","Invalid RTMP URL","Unsupported video format. Try installing Adobe Flash."],errorUrls:["","","","","","","","","","","http://get.adobe.com/flashplayer/"],playlist:[],hlsFix:a&&l<8,disableInline:!1},bean:v,common:y,slider:i,barSlider:r,extend:g});var C=0,A=e("./ext/resolve");if(void 0!==window.jQuery){var c=window.jQuery;c(function(){"function"==typeof c.fn.flowplayer&&c('.flowplayer:has(video:not(.fp-engine),script[type="application/json"])').flowplayer()});c.fn.flowplayer=function(r,o){return this.each(function(){"string"==typeof r&&(r={swf:r}),m(r)&&(o=r,r={});var t=c(this),e=t.find('script[type="application/json"]'),n=e.length?JSON.parse(e.text()):function(i){if(!i.length)return{};var r=i.data()||{},o={};return c.each(["autoplay","loop","preload","poster"],function(e,t){var n=i.attr(t);void 0!==n&&-1!==["autoplay","poster"].indexOf(t)?o[t]=n||!0:void 0!==n&&(r[t]=n||!0)}),i[0].autoplay=i[0].preload=!1,r.subtitles=i.find("track").map(function(){var e=c(this);return{src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label"),srclang:e.attr("srclang"),default:e.prop("default")}}).get(),r.sources=(new A).sourcesFromVideoTag(i,c),g(o,{clip:r})}(t.find("video")),i=u(this,c.extend({},r||{},n,t.data()),o);w.EVENTS.forEach(function(e){i.on(e+".jquery",function(e){t.trigger.call(t,e.type,e.detail&&e.detail.args)})}),t.data("flowplayer",i)})}}function u(e,t,n){t&&t.embed&&(t.embed=g({},M.defaults.embed,t.embed));var i=!1;try{void 0===M.conf.storage&&"object"==typeof window.localStorage&&(window.localStorage.flowplayerTestStorage="test",i=!0)}catch(e){}var r,o,a=e,s=g({},M.defaults,M.conf,t),l={},c=a.className,u=new A;y.addClass(a,"is-loading"),y.toggleClass(a,"no-flex",!M.support.flex),y.toggleClass(a,"no-svg",!M.support.svg);try{l=M.conf.storage||(i?window.localStorage:l)}catch(e){}if(s.volume="true"===l.muted?0:s.volume!==M.defaults.volume?s.volume:isNaN(l.volume)?s.volume:l.volume,s.debug=!!l.flowplayerDebug||s.debug,s.aspectRatio&&"string"==typeof s.aspectRatio){var f=s.aspectRatio.split(/[:\/]/);s.ratio=f[1]/f[0]}var d=a.currentStyle&&"rtl"===a.currentStyle.direction||window.getComputedStyle&&null!==window.getComputedStyle(a,null)&&"rtl"===window.getComputedStyle(a,null).getPropertyValue("direction");d&&y.addClass(a,"is-rtl");var p={conf:s,currentSpeed:1,volumeLevel:s.muted?0:void 0===s.volume?1*l.volume:s.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:"true"==l.muted||s.muted,paused:!1,playing:!1,ready:!1,splash:!1,rtl:d,hijack:function(e){try{p.engine.suspendEngine()}catch(e){}p.hijacked=e},release:function(){try{p.engine.resumeEngine()}catch(e){}p.hijacked=!1},debug:function(){s.debug&&console.log.apply(console,["DEBUG"].concat([].slice.call(arguments)))},load:function(e,t){if(!p.error&&!p.loading){p.video={},p.finished=!1,e=e||s.clip,e=g({},u.resolve(e,s.clip.sources)),(p.playing||p.engine)&&(e.autoplay=!0);var n=h(e);if(!n)return setTimeout(function(){p.trigger("error",[p,{code:M.support.flashVideo?5:10}])})&&p;if(!n.engineName)throw new Error("engineName property of factory should be exposed");if(p.engine&&n.engineName===p.engine.engineName||(p.ready=!1,p.engine&&(p.engine.unload(),p.conf.autoplay=!0),o=p.engine=n(p,a),p.one("ready",function(){setTimeout(function(){p.muted?p.mute(!0,!0):o.volume(p.volumeLevel)})})),g(e,o.pick(e.sources.filter(function(e){return!e.engine||e.engine===o.engineName}))),e.src)p.trigger("load",[p,e,o],!0).defaultPrevented?p.loading=!1:(p.ready=!1,o.load(e),m(e)&&(t=e),t&&p.one("ready",t));return p}},pause:function(e){return p.hijacked?p.hijacked.pause(e)|p:(!p.ready||p.seeking||p.loading||(o.pause(),p.one("pause",e)),p)},resume:function(){if(!p.trigger("beforeresume",[p],!0).defaultPrevented)return p.hijacked?p.hijacked.resume()|p:(p.ready&&p.paused&&(o.resume(),p.finished&&(p.trigger("resume",[p]),p.finished=!1)),p)},toggle:function(){return p.ready?p.paused?p.resume():p.pause():p.load()},seek:function(e,t){if("boolean"==typeof e){var n=p.conf.seekStep||.1*p.video.duration;e=p.video.time+(e?n:-n),e=Math.min(Math.max(e,0),p.video.duration-.1)}if(void 0===e)return p;if(p.hijacked)return p.hijacked.seek(e,t)|p;p.ready&&(r=e,p.trigger("beforeseek",[p,e],!0).defaultPrevented?(p.seeking=!1,y.toggleClass(a,"is-seeking",p.seeking)):(o.seek(e),m(t)&&p.one("seek",t)));return p},seekTo:function(e,t){return void 0===e?p.seek(r,t):void 0!==p.video.seekOffset?p.seek(p.video.seekOffset+.1*(p.video.duration-p.video.seekOffset)*e,t):p.seek(.1*p.video.duration*e,t)},mute:function(e,t){return void 0===e&&(e=!p.muted),p.muted=e,t||(l.muted=e,l.volume=isNaN(l.volume)?s.volume:l.volume),void 0!==o.mute?o.mute(e):(p.volume(e?0:l.volume,!0),p.trigger("mute",[p,e])),p},volume:function(e,t){return p.ready&&(e=Math.min(Math.max(e,0),1),t||(l.volume=e),o.volume(e)),p},speed:function(e,t){return p.ready&&("boolean"==typeof e&&(e=s.speeds[s.speeds.indexOf(p.currentSpeed)+(e?1:-1)]||p.currentSpeed),o.speed(e),t&&a.one("speed",t)),p},stop:function(){return p.ready&&(p.pause(),!p.live||p.dvr?p.seek(0,function(){p.trigger("stop",[p])}):p.trigger("stop",[p])),p},unload:function(){return s.splash?(p.trigger("unload",[p]),o&&(o.unload(),p.engine=o=0)):p.stop(),p},shutdown:function(){p.unload(),p.trigger("shutdown",[p]),v.off(a),delete b[a.getAttribute("data-flowplayer-instance-id")],a.removeAttribute("data-flowplayer-instance-id")},disable:function(e){return void 0===e&&(e=!p.disabled),e!=p.disabled&&(p.disabled=e,p.trigger("disable",e)),p},registerExtension:function(e,t){"string"==typeof(e=e||[])&&(e=[e]),"string"==typeof(t=t||[])&&(t=[t]),e.forEach(function(e){p.extensions.js.push(e)}),t.forEach(function(e){p.extensions.css.push(e)})}};p.conf=g(p.conf,s),p.extensions={js:[],css:[]},M.extensions.forEach(function(e){p.registerExtension(e[0],e[1])}),w(p);var h=function(e){var n,i=M.engines;if(s.engine){var t=i.filter(function(e){return e.engineName===s.engine})[0];if(t&&e.sources.some(function(e){return(!e.engine||e.engine===t.engineName)&&t.canPlay(e.type,p.conf)}))return t}return s.enginePreference&&(i=M.engines.filter(function(e){return-1<s.enginePreference.indexOf(e.engineName)}).sort(function(e,t){return s.enginePreference.indexOf(e.engineName)-s.enginePreference.indexOf(t.engineName)})),e.sources.some(function(t){var e=i.filter(function(e){return(!t.engine||t.engine===e.engineName)&&e.canPlay(t.type,p.conf)}).shift();return e&&(n=e),!!e}),n};return a.getAttribute("data-flowplayer-instance-id")||(a.setAttribute("data-flowplayer-instance-id",C++),p.on("boot",function(){var e=M.support;!s.splash&&!y.hasClass(a,"is-splash")&&e.firstframe||(p.forcedSplash=!s.splash&&!y.hasClass(a,"is-splash"),p.splash=!0,s.splash||(s.splash=!0),y.addClass(a,"is-splash")),s.splash&&y.find("video",a).forEach(y.removeNode),(s.dvr||s.live||y.hasClass(a,"is-live"))&&(p.live=s.live=!0,p.dvr=s.dvr=!!s.dvr||y.hasClass(a,"is-dvr"),y.addClass(a,"is-live"),y.toggleClass(a,"is-dvr",p.dvr)),I.forEach(function(e){e(p,a)}),b.push(p),s.splash?p.unload():p.load(),s.disabled&&p.disable(),p.one("ready",n),p.one("shutdown",function(){a.className=c})}).on("load",function(e,t,n){s.splash&&y.find(".flowplayer.is-ready,.flowplayer.is-loading").forEach(function(e){var t=e.getAttribute("data-flowplayer-instance-id");if(t!==a.getAttribute("data-flowplayer-instance-id")){var n=b[Number(t)];n&&n.conf.splash&&n.unload()}}),y.addClass(a,"is-loading"),t.loading=!0,void 0===n.live&&void 0===n.dvr||(y.toggleClass(a,"is-live",n.dvr||n.live),y.toggleClass(a,"is-dvr",!!n.dvr),t.live=n.dvr||n.live,t.dvr=!!n.dvr)}).on("ready",function(e,t,n){n.time=0,t.video=n,y.removeClass(a,"is-loading"),t.loading=!1,t.muted?t.mute(!0,!0):t.volume(t.volumeLevel);var i=t.conf.hlsFix&&/mpegurl/i.exec(n.type);y.toggleClass(a,"hls-fix",!!i)}).on("unload",function(){y.removeClass(a,"is-loading"),p.loading=!1}).on("ready unload",function(e){var t="ready"==e.type;y.toggleClass(a,"is-splash",!t),y.toggleClass(a,"is-ready",t),p.ready=t,p.splash=!t}).on("progress",function(e,t,n){t.video.time=n}).on("buffer",function(e,t,n){t.video.buffer="number"==typeof n?n:n.length?n[n.length-1].end:0}).on("speed",function(e,t,n){t.currentSpeed=n}).on("volume",function(e,t,n){t.volumeLevel=Math.round(100*n)/100,t.muted&&n&&t.mute(!1)}).on("beforeseek seek",function(e){p.seeking="beforeseek"==e.type,y.toggleClass(a,"is-seeking",p.seeking)}).on("ready pause resume unload finish stop",function(e){p.paused=/pause|finish|unload|stop/.test(e.type),p.paused=p.paused||"ready"===e.type&&!s.autoplay&&!p.playing,p.playing=!p.paused,y.toggleClass(a,"is-paused",p.paused),y.toggleClass(a,"is-playing",p.playing),p.load.ed||p.pause()}).on("finish",function(){p.finished=!0}).on("error",function(){})),p.trigger("boot",[p,a]),p}},{"./common":1,"./ext/events":12,"./ext/resolve":21,"./ext/ui/bar-slider":28,"./ext/ui/slider":29,bean:34,"extend-object":39,"is-function":42}],32:[function(e,t,n){e("es5-shim");var b=t.exports=e("./flowplayer");e("./ext/support"),e("./engine/embed"),e("./engine/hlsjs"),e("./engine/html5"),e("./engine/flash"),e("./ext/ui"),e("./ext/message"),e("./ext/keyboard"),e("./ext/playlist"),e("./ext/cuepoint"),e("./ext/subtitle"),e("./ext/analytics"),e("./ext/share"),e("./ext/facebook"),e("./ext/twitter"),e("./ext/embed"),e("./ext/airplay"),e("./ext/chromecast"),e("./ext/qsel"),e("./ext/menu"),e("./ext/fullscreen"),e("./ext/mobile"),b(function(e,l){function t(e,t){for(var n=0,i=(t=function(e){var t="ab.ca,ac.ac,ac.ae,ac.at,ac.be,ac.cn,ac.il,ac.in,ac.jp,ac.kr,ac.sg,ac.th,ac.uk,ad.jp,adm.br,adv.br,ah.cn,am.br,arq.br,art.br,arts.ro,asn.au,asso.fr,asso.mc,bc.ca,bel.tr,bio.br,biz.pl,biz.tr,bj.cn,br.com,cn.com,cng.br,cnt.br,co.ac,co.at,co.de,co.gl,co.hk,co.id,co.il,co.in,co.jp,co.kr,co.mg,co.ms,co.nz,co.th,co.uk,co.ve,co.vi,co.za,com.ag,com.ai,com.ar,com.au,com.br,com.cn,com.co,com.cy,com.de,com.do,com.ec,com.es,com.fj,com.fr,com.gl,com.gt,com.hk,com.hr,com.hu,com.kg,com.ki,com.lc,com.mg,com.mm,com.ms,com.mt,com.mu,com.mx,com.my,com.na,com.nf,com.ng,com.ni,com.pa,com.ph,com.pl,com.pt,com.qa,com.ro,com.ru,com.sb,com.sc,com.sg,com.sv,com.tr,com.tw,com.ua,com.uy,com.ve,com.vn,cp.tz,cq.cn,de.com,de.org,ecn.br,ed.jp,edu.au,edu.cn,edu.hk,edu.mm,edu.my,edu.pl,edu.pt,edu.qa,edu.sg,edu.tr,edu.tw,eng.br,ernet.in,esp.br,etc.br,eti.br,eu.com,eu.int,eu.lv,firm.in,firm.ro,fm.br,fot.br,fst.br,g12.br,gb.com,gb.net,gd.cn,gen.in,go.jp,go.kr,go.th,gov.au,gov.az,gov.br,gov.cn,gov.il,gov.in,gov.mm,gov.my,gov.qa,gov.sg,gov.tr,gov.tw,gov.uk,govt.nz,gr.jp,gs.cn,gv.ac,gv.at,gx.cn,gz.cn,he.cn,hi.cn,hk.cn,hl.cn,hu.com,id.au,idv.tw,in.th,in.ua,ind.br,ind.in,inf.br,info.pl,info.ro,info.tr,info.ve,iwi.nz,jl.cn,jor.br,js.cn,jus.br,k12.il,k12.tr,kr.com,lel.br,lg.jp,ln.cn,ltd.uk,maori.nz,mb.ca,me.uk,med.br,mi.th,mil.br,mil.uk,mo.cn,mod.uk,muni.il,nb.ca,ne.jp,ne.kr,net.ag,net.ai,net.au,net.br,net.cn,net.do,net.gl,net.hk,net.il,net.in,net.kg,net.ki,net.lc,net.mg,net.mm,net.mu,net.ni,net.nz,net.pl,net.ru,net.sb,net.sc,net.sg,net.th,net.tr,net.tw,net.uk,net.ve,nf.ca,nhs.uk,nm.cn,nm.kr,no.com,nom.br,nom.ni,nom.ro,ns.ca,nt.ca,nt.ro,ntr.br,nx.cn,odo.br,off.ai,on.ca,or.ac,or.at,or.jp,or.kr,or.th,org.ag,org.ai,org.au,org.br,org.cn,org.do,org.es,org.gl,org.hk,org.in,org.kg,org.ki,org.lc,org.mg,org.mm,org.ms,org.nf,org.ng,org.ni,org.nz,org.pl,org.ro,org.ru,org.sb,org.sc,org.sg,org.tr,org.tw,org.uk,org.ve,pe.ca,plc.uk,police.uk,ppg.br,presse.fr,pro.br,psc.br,psi.br,qc.ca,qc.com,qh.cn,rec.br,rec.ro,res.in,sa.com,sc.cn,sch.uk,se.com,se.net,sh.cn,sk.ca,slg.br,sn.cn,store.ro,tj.cn,tm.fr,tm.mc,tm.ro,tmp.br,tur.br,tv.br,tv.tr,tw.cn,uk.com,uk.net,us.com,uy.com,vet.br,waw.pl,web.ve,www.ro,xj.cn,xz.cn,yk.ca,yn.cn,zj.cn,zlg.br".split(","),n=(e=e.toLowerCase()).split("."),i=n.length;if(i<2||/^\d+$/.test(n[i-1]))return e;var r=n.slice(-2).join(".");return 3<=i&&0<=t.indexOf(r)?n.slice(-3).join("."):r}(t)).length-1;0<=i;i--)n+=0x65cb98ae4ad1ec*t.charCodeAt(i);for(n=(""+n).substring(0,7),i=0;i<e.length;i++)if(n===e[i].substring(1,8))return 1}var n,i,r,o,a=e.conf,s=b.common,c=s.createElement,u=a.swf.indexOf("flowplayer.org")&&a.e&&l.getAttribute("data-origin"),f=u?(n=u,(i=document.createElement("a")).href=n,s.hostname(i.hostname)):s.hostname(),d=(document,a.key);if("file:"==location.protocol&&(f="localhost"),e.load.ed=1,a.hostname=f,a.origin=u||location.href,u&&(o="is-embedded",-1===(r=l).className.split(" ").indexOf(o)&&(r.className+=" "+o)),"string"==typeof d&&(d=d.split(/,\s*/)),d&&t(d,f)){if(a.logo){var p=s.find(".fp-player",l)[0],h=a.logo.href||"",g=a.logo.src||a.logo,m=c("a",{className:"fp-logo",href:h});u&&(m.href=m.href||u),a.embed&&a.embed.popup&&(m.target="_blank");var v=c("img",{src:g});m.appendChild(v),(p||l).appendChild(m)}}else{m=c("a",{onclick:""});((p=s.find(".fp-player",l)[0])||l).appendChild(m);var y=c("div",{className:"fp-context-menu fp-menu"},'<strong>&copy; 2018 Flowplayer AB</strong><a href="https://flowplayer.com/hello/?from=player">About Flowplayer</a><a href="https://flowplayer.com/license">GPL based license</a>'),w=window.location.href.indexOf("localhost");7!==w&&(p||l).appendChild(y),e.on("pause resume finish unload ready",function(e,t){var n,i=-1;if(t.video.src)for(var r=[["org","flowplayer","drive"],["org","flowplayer","my"],["org","flowplayer","cdn"],["com","flowplayer","cdn"]],o=0;o<r.length&&-1===(i=t.video.src.indexOf("://"+r[o].reverse().join(".")));o++);if(/pause|resume/.test(e.type)&&"flash"!=t.engine.engineName&&4!=i&&5!=i){var a={display:"block",position:"absolute",left:"16px",bottom:"56px",zIndex:99999,width:"120px",height:"27px",backgroundImage:"url("+[".png","fplogo","/",".com","foliovision","//","https:"].reverse().join("")+")"};for(var s in a)a.hasOwnProperty(s)&&(m.style[s]=a[s]);t.load.ed=(n=m,"none"!==window.getComputedStyle(n).display&&(7===w||y.parentNode==l||y.parentNode==p)),t.load.ed||t.pause()}else m.style.display="none"})}})},{"./engine/embed":2,"./engine/flash":3,"./engine/hlsjs":4,"./engine/html5":6,"./ext/airplay":7,"./ext/analytics":8,"./ext/chromecast":9,"./ext/cuepoint":10,"./ext/embed":11,"./ext/facebook":13,"./ext/fullscreen":14,"./ext/keyboard":15,"./ext/menu":16,"./ext/message":17,"./ext/mobile":18,"./ext/playlist":19,"./ext/qsel":20,"./ext/share":22,"./ext/subtitle":23,"./ext/support":25,"./ext/twitter":26,"./ext/ui":27,"./flowplayer":31,"es5-shim":38}],33:[function(e,t,n){"use strict";n.byteLength=function(e){var t=f(e),n=t[0],i=t[1];return 3*(n+i)/4-i},n.toByteArray=function(e){for(var t,n=f(e),i=n[0],r=n[1],o=new u(function(e,t,n){return 3*(t+n)/4-n}(0,i,r)),a=0,s=0<r?i-4:i,l=0;l<s;l+=4)t=c[e.charCodeAt(l)]<<18|c[e.charCodeAt(l+1)]<<12|c[e.charCodeAt(l+2)]<<6|c[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=255&t;2===r&&(t=c[e.charCodeAt(l)]<<2|c[e.charCodeAt(l+1)]>>4,o[a++]=255&t);1===r&&(t=c[e.charCodeAt(l)]<<10|c[e.charCodeAt(l+1)]<<4|c[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t);return o},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,r=[],o=0,a=n-i;o<a;o+=16383)r.push(l(e,o,a<o+16383?a:o+16383));1==i?(t=e[n-1],r.push(s[t>>2]+s[t<<4&63]+"==")):2==i&&(t=(e[n-2]<<8)+e[n-1],r.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return r.join("")};for(var s=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,o=i.length;r<o;++r)s[r]=i[r],c[i.charCodeAt(r)]=r;function f(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,r,o=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(s[(r=i)>>18&63]+s[r>>12&63]+s[r>>6&63]+s[63&r]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],34:[function(e,t,n){var i,r;i=this,r=function(e,t){e=e||"bean",t=t||this;function f(e,t){return e.split(t||" ")}function l(e){return"string"==typeof e}function d(e){return"function"==typeof e}function c(e,t){return L||t||e!==j&&e!==A?e:x}function n(e){a=arguments.length?e:j.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}}function o(e,t){if(L||!t||!e||e.propertyName=="_on"+t){var n=O.get(this,t||e.type,null,!1),i=n.length,r=0;for(e=new z(e,this,!0),t&&(e.type=t);r<i&&!e.isImmediatePropagationStopped();r++)n[r].removed||n[r].handler.call(this,e)}}function p(r,n){function i(e,t){for(var n,i=l(r)?a(r,t):r;e&&e!==t;e=e.parentNode)for(n=i.length;n--;)if(i[n]===e)return e}function e(e){var t=i(e.target,this);t&&n.apply(t,arguments)}return e.__beanDel={ft:i,selector:r},e}var a,h,g,i,r,s,u,m,v,y,w,b,I,M,C,A=window,S=t[e],E=/[^\.]*(?=\..*)\.|.*/,N=/\..*/,D="addEventListener",j=document||{},x=j.documentElement||{},L=x[D],T=L?D:"attachEvent",Z={},P=Array.prototype.slice,k=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},f("click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll "+(L?"show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinput readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ":""))),Y=(C="compareDocumentPosition"in x?function(e,t){return t.compareDocumentPosition&&16==(16&t.compareDocumentPosition(e))}:"contains"in x?function(e,t){return(t=9===t.nodeType||t===window?x:t)!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},{mouseenter:{base:"mouseover",condition:K},mouseleave:{base:"mouseout",condition:K},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}),z=(i=f("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName"),r=i.concat(f("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),s=r.concat(f("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),u=i.concat(f("char charCode key keyCode keyIdentifier keyLocation location")),m=i.concat(f("data")),v=i.concat(f("touches targetTouches changedTouches scale rotation")),y=i.concat(f("data origin source")),w=i.concat(f("state")),b=/over|out/,I=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.keyCode||e.which,u}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,t,n){return t.rightClick=3===e.which||2===e.button,t.pos={x:0,y:0},e.pageX||e.pageY?(t.clientX=e.pageX,t.clientY=e.pageY):(e.clientX||e.clientY)&&(t.clientX=e.clientX+j.body.scrollLeft+x.scrollLeft,t.clientY=e.clientY+j.body.scrollTop+x.scrollTop),b.test(n)&&(t.relatedTarget=e.relatedTarget||e[("mouseover"==n?"from":"to")+"Element"]),r}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return s}},{reg:/^text/i,fix:function(){return m}},{reg:/^touch|^gesture/i,fix:function(){return v}},{reg:/^message$/i,fix:function(){return y}},{reg:/^popstate$/i,fix:function(){return w}},{reg:/.*/,fix:function(){return i}}],M={},_.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},_.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},_.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},_.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},_.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},_.prototype.clone=function(e){var t=new _(this,this.element,this.isNative);return t.currentTarget=e,t},_),G=(X.prototype.inNamespaces=function(e){var t,n,i=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&i++;return e.length===i},X.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},X),O=(h={},g=function(e,t,n,i,r,o){var a=r?"r":"$";if(t&&"*"!=t){var s,l=0,c=h[a+t],u="*"==e;if(!c)return;for(s=c.length;l<s;l++)if((u||c[l].matches(e,n,i))&&!o(c[l],c,l,t))return}else for(var f in h)f.charAt(0)==a&&g(e,f.substr(1),n,i,r,o)},{has:function(e,t,n,i){var r,o=h[(i?"r":"$")+t];if(o)for(r=o.length;r--;)if(!o[r].root&&o[r].matches(e,n,null))return!0;return!1},get:function(e,t,n,i){var r=[];return g(e,t,n,null,i,function(e){return r.push(e)}),r},put:function(e){var t=!e.root&&!this.has(e.element,e.type,null,!1),n=(e.root?"r":"$")+e.type;return(h[n]||(h[n]=[])).push(e),t},del:function(e){g(e.element,e.type,null,e.handler,e.root,function(e,t,n){return t.splice(n,1),e.removed=!0,0===t.length&&delete h[(e.root?"r":"$")+e.type],!1})},entries:function(){var e,t=[];for(e in h)"$"==e.charAt(0)&&(t=t.concat(h[e]));return t}}),R=L?function(e,t,n){e[n?D:"removeEventListener"](t,o,!1)}:function(t,e,n,i){var r;n?(O.put(r=new G(t,i||e,function(e){o.call(t,e,i)},o,null,null,!0)),i&&null==t["_on"+i]&&(t["_on"+i]=0),r.target.attachEvent("on"+r.eventType,r.handler)):(r=O.get(t,i||e,o,!0)[0])&&(r.target.detachEvent("on"+r.eventType,r.handler),O.del(r))},W=function(e,t,n,i,r){return function(){i.apply(this,arguments),e(t,n,r)}},U=function(e,t,n,i){var r,o,a=t&&t.replace(N,""),s=O.get(e,a,null,!1),l={};for(r=0,o=s.length;r<o;r++)n&&s[r].original!==n||!s[r].inNamespaces(i)||(O.del(s[r]),!l[s[r].eventType]&&s[r][T]&&(l[s[r].eventType]={t:s[r].eventType,c:s[r].type}));for(r in l)O.has(e,l[r].t,null,!1)||R(e,l[r].t,!1,l[r].c)},J=L?function(e,t,n){var i=j.createEvent(e?"HTMLEvents":"UIEvents");i[e?"initEvent":"initUIEvent"](t,!0,!0,A,1),n.dispatchEvent(i)}:function(e,t,n){n=c(n,e),e?n.fireEvent("on"+t,j.createEventObject()):n["_on"+t]++},B=function(e,t,n){var i,r,o,a,s=l(t);if(s&&0<t.indexOf(" ")){for(a=(t=f(t)).length;a--;)B(e,t[a],n);return e}if((r=s&&t.replace(N,""))&&Y[r]&&(r=Y[r].base),!t||s)(o=s&&t.replace(E,""))&&(o=f(o,".")),U(e,r,n,o);else if(d(t))U(e,null,t);else for(i in t)t.hasOwnProperty(i)&&B(e,i,t[i]);return e},H=function(e,t,n,i){var r,o,a,s,l,c,u;if(void 0!==n||"object"!=typeof t){for(i=d(n)?(l=P.call(arguments,3),r=n):(r=i,l=P.call(arguments,4),p(n,r)),a=f(t),this===Z&&(i=W(B,e,t,i,r)),s=a.length;s--;)u=O.put(c=new G(e,a[s].replace(N,""),i,r,f(a[s].replace(E,""),"."),l,!1)),c[T]&&u&&R(e,c.eventType,!0,c.customType);return e}for(o in t)t.hasOwnProperty(o)&&H.call(this,e,o,t[o])},F={on:H,add:function(e,t,n,i){return H.apply(null,l(n)?[e,n,t,i].concat(3<arguments.length?P.call(arguments,5):[]):P.call(arguments))},one:function(){return H.apply(Z,arguments)},off:B,remove:B,clone:function(e,t,n){for(var i,r,o=O.get(t,n,null,!1),a=o.length,s=0;s<a;s++)o[s].original&&(i=[e,o[s].type],(r=o[s].handler.__beanDel)&&i.push(r.selector),i.push(o[s].original),H.apply(null,i));return e},fire:function(e,t,n){var i,r,o,a,s,l=f(t);for(i=l.length;i--;)if(t=l[i].replace(N,""),(a=l[i].replace(E,""))&&(a=f(a,".")),a||n||!e[T])for(s=O.get(e,t,null,!1),n=[!1].concat(n),r=0,o=s.length;r<o;r++)s[r].inNamespaces(a)&&s[r].handler.apply(e,n);else J(k[t],t,e);return e},Event:z,setSelectorEngine:n,noConflict:function(){return t[e]=S,this}};function V(n,i,r,o){function a(e,t){return i.apply(n,o?P.call(t,e?0:1).concat(o):t)}function s(e,t){return i.__beanDel?i.__beanDel.ft(e.target,n):t}var e=r?function(e){var t=s(e,this);if(r.apply(t,arguments))return e&&(e.currentTarget=t),a(e,arguments)}:function(e){return i.__beanDel&&(e=e.clone(s(e))),a(e,arguments)};return e.__beanDel=i.__beanDel,e}function X(e,t,n,i,r,o,a){var s,l=Y[t];"unload"==t&&(n=W(U,e,t,n,i)),l&&(l.condition&&(n=V(e,n,l.condition,o)),t=l.base||t),this.isNative=s=k[t]&&!!e[T],this.customType=!L&&!s&&t,this.element=e,this.type=t,this.original=i,this.namespaces=r,this.eventType=L||s?t:"propertychange",this.target=c(e,s),this[T]=!!this.target[T],this.root=a,this.handler=V(e,n,null,o)}function _(e,t,n){if(arguments.length&&(e=e||((t.ownerDocument||t.document||t).parentWindow||A).event,this.originalEvent=e,this.isNative=n,this.isBean=!0,e)){var i,r,o,a,s,l=e.type,c=e.target||e.srcElement;if(this.target=c&&3===c.nodeType?c.parentNode:c,n){if(!(s=M[l]))for(i=0,r=I.length;i<r;i++)if(I[i].reg.test(l)){M[l]=s=I[i].fix;break}for(i=(a=s(e,this,l)).length;i--;)!((o=a[i])in this)&&o in e&&(this[o]=e[o])}}}function K(e){var t=e.relatedTarget;return t?t!==this&&"xul"!==t.prefix&&!/document/.test(this.toString())&&!C(t,this):null==t}if(A.attachEvent){var Q=function(){var e,t=O.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&B(t[e].element,t[e].type);A.detachEvent("onunload",Q),A.CollectGarbage&&A.CollectGarbage()};A.attachEvent("onunload",Q)}return n(),F},void 0!==t&&t.exports?t.exports=r():i.bean=r()},{}],35:[function(t,e,O){(function(e){"use strict";var i=t("base64-js"),o=t("ieee754"),a=t("isarray");function n(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=f.prototype:(null===e&&(e=new f(t)),e.length=t),e}function f(e,t,n){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(e,t,n);if("number"!=typeof e)return r(this,e,t,n);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}function r(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i);f.TYPED_ARRAY_SUPPORT?(e=t).__proto__=f.prototype:e=u(e,t);return e}(e,t,n,i):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|p(t,n),r=(e=s(e,i)).write(t,n);r!==i&&(e=e.slice(0,r));return e}(e,t,n):function(e,t){if(f.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeo
1
  /*!
2
 
3
+ Flowplayer v7.2.11 (2022-09-09) | flowplayer.com/license
4
 
5
  */