EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor - Version 2.7.0

Version Description

Download this release

Release Info

Developer Asif2BD
Plugin Icon wp plugin EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor
Version 2.7.0
Comparing to
See all releases

Code changes from version 2.6.2 to 2.7.0

Files changed (90) hide show
  1. EmbedPress/Core.php +38 -37
  2. EmbedPress/Elementor/Widgets/Embedpress_Elementor.php +1 -1
  3. EmbedPress/Ends/Back/Handler.php +3 -3
  4. EmbedPress/Providers/Giphy.php +13 -5
  5. EmbedPress/Providers/GoogleDocs.php +15 -6
  6. EmbedPress/Providers/GoogleMaps.php +19 -8
  7. EmbedPress/Providers/Twitch.php +13 -5
  8. EmbedPress/RestAPI.php +8 -7
  9. EmbedPress/Shortcode.php +63 -63
  10. Gutenberg/dist/blocks.build.js +1 -1
  11. Gutenberg/package-lock.json +133 -26
  12. Gutenberg/package.json +2 -2
  13. Gutenberg/src/google-docs/edit.js +3 -2
  14. embedpress.php +1 -1
  15. includes.php +1 -1
  16. readme.txt +8 -3
  17. vendor/autoload.php +1 -1
  18. vendor/composer/ClassLoader.php +5 -5
  19. vendor/composer/InstalledVersions.php +218 -0
  20. vendor/composer/autoload_classmap.php +1 -0
  21. vendor/composer/autoload_files.php +0 -11
  22. vendor/composer/autoload_namespaces.php +0 -2
  23. vendor/composer/autoload_psr4.php +1 -3
  24. vendor/composer/autoload_real.php +10 -23
  25. vendor/composer/autoload_static.php +10 -38
  26. vendor/composer/installed.json +70 -242
  27. vendor/composer/installed.php +33 -0
  28. vendor/composer/platform_check.php +26 -0
  29. vendor/ostraining/embera +0 -1
  30. vendor/pimple/pimple/.travis.yml +0 -40
  31. vendor/pimple/pimple/CHANGELOG +0 -59
  32. vendor/pimple/pimple/LICENSE +0 -19
  33. vendor/pimple/pimple/README.rst +0 -326
  34. vendor/pimple/pimple/composer.json +0 -29
  35. vendor/pimple/pimple/ext/pimple/README.md +0 -12
  36. vendor/pimple/pimple/ext/pimple/config.m4 +0 -63
  37. vendor/pimple/pimple/ext/pimple/config.w32 +0 -13
  38. vendor/pimple/pimple/ext/pimple/php_pimple.h +0 -137
  39. vendor/pimple/pimple/ext/pimple/pimple.c +0 -1114
  40. vendor/pimple/pimple/ext/pimple/pimple_compat.h +0 -81
  41. vendor/pimple/pimple/ext/pimple/tests/001.phpt +0 -45
  42. vendor/pimple/pimple/ext/pimple/tests/002.phpt +0 -15
  43. vendor/pimple/pimple/ext/pimple/tests/003.phpt +0 -16
  44. vendor/pimple/pimple/ext/pimple/tests/004.phpt +0 -30
  45. vendor/pimple/pimple/ext/pimple/tests/005.phpt +0 -27
  46. vendor/pimple/pimple/ext/pimple/tests/006.phpt +0 -51
  47. vendor/pimple/pimple/ext/pimple/tests/007.phpt +0 -22
  48. vendor/pimple/pimple/ext/pimple/tests/008.phpt +0 -29
  49. vendor/pimple/pimple/ext/pimple/tests/009.phpt +0 -13
  50. vendor/pimple/pimple/ext/pimple/tests/010.phpt +0 -45
  51. vendor/pimple/pimple/ext/pimple/tests/011.phpt +0 -19
  52. vendor/pimple/pimple/ext/pimple/tests/012.phpt +0 -28
  53. vendor/pimple/pimple/ext/pimple/tests/013.phpt +0 -33
  54. vendor/pimple/pimple/ext/pimple/tests/014.phpt +0 -30
  55. vendor/pimple/pimple/ext/pimple/tests/015.phpt +0 -17
  56. vendor/pimple/pimple/ext/pimple/tests/016.phpt +0 -24
  57. vendor/pimple/pimple/ext/pimple/tests/017.phpt +0 -17
  58. vendor/pimple/pimple/ext/pimple/tests/017_1.phpt +0 -17
  59. vendor/pimple/pimple/ext/pimple/tests/018.phpt +0 -23
  60. vendor/pimple/pimple/ext/pimple/tests/019.phpt +0 -18
  61. vendor/pimple/pimple/ext/pimple/tests/bench.phpb +0 -51
  62. vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb +0 -25
  63. vendor/pimple/pimple/phpunit.xml.dist +0 -14
  64. vendor/pimple/pimple/src/Pimple/Container.php +0 -298
  65. vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php +0 -38
  66. vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php +0 -45
  67. vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php +0 -45
  68. vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php +0 -45
  69. vendor/pimple/pimple/src/Pimple/Psr11/Container.php +0 -55
  70. vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php +0 -75
  71. vendor/pimple/pimple/src/Pimple/ServiceIterator.php +0 -69
  72. vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php +0 -46
  73. vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php +0 -38
  74. vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php +0 -34
  75. vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php +0 -54
  76. vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php +0 -35
  77. vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php +0 -76
  78. vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php +0 -589
  79. vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php +0 -77
  80. vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php +0 -134
  81. vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php +0 -52
  82. vendor/psr/container/LICENSE +0 -21
  83. vendor/psr/container/README.md +0 -5
  84. vendor/psr/container/composer.json +0 -27
  85. vendor/psr/container/src/ContainerExceptionInterface.php +0 -13
  86. vendor/psr/container/src/ContainerInterface.php +0 -37
  87. vendor/psr/container/src/NotFoundExceptionInterface.php +0 -13
  88. vendor/publishpress/edd-license-handler +0 -1
  89. vendor/publishpress/wordpress-edd-license-integration +0 -1
  90. vendor/wpdevelopers/embera +1 -0
EmbedPress/Core.php CHANGED
@@ -4,6 +4,7 @@ namespace EmbedPress;
4
 
5
  use EmbedPress\Ends\Back\Handler as EndHandlerAdmin;
6
  use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
 
7
 
8
 
9
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
@@ -18,7 +19,7 @@ use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
18
  * @since 1.0.0
19
  */
20
  class Core {
21
- use \EmbedPress\Includes\Traits\Shared;
22
 
23
  /**
24
  * The name of the plugin.
@@ -172,43 +173,43 @@ class Core {
172
  '#https?://(.+\.)?viddler\.com/v/.+#i' => 'viddler',
173
 
174
  // Deviantart.com (http://www.deviantart.com)
175
- '#https?://(.+\.)?deviantart\.com/art/.+#i' => 'devianart',
176
- '#https?://(.+\.)?deviantart\.com/.+#i' => 'devianart',
177
- '#https?://(.+\.)?deviantart\.com/.*/d.+#i' => 'devianart',
178
- '#https?://(.+\.)?fav\.me/.+#i' => 'devianart',
179
- '#https?://(.+\.)?sta\.sh/.+#i' => 'devianart',
180
 
181
  // chirbit.com (http://www.chirbit.com/)
182
- '#https?://(.+\.)?chirb\.it/.+#i' => 'chirbit',
183
 
184
 
185
  // nfb.ca (http://www.nfb.ca/)
186
- '#https?://(.+\.)?nfb\.ca/film/.+#i' => 'nfb',
187
 
188
  // Dotsub (http://dotsub.com/)
189
- '#https?://(.+\.)?dotsub\.com/view/.+#i' => 'dotsub',
190
 
191
  // Rdio (http://rdio.com/)
192
  '#https?://(.+\.)?rdio\.com/(artist|people)/.+#i' => 'rdio',
193
 
194
  // Sapo Videos (http://videos.sapo.pt)
195
- '#https?://(.+\.)?videos\.sapo\.pt/.+#i' => 'sapo',
196
 
197
  // Official FM (http://official.fm)
198
  '#https?://(.+\.)?official\.fm/(tracks|playlists)/.+#i' => 'officialfm',
199
 
200
  // HuffDuffer (http://huffduffer.com)
201
- '#https?://(.+\.)?huffduffer\.com/.+#i' => 'huffduffer',
202
 
203
  // Shoudio (http://shoudio.com)
204
- '#https?://(.+\.)?shoudio\.(com|io)/.+#i' => 'shoudio',
205
 
206
  // Moby Picture (http://www.mobypicture.com)
207
  '#https?://(.+\.)?mobypicture\.com/user/.+/view/.+#i' => 'mobypicture',
208
  '#https?://(.+\.)?moby\.to/.+#i' => 'mobypicture',
209
 
210
  // 23HQ (http://www.23hq.com)
211
- '#https?://(.+\.)?23hq\.com/.+/photo/.+#i' => '23hq',
212
 
213
  // Cacoo (https://cacoo.com)
214
  '#https?://(.+\.)?cacoo\.com/diagrams/.+#i' => 'cacoo',
@@ -217,19 +218,19 @@ class Core {
217
  '#https?://(.+\.)?dipity\.com/.+#i' => 'dipity',
218
 
219
  // Roomshare (http://roomshare.jp)
220
- '#https?://(.+\.)?roomshare\.jp/(en/)?post/.+#i' => 'roomshare',
221
 
222
  // Crowd Ranking (http://crowdranking.com)
223
  '#https?://(.+\.)?c9ng\.com/.+#i' => 'crowd',
224
 
225
  // CircuitLab (https://www.circuitlab.com/)
226
- '#https?://(.+\.)?circuitlab\.com/circuit/.+#i' => 'circuitlab',
227
 
228
  // Coub (http://coub.com/)
229
- '#https?://(.+\.)?coub\.com/(view|embed)/.+#i' => 'coub',
230
 
231
  // Ustream (http://www.ustream.tv)
232
- '#https?://(.+\.)?ustream\.(tv|com)/.+#i' => 'ustream',
233
 
234
  // Daily Mile (http://www.dailymile.com)
235
  '#https?://(.+\.)?dailymile\.com/people/.+/entries/.+#i' => 'daily',
@@ -245,25 +246,25 @@ class Core {
245
  '#https?://(.+\.)?rapidengage\.com/s/.+#i' => 'rapidengage',
246
 
247
  // Getty Images (http://www.gettyimages.com/)
248
- '#https?://(.+\.)?gty\.im/.+#i' => 'gettyimages',
249
- '#https?://(.+\.)?gettyimages\.com/detail/photo/.+#i' => 'gettyimages',
250
 
251
  // amCharts Live Editor (http://live.amcharts.com/)
252
- '#https?://(.+\.)?live\.amcharts\.com/.+#i' => 'amcharts',
253
 
254
  // Infogram (https://infogr.am/)
255
- '#https?://(.+\.)?infogr\.am/.+#i' => 'infogram',
256
  //(https://infogram.com/)
257
- '#https?://(.+\.)?infogram\.com/.+#i' => 'infogram',
258
 
259
  // ChartBlocks (http://www.chartblocks.com/)
260
- '#https?://(.+\.)?public\.chartblocks\.com/c/.+#i' => 'chartblocks',
261
 
262
  // ReleaseWire (http://www.releasewire.com/)
263
- '#https?://(.+\.)?rwire\.com/.+#i' => 'releasewire',
264
 
265
  // ShortNote (https://www.shortnote.jp/)
266
- '#https?://(.+\.)?shortnote\.jp/view/notes/.+#i' => 'shortnote',
267
 
268
  // EgliseInfo (http://egliseinfo.catholique.fr/)
269
  '#https?://(.+\.)?egliseinfo\.catholique\.fr/.+#i' => 'egliseinfo',
@@ -276,13 +277,13 @@ class Core {
276
  '#https?://(.+\.)?bambuser\.com/v/.+#i' => 'bambuser',
277
 
278
  // https://clyp.it
279
- '#https?://(.+\.)?clyp\.it/.+#i' => 'clyp',
280
 
281
  // https://gist.github.com
282
  '#https?://(.+\.)?gist\.github\.com/.+#i' => 'github',
283
 
284
  // https://portfolium.com
285
- '#https?://(.+\.)?portfolium\.com/.+#i' => 'portfolium',
286
 
287
  // http://rutube.ru
288
  '#https?://(.+\.)?rutube\.ru/video/.+#i' => 'rutube',
@@ -291,29 +292,29 @@ class Core {
291
  '#https?://(.+\.)?videojug\.com/.+#i' => 'videojug',
292
 
293
  // https://vine.com
294
- '#https?://(.+\.)?vine\.co/v/.+#i' => 'vine',
295
 
296
  // Google Shortened Url
297
  '#https?://(.+\.)?goo\.gl/.+#i' => 'google',
298
 
299
  // Google Maps
300
- '#https?://(.+\.)?google\.com/maps/.+#i' => 'googlemaps',
301
- '#https?://(.+\.)?maps\.google\.com/.+#i' => 'googlemaps',
302
 
303
  // Google Docs
304
- '#https?://(.+\.)?docs\.google\.com/(.+/)?(document|presentation|spreadsheets|forms|drawings)/.+#i' => 'googledocs',
305
 
306
  // Twitch.tv
307
- '#https?://(.+\.)?twitch\.tv/.+#i' => 'twitch',
308
 
309
  // Giphy
310
- '#https?://(.+\.)?giphy\.com/gifs/.+#i' => 'giphy',
311
- '#https?://(.+\.)?i\.giphy\.com/.+#i' => 'giphy',
312
- '#https?://(.+\.)?gph\.is/.+#i' => 'giphy',
313
 
314
  // Wistia
315
- '#https?://(.+\.)?wistia\.com/medias/.+#i' => 'wistia',
316
- '#https?://(.+\.)?fast\.wistia\.com/embed/medias/.+#i\.jsonp' => 'wistia',
317
  ];
318
 
319
  /**
4
 
5
  use EmbedPress\Ends\Back\Handler as EndHandlerAdmin;
6
  use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
7
+ use EmbedPress\Includes\Traits\Shared;
8
 
9
 
10
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
19
  * @since 1.0.0
20
  */
21
  class Core {
22
+ use Shared;
23
 
24
  /**
25
  * The name of the plugin.
173
  '#https?://(.+\.)?viddler\.com/v/.+#i' => 'viddler',
174
 
175
  // Deviantart.com (http://www.deviantart.com)
176
+ // '#https?://(.+\.)?deviantart\.com/art/.+#i' => 'devianart',
177
+ // '#https?://(.+\.)?deviantart\.com/.+#i' => 'devianart',
178
+ // '#https?://(.+\.)?deviantart\.com/.*/d.+#i' => 'devianart',
179
+ // '#https?://(.+\.)?fav\.me/.+#i' => 'devianart',
180
+ // '#https?://(.+\.)?sta\.sh/.+#i' => 'devianart',
181
 
182
  // chirbit.com (http://www.chirbit.com/)
183
+ //'#https?://(.+\.)?chirb\.it/.+#i' => 'chirbit',
184
 
185
 
186
  // nfb.ca (http://www.nfb.ca/)
187
+ //'#https?://(.+\.)?nfb\.ca/film/.+#i' => 'nfb',
188
 
189
  // Dotsub (http://dotsub.com/)
190
+ //'#https?://(.+\.)?dotsub\.com/view/.+#i' => 'dotsub',
191
 
192
  // Rdio (http://rdio.com/)
193
  '#https?://(.+\.)?rdio\.com/(artist|people)/.+#i' => 'rdio',
194
 
195
  // Sapo Videos (http://videos.sapo.pt)
196
+ //'#https?://(.+\.)?videos\.sapo\.pt/.+#i' => 'sapo',
197
 
198
  // Official FM (http://official.fm)
199
  '#https?://(.+\.)?official\.fm/(tracks|playlists)/.+#i' => 'officialfm',
200
 
201
  // HuffDuffer (http://huffduffer.com)
202
+ //'#https?://(.+\.)?huffduffer\.com/.+#i' => 'huffduffer',
203
 
204
  // Shoudio (http://shoudio.com)
205
+ //'#https?://(.+\.)?shoudio\.(com|io)/.+#i' => 'shoudio',
206
 
207
  // Moby Picture (http://www.mobypicture.com)
208
  '#https?://(.+\.)?mobypicture\.com/user/.+/view/.+#i' => 'mobypicture',
209
  '#https?://(.+\.)?moby\.to/.+#i' => 'mobypicture',
210
 
211
  // 23HQ (http://www.23hq.com)
212
+ //'#https?://(.+\.)?23hq\.com/.+/photo/.+#i' => '23hq',
213
 
214
  // Cacoo (https://cacoo.com)
215
  '#https?://(.+\.)?cacoo\.com/diagrams/.+#i' => 'cacoo',
218
  '#https?://(.+\.)?dipity\.com/.+#i' => 'dipity',
219
 
220
  // Roomshare (http://roomshare.jp)
221
+ //'#https?://(.+\.)?roomshare\.jp/(en/)?post/.+#i' => 'roomshare',
222
 
223
  // Crowd Ranking (http://crowdranking.com)
224
  '#https?://(.+\.)?c9ng\.com/.+#i' => 'crowd',
225
 
226
  // CircuitLab (https://www.circuitlab.com/)
227
+ //'#https?://(.+\.)?circuitlab\.com/circuit/.+#i' => 'circuitlab',
228
 
229
  // Coub (http://coub.com/)
230
+ //'#https?://(.+\.)?coub\.com/(view|embed)/.+#i' => 'coub',
231
 
232
  // Ustream (http://www.ustream.tv)
233
+ //'#https?://(.+\.)?ustream\.(tv|com)/.+#i' => 'ustream',
234
 
235
  // Daily Mile (http://www.dailymile.com)
236
  '#https?://(.+\.)?dailymile\.com/people/.+/entries/.+#i' => 'daily',
246
  '#https?://(.+\.)?rapidengage\.com/s/.+#i' => 'rapidengage',
247
 
248
  // Getty Images (http://www.gettyimages.com/)
249
+ //'#https?://(.+\.)?gty\.im/.+#i' => 'gettyimages',
250
+ //'#https?://(.+\.)?gettyimages\.com/detail/photo/.+#i' => 'gettyimages',
251
 
252
  // amCharts Live Editor (http://live.amcharts.com/)
253
+ //'#https?://(.+\.)?live\.amcharts\.com/.+#i' => 'amcharts',
254
 
255
  // Infogram (https://infogr.am/)
256
+ //'#https?://(.+\.)?infogr\.am/.+#i' => 'infogram',
257
  //(https://infogram.com/)
258
+ //'#https?://(.+\.)?infogram\.com/.+#i' => 'infogram',
259
 
260
  // ChartBlocks (http://www.chartblocks.com/)
261
+ //'#https?://(.+\.)?public\.chartblocks\.com/c/.+#i' => 'chartblocks',
262
 
263
  // ReleaseWire (http://www.releasewire.com/)
264
+ //'#https?://(.+\.)?rwire\.com/.+#i' => 'releasewire',
265
 
266
  // ShortNote (https://www.shortnote.jp/)
267
+ //'#https?://(.+\.)?shortnote\.jp/view/notes/.+#i' => 'shortnote',
268
 
269
  // EgliseInfo (http://egliseinfo.catholique.fr/)
270
  '#https?://(.+\.)?egliseinfo\.catholique\.fr/.+#i' => 'egliseinfo',
277
  '#https?://(.+\.)?bambuser\.com/v/.+#i' => 'bambuser',
278
 
279
  // https://clyp.it
280
+ //'#https?://(.+\.)?clyp\.it/.+#i' => 'clyp',
281
 
282
  // https://gist.github.com
283
  '#https?://(.+\.)?gist\.github\.com/.+#i' => 'github',
284
 
285
  // https://portfolium.com
286
+ //'#https?://(.+\.)?portfolium\.com/.+#i' => 'portfolium',
287
 
288
  // http://rutube.ru
289
  '#https?://(.+\.)?rutube\.ru/video/.+#i' => 'rutube',
292
  '#https?://(.+\.)?videojug\.com/.+#i' => 'videojug',
293
 
294
  // https://vine.com
295
+ //'#https?://(.+\.)?vine\.co/v/.+#i' => 'vine',
296
 
297
  // Google Shortened Url
298
  '#https?://(.+\.)?goo\.gl/.+#i' => 'google',
299
 
300
  // Google Maps
301
+ //'#https?://(.+\.)?google\.com/maps/.+#i' => 'googlemaps',
302
+ //'#https?://(.+\.)?maps\.google\.com/.+#i' => 'googlemaps',
303
 
304
  // Google Docs
305
+ //'#https?://(.+\.)?docs\.google\.com/(.+/)?(document|presentation|spreadsheets|forms|drawings)/.+#i' => 'googledocs',
306
 
307
  // Twitch.tv
308
+ //'#https?://(.+\.)?twitch\.tv/.+#i' => 'twitch',
309
 
310
  // Giphy
311
+ //'#https?://(.+\.)?giphy\.com/gifs/.+#i' => 'giphy',
312
+ //'#https?://(.+\.)?i\.giphy\.com/.+#i' => 'giphy',
313
+ //'#https?://(.+\.)?gph\.is/.+#i' => 'giphy',
314
 
315
  // Wistia
316
+ //'#https?://(.+\.)?wistia\.com/medias/.+#i' => 'wistia',
317
+ //'#https?://(.+\.)?fast\.wistia\.com/embed/medias/.+#i\.jsonp' => 'wistia',
318
  ];
319
 
320
  /**
EmbedPress/Elementor/Widgets/Embedpress_Elementor.php CHANGED
@@ -145,7 +145,7 @@ class Embedpress_Elementor extends Widget_Base {
145
 
146
  protected function render() {
147
  $settings = $this->get_settings_for_display();
148
- $embed_content = Shortcode::parseContent( $settings['embedpress_embeded_link'], true, [] );
149
  $embed = apply_filters( 'embedpress_elementor_embed', $embed_content, $settings );
150
  $content = is_object( $embed ) ? $embed->embed : $embed;
151
 
145
 
146
  protected function render() {
147
  $settings = $this->get_settings_for_display();
148
+ $embed_content = Shortcode::parseContent( $settings['embedpress_embeded_link'], true );
149
  $embed = apply_filters( 'embedpress_elementor_embed', $embed_content, $settings );
150
  $content = is_object( $embed ) ? $embed->embed : $embed;
151
 
EmbedPress/Ends/Back/Handler.php CHANGED
@@ -126,16 +126,16 @@ class Handler extends EndHandlerAbstract {
126
  ];
127
 
128
  if ( !!strlen( $response['url'] ) ) {
129
- $embera = new Embera();
130
 
131
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
132
  if ( !empty( $additionalServiceProviders ) ) {
133
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
134
- Shortcode::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls, $embera );
135
  }
136
  }
 
137
 
138
- $urlInfo = $embera->getUrlInfo( $response['url'] );
139
  if ( isset( $urlInfo[$response['url']] ) ) {
140
  $urlInfo = (object)$urlInfo[$response['url']];
141
  $response['canBeResponsive'] = Core::canServiceProviderBeResponsive( $urlInfo->provider_alias );
126
  ];
127
 
128
  if ( !!strlen( $response['url'] ) ) {
 
129
 
130
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
131
  if ( !empty( $additionalServiceProviders ) ) {
132
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
133
+ Shortcode::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls );
134
  }
135
  }
136
+ $embera = new Embera([], Shortcode::get_collection());
137
 
138
+ $urlInfo = $embera->getUrlData( $response['url'] );
139
  if ( isset( $urlInfo[$response['url']] ) ) {
140
  $urlInfo = (object)$urlInfo[$response['url']];
141
  $response['canBeResponsive'] = Core::canServiceProviderBeResponsive( $urlInfo->provider_alias );
EmbedPress/Providers/Giphy.php CHANGED
@@ -2,7 +2,9 @@
2
 
3
  namespace EmbedPress\Providers;
4
 
5
- use Embera\Adapters\Service as EmberaService;
 
 
6
 
7
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
8
 
@@ -16,7 +18,7 @@ use Embera\Adapters\Service as EmberaService;
16
  * @license GPLv3 or later
17
  * @since 1.5.0
18
  */
19
- class Giphy extends EmberaService
20
  {
21
  /**
22
  * The regex which identifies Giphy URLs.
@@ -31,13 +33,14 @@ class Giphy extends EmberaService
31
  /**
32
  * Method that verifies if the embed URL belongs to Giphy.
33
  *
 
 
34
  * @since 1.5.0
35
  *
36
- * @return boolean
37
  */
38
- public function validateUrl()
39
  {
40
- return preg_match($this->urlRegexPattern, $this->url);
41
  }
42
 
43
  /**
@@ -72,4 +75,9 @@ class Giphy extends EmberaService
72
 
73
  return $response;
74
  }
 
 
 
 
 
75
  }
2
 
3
  namespace EmbedPress\Providers;
4
 
5
+ use Embera\Provider\ProviderAdapter;
6
+ use Embera\Provider\ProviderInterface;
7
+ use Embera\Url;
8
 
9
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
10
 
18
  * @license GPLv3 or later
19
  * @since 1.5.0
20
  */
21
+ class Giphy extends ProviderAdapter implements ProviderInterface
22
  {
23
  /**
24
  * The regex which identifies Giphy URLs.
33
  /**
34
  * Method that verifies if the embed URL belongs to Giphy.
35
  *
36
+ * @param Url $url
37
+ * @return boolean
38
  * @since 1.5.0
39
  *
 
40
  */
41
+ public function validateUrl(Url $url)
42
  {
43
+ return (bool) preg_match($this->urlRegexPattern, (string) $url);
44
  }
45
 
46
  /**
75
 
76
  return $response;
77
  }
78
+ /** inline @inheritDoc */
79
+ public function modifyResponse( array $response = [])
80
+ {
81
+ return $this->fakeResponse();
82
+ }
83
  }
EmbedPress/Providers/GoogleDocs.php CHANGED
@@ -2,7 +2,9 @@
2
 
3
  namespace EmbedPress\Providers;
4
 
5
- use Embera\Adapters\Service as EmberaService;
 
 
6
 
7
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
8
 
@@ -16,19 +18,20 @@ use Embera\Adapters\Service as EmberaService;
16
  * @license GPLv3 or later
17
  * @since 1.0.0
18
  */
19
- class GoogleDocs extends EmberaService
20
  {
21
  /**
22
  * Method that verifies if the embed URL belongs to GoogleDocs.
23
  *
 
 
24
  * @since 1.0.0
25
  *
26
- * @return boolean
27
  */
28
- public function validateUrl()
29
  {
30
- return preg_match('~http[s]?:\/\/((?:www\.)?docs\.google\.com\/(?:.*/)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)~i',
31
- $this->url);
32
  }
33
 
34
  /**
@@ -116,4 +119,10 @@ class GoogleDocs extends EmberaService
116
  'wrapper_class' => 'ose-google-docs-' . $type,
117
  ];
118
  }
 
 
 
 
 
 
119
  }
2
 
3
  namespace EmbedPress\Providers;
4
 
5
+ use Embera\Provider\ProviderAdapter;
6
+ use Embera\Provider\ProviderInterface;
7
+ use Embera\Url;
8
 
9
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
10
 
18
  * @license GPLv3 or later
19
  * @since 1.0.0
20
  */
21
+ class GoogleDocs extends ProviderAdapter implements ProviderInterface
22
  {
23
  /**
24
  * Method that verifies if the embed URL belongs to GoogleDocs.
25
  *
26
+ * @param Url $url
27
+ * @return boolean
28
  * @since 1.0.0
29
  *
 
30
  */
31
+ public function validateUrl(Url $url)
32
  {
33
+ return (bool) preg_match('~http[s]?:\/\/((?:www\.)?docs\.google\.com\/(?:.*/)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)~i',
34
+ $url);
35
  }
36
 
37
  /**
119
  'wrapper_class' => 'ose-google-docs-' . $type,
120
  ];
121
  }
122
+
123
+ /** inline @inheritDoc */
124
+ public function modifyResponse( array $response = [])
125
+ {
126
+ return $this->fakeResponse();
127
+ }
128
  }
EmbedPress/Providers/GoogleMaps.php CHANGED
@@ -2,7 +2,9 @@
2
 
3
  namespace EmbedPress\Providers;
4
 
5
- use Embera\Adapters\Service as EmberaService;
 
 
6
 
7
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
8
 
@@ -16,19 +18,24 @@ use Embera\Adapters\Service as EmberaService;
16
  * @license GPLv3 or later
17
  * @since 1.0.0
18
  */
19
- class GoogleMaps extends EmberaService
20
  {
 
 
21
  /**
22
  * Method that verifies if the embed URL belongs to GoogleMaps.
23
  *
 
 
24
  * @since 1.0.0
25
  *
26
- * @return boolean
27
  */
28
- public function validateUrl()
29
  {
30
- return preg_match('~http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)~i',
31
- $this->url);
 
 
32
  }
33
 
34
  /**
@@ -40,8 +47,6 @@ class GoogleMaps extends EmberaService
40
  */
41
  public function fakeResponse()
42
  {
43
- $iframeSrc = '';
44
-
45
  // Check if the url is already converted to the embed format
46
  if (preg_match('~(maps/embed|output=embed)~i', $this->url)) {
47
  $iframeSrc = $this->url;
@@ -62,4 +67,10 @@ class GoogleMaps extends EmberaService
62
  'html' => '<iframe width="600" height="450" src="' . $iframeSrc . '" frameborder="0"></iframe>',
63
  ];
64
  }
 
 
 
 
 
 
65
  }
2
 
3
  namespace EmbedPress\Providers;
4
 
5
+ use Embera\Provider\ProviderAdapter;
6
+ use Embera\Provider\ProviderInterface;
7
+ use Embera\Url;
8
 
9
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
10
 
18
  * @license GPLv3 or later
19
  * @since 1.0.0
20
  */
21
+ class GoogleMaps extends ProviderAdapter implements ProviderInterface
22
  {
23
+ /** inline {@inheritdoc} */
24
+ protected static $hosts = ["google.com", "google.com.*", "maps.google.com", "goo.gl", "google.co.*"];
25
  /**
26
  * Method that verifies if the embed URL belongs to GoogleMaps.
27
  *
28
+ * @param Url $url
29
+ * @return boolean
30
  * @since 1.0.0
31
  *
 
32
  */
33
+ public function validateUrl(Url $url)
34
  {
35
+
36
+ return (bool) preg_match('~http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)~i',
37
+ (string) $url);
38
+
39
  }
40
 
41
  /**
47
  */
48
  public function fakeResponse()
49
  {
 
 
50
  // Check if the url is already converted to the embed format
51
  if (preg_match('~(maps/embed|output=embed)~i', $this->url)) {
52
  $iframeSrc = $this->url;
67
  'html' => '<iframe width="600" height="450" src="' . $iframeSrc . '" frameborder="0"></iframe>',
68
  ];
69
  }
70
+ /** inline @inheritDoc */
71
+ public function modifyResponse( array $response = [])
72
+ {
73
+ return $this->fakeResponse();
74
+ }
75
+
76
  }
EmbedPress/Providers/Twitch.php CHANGED
@@ -2,7 +2,9 @@
2
 
3
  namespace EmbedPress\Providers;
4
 
5
- use Embera\Adapters\Service as EmberaService;
 
 
6
 
7
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
8
 
@@ -16,7 +18,7 @@ use Embera\Adapters\Service as EmberaService;
16
  * @license GPLv3 or later
17
  * @since 1.5.0
18
  */
19
- class Twitch extends EmberaService
20
  {
21
  /**
22
  * The regex which identifies Twitch URLs.
@@ -31,13 +33,14 @@ class Twitch extends EmberaService
31
  /**
32
  * Method that verifies if the embed URL belongs to Twitch.
33
  *
 
 
34
  * @since 1.5.0
35
  *
36
- * @return boolean
37
  */
38
- public function validateUrl()
39
  {
40
- return preg_match($this->urlRegexPattern, $this->url);
41
  }
42
 
43
  /**
@@ -124,4 +127,9 @@ class Twitch extends EmberaService
124
 
125
  return $response;
126
  }
 
 
 
 
 
127
  }
2
 
3
  namespace EmbedPress\Providers;
4
 
5
+ use Embera\Provider\ProviderAdapter;
6
+ use Embera\Provider\ProviderInterface;
7
+ use Embera\Url;
8
 
9
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
10
 
18
  * @license GPLv3 or later
19
  * @since 1.5.0
20
  */
21
+ class Twitch extends ProviderAdapter implements ProviderInterface
22
  {
23
  /**
24
  * The regex which identifies Twitch URLs.
33
  /**
34
  * Method that verifies if the embed URL belongs to Twitch.
35
  *
36
+ * @param Url $url
37
+ * @return boolean
38
  * @since 1.5.0
39
  *
 
40
  */
41
+ public function validateUrl(Url $url)
42
  {
43
+ return (bool) preg_match($this->urlRegexPattern, $this->url);
44
  }
45
 
46
  /**
127
 
128
  return $response;
129
  }
130
+ /** inline @inheritDoc */
131
+ public function modifyResponse( array $response = [])
132
+ {
133
+ return $this->fakeResponse();
134
+ }
135
  }
EmbedPress/RestAPI.php CHANGED
@@ -2,7 +2,9 @@
2
 
3
  namespace EmbedPress;
4
 
 
5
  use WP_Error as WP_ErrorAlias;
 
6
  use WP_REST_Response;
7
 
8
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
@@ -21,27 +23,26 @@ class RestAPI
21
  /**
22
  * @param WP_REST_Request $request
23
  *
24
- * @return WP_REST_Response
25
  */
26
  public static function oembed($request)
27
  {
28
- $url = sanitize_url($request->get_param('url'));
29
 
30
  if (empty($url)) {
31
  return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
32
  }
33
 
34
  $config = [];
35
- $embera = new \Embera\Embera($config);
36
 
37
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
38
  if ( ! empty($additionalServiceProviders)) {
39
  foreach ($additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls) {
40
- Shortcode::addServiceProvider($serviceProviderClassName, $serviceProviderUrls, $embera);
41
  }
42
  }
43
-
44
- $urlInfo = $embera->getUrlInfo($url);
45
  if (isset($urlInfo[$url])) {
46
  $urlInfo = (object)$urlInfo[$url];
47
  $response['canBeResponsive'] = Core::canServiceProviderBeResponsive($urlInfo->provider_alias);
@@ -51,6 +52,6 @@ class RestAPI
51
  return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
52
  }
53
 
54
- return new WP_REST_Response($urlInfo, 202);
55
  }
56
  }
2
 
3
  namespace EmbedPress;
4
 
5
+ use Embera\Embera;
6
  use WP_Error as WP_ErrorAlias;
7
+ use WP_REST_Request;
8
  use WP_REST_Response;
9
 
10
  (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
23
  /**
24
  * @param WP_REST_Request $request
25
  *
26
+ * @return WP_REST_Response | WP_ErrorAlias
27
  */
28
  public static function oembed($request)
29
  {
30
+ $url = esc_url_raw($request->get_param('url'));
31
 
32
  if (empty($url)) {
33
  return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
34
  }
35
 
36
  $config = [];
 
37
 
38
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
39
  if ( ! empty($additionalServiceProviders)) {
40
  foreach ($additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls) {
41
+ Shortcode::addServiceProvider($serviceProviderClassName, $serviceProviderUrls);
42
  }
43
  }
44
+ $embera = new Embera($config, Shortcode::get_collection());
45
+ $urlInfo = $embera->getUrlData($url);
46
  if (isset($urlInfo[$url])) {
47
  $urlInfo = (object)$urlInfo[$url];
48
  $response['canBeResponsive'] = Core::canServiceProviderBeResponsive($urlInfo->provider_alias);
52
  return new WP_ErrorAlias('embedpress_invalid_url', 'Invalid Embed URL', ['status' => 404]);
53
  }
54
 
55
+ return new WP_REST_Response($urlInfo, 200);
56
  }
57
  }
EmbedPress/Shortcode.php CHANGED
@@ -3,7 +3,8 @@
3
  namespace EmbedPress;
4
 
5
  use Embera\Embera;
6
- use Embera\Formatter;
 
7
 
8
  ( defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' ) ) or die( "No direct script access allowed." );
9
 
@@ -24,10 +25,20 @@ class Shortcode {
24
  * @access private
25
  * @static
26
  *
27
- * @var string $oEmbedInstance
28
  */
29
  private static $oEmbedInstance = null;
30
-
 
 
 
 
 
 
 
 
 
 
31
  /**
32
  * Register the plugin's shortcode into WordPress.
33
  *
@@ -68,17 +79,16 @@ class Shortcode {
68
 
69
  return is_object( $embed ) ? $embed->embed : $embed;
70
  }
71
-
72
  /**
73
  * Replace a given content with its embeded HTML code.
74
  *
75
  * @param string The raw content that will be replaced.
76
- * @param boolean Optional. If true, new lines at the end of the embeded code are stripped.
77
- *
78
  * @return string
79
  * @since 1.0.0
80
  * @static
81
- *
82
  */
83
  public static function parseContent( $subject, $stripNewLine = false, $customAttributes = [] ) {
84
  if ( !empty( $subject ) ) {
@@ -124,31 +134,30 @@ class Shortcode {
124
  unset( $attributes[ 'height' ] );
125
  }
126
  }
127
-
128
  // Identify what service provider the shortcode's link belongs to
129
  $serviceProvider = self::$oEmbedInstance->get_provider( $content );
130
-
131
-
132
  // Check if OEmbed was unable to detect the url service provider.
133
  if ( empty( $serviceProvider ) ) {
134
  // Attempt to do the same using Embera.
135
- $emberaInstance = new Embera( $emberaInstanceSettings );
136
  // Add support to the user's custom service providers
137
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
138
  if ( !empty( $additionalServiceProviders ) ) {
139
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
140
- self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls, $emberaInstance );
141
  }
142
-
143
  unset( $serviceProviderUrls, $serviceProviderClassName );
144
  }
145
 
146
  // Attempt to fetch more info about the url-embed.
147
- $urlData = $emberaInstance->getUrlInfo( $content );
 
148
  } else {
149
  // Attempt to fetch more info about the url-embed.
150
  $urlData = self::$oEmbedInstance->fetch( $serviceProvider, $content, $attributes );
151
  }
 
152
 
153
  // Sanitize the data
154
  $urlData = self::sanitizeUrlData( $urlData );
@@ -210,68 +219,51 @@ class Shortcode {
210
  unset( $service, $supportedServicesHeadersPatterns, $headers, $matches );
211
 
212
  }
213
- // Facebook is a special case. WordPress will try to embed them using OEmbed, but they always end up embedding the profile page, regardless
214
- // if the url was pointing to a photo, a post, etc. So, since Embera can embed only facebook-media/posts, we'll use it only for that.
215
- // if ( isset( $urlData->provider_name ) && in_array( $urlData->provider_name, ['Facebook'] ) ) {
216
- // // Check if this is a Facebook profile url.
217
- // if ( preg_match( '/facebook\.com\/(?:[^\/]+?)\/?$/', $content, $match ) ) {
218
- // // Try to embed the url using WP's OSEmbed.
219
- // $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
220
- // } else {
221
- // // Try to embed the url using EmbedPress' Embera.
222
- // $parsedContent = false;
223
- // }
224
- // } else {
225
- // // Try to embed the url using WP's OSEmbed.
226
- //
227
- // }
228
-
229
  $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
230
-
231
-
 
 
 
 
 
 
232
 
233
  if ( !$parsedContent ) {
 
234
  if ( !isset( $emberaInstance ) ) {
235
-
236
- // If the embed couldn't be generated, we'll try to use Embera's API
237
- $emberaInstance = new Embera( $emberaInstanceSettings );
238
  // Add support to the user's custom service providers
239
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
240
  if ( !empty( $additionalServiceProviders ) ) {
241
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
242
- self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls,
243
- $emberaInstance );
244
  }
245
-
246
  unset( $serviceProviderUrls, $serviceProviderClassName );
247
  }
 
248
  }
249
-
250
- // Register the html template
251
- $emberaFormaterInstance = new Formatter( $emberaInstance, true );
252
- $emberaFormaterInstance->setTemplate( $embedTemplate );
253
-
254
- // Try to generate the embed using Embera API
255
- $parsedContent = $emberaFormaterInstance->transform( $content );
256
-
257
- unset( $emberaFormaterInstance, $additionalServiceProviders, $emberaInstance );
258
  } else {
259
  // Inject the generated code inside the html template
260
  $parsedContent = str_replace( '{html}', $parsedContent, $embedTemplate );
261
-
262
  // Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
263
  $parsedContent = str_replace( "'", '"', $parsedContent );
264
-
265
- // Replace the flag `{provider_alias}` which is used by Embera with the "ose-<serviceProviderAlias>". I.e: YouTube -> "ose-youtube"
266
  $parsedContent = preg_replace( '/((?:ose-)?\{provider_alias\})/i',
267
- "ose-" . strtolower( $urlData->provider_name ), $parsedContent );
268
  }
269
 
270
- if ( isset( $urlData->provider_name ) || ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) ) ) {
271
  // NFB seems to always return their embed code with all HTML entities into their applicable characters string.
272
- if ( ( isset( $urlData->provider_name ) && strtoupper( $urlData->provider_name ) === "NATIONAL FILM BOARD OF CANADA" ) || ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) && strtoupper( $urlData[ $content ][ 'provider_name' ] ) === "NATIONAL FILM BOARD OF CANADA" ) ) {
 
273
  $parsedContent = html_entity_decode( $parsedContent );
274
- } elseif ( ( isset( $urlData->provider_name ) && strtoupper( $urlData->provider_name ) === "FACEBOOK" ) || ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) && strtoupper( $urlData[ $content ][ 'provider_name' ] ) === "FACEBOOK" ) ) {
275
  $plgSettings = Core::getSettings();
276
 
277
  // Check if the user wants to force a certain language into Facebook embeds.
@@ -363,30 +355,33 @@ class Shortcode {
363
 
364
  return $subject;
365
  }
366
-
367
  /**
368
  * Method that adds support to a given new service provider (SP).
369
  *
370
  * @param string $className The new SP class name.
371
- * @param string $reference The new SP reference name.
372
- * @param \Embera\Embera $emberaInstance The embera's instance where the SP will be registered in.
373
- *
374
- * @return boolean
375
  * @since 1.0.0
376
  * @static
377
  *
378
  */
379
- public static function addServiceProvider( $className, $reference, &$emberaInstance ) {
380
  if ( empty( $className ) || empty( $reference ) ) {
381
  return false;
382
  }
383
-
 
 
 
384
  if ( is_string( $reference ) ) {
385
- $emberaInstance->addProvider( $reference, EMBEDPRESS_NAMESPACE . "\\Providers\\{$className}" );
 
386
  } elseif ( is_array( $reference ) ) {
387
  foreach ( $reference as $serviceProviderUrl ) {
388
- self::addServiceProvider( $className, $serviceProviderUrl, $emberaInstance );
389
  }
 
390
  } else {
391
  return false;
392
  }
@@ -677,4 +672,9 @@ class Shortcode {
677
  return null;
678
  }
679
  }
 
 
 
 
 
680
  }
3
  namespace EmbedPress;
4
 
5
  use Embera\Embera;
6
+ use Embera\ProviderCollection\DefaultProviderCollection;
7
+ use WP_oEmbed;
8
 
9
  ( defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' ) ) or die( "No direct script access allowed." );
10
 
25
  * @access private
26
  * @static
27
  *
28
+ * @var WP_oEmbed $oEmbedInstance
29
  */
30
  private static $oEmbedInstance = null;
31
+ /**
32
+ * The DefaultProviderCollection class instance.
33
+ *
34
+ * @since 1.0.0
35
+ * @access private
36
+ * @static
37
+ *
38
+ * @var DefaultProviderCollection $collection
39
+ */
40
+ private static $collection = null;
41
+
42
  /**
43
  * Register the plugin's shortcode into WordPress.
44
  *
79
 
80
  return is_object( $embed ) ? $embed->embed : $embed;
81
  }
82
+
83
  /**
84
  * Replace a given content with its embeded HTML code.
85
  *
86
  * @param string The raw content that will be replaced.
87
+ * @param bool $stripNewLine
88
+ * @param array $customAttributes
89
  * @return string
90
  * @since 1.0.0
91
  * @static
 
92
  */
93
  public static function parseContent( $subject, $stripNewLine = false, $customAttributes = [] ) {
94
  if ( !empty( $subject ) ) {
134
  unset( $attributes[ 'height' ] );
135
  }
136
  }
137
+
138
  // Identify what service provider the shortcode's link belongs to
139
  $serviceProvider = self::$oEmbedInstance->get_provider( $content );
140
+
 
141
  // Check if OEmbed was unable to detect the url service provider.
142
  if ( empty( $serviceProvider ) ) {
143
  // Attempt to do the same using Embera.
 
144
  // Add support to the user's custom service providers
145
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
146
  if ( !empty( $additionalServiceProviders ) ) {
147
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
148
+ self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls );
149
  }
 
150
  unset( $serviceProviderUrls, $serviceProviderClassName );
151
  }
152
 
153
  // Attempt to fetch more info about the url-embed.
154
+ $emberaInstance = new Embera( $emberaInstanceSettings, self::$collection );
155
+ $urlData = $emberaInstance->getUrlData( $content );
156
  } else {
157
  // Attempt to fetch more info about the url-embed.
158
  $urlData = self::$oEmbedInstance->fetch( $serviceProvider, $content, $attributes );
159
  }
160
+
161
 
162
  // Sanitize the data
163
  $urlData = self::sanitizeUrlData( $urlData );
219
  unset( $service, $supportedServicesHeadersPatterns, $headers, $matches );
220
 
221
  }
222
+
223
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  $parsedContent = self::$oEmbedInstance->get_html( $content, $attributes );
225
+
226
+ $provider_name = '';
227
+ if (isset( $urlData->provider_name )) {
228
+ $provider_name = isset( $urlData->provider_name );
229
+ }elseif ( is_array( $urlData ) && isset( $urlData[ $content ][ 'provider_name' ] ) ) {
230
+ $provider_name = $urlData[ $content ][ 'provider_name' ];
231
+ }
232
+
233
 
234
  if ( !$parsedContent ) {
235
+ // If the embed couldn't be generated, we'll try to use Embera's API
236
  if ( !isset( $emberaInstance ) ) {
 
 
 
237
  // Add support to the user's custom service providers
238
  $additionalServiceProviders = Core::getAdditionalServiceProviders();
239
  if ( !empty( $additionalServiceProviders ) ) {
240
  foreach ( $additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls ) {
241
+ self::addServiceProvider( $serviceProviderClassName, $serviceProviderUrls);
 
242
  }
243
+
244
  unset( $serviceProviderUrls, $serviceProviderClassName );
245
  }
246
+ $emberaInstance = new Embera( $emberaInstanceSettings );
247
  }
248
+
249
+ // Inject the generated code inside the html template
250
+ $parsedContent = str_replace( '{html}', $emberaInstance->autoEmbed($content), $embedTemplate );
251
+
 
 
 
 
 
252
  } else {
253
  // Inject the generated code inside the html template
254
  $parsedContent = str_replace( '{html}', $parsedContent, $embedTemplate );
 
255
  // Replace all single quotes to double quotes. I.e: foo='joe' -> foo="joe"
256
  $parsedContent = str_replace( "'", '"', $parsedContent );
 
 
257
  $parsedContent = preg_replace( '/((?:ose-)?\{provider_alias\})/i',
258
+ "ose-" . strtolower( $provider_name ), $parsedContent );
259
  }
260
 
261
+ if ( !empty($provider_name) ) {
262
  // NFB seems to always return their embed code with all HTML entities into their applicable characters string.
263
+ $PROVIDER_NAME_IN_CAP = strtoupper($provider_name);
264
+ if ( $PROVIDER_NAME_IN_CAP === "NATIONAL FILM BOARD OF CANADA" ) {
265
  $parsedContent = html_entity_decode( $parsedContent );
266
+ } elseif ( $PROVIDER_NAME_IN_CAP === "FACEBOOK" ) {
267
  $plgSettings = Core::getSettings();
268
 
269
  // Check if the user wants to force a certain language into Facebook embeds.
355
 
356
  return $subject;
357
  }
358
+
359
  /**
360
  * Method that adds support to a given new service provider (SP).
361
  *
362
  * @param string $className The new SP class name.
363
+ * @param string $reference The new SP reference name.*
364
+ * @return DefaultProviderCollection|bool
 
 
365
  * @since 1.0.0
366
  * @static
367
  *
368
  */
369
+ public static function addServiceProvider( $className, $reference ) {
370
  if ( empty( $className ) || empty( $reference ) ) {
371
  return false;
372
  }
373
+
374
+ if (is_null(self::$collection)) {
375
+ self::$collection = new DefaultProviderCollection();
376
+ }
377
  if ( is_string( $reference ) ) {
378
+ self::$collection->addProvider( $reference, EMBEDPRESS_NAMESPACE . "\\Providers\\{$className}" );
379
+ return self::$collection;
380
  } elseif ( is_array( $reference ) ) {
381
  foreach ( $reference as $serviceProviderUrl ) {
382
+ self::addServiceProvider( $className, $serviceProviderUrl);
383
  }
384
+ return self::$collection;
385
  } else {
386
  return false;
387
  }
672
  return null;
673
  }
674
  }
675
+
676
+ public static function get_collection()
677
+ {
678
+ return self::$collection;
679
+ }
680
  }
Gutenberg/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"g",function(){return s}),n.d(t,"f",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return m}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"a",function(){return w});var r=wp.components,i=r.G,l=r.Path,o=(r.Polygon,r.SVG),a=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(i,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null)),c=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(o,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})),w=(wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4 c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8 c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1 c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8 c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2 c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2 c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1 c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7 C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1 c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11 c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2 v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"})))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 276 340"},wp.element.createElement("path",{d:"M196.7.6H24.3C11.1.6.4 11.3.4 24.6v292.9c0 12.3 10 22.2 22.2 22.2H252c13.3 0 23.9-10.7 23.9-23.9V80.9L196.7.6z",fill:"#e94848"}),wp.element.createElement("path",{d:"M196.7 57c0 13.3 10.7 23.9 23.9 23.9H276L196.7.6V57z",fill:"#f19191"}),wp.element.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"77.111",x2:"116.568",y2:"77.111"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M113 84.5H48.3c-1.9 0-3.5-1.6-3.5-3.5v-7.7c0-1.9 1.6-3.5 3.5-3.5H113c1.9 0 3.5 1.6 3.5 3.5V81c.1 1.9-1.5 3.5-3.5 3.5z",fill:"url(#A)"}),wp.element.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.016",x2:"233.927",y2:"136.016"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",opacity:".8",fill:"url(#B)"}),wp.element.createElement("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.993",x2:"233.927",y2:"135.993"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"33.6",opacity:".7",fill:"url(#C)"}),wp.element.createElement("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.969",x2:"233.927",y2:"135.969"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"67.2",opacity:".6",fill:"url(#D)"}),wp.element.createElement("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.045",x2:"233.927",y2:"136.045"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"100.7",opacity:".4",fill:"url(#E)"}),wp.element.createElement("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"270.322",x2:"174.778",y2:"270.322"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M171.9 277.7H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9h124.3c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z",opacity:".3",fill:"url(#F)"}),wp.element.createElement("defs",null,wp.element.createElement("path",{id:"H",d:"M231 143.4H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9H231c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z"}))))},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(i,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.element.Fragment,l=wp.components,o=l.IconButton,a=l.Toolbar,s=wp.editor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(i,null,wp.element.createElement(s,null,wp.element.createElement(a,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=n(10),i=n.n(r),l=wp.i18n,o=l.__,a=l._x,s=wp.components,c=s.Button,u=s.Placeholder,p=s.ExternalLink,m=wp.blockEditor.BlockIcon,d=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,s=e.onChange,d=e.cannotEmbed,f=e.docLink,h=e.DocTitle,w=i()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:w},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:o("Enter URL to embed here\u2026"),onChange:s}),wp.element.createElement(c,{isLarge:!0,type:"submit"},a("Embed","button label")),d&&wp.element.createElement("p",{className:"components-placeholder__error"},o("Sorry, we could not embed that content."),wp.element.createElement("br",null))),f&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:f},h))))};t.a=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(11),a=n.n(o),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),c(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40),n(44);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(7),i=(n.n(r),n(8)),l=(n.n(i),n(9)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:o.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element.Component,f=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"document"==o?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Docs URL");return!d||r?wp.element.createElement("div",null,wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.b,DocTitle:m("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=f},function(e,t,n){var r,i;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var o=n.apply(null,r);o&&e.push(o)}else if("object"===i)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),i=(n.n(r),n(14)),l=(n.n(i),n(15)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:o.g,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"presentation"==o?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:m("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(17),i=(n.n(r),n(18)),l=(n.n(i),n(19)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:o.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];if(o&&"spreadsheets"==o){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var s=!1,c=!1;a.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(21),i=(n.n(r),n(22)),l=(n.n(i),n(23)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:o.d,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=(wp.components.Disabled,function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"forms"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f));t.a=w},function(e,t,n){"use strict";var r=n(25),i=(n.n(r),n(26)),l=(n.n(i),n(27)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:o.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"drawings"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:c.c,DocTitle:p("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:i?"none":""},width:"960",height:"720"}),wp.element.createElement(o.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=h},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(29),l=(n.n(i),n(30)),o=(n.n(l),n(31)),a=n(0),s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:s("Google Maps"),icon:a.e,category:"embedpress",keywords:[s("embedpress"),s("google"),s("maps")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var i=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=i.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(Disabled,null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(33),i=(n.n(r),n(34)),l=(n.n(i),n(35)),o=n(0),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:s("Twitch"),icon:o.h,category:"embedpress",keywords:[s("embedpress"),s("twitch")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs,i=n+"&parent="+embedpressObj.twitch_host;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:i},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var i=this.decodeHTMLEntities(t),l=r.exec(i),o=l[1];console.log(o);var a,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":i="https://player.twitch.tv/?channel="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":i="https://clips.twitch.tv/embed?clip="+o+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":o=l[2],i="https://player.twitch.tv/?video="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":i="http://www.twitch.tv/embed/"+o+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+o+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Twitch URL");if(!h||r)return wp.element.createElement(s.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:d("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"});var v=h+"&parent="+embedpressObj.twitch_host;return wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,p({src:v},b,{onLoad:this.onLoad,style:{display:i?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(37),i=(n.n(r),n(38)),l=(n.n(i),n(39)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:o.i,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:["wide","full","right","left"],default:""},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),i=r[1],l="//fast.wistia.net/embed/iframe/"+i;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:i}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Wistia URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:m("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(41),i=(n.n(r),n(42)),l=(n.n(i),n(43)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:o.j,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:["wide","full","right","left"],default:""},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var i=r[1],l="https://www.youtube.com/embed/"+i,o=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)o.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o.href,mediaId:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Youtube URL");return!h||r?wp.element.createElement(s.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.j,DocTitle:d("Learn More About Youtube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,p({src:h},b,{onLoad:this.onLoad,style:{display:i?"none":""},width:"640",onFocus:this.hideOverlay,height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(45),i=(n.n(r),n(46)),l=(n.n(i),n(47)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/document",{title:a("Document"),icon:o.a,category:"embedpress",keywords:[a("embedpress"),a("pdf"),a("doc"),a("ppt")],supports:{align:["wide","full","right","left"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:600},fileName:{type:"string"},mime:{type:"string"}},edit:l.a,save:function(e){var t=e.attributes,n=t.href,r=t.mime,i=t.id,l=t.width,o=t.height,a=t.powered_by,s="//view.officeapps.live.com/op/embed.aspx?src="+n;return wp.element.createElement("figure",{className:"embedpress-embed-document"},"application/pdf"===r&&wp.element.createElement("div",{style:{height:o,width:l},className:"embedpress-embed-document-pdf "+i,"data-emid":i,"data-emsrc":n}),"application/pdf"!==r&&wp.element.createElement("iframe",{style:{height:o,width:l},src:s,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),a&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(4),a=n(1),s=n(0),c=function(){function e(e,t){var n=[],r=!0,i=!1,l=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,l=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,w=wp.editor,b=w.BlockIcon,y=w.MediaPlaceholder,v=w.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,k=wp.components,_=k.RangeControl,S=k.PanelBody,U=k.ExternalLink,O=k.ToggleControl,R=["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"],M=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return l(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,i=t.noticeOperations,l=n.href;if(f(l)){r({filesList:[d(l)],onFileChange:function(t){var n=c(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),i.createErrorNotice(t)}}),h(l)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&(this.setState({loadPdf:!1}),PDFObject.embed(this.props.attributes.href,"."+this.props.attributes.id))}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),embedpressObj.embedpress_pro&&this.props.setAttributes({powered_by:!1}),"application/pdf"===e.mime&&(this.setState({loadPdf:!1}),PDFObject.embed(e.url,"."+this.props.attributes.id)))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,i=t.href,l=t.mime,c=t.id,u=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,w=f.interactive,g=f.fetching,E=f.loadPdf;if(!i||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(b,{icon:s.a}),labels:{title:p("Document"),instructions:p("Upload a file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:R,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(U,{href:"https://embedpress.com/docs/embed-docuemnt/"},"Learn more about Embedded document "))));var k="//view.officeapps.live.com/op/embed.aspx?src="+i;return wp.element.createElement(L,null,g&&"application/pdf"!==l?wp.element.createElement(a.a,null):null,"application/pdf"===l&&wp.element.createElement("div",{style:{height:m,width:u},className:"embedpress-embed-document-pdf "+c,"data-emid":c,"data-emsrc":i}),"application/pdf"!==l&&wp.element.createElement(o.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:u,display:g||!E?"none":""},onLoad:this.onLoad,src:k,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!w&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(S,{title:p("Embed Size","embedpress")},wp.element.createElement(_,{label:p("Width","embedpress"),value:u,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(_,{label:p("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(O,{label:p("Powered By"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=M}]);
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"g",function(){return s}),n.d(t,"f",function(){return c}),n.d(t,"d",function(){return u}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return m}),n.d(t,"h",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"j",function(){return h}),n.d(t,"a",function(){return w});var r=wp.components,i=r.G,l=r.Path,o=(r.Polygon,r.SVG),a=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#2196F3"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#BBDEFB"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#1565C0"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 23 L 33 23 L 33 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 27 L 33 27 L 33 29 L 15 29 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 31 L 33 31 L 33 33 L 15 33 Z "}),wp.element.createElement(l,{style:{fill:"#E3F2FD"},d:"M 15 35 L 25 35 L 25 37 L 15 37 Z "}))),s=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink","enable-background":"new 0 0 24 24",id:"Layer_2",version:"1.1",viewBox:"0 0 24 24"},wp.element.createElement(i,null,wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14c1.1045704,0,2-0.8954296,2-2 V6z",style:{fill:"#FFC720"}}),wp.element.createElement(l,{d:"M17,6c-0.5444336,0-1.0367432-0.2190552-1.3973999-0.5719604L21,10.8254395V6H17z",style:{fill:"url(#SVGID_1_)"}}),wp.element.createElement(l,{d:"M19,23.75H5c-1.1045532,0-2-0.8954468-2-2V22c0,1.1045532,0.8954468,2,2,2h14c1.1045532,0,2-0.8954468,2-2 v-0.25C21,22.8545532,20.1045532,23.75,19,23.75z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0v4c0,1.1045694,0.8954306,2,2,2h4L15,0z",style:{fill:"#FFE083"}}),wp.element.createElement(l,{d:"M17,5.75c-1.1045532,0-2-0.8954468-2-2V4c0,1.1045532,0.8954468,2,2,2h4l-0.25-0.25H17z",style:{opacity:"0.1"}}),wp.element.createElement(l,{d:"M15,0H5C3.8954468,0,3,0.8953857,3,2v0.25c0-1.1046143,0.8954468-2,2-2h10",style:{fill:"#FFFFFF",opacity:"0.2"}}),wp.element.createElement(l,{d:"M15.5,9h-7C7.6728516,9,7,9.6728516,7,10.5v6C7,17.3271484,7.6728516,18,8.5,18h7 c0.8271484,0,1.5-0.6728516,1.5-1.5v-6C17,9.6728516,16.3271484,9,15.5,9z M8,15.5V11h8v4.5H8z",style:{fill:"#FFFFFF"}}),wp.element.createElement(l,{d:"M21,6l-6-6H5C3.8954306,0,3,0.8954305,3,2v20c0,1.1045704,0.8954306,2,2,2h14 c1.1045704,0,2-0.8954296,2-2V6z",style:{fill:"url(#SVGID_2_)"}})),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null),wp.element.createElement(i,null)),c=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#43A047"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C8E6C9"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 31 23 L 15 23 L 15 37 L 33 37 L 33 23 Z M 17 25 L 21 25 L 21 27 L 17 27 Z M 17 29 L 21 29 L 21 31 L 17 31 Z M 17 33 L 21 33 L 21 35 L 17 35 Z M 31 35 L 23 35 L 23 33 L 31 33 Z M 31 31 L 23 31 L 23 29 L 31 29 Z M 31 27 L 23 27 L 23 25 L 31 25 Z "}))),u=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#7850C1"},d:"M 37 45 L 11 45 C 9.34375 45 8 43.65625 8 42 L 8 6 C 8 4.34375 9.34375 3 11 3 L 30 3 L 40 13 L 40 42 C 40 43.65625 38.65625 45 37 45 Z "}),wp.element.createElement(l,{style:{fill:"#C2ABE1"},d:"M 40 13 L 30 13 L 30 3 Z "}),wp.element.createElement(l,{style:{fill:"#2E7D32"},d:"M 30 13 L 40 23 L 40 13 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 23 L 33 23 L 33 25 L 19 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 28 L 33 28 L 33 30 L 19 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 19 33 L 33 33 L 33 35 L 19 35 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 23 L 17 23 L 17 25 L 15 25 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 28 L 17 28 L 17 30 L 15 30 Z "}),wp.element.createElement(l,{style:{fill:"#E8F5E9"},d:"M 15 33 L 17 33 L 17 35 L 15 35 Z "}))),p=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#DE5245"},d:"M37,45H11c-1.7,0-3-1.3-3-3V6c0-1.7,1.3-3,3-3h19l10,10v29C40,43.7,38.7,45,37,45z"}),wp.element.createElement(l,{style:{fill:"#EEA6A0"},d:"M40,13H30V3L40,13z"}),wp.element.createElement(l,{style:{fill:"#B3433A"},d:"M30,13l10,10V13H30z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M20.5,32c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5s5.5,2.5,5.5,5.5C26,29.5,23.5,32,20.5,32z M20.5,23c-1.9,0-3.5,1.6-3.5,3.5s1.6,3.5,3.5,3.5s3.5-1.6,3.5-3.5S22.4,23,20.5,23z"}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M27.6,29c-0.6,1.8-1.9,3.3-3.6,4.1V38h9v-9H27.6z"}))),m=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#1C9957"},d:"M 42 39 L 42 9 C 42 7.34375 40.65625 6 39 6 L 9 6 C 7.34375 6 6 7.34375 6 9 L 6 39 C 6 40.65625 7.34375 42 9 42 L 39 42 C 40.65625 42 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#3E7BF1"},d:"M 9 42 L 39 42 C 40.65625 42 24 26 24 26 C 24 26 7.34375 42 9 42 Z "}),wp.element.createElement(l,{style:{fill:"#CBCCC9"},d:"M 42 39 L 42 9 C 42 7.34375 26 24 26 24 C 26 24 42 40.65625 42 39 Z "}),wp.element.createElement(l,{style:{fill:"#EFEFEF"},d:"M 39 42 C 40.65625 42 42 40.65625 42 39 L 42 38.753906 L 26.246094 23 L 23 26.246094 L 38.753906 42 Z "}),wp.element.createElement(l,{style:{fill:"#FFD73D"},d:"M 42 9 C 42 7.34375 40.65625 6 39 6 L 38.753906 6 L 6 38.753906 L 6 39 C 6 40.65625 7.34375 42 9 42 L 9.246094 42 L 42 9.246094 Z "}),wp.element.createElement(l,{style:{fill:"#D73F35"},d:"M 36 2 C 30.476563 2 26 6.476563 26 12 C 26 18.8125 33.664063 21.296875 35.332031 31.851563 C 35.441406 32.53125 35.449219 33 36 33 C 36.550781 33 36.558594 32.53125 36.667969 31.851563 C 38.335938 21.296875 46 18.8125 46 12 C 46 6.476563 41.523438 2 36 2 Z "}),wp.element.createElement(l,{style:{fill:"#752622"},d:"M 39.5 12 C 39.5 13.933594 37.933594 15.5 36 15.5 C 34.066406 15.5 32.5 13.933594 32.5 12 C 32.5 10.066406 34.066406 8.5 36 8.5 C 37.933594 8.5 39.5 10.066406 39.5 12 Z "}),wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 14.492188 12.53125 L 14.492188 14.632813 L 17.488281 14.632813 C 17.09375 15.90625 16.03125 16.816406 14.492188 16.816406 C 12.660156 16.816406 11.175781 15.332031 11.175781 13.5 C 11.175781 11.664063 12.660156 10.179688 14.492188 10.179688 C 15.316406 10.179688 16.070313 10.484375 16.648438 10.980469 L 18.195313 9.433594 C 17.21875 8.542969 15.921875 8 14.492188 8 C 11.453125 8 8.992188 10.464844 8.992188 13.5 C 8.992188 16.535156 11.453125 19 14.492188 19 C 19.304688 19 20.128906 14.683594 19.675781 12.539063 Z "}))),d=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 48 48",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#FFFFFF"},d:"M 12 32 L 12 8 L 39 8 L 39 26 L 33 32 L 24 32 L 18 38 L 18 32 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 9 5 L 6 12.121094 L 6 38 L 15 38 L 15 43 L 20 43 L 25 38 L 32 38 L 42 28 L 42 5 Z M 38 26 L 33 31 L 24 31 L 19 36 L 19 31 L 13 31 L 13 9 L 38 9 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 32 25 L 27 25 L 27 15 L 32 15 Z "}),wp.element.createElement(l,{style:{fill:"#8E24AA"},d:"M 24 25 L 19 25 L 19 15 L 24 15 Z "}))),f=wp.element.createElement(o,{xmlns:"http://www.w3.org/1999/xlink",viewBox:"0 0 769 598",version:"1.1"},wp.element.createElement(i,null,wp.element.createElement(l,{style:{fill:"#148ee0"},d:"M766.89,229.17c0,0 -17.78,35.38 -106.5,91.3c-37.82,23.79 -116.36,49.1 -217.33,58.86c-54.52,5.29 -154.9,0.99 -197.96,0.99c-43.29,0 -63.13,9.12 -101.95,52.84c-143.15,161.36 -143.15,161.36 -143.15,161.36c0,0 49.57,0.24 87.01,0.24c37.43,0 271.55,13.59 375.43,-14.98c337.36,-92.72 304.46,-350.62 304.46,-350.62z"}),wp.element.createElement(l,{style:{fill:"#54bbff"},d:"M757.84,126.66c16.23,-98.97 -39.68,-126.16 -39.68,-126.16c0,0 2.36,80.57 -145.7,97.65c-131.42,15.16 -572.46,3.74 -572.46,3.74c0,0 0,0 141.74,162.54c38.39,44.06 58.76,49.17 101.92,52.22c43.16,2.89 138.42,1.86 202.99,-3.05c70.58,-5.41 171.17,-28.43 239.19,-81.11c34.88,-26.98 65.21,-64.48 72,-105.83z"}))),h=wp.element.createElement(o,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement(l,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})),w=(wp.element.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 56 23"},wp.element.createElement("g",null,wp.element.createElement("g",null,wp.element.createElement("path",{style:{fill:"#DA2B28"},className:"st0",d:"M55.4,3.7c-0.2-0.9-0.6-1.6-1.3-2.2c-0.7-0.6-1.4-0.9-2.3-1c-2.7-0.3-6.8-0.4-12.3-0.4 c-5.5,0-9.6,0.1-12.3,0.4c-0.9,0.1-1.6,0.5-2.3,1c-0.7,0.6-1.1,1.3-1.3,2.2c-0.4,1.7-0.6,4.3-0.6,7.8c0,3.5,0.2,6.1,0.6,7.8 c0.2,0.9,0.6,1.6,1.3,2.2c0.7,0.6,1.4,0.9,2.3,1c2.7,0.3,6.8,0.5,12.3,0.5c5.5,0,9.6-0.2,12.3-0.5c0.9-0.1,1.6-0.4,2.3-1 c0.7-0.6,1.1-1.3,1.3-2.2c0.4-1.7,0.6-4.3,0.6-7.8C56,8,55.8,5.4,55.4,3.7L55.4,3.7z M32.5,6h-2.4v12.6h-2.2V6h-2.3V3.9h6.9V6z M38.5,18.6h-2v-1.2c-0.8,0.9-1.6,1.4-2.3,1.4c-0.7,0-1.1-0.3-1.3-0.8c-0.1-0.4-0.2-0.9-0.2-1.6V7.6h2v8.1c0,0.5,0,0.7,0,0.8 c0,0.3,0.2,0.5,0.5,0.5c0.4,0,0.8-0.3,1.3-0.9V7.6h2V18.6z M46.1,15.3c0,1.1-0.1,1.8-0.2,2.2c-0.3,0.8-0.8,1.2-1.6,1.2 c-0.7,0-1.4-0.4-2.1-1.2v1.1h-2V3.9h2v4.8c0.6-0.8,1.3-1.2,2.1-1.2c0.8,0,1.3,0.4,1.6,1.2c0.1,0.4,0.2,1.1,0.2,2.2V15.3z M53.5,13.5h-4v1.9c0,1,0.3,1.5,1,1.5c0.5,0,0.8-0.3,0.9-0.8c0-0.1,0-0.6,0-1.4h2v0.3c0,0.7,0,1.2,0,1.3c0,0.4-0.2,0.8-0.5,1.2 c-0.5,0.8-1.3,1.2-2.4,1.2c-1,0-1.8-0.4-2.4-1.1c-0.4-0.5-0.6-1.4-0.6-2.6v-3.8c0-1.2,0.2-2,0.6-2.6c0.6-0.8,1.4-1.1,2.4-1.1 c1,0,1.8,0.4,2.3,1.1c0.4,0.5,0.6,1.4,0.6,2.6V13.5z M53.5,13.5"}),wp.element.createElement("path",{className:"st0",d:"M43.2,9.3c-0.3,0-0.7,0.2-1,0.5v6.7c0.3,0.3,0.7,0.5,1,0.5c0.6,0,0.9-0.5,0.9-1.5v-4.7 C44.1,9.8,43.8,9.3,43.2,9.3L43.2,9.3z M43.2,9.3"}),wp.element.createElement("path",{className:"st0",d:"M50.6,9.3c-0.7,0-1,0.5-1,1.5v1h2v-1C51.6,9.8,51.2,9.3,50.6,9.3L50.6,9.3z M50.6,9.3"})),wp.element.createElement("g",null,wp.element.createElement("path",{d:"M2.8,12.8v6h2.2v-6L7.7,4H5.5L4,9.8L2.4,4H0.1c0.4,1.2,0.9,2.6,1.4,4.1C2.2,10.2,2.6,11.7,2.8,12.8L2.8,12.8z M2.8,12.8"}),wp.element.createElement("path",{d:"M10.7,19c1,0,1.8-0.4,2.3-1.1c0.4-0.5,0.6-1.4,0.6-2.6v-3.9c0-1.2-0.2-2-0.6-2.6c-0.5-0.8-1.3-1.1-2.3-1.1 c-1,0-1.8,0.4-2.3,1.1C8,9.3,7.8,10.2,7.8,11.4v3.9c0,1.2,0.2,2.1,0.6,2.6C8.9,18.6,9.7,19,10.7,19L10.7,19z M9.8,11 c0-1,0.3-1.5,1-1.5c0.6,0,1,0.5,1,1.5v4.7c0,1-0.3,1.6-1,1.6c-0.6,0-1-0.5-1-1.6V11z M9.8,11"}),wp.element.createElement("path",{d:"M16.8,19c0.7,0,1.5-0.5,2.3-1.4v1.2h2V7.8h-2v8.4c-0.4,0.6-0.9,1-1.3,1c-0.3,0-0.4-0.2-0.5-0.5c0,0,0-0.3,0-0.8V7.8h-2 v8.7c0,0.8,0.1,1.3,0.2,1.7C15.7,18.7,16.1,19,16.8,19L16.8,19z M16.8,19"})))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 276 340"},wp.element.createElement("path",{d:"M196.7.6H24.3C11.1.6.4 11.3.4 24.6v292.9c0 12.3 10 22.2 22.2 22.2H252c13.3 0 23.9-10.7 23.9-23.9V80.9L196.7.6z",fill:"#e94848"}),wp.element.createElement("path",{d:"M196.7 57c0 13.3 10.7 23.9 23.9 23.9H276L196.7.6V57z",fill:"#f19191"}),wp.element.createElement("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"77.111",x2:"116.568",y2:"77.111"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M113 84.5H48.3c-1.9 0-3.5-1.6-3.5-3.5v-7.7c0-1.9 1.6-3.5 3.5-3.5H113c1.9 0 3.5 1.6 3.5 3.5V81c.1 1.9-1.5 3.5-3.5 3.5z",fill:"url(#A)"}),wp.element.createElement("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.016",x2:"233.927",y2:"136.016"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",opacity:".8",fill:"url(#B)"}),wp.element.createElement("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.993",x2:"233.927",y2:"135.993"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"33.6",opacity:".7",fill:"url(#C)"}),wp.element.createElement("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"135.969",x2:"233.927",y2:"135.969"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"67.2",opacity:".6",fill:"url(#D)"}),wp.element.createElement("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"136.045",x2:"233.927",y2:"136.045"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("use",{href:"#H",y:"100.7",opacity:".4",fill:"url(#E)"}),wp.element.createElement("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:"44.744",y1:"270.322",x2:"174.778",y2:"270.322"},wp.element.createElement("stop",{offset:"0","stop-color":"#fff"}),wp.element.createElement("stop",{offset:"1","stop-color":"#fff0f0"})),wp.element.createElement("path",{d:"M171.9 277.7H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9h124.3c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z",opacity:".3",fill:"url(#F)"}),wp.element.createElement("defs",null,wp.element.createElement("path",{id:"H",d:"M231 143.4H47.6c-1.6 0-2.9-1.3-2.9-2.9v-9c0-1.6 1.3-2.9 2.9-2.9H231c1.6 0 2.9 1.3 2.9 2.9v9c0 1.6-1.3 2.9-2.9 2.9z"}))))},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.components.Spinner,l=function(){return wp.element.createElement("div",{className:"wp-block-embed is-loading"},wp.element.createElement(i,null),wp.element.createElement("p",null,r("Embedding\u2026")))};t.a=l},function(e,t,n){"use strict";var r=wp.i18n.__,i=wp.element.Fragment,l=wp.components,o=l.IconButton,a=l.Toolbar,s=wp.editor.BlockControls,c=function(e){var t=e.showEditButton,n=e.switchBackToURLInput;return wp.element.createElement(i,null,wp.element.createElement(s,null,wp.element.createElement(a,null,t&&wp.element.createElement(o,{className:"components-toolbar__control",label:r("Edit URL"),icon:"edit",onClick:n}))))};t.a=c},function(e,t,n){"use strict";var r=n(10),i=n.n(r),l=wp.i18n,o=l.__,a=l._x,s=wp.components,c=s.Button,u=s.Placeholder,p=s.ExternalLink,m=wp.blockEditor.BlockIcon,d=function(e){var t=e.icon,n=e.label,r=e.value,l=e.onSubmit,s=e.onChange,d=e.cannotEmbed,f=e.docLink,h=e.DocTitle,w=i()("wp-block-embed",{});return wp.element.createElement("div",null,wp.element.createElement(u,{icon:wp.element.createElement(m,{icon:t,showColors:!0}),label:n,className:w},wp.element.createElement("form",{onSubmit:l},wp.element.createElement("input",{type:"url",value:r||"",className:"components-placeholder__input","aria-label":n,placeholder:o("Enter URL to embed here\u2026"),onChange:s}),wp.element.createElement(c,{isLarge:!0,type:"submit"},a("Embed","button label")),d&&wp.element.createElement("p",{className:"components-placeholder__error"},o("Sorry, we could not embed that content."),wp.element.createElement("br",null))),f&&wp.element.createElement("div",{className:"components-placeholder__learn-more"},wp.element.createElement(p,{href:f},h))))};t.a=d},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(11),a=n.n(o),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=wp.element.Component,p=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),c(t,[{key:"componentDidMount",value:function(){a.a.findDOMNode(this.refs.iframe).addEventListener("load",this.props.onLoad)}},{key:"render",value:function(){return wp.element.createElement("iframe",s({ref:"iframe"},this.props))}}]),t}(u);t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(6),n(12),n(16),n(20),n(24),n(28),n(32),n(36),n(40),n(44);!function(){var e=wp.element.createElement("svg",{width:"33",height:"20",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 270 270"},wp.element.createElement("g",null,wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"0,0 0,52 15,52 15,15 52,15 52,0 \t"}),wp.element.createElement("polygon",{className:"st0",fill:"#9595C1",points:"255,218 255,255 218,255 218,270 270,270 270,218 \t"}),wp.element.createElement("path",{fill:"#5B4E96",d:"M260.7,68.1c-10.4-18.6-29.3-31.2-50.6-33.6c-12.4-1.4-25,0.6-36.3,6c-1.3,0.6-2.6,1.3-3.9,2 C154.5,51,143,65.3,138.3,81.7l0,0.1l-36.4,103.8c-3.1,9.4-9.1,17-17.1,21.4c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.5,3.2 c-11.5-1.3-21.6-8.1-27.2-18.1c-4.6-8.3-5.7-18-3.1-27.2c2.6-9.2,8.7-16.9,17.1-21.5c0.7-0.4,1.4-0.8,2.1-1.1 c6.1-2.9,12.7-4,19.6-3.2c0.3,0,0.5,0.1,0.8,0.1L64.9,162c-0.5,1.5,0.3,3.1,1.8,3.6l19.4,6.3c1.5,0.5,3-0.3,3.5-1.7l16.7-47.4 c0.4-1.2,0.3-2.5-0.3-3.6c-0.6-1.1-1.6-2-2.8-2.4l-17.6-5.1c-0.4-0.1-0.8-0.2-1.2-0.3l-1.6-0.5l0,0.1c-2.5-0.6-5-1.1-7.5-1.3 c-12.5-1.4-25.1,0.6-36.4,6c-1.3,0.6-2.6,1.3-3.9,2c-15.6,8.7-27,22.9-31.9,40.1c-4.9,17.1-2.8,35.1,5.8,50.5 c10.4,18.6,29.3,31.2,50.6,33.6c12.4,1.4,25-0.6,36.3-6c1.3-0.6,2.6-1.3,3.9-2c15.3-8.5,26.8-22.8,31.6-39.2l0-0.1L167.8,91 l0.1-0.2l0-0.1c4.1-10.5,9.3-17,17-21.3c0.7-0.4,1.4-0.7,2.1-1.1c6.1-2.9,12.8-4,19.5-3.2c11.5,1.3,21.6,8.1,27.2,18.1 c9.6,17.2,3.3,39.1-14,48.7c-0.7,0.4-1.4,0.7-2.1,1.1c-6.1,2.9-12.8,4-19.7,3.2c-2-0.2-4.1-0.6-6.1-1.2l-0.2-0.1l-11.3-3.4 c-1.2-0.4-2.5,0.3-2.9,1.5l-8.8,24.8c-0.5,1.3,0.3,2.7,1.6,3.1l13.9,4c3.4,0.9,6.8,1.6,10.3,2c12.4,1.4,25-0.6,36.3-6l0.1,0 c1.3-0.6,2.6-1.3,3.9-2C266.8,140.8,278.5,100.1,260.7,68.1z"})));wp.blocks.updateCategory("embedpress",{icon:e})}()},function(e,t,n){"use strict";var r=n(7),i=(n.n(r),n(8)),l=(n.n(i),n(9)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-docs-block",{title:a("Google Docs"),icon:o.b,category:"embedpress",keywords:[a("embedpress"),a("google"),a("docs")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("figure",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-document"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element.Component,f=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.updateAlignment=e.updateAlignment.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"updateAlignment",value:function(e){var t=this.props.setAttributes,n=-1!==["wide","full"].indexOf(e)?{width:void 0,height:void 0}:{};t(Object.assign({},n,{align:e}))}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"document"==o?(r.match(/([?&])embedded=true/i)||(r.indexOf("?")>-1?r+="&embedded=true":r+="?embedded=true"),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Docs URL");return!d||r?wp.element.createElement("div",null,wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.b,DocTitle:m("Learn more about Google doc embed"),docLink:"https://embedpress.com/docs/embed-google-docs-wordpress/"})):wp.element.createElement("div",null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onMouseUp:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozAllowFullScreen:"true",webkitAllowFullScreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(d);t.a=f},function(e,t,n){var r,i;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var o=n.apply(null,r);o&&e.push(o)}else if("object"===i)for(var a in r)l.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}var l={}.hasOwnProperty;"undefined"!==typeof e&&e.exports?(n.default=n,e.exports=n):(r=[],void 0!==(i=function(){return n}.apply(t,r))&&(e.exports=i))}()},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";var r=n(13),i=(n.n(r),n(14)),l=(n.n(i),n(15)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-slides-block",{title:a("Google Slides"),icon:o.g,category:"embedpress",keywords:[a("embedpress"),a("google"),a("slides")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-presentation"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"presentation"==o?(r.match(/pub\?/i)&&(r=r.replace("/pub?","/embed?")),this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Slides URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.g,DocTitle:m("Learn more about Google slides embed"),docLink:"https://embedpress.com/docs/embed-google-slides-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(17),i=(n.n(r),n(18)),l=(n.n(i),n(19)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-sheets-block",{title:a("Google Sheets"),icon:o.f,category:"embedpress",keywords:[a("embedpress"),a("google"),a("sheets")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))},deprecated:[{attributes:{align:{type:"string",enum:["left","center","right","wide","full"]}},save:function(e){var t=e.attributes.iframeSrc;if(t)return wp.element.createElement("div",{className:"ose-google-docs-spreadsheets"},wp.element.createElement("iframe",{src:t,frameBorder:"0",width:"600",height:"450",allowFullScreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];if(o&&"spreadsheets"==o){if(r.indexOf("?")>-1){var a=r.split("?");if(a=a[1],a=a.split("&"),console.log(a),a.length>0){var s=!1,c=!1;a.map(function(e){e.indexOf("widget=")?c=!0:e.indexOf("headers=")&&(s=!0)}),c||(r+="&widget=true"),s||(r+="&headers=false")}}else r+="?widget=true&headers=false";this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Sheets URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.f,DocTitle:m("Learn more about Google sheet embed"),docLink:"https://embedpress.com/docs/embed-google-sheets-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(21),i=(n.n(r),n(22)),l=(n.n(i),n(23)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-forms-block",{title:a("Google Forms"),icon:o.d,category:"embedpress",keywords:[a("embedpress"),a("google"),a("forms")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-forms"},wp.element.createElement("iframe",{src:t,frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=(wp.components.Disabled,function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"forms"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Forms URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.d,DocTitle:m("Learn more about Google forms embed"),docLink:"https://embedpress.com/docs/embed-google-forms-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f));t.a=w},function(e,t,n){"use strict";var r=n(25),i=(n.n(r),n(26)),l=(n.n(i),n(27)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-drawings-block",{title:a("Google Drawings"),icon:o.c,category:"embedpress",keywords:[a("embedpress"),a("google"),a("drawings")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-docs-drawings"},wp.element.createElement("img",{src:t,width:"960",height:"720"}))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(0),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.element,d=m.Component,f=m.Fragment,h=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1},e}return l(t,e),u(t,[{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/((?:www\.)?docs\.google\.com(?:.*)?(?:document|presentation|spreadsheets|forms|drawings)\/[a-z0-9\/\?=_\-\.\,&%\$#\@\!\+]*)/i)){var r=this.decodeHTMLEntities(t),i=/google\.com(?:.+)?(document|presentation|spreadsheets|forms|drawings)/i,l=i.exec(r),o=l[1];o&&"drawings"==o?(this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})):this.setState({cannotEmbed:!0,editingURL:!0})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,u=this.props.attributes.iframeSrc,m=p("Google Drawings URL (Get your link from File -> Publish to the web -> Link)");return!u||r?wp.element.createElement(s.a,{label:m,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:c.c,DocTitle:p("Learn more about Google drawing embed"),docLink:"https://embedpress.com/docs/embed-google-drawings-wordpress/"}):wp.element.createElement(f,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("img",{src:u,onLoad:this.onLoad,style:{display:i?"none":""},width:"960",height:"720"}),wp.element.createElement(o.a,{showEditButton:u&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}]),t}(d);t.a=h},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(29),l=(n.n(i),n(30)),o=(n.n(l),n(31)),a=n(0),s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/google-maps-block",{title:s("Google Maps"),icon:a.e,category:"embedpress",keywords:[s("embedpress"),s("google"),s("maps")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:o.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("figure",{className:"ose-google-maps"},wp.element.createElement("iframe",r({src:t,frameborder:"0",width:"600",height:"450"},"frameborder","0")))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&t.match(/^http[s]?:\/\/(?:(?:(?:www\.|maps\.)?(?:google\.com?))|(?:goo\.gl))(?:\.[a-z]{2})?\/(?:maps\/)?(?:place\/)?(?:[a-z0-9\/%+\-_]*)?([a-z0-9\/%,+\-_=!:@\.&*\$#?\']*)/i)){var r=this.decodeHTMLEntities(t);if(t.match("~(maps/embed|output=embed)~i"));else{var i=/@(-?[0-9\.]+,-?[0-9\.]+).+,([0-9\.]+[a-z])/i,l=i.exec(r);l&&l.length>1&&l[1]&&l[2]?r="https://maps.google.com/maps?hl=en&ie=UTF8&ll="+l[1]+"&spn="+l[1]+"&t=m&z="+Math.round(parseInt(l[2]))+"&output=embed":this.setState({cannotEmbed:!0,editingURL:!0})}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:r})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Google Maps URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.e,DocTitle:m("Learn more about Google map embed"),docLink:"https://embedpress.com/docs/embed-google-maps-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(Disabled,null,wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(33),i=(n.n(r),n(34)),l=(n.n(i),n(35)),o=n(0),a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/twitch-block",{title:s("Twitch"),icon:o.h,category:"embedpress",keywords:[s("embedpress"),s("twitch")],supports:{align:["wide","full","right","left"],default:""},attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""},attrs:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes,n=t.iframeSrc,r=t.attrs,i=n+"&parent="+embedpressObj.twitch_host;return wp.element.createElement("figure",{className:"ose-twitch-presentation"},wp.element.createElement("iframe",a({src:i},r,{frameborder:"0",width:"600",height:"450"})))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=/http[s]?:\/\/(?:www\.|clips\.)twitch\.tv\/([0-9a-zA-Z\-\_]+)\/?(chat\/?$|[0-9a-z\-\_]*)?/;if(t&&t.match(r)){var i=this.decodeHTMLEntities(t),l=r.exec(i),o=l[1];console.log(o);var a,s="channel";switch(t.indexOf("clips.twitch.tv")>-1?s="clip":t.indexOf("/videos/")>-1?s="video":t.indexOf("#/chat$#")>-1&&(s="chat"),console.log(s),s){case"channel":i="https://player.twitch.tv/?channel="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"clip":i="https://clips.twitch.tv/embed?clip="+o+"&autoplay=false",a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"video":o=l[2],i="https://player.twitch.tv/?video="+o,a={scrolling:"no",frameborder:"0",allowfullscreen:"true"};break;case"chat":i="http://www.twitch.tv/embed/"+o+"/chat",a={scrolling:"yes",frameborder:"0",allowfullscreen:"true",id:"'"+o+"'"}}this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:i,attrs:a})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Twitch URL");if(!h||r)return wp.element.createElement(s.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.h,DocTitle:d("Learn more about twitch embed"),docLink:"https://embedpress.com/docs/embed-twitch-streams-chat/"});var v=h+"&parent="+embedpressObj.twitch_host;return wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,p({src:v},b,{onLoad:this.onLoad,style:{display:i?"none":""},onFocus:this.hideOverlay,width:"600",height:"450"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(37),i=(n.n(r),n(38)),l=(n.n(i),n(39)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/wistia-block",{title:a("Wistia"),icon:o.i,category:"embedpress",keywords:[a("embedpress"),a("wistia")],supports:{align:["wide","full","right","left"],default:""},edit:l.a,save:function(e){return null},deprecated:[{attributes:{url:{type:"string",default:""},iframeSrc:{type:"string",default:""}},edit:l.a,save:function(e){var t=e.attributes.iframeSrc;return wp.element.createElement("div",{class:"ose-wistia"},wp.element.createElement("iframe",{src:t,allowtransparency:"true",frameborder:"0",class:"wistia_embed",name:"wistia_embed",width:"600",height:"330"}))}}]})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),m=wp.i18n.__,d=wp.element,f=d.Component,h=d.Fragment,w=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1,mediaId:null},e.setUrl(),e}return l(t,e),p(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentDidMount",value:function(){if(this.props.attributes.url){var e=this.props.attributes.url.match(/medias\/(.*)/),t=e[1];this.setState(Object.assign({},this.state,{mediaId:t}))}}},{key:"onLoad",value:function(){if(this.setState({fetching:!1}),embedpressObj.wisita_options){var e=Object.assign({},this.state);setTimeout(function(){var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.charset="ISO-8859-1",document.body.appendChild(e)},100),setTimeout(function(){var t=document.createElement("script");t.type="text/javascript",t.innerHTML="window.pp_embed_wistia_labels = "+embedpressObj.wistia_labels,document.body.appendChild(t),t=document.createElement("script"),t.type="text/javascript",t.innerHTML='wistiaEmbed = Wistia.embed( "'+e.mediaId+'", '+embedpressObj.wisita_options+" );",document.body.appendChild(t)},400)}}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;if(n({url:t}),t&&(t.match(/^http[s]?:\/\/(?:www\.)?wistia\.com\/medias/i)||t.match(/^http[s]?:\/\/(?:www\.)?fast\/.wistia\.com\/embed\/medias/i.jsonp))){var r=t.match(/medias\/(.*)/),i=r[1],l="//fast.wistia.net/embed/iframe/"+i;this.setState({editingURL:!1,cannotEmbed:!1,mediaId:i}),n({iframeSrc:l})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,p=t.interactive,d=this.props.attributes.iframeSrc,f=m("Wistia URL");return!d||r?wp.element.createElement(s.a,{label:f,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.i,DocTitle:m("Learn more about Wistia embed"),docLink:"https://embedpress.com/docs/embed-wistia-videos-wordpress/"}):wp.element.createElement(h,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement("div",{className:"ose-wistia",id:"wistia_"+this.state.mediaId},wp.element.createElement(c.a,{src:d,onFocus:this.hideOverlay,onLoad:this.onLoad,style:{display:i?"none":""},frameborder:"0",width:"600",height:"330",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!p&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:d&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(f);t.a=w},function(e,t,n){"use strict";var r=n(41),i=(n.n(r),n(42)),l=(n.n(i),n(43)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/youtube-block",{title:a("Youtube"),icon:o.j,category:"embedpress",keywords:[a("embedpress"),a("youtube")],supports:{align:["wide","full","right","left"],default:""},edit:l.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(2),a=n(1),s=n(3),c=n(4),u=n(0),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=wp.i18n.__,f=wp.element,h=f.Component,w=f.Fragment,b=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.switchBackToURLInput=e.switchBackToURLInput.bind(e),e.setUrl=e.setUrl.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={editingURL:!1,url:e.props.attributes.url,fetching:!0,cannotEmbed:!1,interactive:!1},e}return l(t,e),m(t,[{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"componentWillMount",value:function(){this.state.url&&this.setUrl()}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"decodeHTMLEntities",value:function(e){return e&&"string"===typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,"")),e}},{key:"setUrl",value:function(e){e&&e.preventDefault();var t=this.state.url,n=this.props.setAttributes;n({url:t});var r=t.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/);if(t&&r){var i=r[1],l="https://www.youtube.com/embed/"+i,o=new URL(l);if("undefined"!==typeof embedpressProObj)for(var a in embedpressProObj.youtubeParams)o.searchParams.set(a,embedpressProObj.youtubeParams[a]);this.setState({editingURL:!1,cannotEmbed:!1}),n({iframeSrc:o.href,mediaId:i})}else this.setState({cannotEmbed:!0,editingURL:!0})}},{key:"switchBackToURLInput",value:function(){this.setState({editingURL:!0})}},{key:"render",value:function(){var e=this,t=this.state,n=t.url,r=t.editingURL,i=t.fetching,l=t.cannotEmbed,m=t.interactive,f=this.props.attributes,h=f.iframeSrc,b=f.attrs,y=d("Youtube URL");return!h||r?wp.element.createElement(s.a,{label:y,onSubmit:this.setUrl,value:n,cannotEmbed:l,onChange:function(t){return e.setState({url:t.target.value})},icon:u.j,DocTitle:d("Learn More About Youtube Embed"),docLink:"https://embedpress.com/docs/embed-youtube-wordpress/"}):wp.element.createElement(w,null,i?wp.element.createElement(a.a,null):null,wp.element.createElement(c.a,p({src:h},b,{onLoad:this.onLoad,style:{display:i?"none":""},width:"640",onFocus:this.hideOverlay,height:"450",allowfullscreen:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true"})),!m&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),wp.element.createElement(o.a,{showEditButton:h&&!l,switchBackToURLInput:this.switchBackToURLInput}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(h);t.a=b},function(e,t,n){"use strict";var r=n(45),i=(n.n(r),n(46)),l=(n.n(i),n(47)),o=n(0),a=wp.i18n.__;(0,wp.blocks.registerBlockType)("embedpress/document",{title:a("Document"),icon:o.a,category:"embedpress",keywords:[a("embedpress"),a("pdf"),a("doc"),a("ppt")],supports:{align:["wide","full","right","left"],default:""},attributes:{id:{type:"string"},href:{type:"string"},powered_by:{type:"boolean",default:!0},width:{type:"number",default:600},height:{type:"number",default:600},fileName:{type:"string"},mime:{type:"string"}},edit:l.a,save:function(e){var t=e.attributes,n=t.href,r=t.mime,i=t.id,l=t.width,o=t.height,a=t.powered_by,s="//view.officeapps.live.com/op/embed.aspx?src="+n;return wp.element.createElement("figure",{className:"embedpress-embed-document"},"application/pdf"===r&&wp.element.createElement("div",{style:{height:o,width:l},className:"embedpress-embed-document-pdf "+i,"data-emid":i,"data-emsrc":n}),"application/pdf"!==r&&wp.element.createElement("iframe",{style:{height:o,width:l},src:s,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),a&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"))}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=n(4),a=n(1),s=n(0),c=function(){function e(e,t){var n=[],r=!0,i=!1,l=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,l=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=wp.i18n.__,m=wp.blob,d=m.getBlobByURL,f=m.isBlobURL,h=m.revokeBlobURL,w=wp.editor,b=w.BlockIcon,y=w.MediaPlaceholder,v=w.InspectorControls,g=wp.element,E=g.Component,L=g.Fragment,k=wp.components,_=k.RangeControl,S=k.PanelBody,U=k.ExternalLink,O=k.ToggleControl,R=["application/pdf","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"],M=function(e){function t(){r(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onSelectFile=e.onSelectFile.bind(e),e.onUploadError=e.onUploadError.bind(e),e.onLoad=e.onLoad.bind(e),e.hideOverlay=e.hideOverlay.bind(e),e.state={hasError:!1,fetching:!1,interactive:!1,loadPdf:!0},e}return l(t,e),u(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.attributes,r=t.mediaUpload,i=t.noticeOperations,l=n.href;if(f(l)){r({filesList:[d(l)],onFileChange:function(t){var n=c(t,1),r=n[0];return e.onSelectFile(r)},onError:function(t){e.setState({hasError:!0}),i.createErrorNotice(t)}}),h(l)}this.props.attributes.href&&"application/pdf"===this.props.attributes.mime&&this.state.loadPdf&&(this.setState({loadPdf:!1}),PDFObject.embed(this.props.attributes.href,"."+this.props.attributes.id))}},{key:"componentDidUpdate",value:function(e){e.isSelected&&!this.props.isSelected&&this.setState({showCopyConfirmation:!1})}},{key:"hideOverlay",value:function(){this.setState({interactive:!0})}},{key:"onLoad",value:function(){this.setState({fetching:!1})}},{key:"onSelectFile",value:function(e){e&&e.url&&(this.setState({hasError:!1}),this.props.setAttributes({href:e.url,fileName:e.title,id:"embedpress-pdf-"+Date.now(),mime:e.mime}),embedpressObj.embedpress_pro&&this.props.setAttributes({powered_by:!1}),"application/pdf"===e.mime&&(this.setState({loadPdf:!1}),PDFObject.embed(e.url,"."+this.props.attributes.id)))}},{key:"onUploadError",value:function(e){var t=this.props.noticeOperations;t.removeAllNotices(),t.createErrorNotice(e)}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.noticeUI,r=e.setAttributes,i=t.href,l=t.mime,c=t.id,u=t.width,m=t.height,d=t.powered_by,f=this.state,h=f.hasError,w=f.interactive,g=f.fetching,E=f.loadPdf;if(!i||h)return wp.element.createElement("div",{className:"embedpress-document-editmode"},wp.element.createElement(y,{icon:wp.element.createElement(b,{icon:s.a}),labels:{title:p("Document"),instructions:p("Upload a file or pick one from your media library for embed.")},onSelect:this.onSelectFile,notices:n,allowedTypes:R,onError:this.onUploadError},wp.element.createElement("div",{style:{width:"100%"},className:"components-placeholder__learn-more embedpress-doc-link"},wp.element.createElement(U,{href:"https://embedpress.com/docs/embed-docuemnt/"},"Learn more about Embedded document "))));var k="//view.officeapps.live.com/op/embed.aspx?src="+i;return wp.element.createElement(L,null,g&&"application/pdf"!==l?wp.element.createElement(a.a,null):null,"application/pdf"===l&&wp.element.createElement("div",{style:{height:m,width:u},className:"embedpress-embed-document-pdf "+c,"data-emid":c,"data-emsrc":i}),"application/pdf"!==l&&wp.element.createElement(o.a,{onMouseUponMouseUp:this.hideOverlay,style:{height:m,width:u,display:g||!E?"none":""},onLoad:this.onLoad,src:k,mozallowfullscreen:"true",webkitallowfullscreen:"true"}),!w&&wp.element.createElement("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}),d&&wp.element.createElement("p",{className:"embedpress-el-powered"},"Powered By EmbedPress"),wp.element.createElement(v,{key:"inspector"},wp.element.createElement(S,{title:p("Embed Size","embedpress")},wp.element.createElement(_,{label:p("Width","embedpress"),value:u,onChange:function(e){return r({width:e})},max:1e3,min:1}),wp.element.createElement(_,{label:p("Height","embedpress"),value:m,onChange:function(e){return r({height:e})},max:1e3,min:1}),wp.element.createElement(O,{label:p("Powered By"),onChange:function(e){return r({powered_by:e})},checked:d}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}}]),t}(E);t.a=M}]);
Gutenberg/package-lock.json CHANGED
@@ -336,17 +336,20 @@
336
  "arr-diff": {
337
  "version": "4.0.0",
338
  "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
339
- "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA="
 
340
  },
341
  "arr-flatten": {
342
  "version": "1.1.0",
343
  "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
344
- "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg=="
 
345
  },
346
  "arr-union": {
347
  "version": "3.1.0",
348
  "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
349
- "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ="
 
350
  },
351
  "array-find-index": {
352
  "version": "1.0.2",
@@ -366,7 +369,8 @@
366
  "array-unique": {
367
  "version": "0.3.2",
368
  "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
369
- "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg="
 
370
  },
371
  "array.prototype.flatmap": {
372
  "version": "1.2.3",
@@ -435,7 +439,8 @@
435
  "assign-symbols": {
436
  "version": "1.0.0",
437
  "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
438
- "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c="
 
439
  },
440
  "ast-types-flow": {
441
  "version": "0.0.7",
@@ -469,7 +474,8 @@
469
  "atob": {
470
  "version": "2.1.2",
471
  "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
472
- "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg=="
 
473
  },
474
  "autoprefixer": {
475
  "version": "7.2.6",
@@ -1230,6 +1236,7 @@
1230
  "version": "0.11.2",
1231
  "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
1232
  "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
 
1233
  "requires": {
1234
  "cache-base": "^1.0.1",
1235
  "class-utils": "^0.3.5",
@@ -1244,6 +1251,7 @@
1244
  "version": "1.0.0",
1245
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
1246
  "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
 
1247
  "requires": {
1248
  "is-descriptor": "^1.0.0"
1249
  }
@@ -1252,6 +1260,7 @@
1252
  "version": "1.0.0",
1253
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
1254
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
 
1255
  "requires": {
1256
  "kind-of": "^6.0.0"
1257
  }
@@ -1260,6 +1269,7 @@
1260
  "version": "1.0.0",
1261
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
1262
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
 
1263
  "requires": {
1264
  "kind-of": "^6.0.0"
1265
  }
@@ -1268,6 +1278,7 @@
1268
  "version": "1.0.2",
1269
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
1270
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
 
1271
  "requires": {
1272
  "is-accessor-descriptor": "^1.0.0",
1273
  "is-data-descriptor": "^1.0.0",
@@ -1479,6 +1490,7 @@
1479
  "version": "1.0.1",
1480
  "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
1481
  "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
 
1482
  "requires": {
1483
  "collection-visit": "^1.0.0",
1484
  "component-emitter": "^1.2.1",
@@ -1691,6 +1703,7 @@
1691
  "version": "0.3.6",
1692
  "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
1693
  "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
 
1694
  "requires": {
1695
  "arr-union": "^3.1.0",
1696
  "define-property": "^0.2.5",
@@ -1702,6 +1715,7 @@
1702
  "version": "0.2.5",
1703
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
1704
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
 
1705
  "requires": {
1706
  "is-descriptor": "^0.1.0"
1707
  }
@@ -1801,6 +1815,7 @@
1801
  "version": "1.0.0",
1802
  "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
1803
  "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
 
1804
  "requires": {
1805
  "map-visit": "^1.0.0",
1806
  "object-visit": "^1.0.0"
@@ -1835,7 +1850,8 @@
1835
  "component-emitter": {
1836
  "version": "1.3.0",
1837
  "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
1838
- "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
 
1839
  },
1840
  "concat-map": {
1841
  "version": "0.0.1",
@@ -1892,7 +1908,8 @@
1892
  "copy-descriptor": {
1893
  "version": "0.1.1",
1894
  "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
1895
- "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
 
1896
  },
1897
  "core-js": {
1898
  "version": "2.6.11",
@@ -2081,7 +2098,8 @@
2081
  "decode-uri-component": {
2082
  "version": "0.2.0",
2083
  "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
2084
- "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
 
2085
  },
2086
  "deep-extend": {
2087
  "version": "0.6.0",
@@ -2105,6 +2123,7 @@
2105
  "version": "2.0.2",
2106
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
2107
  "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
 
2108
  "requires": {
2109
  "is-descriptor": "^1.0.2",
2110
  "isobject": "^3.0.1"
@@ -2114,6 +2133,7 @@
2114
  "version": "1.0.0",
2115
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
2116
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
 
2117
  "requires": {
2118
  "kind-of": "^6.0.0"
2119
  }
@@ -2122,6 +2142,7 @@
2122
  "version": "1.0.0",
2123
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
2124
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
 
2125
  "requires": {
2126
  "kind-of": "^6.0.0"
2127
  }
@@ -2130,6 +2151,7 @@
2130
  "version": "1.0.2",
2131
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
2132
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
 
2133
  "requires": {
2134
  "is-accessor-descriptor": "^1.0.0",
2135
  "is-data-descriptor": "^1.0.0",
@@ -2660,6 +2682,7 @@
2660
  "version": "2.1.4",
2661
  "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
2662
  "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
 
2663
  "requires": {
2664
  "debug": "^2.3.3",
2665
  "define-property": "^0.2.5",
@@ -2674,6 +2697,7 @@
2674
  "version": "0.2.5",
2675
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
2676
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
 
2677
  "requires": {
2678
  "is-descriptor": "^0.1.0"
2679
  }
@@ -2682,6 +2706,7 @@
2682
  "version": "2.0.1",
2683
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
2684
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
2685
  "requires": {
2686
  "is-extendable": "^0.1.0"
2687
  }
@@ -2712,6 +2737,7 @@
2712
  "version": "3.0.2",
2713
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
2714
  "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
 
2715
  "requires": {
2716
  "assign-symbols": "^1.0.0",
2717
  "is-extendable": "^1.0.1"
@@ -2721,6 +2747,7 @@
2721
  "version": "1.0.1",
2722
  "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
2723
  "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
 
2724
  "requires": {
2725
  "is-plain-object": "^2.0.4"
2726
  }
@@ -2741,6 +2768,7 @@
2741
  "version": "2.0.4",
2742
  "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
2743
  "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
 
2744
  "requires": {
2745
  "array-unique": "^0.3.2",
2746
  "define-property": "^1.0.0",
@@ -2756,6 +2784,7 @@
2756
  "version": "1.0.0",
2757
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
2758
  "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
 
2759
  "requires": {
2760
  "is-descriptor": "^1.0.0"
2761
  }
@@ -2764,6 +2793,7 @@
2764
  "version": "2.0.1",
2765
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
2766
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
2767
  "requires": {
2768
  "is-extendable": "^0.1.0"
2769
  }
@@ -2772,6 +2802,7 @@
2772
  "version": "1.0.0",
2773
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
2774
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
 
2775
  "requires": {
2776
  "kind-of": "^6.0.0"
2777
  }
@@ -2780,6 +2811,7 @@
2780
  "version": "1.0.0",
2781
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
2782
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
 
2783
  "requires": {
2784
  "kind-of": "^6.0.0"
2785
  }
@@ -2788,6 +2820,7 @@
2788
  "version": "1.0.2",
2789
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
2790
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
 
2791
  "requires": {
2792
  "is-accessor-descriptor": "^1.0.0",
2793
  "is-data-descriptor": "^1.0.0",
@@ -2919,6 +2952,7 @@
2919
  "version": "0.2.1",
2920
  "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
2921
  "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
 
2922
  "requires": {
2923
  "map-cache": "^0.2.2"
2924
  }
@@ -3026,7 +3060,8 @@
3026
  "get-value": {
3027
  "version": "2.0.6",
3028
  "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
3029
- "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg="
 
3030
  },
3031
  "getpass": {
3032
  "version": "0.1.7",
@@ -3185,6 +3220,7 @@
3185
  "version": "1.0.0",
3186
  "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
3187
  "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
 
3188
  "requires": {
3189
  "get-value": "^2.0.6",
3190
  "has-values": "^1.0.0",
@@ -3195,6 +3231,7 @@
3195
  "version": "1.0.0",
3196
  "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
3197
  "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
 
3198
  "requires": {
3199
  "is-number": "^3.0.0",
3200
  "kind-of": "^4.0.0"
@@ -3204,6 +3241,7 @@
3204
  "version": "3.0.0",
3205
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
3206
  "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
 
3207
  "requires": {
3208
  "kind-of": "^3.0.2"
3209
  },
@@ -3212,6 +3250,7 @@
3212
  "version": "3.2.2",
3213
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3214
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
3215
  "requires": {
3216
  "is-buffer": "^1.1.5"
3217
  }
@@ -3222,6 +3261,7 @@
3222
  "version": "4.0.0",
3223
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
3224
  "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
 
3225
  "requires": {
3226
  "is-buffer": "^1.1.5"
3227
  }
@@ -3477,6 +3517,7 @@
3477
  "version": "0.1.6",
3478
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
3479
  "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
 
3480
  "requires": {
3481
  "kind-of": "^3.0.2"
3482
  },
@@ -3485,6 +3526,7 @@
3485
  "version": "3.2.2",
3486
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3487
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
3488
  "requires": {
3489
  "is-buffer": "^1.1.5"
3490
  }
@@ -3527,6 +3569,7 @@
3527
  "version": "0.1.4",
3528
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
3529
  "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
 
3530
  "requires": {
3531
  "kind-of": "^3.0.2"
3532
  },
@@ -3535,6 +3578,7 @@
3535
  "version": "3.2.2",
3536
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3537
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
3538
  "requires": {
3539
  "is-buffer": "^1.1.5"
3540
  }
@@ -3550,6 +3594,7 @@
3550
  "version": "0.1.6",
3551
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
3552
  "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
 
3553
  "requires": {
3554
  "is-accessor-descriptor": "^0.1.6",
3555
  "is-data-descriptor": "^0.1.4",
@@ -3559,7 +3604,8 @@
3559
  "kind-of": {
3560
  "version": "5.1.0",
3561
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
3562
- "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw=="
 
3563
  }
3564
  }
3565
  },
@@ -3576,7 +3622,8 @@
3576
  "is-extglob": {
3577
  "version": "2.1.1",
3578
  "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
3579
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
 
3580
  },
3581
  "is-finite": {
3582
  "version": "1.1.0",
@@ -3592,6 +3639,7 @@
3592
  "version": "4.0.1",
3593
  "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
3594
  "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
 
3595
  "requires": {
3596
  "is-extglob": "^2.1.1"
3597
  }
@@ -3691,7 +3739,8 @@
3691
  "is-windows": {
3692
  "version": "1.0.2",
3693
  "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
3694
- "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA=="
 
3695
  },
3696
  "isarray": {
3697
  "version": "1.0.0",
@@ -3971,7 +4020,8 @@
3971
  "map-cache": {
3972
  "version": "0.2.2",
3973
  "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
3974
- "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8="
 
3975
  },
3976
  "map-obj": {
3977
  "version": "1.0.1",
@@ -3982,6 +4032,7 @@
3982
  "version": "1.0.0",
3983
  "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
3984
  "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
 
3985
  "requires": {
3986
  "object-visit": "^1.0.0"
3987
  }
@@ -4034,6 +4085,7 @@
4034
  "version": "3.1.10",
4035
  "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
4036
  "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
 
4037
  "requires": {
4038
  "arr-diff": "^4.0.0",
4039
  "array-unique": "^0.3.2",
@@ -4054,6 +4106,7 @@
4054
  "version": "2.3.2",
4055
  "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
4056
  "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
 
4057
  "requires": {
4058
  "arr-flatten": "^1.1.0",
4059
  "array-unique": "^0.3.2",
@@ -4071,6 +4124,7 @@
4071
  "version": "2.0.1",
4072
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
4073
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
4074
  "requires": {
4075
  "is-extendable": "^0.1.0"
4076
  }
@@ -4081,6 +4135,7 @@
4081
  "version": "4.0.0",
4082
  "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
4083
  "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
 
4084
  "requires": {
4085
  "extend-shallow": "^2.0.1",
4086
  "is-number": "^3.0.0",
@@ -4092,6 +4147,7 @@
4092
  "version": "2.0.1",
4093
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
4094
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
4095
  "requires": {
4096
  "is-extendable": "^0.1.0"
4097
  }
@@ -4102,6 +4158,7 @@
4102
  "version": "3.0.0",
4103
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
4104
  "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
 
4105
  "requires": {
4106
  "kind-of": "^3.0.2"
4107
  },
@@ -4110,6 +4167,7 @@
4110
  "version": "3.2.2",
4111
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
4112
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
4113
  "requires": {
4114
  "is-buffer": "^1.1.5"
4115
  }
@@ -4120,6 +4178,7 @@
4120
  "version": "2.1.1",
4121
  "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
4122
  "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
 
4123
  "requires": {
4124
  "is-number": "^3.0.0",
4125
  "repeat-string": "^1.6.1"
@@ -4188,6 +4247,7 @@
4188
  "version": "1.3.2",
4189
  "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
4190
  "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
 
4191
  "requires": {
4192
  "for-in": "^1.0.2",
4193
  "is-extendable": "^1.0.1"
@@ -4197,6 +4257,7 @@
4197
  "version": "1.0.1",
4198
  "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
4199
  "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
 
4200
  "requires": {
4201
  "is-plain-object": "^2.0.4"
4202
  }
@@ -4246,6 +4307,7 @@
4246
  "version": "1.2.13",
4247
  "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
4248
  "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
 
4249
  "requires": {
4250
  "arr-diff": "^4.0.0",
4251
  "array-unique": "^0.3.2",
@@ -4422,7 +4484,8 @@
4422
  "normalize-path": {
4423
  "version": "3.0.0",
4424
  "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
4425
- "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="
 
4426
  },
4427
  "normalize-range": {
4428
  "version": "0.1.2",
@@ -4472,6 +4535,7 @@
4472
  "version": "0.1.0",
4473
  "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
4474
  "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
 
4475
  "requires": {
4476
  "copy-descriptor": "^0.1.0",
4477
  "define-property": "^0.2.5",
@@ -4482,6 +4546,7 @@
4482
  "version": "0.2.5",
4483
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
4484
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
 
4485
  "requires": {
4486
  "is-descriptor": "^0.1.0"
4487
  }
@@ -4490,6 +4555,7 @@
4490
  "version": "3.2.2",
4491
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
4492
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
4493
  "requires": {
4494
  "is-buffer": "^1.1.5"
4495
  }
@@ -4510,6 +4576,7 @@
4510
  "version": "1.0.1",
4511
  "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
4512
  "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
 
4513
  "requires": {
4514
  "isobject": "^3.0.0"
4515
  }
@@ -4550,6 +4617,7 @@
4550
  "version": "1.3.0",
4551
  "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
4552
  "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
 
4553
  "requires": {
4554
  "isobject": "^3.0.1"
4555
  }
@@ -4705,7 +4773,8 @@
4705
  "pascalcase": {
4706
  "version": "0.1.1",
4707
  "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
4708
- "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ="
 
4709
  },
4710
  "path-browserify": {
4711
  "version": "0.0.1",
@@ -4780,7 +4849,8 @@
4780
  "picomatch": {
4781
  "version": "2.2.2",
4782
  "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
4783
- "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
 
4784
  },
4785
  "pify": {
4786
  "version": "3.0.0",
@@ -4816,7 +4886,8 @@
4816
  "posix-character-classes": {
4817
  "version": "0.1.1",
4818
  "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
4819
- "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
 
4820
  },
4821
  "postcss": {
4822
  "version": "6.0.23",
@@ -5125,6 +5196,7 @@
5125
  "version": "1.0.2",
5126
  "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
5127
  "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
 
5128
  "requires": {
5129
  "extend-shallow": "^3.0.2",
5130
  "safe-regex": "^1.1.0"
@@ -5200,7 +5272,8 @@
5200
  "repeat-element": {
5201
  "version": "1.1.3",
5202
  "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
5203
- "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g=="
 
5204
  },
5205
  "repeat-string": {
5206
  "version": "1.6.1",
@@ -5297,7 +5370,8 @@
5297
  "resolve-url": {
5298
  "version": "0.2.1",
5299
  "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
5300
- "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo="
 
5301
  },
5302
  "restore-cursor": {
5303
  "version": "2.0.0",
@@ -5311,7 +5385,8 @@
5311
  "ret": {
5312
  "version": "0.1.15",
5313
  "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
5314
- "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
 
5315
  },
5316
  "right-align": {
5317
  "version": "0.1.3",
@@ -5373,6 +5448,7 @@
5373
  "version": "1.1.0",
5374
  "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
5375
  "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
 
5376
  "requires": {
5377
  "ret": "~0.1.10"
5378
  }
@@ -5454,6 +5530,7 @@
5454
  "version": "2.0.1",
5455
  "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
5456
  "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
 
5457
  "requires": {
5458
  "extend-shallow": "^2.0.1",
5459
  "is-extendable": "^0.1.1",
@@ -5465,6 +5542,7 @@
5465
  "version": "2.0.1",
5466
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5467
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
5468
  "requires": {
5469
  "is-extendable": "^0.1.0"
5470
  }
@@ -5556,6 +5634,7 @@
5556
  "version": "0.8.2",
5557
  "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
5558
  "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
 
5559
  "requires": {
5560
  "base": "^0.11.1",
5561
  "debug": "^2.2.0",
@@ -5571,6 +5650,7 @@
5571
  "version": "0.2.5",
5572
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
5573
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
 
5574
  "requires": {
5575
  "is-descriptor": "^0.1.0"
5576
  }
@@ -5579,6 +5659,7 @@
5579
  "version": "2.0.1",
5580
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5581
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
5582
  "requires": {
5583
  "is-extendable": "^0.1.0"
5584
  }
@@ -5586,7 +5667,8 @@
5586
  "source-map": {
5587
  "version": "0.5.7",
5588
  "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
5589
- "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
 
5590
  }
5591
  }
5592
  },
@@ -5594,6 +5676,7 @@
5594
  "version": "2.1.1",
5595
  "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
5596
  "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
 
5597
  "requires": {
5598
  "define-property": "^1.0.0",
5599
  "isobject": "^3.0.0",
@@ -5604,6 +5687,7 @@
5604
  "version": "1.0.0",
5605
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
5606
  "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
 
5607
  "requires": {
5608
  "is-descriptor": "^1.0.0"
5609
  }
@@ -5612,6 +5696,7 @@
5612
  "version": "1.0.0",
5613
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
5614
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
 
5615
  "requires": {
5616
  "kind-of": "^6.0.0"
5617
  }
@@ -5620,6 +5705,7 @@
5620
  "version": "1.0.0",
5621
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
5622
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
 
5623
  "requires": {
5624
  "kind-of": "^6.0.0"
5625
  }
@@ -5628,6 +5714,7 @@
5628
  "version": "1.0.2",
5629
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
5630
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
 
5631
  "requires": {
5632
  "is-accessor-descriptor": "^1.0.0",
5633
  "is-data-descriptor": "^1.0.0",
@@ -5640,6 +5727,7 @@
5640
  "version": "3.0.1",
5641
  "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
5642
  "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
 
5643
  "requires": {
5644
  "kind-of": "^3.2.0"
5645
  },
@@ -5648,6 +5736,7 @@
5648
  "version": "3.2.2",
5649
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
5650
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
5651
  "requires": {
5652
  "is-buffer": "^1.1.5"
5653
  }
@@ -5668,6 +5757,7 @@
5668
  "version": "0.5.3",
5669
  "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
5670
  "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
 
5671
  "requires": {
5672
  "atob": "^2.1.2",
5673
  "decode-uri-component": "^0.2.0",
@@ -5694,7 +5784,8 @@
5694
  "source-map-url": {
5695
  "version": "0.4.0",
5696
  "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
5697
- "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
 
5698
  },
5699
  "spdx-correct": {
5700
  "version": "3.1.1",
@@ -5728,6 +5819,7 @@
5728
  "version": "3.1.0",
5729
  "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
5730
  "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
 
5731
  "requires": {
5732
  "extend-shallow": "^3.0.0"
5733
  }
@@ -5757,6 +5849,7 @@
5757
  "version": "0.1.2",
5758
  "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
5759
  "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
 
5760
  "requires": {
5761
  "define-property": "^0.2.5",
5762
  "object-copy": "^0.1.0"
@@ -5766,6 +5859,7 @@
5766
  "version": "0.2.5",
5767
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
5768
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
 
5769
  "requires": {
5770
  "is-descriptor": "^0.1.0"
5771
  }
@@ -6001,6 +6095,7 @@
6001
  "version": "0.3.0",
6002
  "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
6003
  "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
 
6004
  "requires": {
6005
  "kind-of": "^3.0.2"
6006
  },
@@ -6009,6 +6104,7 @@
6009
  "version": "3.2.2",
6010
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
6011
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
6012
  "requires": {
6013
  "is-buffer": "^1.1.5"
6014
  }
@@ -6019,6 +6115,7 @@
6019
  "version": "3.0.2",
6020
  "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
6021
  "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
 
6022
  "requires": {
6023
  "define-property": "^2.0.2",
6024
  "extend-shallow": "^3.0.2",
@@ -6168,6 +6265,7 @@
6168
  "version": "1.0.1",
6169
  "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
6170
  "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
 
6171
  "requires": {
6172
  "arr-union": "^3.1.0",
6173
  "get-value": "^2.0.6",
@@ -6192,6 +6290,7 @@
6192
  "version": "1.0.0",
6193
  "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
6194
  "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
 
6195
  "requires": {
6196
  "has-value": "^0.3.1",
6197
  "isobject": "^3.0.0"
@@ -6201,6 +6300,7 @@
6201
  "version": "0.3.1",
6202
  "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
6203
  "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
 
6204
  "requires": {
6205
  "get-value": "^2.0.3",
6206
  "has-values": "^0.1.4",
@@ -6211,6 +6311,7 @@
6211
  "version": "2.1.0",
6212
  "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
6213
  "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
 
6214
  "requires": {
6215
  "isarray": "1.0.0"
6216
  }
@@ -6220,7 +6321,8 @@
6220
  "has-values": {
6221
  "version": "0.1.4",
6222
  "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
6223
- "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E="
 
6224
  }
6225
  }
6226
  },
@@ -6263,7 +6365,8 @@
6263
  "urix": {
6264
  "version": "0.1.0",
6265
  "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
6266
- "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI="
 
6267
  },
6268
  "url": {
6269
  "version": "0.11.0",
@@ -6292,7 +6395,8 @@
6292
  "use": {
6293
  "version": "3.1.1",
6294
  "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
6295
- "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
 
6296
  },
6297
  "util": {
6298
  "version": "0.11.1",
@@ -6432,6 +6536,7 @@
6432
  "version": "2.0.1",
6433
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
6434
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
 
6435
  "requires": {
6436
  "is-extendable": "^0.1.0"
6437
  }
@@ -6491,6 +6596,7 @@
6491
  "version": "3.0.0",
6492
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
6493
  "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
 
6494
  "requires": {
6495
  "kind-of": "^3.0.2"
6496
  }
@@ -6499,6 +6605,7 @@
6499
  "version": "3.2.2",
6500
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
6501
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
 
6502
  "requires": {
6503
  "is-buffer": "^1.1.5"
6504
  }
336
  "arr-diff": {
337
  "version": "4.0.0",
338
  "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
339
+ "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
340
+ "optional": true
341
  },
342
  "arr-flatten": {
343
  "version": "1.1.0",
344
  "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
345
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
346
+ "optional": true
347
  },
348
  "arr-union": {
349
  "version": "3.1.0",
350
  "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
351
+ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
352
+ "optional": true
353
  },
354
  "array-find-index": {
355
  "version": "1.0.2",
369
  "array-unique": {
370
  "version": "0.3.2",
371
  "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
372
+ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
373
+ "optional": true
374
  },
375
  "array.prototype.flatmap": {
376
  "version": "1.2.3",
439
  "assign-symbols": {
440
  "version": "1.0.0",
441
  "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
442
+ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
443
+ "optional": true
444
  },
445
  "ast-types-flow": {
446
  "version": "0.0.7",
474
  "atob": {
475
  "version": "2.1.2",
476
  "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
477
+ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
478
+ "optional": true
479
  },
480
  "autoprefixer": {
481
  "version": "7.2.6",
1236
  "version": "0.11.2",
1237
  "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
1238
  "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
1239
+ "optional": true,
1240
  "requires": {
1241
  "cache-base": "^1.0.1",
1242
  "class-utils": "^0.3.5",
1251
  "version": "1.0.0",
1252
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
1253
  "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
1254
+ "optional": true,
1255
  "requires": {
1256
  "is-descriptor": "^1.0.0"
1257
  }
1260
  "version": "1.0.0",
1261
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
1262
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
1263
+ "optional": true,
1264
  "requires": {
1265
  "kind-of": "^6.0.0"
1266
  }
1269
  "version": "1.0.0",
1270
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
1271
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
1272
+ "optional": true,
1273
  "requires": {
1274
  "kind-of": "^6.0.0"
1275
  }
1278
  "version": "1.0.2",
1279
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
1280
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
1281
+ "optional": true,
1282
  "requires": {
1283
  "is-accessor-descriptor": "^1.0.0",
1284
  "is-data-descriptor": "^1.0.0",
1490
  "version": "1.0.1",
1491
  "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
1492
  "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
1493
+ "optional": true,
1494
  "requires": {
1495
  "collection-visit": "^1.0.0",
1496
  "component-emitter": "^1.2.1",
1703
  "version": "0.3.6",
1704
  "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
1705
  "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
1706
+ "optional": true,
1707
  "requires": {
1708
  "arr-union": "^3.1.0",
1709
  "define-property": "^0.2.5",
1715
  "version": "0.2.5",
1716
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
1717
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
1718
+ "optional": true,
1719
  "requires": {
1720
  "is-descriptor": "^0.1.0"
1721
  }
1815
  "version": "1.0.0",
1816
  "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
1817
  "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
1818
+ "optional": true,
1819
  "requires": {
1820
  "map-visit": "^1.0.0",
1821
  "object-visit": "^1.0.0"
1850
  "component-emitter": {
1851
  "version": "1.3.0",
1852
  "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
1853
+ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
1854
+ "optional": true
1855
  },
1856
  "concat-map": {
1857
  "version": "0.0.1",
1908
  "copy-descriptor": {
1909
  "version": "0.1.1",
1910
  "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
1911
+ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
1912
+ "optional": true
1913
  },
1914
  "core-js": {
1915
  "version": "2.6.11",
2098
  "decode-uri-component": {
2099
  "version": "0.2.0",
2100
  "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
2101
+ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
2102
+ "optional": true
2103
  },
2104
  "deep-extend": {
2105
  "version": "0.6.0",
2123
  "version": "2.0.2",
2124
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
2125
  "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
2126
+ "optional": true,
2127
  "requires": {
2128
  "is-descriptor": "^1.0.2",
2129
  "isobject": "^3.0.1"
2133
  "version": "1.0.0",
2134
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
2135
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
2136
+ "optional": true,
2137
  "requires": {
2138
  "kind-of": "^6.0.0"
2139
  }
2142
  "version": "1.0.0",
2143
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
2144
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
2145
+ "optional": true,
2146
  "requires": {
2147
  "kind-of": "^6.0.0"
2148
  }
2151
  "version": "1.0.2",
2152
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
2153
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
2154
+ "optional": true,
2155
  "requires": {
2156
  "is-accessor-descriptor": "^1.0.0",
2157
  "is-data-descriptor": "^1.0.0",
2682
  "version": "2.1.4",
2683
  "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
2684
  "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
2685
+ "optional": true,
2686
  "requires": {
2687
  "debug": "^2.3.3",
2688
  "define-property": "^0.2.5",
2697
  "version": "0.2.5",
2698
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
2699
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
2700
+ "optional": true,
2701
  "requires": {
2702
  "is-descriptor": "^0.1.0"
2703
  }
2706
  "version": "2.0.1",
2707
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
2708
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
2709
+ "optional": true,
2710
  "requires": {
2711
  "is-extendable": "^0.1.0"
2712
  }
2737
  "version": "3.0.2",
2738
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
2739
  "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
2740
+ "optional": true,
2741
  "requires": {
2742
  "assign-symbols": "^1.0.0",
2743
  "is-extendable": "^1.0.1"
2747
  "version": "1.0.1",
2748
  "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
2749
  "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
2750
+ "optional": true,
2751
  "requires": {
2752
  "is-plain-object": "^2.0.4"
2753
  }
2768
  "version": "2.0.4",
2769
  "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
2770
  "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
2771
+ "optional": true,
2772
  "requires": {
2773
  "array-unique": "^0.3.2",
2774
  "define-property": "^1.0.0",
2784
  "version": "1.0.0",
2785
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
2786
  "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
2787
+ "optional": true,
2788
  "requires": {
2789
  "is-descriptor": "^1.0.0"
2790
  }
2793
  "version": "2.0.1",
2794
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
2795
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
2796
+ "optional": true,
2797
  "requires": {
2798
  "is-extendable": "^0.1.0"
2799
  }
2802
  "version": "1.0.0",
2803
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
2804
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
2805
+ "optional": true,
2806
  "requires": {
2807
  "kind-of": "^6.0.0"
2808
  }
2811
  "version": "1.0.0",
2812
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
2813
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
2814
+ "optional": true,
2815
  "requires": {
2816
  "kind-of": "^6.0.0"
2817
  }
2820
  "version": "1.0.2",
2821
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
2822
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
2823
+ "optional": true,
2824
  "requires": {
2825
  "is-accessor-descriptor": "^1.0.0",
2826
  "is-data-descriptor": "^1.0.0",
2952
  "version": "0.2.1",
2953
  "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
2954
  "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
2955
+ "optional": true,
2956
  "requires": {
2957
  "map-cache": "^0.2.2"
2958
  }
3060
  "get-value": {
3061
  "version": "2.0.6",
3062
  "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
3063
+ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
3064
+ "optional": true
3065
  },
3066
  "getpass": {
3067
  "version": "0.1.7",
3220
  "version": "1.0.0",
3221
  "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
3222
  "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
3223
+ "optional": true,
3224
  "requires": {
3225
  "get-value": "^2.0.6",
3226
  "has-values": "^1.0.0",
3231
  "version": "1.0.0",
3232
  "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
3233
  "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
3234
+ "optional": true,
3235
  "requires": {
3236
  "is-number": "^3.0.0",
3237
  "kind-of": "^4.0.0"
3241
  "version": "3.0.0",
3242
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
3243
  "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
3244
+ "optional": true,
3245
  "requires": {
3246
  "kind-of": "^3.0.2"
3247
  },
3250
  "version": "3.2.2",
3251
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3252
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
3253
+ "optional": true,
3254
  "requires": {
3255
  "is-buffer": "^1.1.5"
3256
  }
3261
  "version": "4.0.0",
3262
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
3263
  "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
3264
+ "optional": true,
3265
  "requires": {
3266
  "is-buffer": "^1.1.5"
3267
  }
3517
  "version": "0.1.6",
3518
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
3519
  "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
3520
+ "optional": true,
3521
  "requires": {
3522
  "kind-of": "^3.0.2"
3523
  },
3526
  "version": "3.2.2",
3527
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3528
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
3529
+ "optional": true,
3530
  "requires": {
3531
  "is-buffer": "^1.1.5"
3532
  }
3569
  "version": "0.1.4",
3570
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
3571
  "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
3572
+ "optional": true,
3573
  "requires": {
3574
  "kind-of": "^3.0.2"
3575
  },
3578
  "version": "3.2.2",
3579
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
3580
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
3581
+ "optional": true,
3582
  "requires": {
3583
  "is-buffer": "^1.1.5"
3584
  }
3594
  "version": "0.1.6",
3595
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
3596
  "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
3597
+ "optional": true,
3598
  "requires": {
3599
  "is-accessor-descriptor": "^0.1.6",
3600
  "is-data-descriptor": "^0.1.4",
3604
  "kind-of": {
3605
  "version": "5.1.0",
3606
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
3607
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
3608
+ "optional": true
3609
  }
3610
  }
3611
  },
3622
  "is-extglob": {
3623
  "version": "2.1.1",
3624
  "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
3625
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
3626
+ "optional": true
3627
  },
3628
  "is-finite": {
3629
  "version": "1.1.0",
3639
  "version": "4.0.1",
3640
  "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
3641
  "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
3642
+ "optional": true,
3643
  "requires": {
3644
  "is-extglob": "^2.1.1"
3645
  }
3739
  "is-windows": {
3740
  "version": "1.0.2",
3741
  "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
3742
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
3743
+ "optional": true
3744
  },
3745
  "isarray": {
3746
  "version": "1.0.0",
4020
  "map-cache": {
4021
  "version": "0.2.2",
4022
  "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
4023
+ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
4024
+ "optional": true
4025
  },
4026
  "map-obj": {
4027
  "version": "1.0.1",
4032
  "version": "1.0.0",
4033
  "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
4034
  "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
4035
+ "optional": true,
4036
  "requires": {
4037
  "object-visit": "^1.0.0"
4038
  }
4085
  "version": "3.1.10",
4086
  "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
4087
  "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
4088
+ "optional": true,
4089
  "requires": {
4090
  "arr-diff": "^4.0.0",
4091
  "array-unique": "^0.3.2",
4106
  "version": "2.3.2",
4107
  "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
4108
  "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
4109
+ "optional": true,
4110
  "requires": {
4111
  "arr-flatten": "^1.1.0",
4112
  "array-unique": "^0.3.2",
4124
  "version": "2.0.1",
4125
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
4126
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
4127
+ "optional": true,
4128
  "requires": {
4129
  "is-extendable": "^0.1.0"
4130
  }
4135
  "version": "4.0.0",
4136
  "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
4137
  "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
4138
+ "optional": true,
4139
  "requires": {
4140
  "extend-shallow": "^2.0.1",
4141
  "is-number": "^3.0.0",
4147
  "version": "2.0.1",
4148
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
4149
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
4150
+ "optional": true,
4151
  "requires": {
4152
  "is-extendable": "^0.1.0"
4153
  }
4158
  "version": "3.0.0",
4159
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
4160
  "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
4161
+ "optional": true,
4162
  "requires": {
4163
  "kind-of": "^3.0.2"
4164
  },
4167
  "version": "3.2.2",
4168
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
4169
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
4170
+ "optional": true,
4171
  "requires": {
4172
  "is-buffer": "^1.1.5"
4173
  }
4178
  "version": "2.1.1",
4179
  "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
4180
  "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
4181
+ "optional": true,
4182
  "requires": {
4183
  "is-number": "^3.0.0",
4184
  "repeat-string": "^1.6.1"
4247
  "version": "1.3.2",
4248
  "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
4249
  "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
4250
+ "optional": true,
4251
  "requires": {
4252
  "for-in": "^1.0.2",
4253
  "is-extendable": "^1.0.1"
4257
  "version": "1.0.1",
4258
  "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
4259
  "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
4260
+ "optional": true,
4261
  "requires": {
4262
  "is-plain-object": "^2.0.4"
4263
  }
4307
  "version": "1.2.13",
4308
  "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
4309
  "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
4310
+ "optional": true,
4311
  "requires": {
4312
  "arr-diff": "^4.0.0",
4313
  "array-unique": "^0.3.2",
4484
  "normalize-path": {
4485
  "version": "3.0.0",
4486
  "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
4487
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
4488
+ "optional": true
4489
  },
4490
  "normalize-range": {
4491
  "version": "0.1.2",
4535
  "version": "0.1.0",
4536
  "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
4537
  "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
4538
+ "optional": true,
4539
  "requires": {
4540
  "copy-descriptor": "^0.1.0",
4541
  "define-property": "^0.2.5",
4546
  "version": "0.2.5",
4547
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
4548
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
4549
+ "optional": true,
4550
  "requires": {
4551
  "is-descriptor": "^0.1.0"
4552
  }
4555
  "version": "3.2.2",
4556
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
4557
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
4558
+ "optional": true,
4559
  "requires": {
4560
  "is-buffer": "^1.1.5"
4561
  }
4576
  "version": "1.0.1",
4577
  "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
4578
  "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
4579
+ "optional": true,
4580
  "requires": {
4581
  "isobject": "^3.0.0"
4582
  }
4617
  "version": "1.3.0",
4618
  "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
4619
  "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
4620
+ "optional": true,
4621
  "requires": {
4622
  "isobject": "^3.0.1"
4623
  }
4773
  "pascalcase": {
4774
  "version": "0.1.1",
4775
  "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
4776
+ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
4777
+ "optional": true
4778
  },
4779
  "path-browserify": {
4780
  "version": "0.0.1",
4849
  "picomatch": {
4850
  "version": "2.2.2",
4851
  "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
4852
+ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
4853
+ "optional": true
4854
  },
4855
  "pify": {
4856
  "version": "3.0.0",
4886
  "posix-character-classes": {
4887
  "version": "0.1.1",
4888
  "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
4889
+ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
4890
+ "optional": true
4891
  },
4892
  "postcss": {
4893
  "version": "6.0.23",
5196
  "version": "1.0.2",
5197
  "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
5198
  "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
5199
+ "optional": true,
5200
  "requires": {
5201
  "extend-shallow": "^3.0.2",
5202
  "safe-regex": "^1.1.0"
5272
  "repeat-element": {
5273
  "version": "1.1.3",
5274
  "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
5275
+ "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==",
5276
+ "optional": true
5277
  },
5278
  "repeat-string": {
5279
  "version": "1.6.1",
5370
  "resolve-url": {
5371
  "version": "0.2.1",
5372
  "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
5373
+ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
5374
+ "optional": true
5375
  },
5376
  "restore-cursor": {
5377
  "version": "2.0.0",
5385
  "ret": {
5386
  "version": "0.1.15",
5387
  "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
5388
+ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
5389
+ "optional": true
5390
  },
5391
  "right-align": {
5392
  "version": "0.1.3",
5448
  "version": "1.1.0",
5449
  "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
5450
  "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
5451
+ "optional": true,
5452
  "requires": {
5453
  "ret": "~0.1.10"
5454
  }
5530
  "version": "2.0.1",
5531
  "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
5532
  "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
5533
+ "optional": true,
5534
  "requires": {
5535
  "extend-shallow": "^2.0.1",
5536
  "is-extendable": "^0.1.1",
5542
  "version": "2.0.1",
5543
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5544
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
5545
+ "optional": true,
5546
  "requires": {
5547
  "is-extendable": "^0.1.0"
5548
  }
5634
  "version": "0.8.2",
5635
  "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
5636
  "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
5637
+ "optional": true,
5638
  "requires": {
5639
  "base": "^0.11.1",
5640
  "debug": "^2.2.0",
5650
  "version": "0.2.5",
5651
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
5652
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
5653
+ "optional": true,
5654
  "requires": {
5655
  "is-descriptor": "^0.1.0"
5656
  }
5659
  "version": "2.0.1",
5660
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
5661
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
5662
+ "optional": true,
5663
  "requires": {
5664
  "is-extendable": "^0.1.0"
5665
  }
5667
  "source-map": {
5668
  "version": "0.5.7",
5669
  "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
5670
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
5671
+ "optional": true
5672
  }
5673
  }
5674
  },
5676
  "version": "2.1.1",
5677
  "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
5678
  "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
5679
+ "optional": true,
5680
  "requires": {
5681
  "define-property": "^1.0.0",
5682
  "isobject": "^3.0.0",
5687
  "version": "1.0.0",
5688
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
5689
  "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
5690
+ "optional": true,
5691
  "requires": {
5692
  "is-descriptor": "^1.0.0"
5693
  }
5696
  "version": "1.0.0",
5697
  "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
5698
  "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
5699
+ "optional": true,
5700
  "requires": {
5701
  "kind-of": "^6.0.0"
5702
  }
5705
  "version": "1.0.0",
5706
  "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
5707
  "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
5708
+ "optional": true,
5709
  "requires": {
5710
  "kind-of": "^6.0.0"
5711
  }
5714
  "version": "1.0.2",
5715
  "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
5716
  "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
5717
+ "optional": true,
5718
  "requires": {
5719
  "is-accessor-descriptor": "^1.0.0",
5720
  "is-data-descriptor": "^1.0.0",
5727
  "version": "3.0.1",
5728
  "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
5729
  "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
5730
+ "optional": true,
5731
  "requires": {
5732
  "kind-of": "^3.2.0"
5733
  },
5736
  "version": "3.2.2",
5737
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
5738
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
5739
+ "optional": true,
5740
  "requires": {
5741
  "is-buffer": "^1.1.5"
5742
  }
5757
  "version": "0.5.3",
5758
  "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
5759
  "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
5760
+ "optional": true,
5761
  "requires": {
5762
  "atob": "^2.1.2",
5763
  "decode-uri-component": "^0.2.0",
5784
  "source-map-url": {
5785
  "version": "0.4.0",
5786
  "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
5787
+ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
5788
+ "optional": true
5789
  },
5790
  "spdx-correct": {
5791
  "version": "3.1.1",
5819
  "version": "3.1.0",
5820
  "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
5821
  "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
5822
+ "optional": true,
5823
  "requires": {
5824
  "extend-shallow": "^3.0.0"
5825
  }
5849
  "version": "0.1.2",
5850
  "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
5851
  "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
5852
+ "optional": true,
5853
  "requires": {
5854
  "define-property": "^0.2.5",
5855
  "object-copy": "^0.1.0"
5859
  "version": "0.2.5",
5860
  "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
5861
  "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
5862
+ "optional": true,
5863
  "requires": {
5864
  "is-descriptor": "^0.1.0"
5865
  }
6095
  "version": "0.3.0",
6096
  "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
6097
  "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
6098
+ "optional": true,
6099
  "requires": {
6100
  "kind-of": "^3.0.2"
6101
  },
6104
  "version": "3.2.2",
6105
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
6106
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
6107
+ "optional": true,
6108
  "requires": {
6109
  "is-buffer": "^1.1.5"
6110
  }
6115
  "version": "3.0.2",
6116
  "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
6117
  "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
6118
+ "optional": true,
6119
  "requires": {
6120
  "define-property": "^2.0.2",
6121
  "extend-shallow": "^3.0.2",
6265
  "version": "1.0.1",
6266
  "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
6267
  "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
6268
+ "optional": true,
6269
  "requires": {
6270
  "arr-union": "^3.1.0",
6271
  "get-value": "^2.0.6",
6290
  "version": "1.0.0",
6291
  "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
6292
  "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
6293
+ "optional": true,
6294
  "requires": {
6295
  "has-value": "^0.3.1",
6296
  "isobject": "^3.0.0"
6300
  "version": "0.3.1",
6301
  "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
6302
  "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
6303
+ "optional": true,
6304
  "requires": {
6305
  "get-value": "^2.0.3",
6306
  "has-values": "^0.1.4",
6311
  "version": "2.1.0",
6312
  "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
6313
  "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
6314
+ "optional": true,
6315
  "requires": {
6316
  "isarray": "1.0.0"
6317
  }
6321
  "has-values": {
6322
  "version": "0.1.4",
6323
  "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
6324
+ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
6325
+ "optional": true
6326
  }
6327
  }
6328
  },
6365
  "urix": {
6366
  "version": "0.1.0",
6367
  "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
6368
+ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
6369
+ "optional": true
6370
  },
6371
  "url": {
6372
  "version": "0.11.0",
6395
  "use": {
6396
  "version": "3.1.1",
6397
  "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
6398
+ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
6399
+ "optional": true
6400
  },
6401
  "util": {
6402
  "version": "0.11.1",
6536
  "version": "2.0.1",
6537
  "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
6538
  "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
6539
+ "optional": true,
6540
  "requires": {
6541
  "is-extendable": "^0.1.0"
6542
  }
6596
  "version": "3.0.0",
6597
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
6598
  "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
6599
+ "optional": true,
6600
  "requires": {
6601
  "kind-of": "^3.0.2"
6602
  }
6605
  "version": "3.2.2",
6606
  "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
6607
  "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
6608
+ "optional": true,
6609
  "requires": {
6610
  "is-buffer": "^1.1.5"
6611
  }
Gutenberg/package.json CHANGED
@@ -8,7 +8,7 @@
8
  "eject": "cgb-scripts eject"
9
  },
10
  "dependencies": {
11
- "classnames": "^2.2.5",
12
- "cgb-scripts": "1.15.0"
13
  }
14
  }
8
  "eject": "cgb-scripts eject"
9
  },
10
  "dependencies": {
11
+ "cgb-scripts": "1.15.0",
12
+ "classnames": "^2.2.5"
13
  }
14
  }
Gutenberg/src/google-docs/edit.js CHANGED
@@ -20,6 +20,7 @@ class GoogleDocsEdit extends Component {
20
  this.setUrl = this.setUrl.bind(this);
21
  this.updateAlignment = this.updateAlignment.bind(this);
22
  this.onLoad = this.onLoad.bind(this);
 
23
  this.state = {
24
  editingURL: false,
25
  url: this.props.attributes.url,
@@ -138,8 +139,8 @@ class GoogleDocsEdit extends Component {
138
  {fetching ? <EmbedLoading/> : null}
139
 
140
  <Iframe src={iframeSrc} onMouseUp={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
141
- frameborder="0" width="600" height="450" allowfullscreen="true"
142
- mozallowfullscreen="true" webkitallowfullscreen="true"/>
143
 
144
  { ! interactive && (
145
  <div
20
  this.setUrl = this.setUrl.bind(this);
21
  this.updateAlignment = this.updateAlignment.bind(this);
22
  this.onLoad = this.onLoad.bind(this);
23
+ this.hideOverlay = this.hideOverlay.bind(this);
24
  this.state = {
25
  editingURL: false,
26
  url: this.props.attributes.url,
139
  {fetching ? <EmbedLoading/> : null}
140
 
141
  <Iframe src={iframeSrc} onMouseUp={ this.hideOverlay } onLoad={this.onLoad} style={{display: fetching ? 'none' : ''}}
142
+ frameBorder="0" width="600" height="450" allowFullScreen="true"
143
+ mozAllowFullScreen="true" webkitAllowFullScreen="true"/>
144
 
145
  { ! interactive && (
146
  <div
embedpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
- * Version: 2.6.2
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
5
  * Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 75+ sources supported.
6
  * Author: WPDeveloper
7
  * Author URI: https://wpdeveloper.net
8
+ * Version: 2.7.0
9
  * Text Domain: embedpress
10
  * Domain Path: /languages
11
  *
includes.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
- define('EMBEDPRESS_VERSION', "2.6.2");
26
  /**
27
  * @deprecated 2.2.0
28
  */
22
  }
23
 
24
  if ( ! defined('EMBEDPRESS_VERSION')) {
25
+ define('EMBEDPRESS_VERSION', "2.7.0");
26
  /**
27
  * @deprecated 2.2.0
28
  */
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embe
6
  Requires at least: 4.6
7
  Tested up to: 5.6
8
  Requires PHP: 5.6
9
- Stable tag: 2.6.2
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
@@ -18,7 +18,7 @@ EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC
18
 
19
  https://www.youtube.com/watch?v=fvYKLkEnJbI
20
 
21
- 🔥RICH MEDIA EMBEDS FROM MORE THAN 75 SITES
22
 
23
  With EmbedPress, all you need is the URL. Find the URL for your video, image, audio file or map and simply cut-and-paste the URL into a WordPress post. EmbedPress automatically understands the URL and embeds your content. You can embed media from over 75 sites.
24
 
@@ -294,6 +294,11 @@ Not at all. You can set up everything your team needs without any coding knowled
294
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
295
  and this project adheres to [Semantic Versioning](http://semver.org/).
296
 
 
 
 
 
 
297
  = [2.6.2] - 2020-10-28 =
298
  * Fixed: Facebook & Instagram Embedding issue
299
  * Fixed: PHP error on WordPress 4.9.8
@@ -654,4 +659,4 @@ Added Wistia and Twitch blocks for Gutenberg
654
 
655
  == Upgrade Notice ==
656
 
657
- * [Minor after 2.5.0] Gutenberg Block Update
6
  Requires at least: 4.6
7
  Tested up to: 5.6
8
  Requires PHP: 5.6
9
+ Stable tag: 2.7.0
10
  License: GPLv3 or later
11
  License URI: https://opensource.org/licenses/GPL-3.0
12
 
18
 
19
  https://www.youtube.com/watch?v=fvYKLkEnJbI
20
 
21
+ 🔥RICH MEDIA EMBEDS FROM MORE THAN 100 SITES
22
 
23
  With EmbedPress, all you need is the URL. Find the URL for your video, image, audio file or map and simply cut-and-paste the URL into a WordPress post. EmbedPress automatically understands the URL and embeds your content. You can embed media from over 75 sites.
24
 
294
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
295
  and this project adheres to [Semantic Versioning](http://semver.org/).
296
 
297
+ = [2.7.0] - 2021-02-01 =
298
+ * Updated: Embera PHP Package
299
+ * Fixed: API response status
300
+ * Few minor bug fix and improvements
301
+
302
  = [2.6.2] - 2020-10-28 =
303
  * Fixed: Facebook & Instagram Embedding issue
304
  * Fixed: PHP error on WordPress 4.9.8
659
 
660
  == Upgrade Notice ==
661
 
662
+ * [Major Update] Must Update
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitfa112be3a45897b53eb16b7ddc526d6f::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit69d10d2d4bdea3f2ca3f6a8fe2e8656a::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -37,8 +37,8 @@ namespace Composer\Autoload;
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
@@ -60,7 +60,7 @@ class ClassLoader
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
@@ -279,7 +279,7 @@ class ClassLoader
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
  }
284
 
285
  /**
@@ -377,7 +377,7 @@ class ClassLoader
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath.'\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
  $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see https://www.php-fig.org/psr/psr-0/
41
+ * @see https://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
64
  }
65
 
66
  return array();
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
  }
284
 
285
  /**
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath . '\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
382
  $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
vendor/composer/InstalledVersions.php ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer;
4
+
5
+ use Composer\Semver\VersionParser;
6
+
7
+
8
+
9
+
10
+
11
+
12
+ class InstalledVersions
13
+ {
14
+ private static $installed = array (
15
+ 'root' =>
16
+ array (
17
+ 'pretty_version' => 'dev-master',
18
+ 'version' => 'dev-master',
19
+ 'aliases' =>
20
+ array (
21
+ ),
22
+ 'reference' => '72072eb854c9b467f3a1d206fe8b3cc6fae1743a',
23
+ 'name' => 'embedpress/embedpress',
24
+ ),
25
+ 'versions' =>
26
+ array (
27
+ 'embedpress/embedpress' =>
28
+ array (
29
+ 'pretty_version' => 'dev-master',
30
+ 'version' => 'dev-master',
31
+ 'aliases' =>
32
+ array (
33
+ ),
34
+ 'reference' => '72072eb854c9b467f3a1d206fe8b3cc6fae1743a',
35
+ ),
36
+ 'wpdevelopers/embera' =>
37
+ array (
38
+ 'pretty_version' => '2.0.17',
39
+ 'version' => '2.0.17.0',
40
+ 'aliases' =>
41
+ array (
42
+ ),
43
+ 'reference' => '5f521fbe77fdfc992dc399ee39e5fdb338ea1f04',
44
+ ),
45
+ ),
46
+ );
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+ public static function getInstalledPackages()
55
+ {
56
+ return array_keys(self::$installed['versions']);
57
+ }
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+ public static function isInstalled($packageName)
68
+ {
69
+ return isset(self::$installed['versions'][$packageName]);
70
+ }
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
86
+ {
87
+ $constraint = $parser->parseConstraints($constraint);
88
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
89
+
90
+ return $provided->matches($constraint);
91
+ }
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ public static function getVersionRanges($packageName)
103
+ {
104
+ if (!isset(self::$installed['versions'][$packageName])) {
105
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
106
+ }
107
+
108
+ $ranges = array();
109
+ if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
110
+ $ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
111
+ }
112
+ if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
113
+ $ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
114
+ }
115
+ if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
116
+ $ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
117
+ }
118
+ if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
119
+ $ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
120
+ }
121
+
122
+ return implode(' || ', $ranges);
123
+ }
124
+
125
+
126
+
127
+
128
+
129
+ public static function getVersion($packageName)
130
+ {
131
+ if (!isset(self::$installed['versions'][$packageName])) {
132
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
133
+ }
134
+
135
+ if (!isset(self::$installed['versions'][$packageName]['version'])) {
136
+ return null;
137
+ }
138
+
139
+ return self::$installed['versions'][$packageName]['version'];
140
+ }
141
+
142
+
143
+
144
+
145
+
146
+ public static function getPrettyVersion($packageName)
147
+ {
148
+ if (!isset(self::$installed['versions'][$packageName])) {
149
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
150
+ }
151
+
152
+ if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
153
+ return null;
154
+ }
155
+
156
+ return self::$installed['versions'][$packageName]['pretty_version'];
157
+ }
158
+
159
+
160
+
161
+
162
+
163
+ public static function getReference($packageName)
164
+ {
165
+ if (!isset(self::$installed['versions'][$packageName])) {
166
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
167
+ }
168
+
169
+ if (!isset(self::$installed['versions'][$packageName]['reference'])) {
170
+ return null;
171
+ }
172
+
173
+ return self::$installed['versions'][$packageName]['reference'];
174
+ }
175
+
176
+
177
+
178
+
179
+
180
+ public static function getRootPackage()
181
+ {
182
+ return self::$installed['root'];
183
+ }
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ public static function getRawData()
192
+ {
193
+ return self::$installed;
194
+ }
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+ public static function reload($data)
215
+ {
216
+ self::$installed = $data;
217
+ }
218
+ }
vendor/composer/autoload_classmap.php CHANGED
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
  );
vendor/composer/autoload_files.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- // autoload_files.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- '46a06f2cec651588901bf1ff51ef5979' => $vendorDir . '/publishpress/edd-license-handler/EDD_License_Handler.php',
10
- '9e7913fda8218537ad84c3389047ab16' => $vendorDir . '/publishpress/edd-license-handler/EDD_SL_Plugin_Updater.php',
11
- );
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,6 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'Pimple' => array($vendorDir . '/pimple/pimple/src'),
10
- 'Embera' => array($vendorDir . '/ostraining/embera/Lib'),
11
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
9
  );
vendor/composer/autoload_psr4.php CHANGED
@@ -6,7 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'PublishPress\\EDD_License\\Core\\' => array($vendorDir . '/publishpress/wordpress-edd-license-integration/src/core'),
10
- 'PublishPress\\Builder\\' => array($vendorDir . '/publishpress/wordpress-plugin-builder/src'),
11
- 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
12
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Embera\\' => array($vendorDir . '/wpdevelopers/embera/src/Embera'),
 
 
10
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitfa112be3a45897b53eb16b7ddc526d6f
6
  {
7
  private static $loader;
8
 
@@ -13,21 +13,26 @@ class ComposerAutoloaderInitfa112be3a45897b53eb16b7ddc526d6f
13
  }
14
  }
15
 
 
 
 
16
  public static function getLoader()
17
  {
18
  if (null !== self::$loader) {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitfa112be3a45897b53eb16b7ddc526d6f', 'loadClassLoader'), true, true);
 
 
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitfa112be3a45897b53eb16b7ddc526d6f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
- require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitfa112be3a45897b53eb16b7ddc526d6f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -47,24 +52,6 @@ class ComposerAutoloaderInitfa112be3a45897b53eb16b7ddc526d6f
47
 
48
  $loader->register(true);
49
 
50
- if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInitfa112be3a45897b53eb16b7ddc526d6f::$files;
52
- } else {
53
- $includeFiles = require __DIR__ . '/autoload_files.php';
54
- }
55
- foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequirefa112be3a45897b53eb16b7ddc526d6f($fileIdentifier, $file);
57
- }
58
-
59
  return $loader;
60
  }
61
  }
62
-
63
- function composerRequirefa112be3a45897b53eb16b7ddc526d6f($fileIdentifier, $file)
64
- {
65
- if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
- require $file;
67
-
68
- $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
- }
70
- }
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit69d10d2d4bdea3f2ca3f6a8fe2e8656a
6
  {
7
  private static $loader;
8
 
13
  }
14
  }
15
 
16
+ /**
17
+ * @return \Composer\Autoload\ClassLoader
18
+ */
19
  public static function getLoader()
20
  {
21
  if (null !== self::$loader) {
22
  return self::$loader;
23
  }
24
 
25
+ require __DIR__ . '/platform_check.php';
26
+
27
+ spl_autoload_register(array('ComposerAutoloaderInit69d10d2d4bdea3f2ca3f6a8fe2e8656a', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit69d10d2d4bdea3f2ca3f6a8fe2e8656a', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
+ require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit69d10d2d4bdea3f2ca3f6a8fe2e8656a::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
52
 
53
  $loader->register(true);
54
 
 
 
 
 
 
 
 
 
 
55
  return $loader;
56
  }
57
  }
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_static.php CHANGED
@@ -4,60 +4,32 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitfa112be3a45897b53eb16b7ddc526d6f
8
  {
9
- public static $files = array (
10
- '46a06f2cec651588901bf1ff51ef5979' => __DIR__ . '/..' . '/publishpress/edd-license-handler/EDD_License_Handler.php',
11
- '9e7913fda8218537ad84c3389047ab16' => __DIR__ . '/..' . '/publishpress/edd-license-handler/EDD_SL_Plugin_Updater.php',
12
- );
13
-
14
  public static $prefixLengthsPsr4 = array (
15
- 'P' =>
16
  array (
17
- 'PublishPress\\EDD_License\\Core\\' => 30,
18
- 'PublishPress\\Builder\\' => 21,
19
- 'Psr\\Container\\' => 14,
20
  ),
21
  );
22
 
23
  public static $prefixDirsPsr4 = array (
24
- 'PublishPress\\EDD_License\\Core\\' =>
25
- array (
26
- 0 => __DIR__ . '/..' . '/publishpress/wordpress-edd-license-integration/src/core',
27
- ),
28
- 'PublishPress\\Builder\\' =>
29
- array (
30
- 0 => __DIR__ . '/..' . '/publishpress/wordpress-plugin-builder/src',
31
- ),
32
- 'Psr\\Container\\' =>
33
  array (
34
- 0 => __DIR__ . '/..' . '/psr/container/src',
35
  ),
36
  );
37
 
38
- public static $prefixesPsr0 = array (
39
- 'P' =>
40
- array (
41
- 'Pimple' =>
42
- array (
43
- 0 => __DIR__ . '/..' . '/pimple/pimple/src',
44
- ),
45
- ),
46
- 'E' =>
47
- array (
48
- 'Embera' =>
49
- array (
50
- 0 => __DIR__ . '/..' . '/ostraining/embera/Lib',
51
- ),
52
- ),
53
  );
54
 
55
  public static function getInitializer(ClassLoader $loader)
56
  {
57
  return \Closure::bind(function () use ($loader) {
58
- $loader->prefixLengthsPsr4 = ComposerStaticInitfa112be3a45897b53eb16b7ddc526d6f::$prefixLengthsPsr4;
59
- $loader->prefixDirsPsr4 = ComposerStaticInitfa112be3a45897b53eb16b7ddc526d6f::$prefixDirsPsr4;
60
- $loader->prefixesPsr0 = ComposerStaticInitfa112be3a45897b53eb16b7ddc526d6f::$prefixesPsr0;
61
 
62
  }, null, ClassLoader::class);
63
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit69d10d2d4bdea3f2ca3f6a8fe2e8656a
8
  {
 
 
 
 
 
9
  public static $prefixLengthsPsr4 = array (
10
+ 'E' =>
11
  array (
12
+ 'Embera\\' => 7,
 
 
13
  ),
14
  );
15
 
16
  public static $prefixDirsPsr4 = array (
17
+ 'Embera\\' =>
 
 
 
 
 
 
 
 
18
  array (
19
+ 0 => __DIR__ . '/..' . '/wpdevelopers/embera/src/Embera',
20
  ),
21
  );
22
 
23
+ public static $classMap = array (
24
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  );
26
 
27
  public static function getInitializer(ClassLoader $loader)
28
  {
29
  return \Closure::bind(function () use ($loader) {
30
+ $loader->prefixLengthsPsr4 = ComposerStaticInit69d10d2d4bdea3f2ca3f6a8fe2e8656a::$prefixLengthsPsr4;
31
+ $loader->prefixDirsPsr4 = ComposerStaticInit69d10d2d4bdea3f2ca3f6a8fe2e8656a::$prefixDirsPsr4;
32
+ $loader->classMap = ComposerStaticInit69d10d2d4bdea3f2ca3f6a8fe2e8656a::$classMap;
33
 
34
  }, null, ClassLoader::class);
35
  }
vendor/composer/installed.json CHANGED
@@ -1,243 +1,71 @@
1
- [
2
- {
3
- "name": "ostraining/embera",
4
- "version": "1.9.3",
5
- "version_normalized": "1.9.3.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/OSTraining/Embera",
9
- "reference": "51d4c22303680b4434c3c0d3a34694c0ebbca1a1"
10
- },
11
- "require": {
12
- "php": ">=5.3"
13
- },
14
- "time": "2016-07-12T20:35:30+00:00",
15
- "type": "library",
16
- "installation-source": "source",
17
- "autoload": {
18
- "psr-0": {
19
- "Embera": "Lib/"
20
- }
21
- },
22
- "license": [
23
- "MIT"
24
- ],
25
- "authors": [
26
- {
27
- "name": "Michael Pratt",
28
- "email": "pratt@hablarmierda.net",
29
- "homepage": "http://www.michael-pratt.com",
30
- "role": "Author/Developer"
31
- }
32
- ],
33
- "description": "Oembed consumer library, that gives information about urls. It helps you replace urls to 60+ sites like youtube or vimeo, with their html embed code.",
34
- "homepage": "https://github.com/OSTraining/Embera",
35
- "keywords": [
36
- "Auto embed",
37
- "Embed",
38
- "Embed Text",
39
- "Instagram",
40
- "Oembed",
41
- "Twitter",
42
- "Url Embed",
43
- "Vimeo",
44
- "Vine",
45
- "Youtube"
46
- ]
47
- },
48
- {
49
- "name": "pimple/pimple",
50
- "version": "v3.2.3",
51
- "version_normalized": "3.2.3.0",
52
- "source": {
53
- "type": "git",
54
- "url": "https://github.com/silexphp/Pimple.git",
55
- "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
56
- },
57
- "dist": {
58
- "type": "zip",
59
- "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
60
- "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
61
- "shasum": ""
62
- },
63
- "require": {
64
- "php": ">=5.3.0",
65
- "psr/container": "^1.0"
66
- },
67
- "require-dev": {
68
- "symfony/phpunit-bridge": "^3.2"
69
- },
70
- "time": "2018-01-21T07:42:36+00:00",
71
- "type": "library",
72
- "extra": {
73
- "branch-alias": {
74
- "dev-master": "3.2.x-dev"
75
- }
76
- },
77
- "installation-source": "dist",
78
- "autoload": {
79
- "psr-0": {
80
- "Pimple": "src/"
81
- }
82
- },
83
- "notification-url": "https://packagist.org/downloads/",
84
- "license": [
85
- "MIT"
86
- ],
87
- "authors": [
88
- {
89
- "name": "Fabien Potencier",
90
- "email": "fabien@symfony.com"
91
- }
92
- ],
93
- "description": "Pimple, a simple Dependency Injection Container",
94
- "homepage": "http://pimple.sensiolabs.org",
95
- "keywords": [
96
- "container",
97
- "dependency injection"
98
- ]
99
- },
100
- {
101
- "name": "psr/container",
102
- "version": "1.0.0",
103
- "version_normalized": "1.0.0.0",
104
- "source": {
105
- "type": "git",
106
- "url": "https://github.com/php-fig/container.git",
107
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
108
- },
109
- "dist": {
110
- "type": "zip",
111
- "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
112
- "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
113
- "shasum": ""
114
- },
115
- "require": {
116
- "php": ">=5.3.0"
117
- },
118
- "time": "2017-02-14T16:28:37+00:00",
119
- "type": "library",
120
- "extra": {
121
- "branch-alias": {
122
- "dev-master": "1.0.x-dev"
123
- }
124
- },
125
- "installation-source": "dist",
126
- "autoload": {
127
- "psr-4": {
128
- "Psr\\Container\\": "src/"
129
- }
130
- },
131
- "notification-url": "https://packagist.org/downloads/",
132
- "license": [
133
- "MIT"
134
- ],
135
- "authors": [
136
- {
137
- "name": "PHP-FIG",
138
- "homepage": "http://www.php-fig.org/"
139
- }
140
- ],
141
- "description": "Common Container Interface (PHP FIG PSR-11)",
142
- "homepage": "https://github.com/php-fig/container",
143
- "keywords": [
144
- "PSR-11",
145
- "container",
146
- "container-interface",
147
- "container-interop",
148
- "psr"
149
- ]
150
- },
151
- {
152
- "name": "publishpress/edd-license-handler",
153
- "version": "1.6.14.4",
154
- "version_normalized": "1.6.14.4",
155
- "source": {
156
- "type": "git",
157
- "url": "https://github.com/OSTraining/EDD-License-handler",
158
- "reference": "30dc3bb2bff29668d17406a996fa2c022d55f613"
159
- },
160
- "time": "2018-05-18T17:13:59+00:00",
161
- "type": "library",
162
- "installation-source": "source",
163
- "autoload": {
164
- "files": [
165
- "EDD_License_Handler.php",
166
- "EDD_SL_Plugin_Updater.php"
167
- ]
168
- },
169
- "license": [
170
- "GPL-2"
171
- ],
172
- "authors": [
173
- {
174
- "name": "EasyDigitalDownloads",
175
- "email": "contact@easydigitaldownloads.com"
176
  },
177
- {
178
- "name": "PublishPress",
179
- "email": "help@publishpress.com"
180
- }
181
- ]
182
- },
183
- {
184
- "name": "publishpress/wordpress-edd-license-integration",
185
- "version": "2.2.2",
186
- "version_normalized": "2.2.2.0",
187
- "source": {
188
- "type": "git",
189
- "url": "https://github.com/OSTraining/WordPress-EDD-License-Integration",
190
- "reference": "2bb4a405b8fed0c8b3728dce284b62e9b8013a96"
191
- },
192
- "require": {
193
- "pimple/pimple": "~3.2",
194
- "publishpress/edd-license-handler": "~1.6"
195
- },
196
- "time": "2018-05-18T17:11:02+00:00",
197
- "type": "library",
198
- "installation-source": "source",
199
- "autoload": {
200
- "psr-4": {
201
- "PublishPress\\EDD_License\\Core\\": "src/core/"
202
- }
203
- },
204
- "license": [
205
- "GPL-2"
206
- ],
207
- "authors": [
208
- {
209
- "name": "PublishPress",
210
- "email": "help@publishpress.com"
211
- }
212
- ]
213
- },
214
- {
215
- "name": "publishpress/wordpress-plugin-builder",
216
- "version": "2.1.6",
217
- "version_normalized": "2.1.6.0",
218
- "source": {
219
- "type": "git",
220
- "url": "https://github.com/OSTraining/WordPress-Plugin-Builder",
221
- "reference": "92d16a9b3f48898e09ccf9f89cf0e1e9467c8a63"
222
- },
223
- "time": "2018-05-17T22:26:21+00:00",
224
- "type": "library",
225
- "installation-source": "source",
226
- "autoload": {
227
- "psr-4": {
228
- "PublishPress\\Builder\\": "src/"
229
- }
230
- },
231
- "license": [
232
- "GPL-2.0+"
233
- ],
234
- "authors": [
235
- {
236
- "name": "PublishPress",
237
- "email": "help@publishpress.com",
238
- "homepage": "https://publishpress.com"
239
- }
240
- ],
241
- "description": "Base class for WordPress plugin builder"
242
- }
243
- ]
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "wpdevelopers/embera",
5
+ "version": "2.0.17",
6
+ "version_normalized": "2.0.17.0",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/WPDevelopers/Embera",
10
+ "reference": "5f521fbe77fdfc992dc399ee39e5fdb338ea1f04"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  },
12
+ "require": {
13
+ "ext-json": "*",
14
+ "php": ">=5.6"
15
+ },
16
+ "require-dev": {
17
+ "phpunit/phpunit": "^8.3"
18
+ },
19
+ "suggest": {
20
+ "ext-curl": "Allow to fetch data using curl instead of using file_get_contents"
21
+ },
22
+ "time": "2021-01-28T07:14:10+00:00",
23
+ "type": "library",
24
+ "installation-source": "source",
25
+ "autoload": {
26
+ "psr-4": {
27
+ "Embera\\": "src/Embera"
28
+ }
29
+ },
30
+ "autoload-dev": {
31
+ "psr-4": {
32
+ "Embera\\": "tests/Embera"
33
+ }
34
+ },
35
+ "scripts": {
36
+ "test": [
37
+ "phpunit"
38
+ ]
39
+ },
40
+ "license": [
41
+ "MIT"
42
+ ],
43
+ "authors": [
44
+ {
45
+ "name": "Michael Pratt",
46
+ "email": "yo@michael-pratt.com",
47
+ "homepage": "http://www.michael-pratt.com",
48
+ "role": "Author/Developer"
49
+ }
50
+ ],
51
+ "description": "Oembed consumer library. Converts urls into their html embed code. Supports 150+ sites, such as Youtube, Twitter, vimeo, Instagram etc.",
52
+ "homepage": "https://github.com/WPDevelopers/Embera",
53
+ "keywords": [
54
+ "Auto embed",
55
+ "Embed",
56
+ "Embed Text",
57
+ "Instagram",
58
+ "Oembed",
59
+ "Responsive Embeds",
60
+ "Twitter",
61
+ "Url Embed",
62
+ "Vimeo",
63
+ "Vine",
64
+ "Youtube"
65
+ ],
66
+ "install-path": "../wpdevelopers/embera"
67
+ }
68
+ ],
69
+ "dev": true,
70
+ "dev-package-names": []
71
+ }
 
 
 
 
 
 
 
vendor/composer/installed.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php return array (
2
+ 'root' =>
3
+ array (
4
+ 'pretty_version' => 'dev-master',
5
+ 'version' => 'dev-master',
6
+ 'aliases' =>
7
+ array (
8
+ ),
9
+ 'reference' => '72072eb854c9b467f3a1d206fe8b3cc6fae1743a',
10
+ 'name' => 'embedpress/embedpress',
11
+ ),
12
+ 'versions' =>
13
+ array (
14
+ 'embedpress/embedpress' =>
15
+ array (
16
+ 'pretty_version' => 'dev-master',
17
+ 'version' => 'dev-master',
18
+ 'aliases' =>
19
+ array (
20
+ ),
21
+ 'reference' => '72072eb854c9b467f3a1d206fe8b3cc6fae1743a',
22
+ ),
23
+ 'wpdevelopers/embera' =>
24
+ array (
25
+ 'pretty_version' => '2.0.17',
26
+ 'version' => '2.0.17.0',
27
+ 'aliases' =>
28
+ array (
29
+ ),
30
+ 'reference' => '5f521fbe77fdfc992dc399ee39e5fdb338ea1f04',
31
+ ),
32
+ ),
33
+ );
vendor/composer/platform_check.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // platform_check.php @generated by Composer
4
+
5
+ $issues = array();
6
+
7
+ if (!(PHP_VERSION_ID >= 50600)) {
8
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
9
+ }
10
+
11
+ if ($issues) {
12
+ if (!headers_sent()) {
13
+ header('HTTP/1.1 500 Internal Server Error');
14
+ }
15
+ if (!ini_get('display_errors')) {
16
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
17
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
18
+ } elseif (!headers_sent()) {
19
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
20
+ }
21
+ }
22
+ trigger_error(
23
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
24
+ E_USER_ERROR
25
+ );
26
+ }
vendor/ostraining/embera DELETED
@@ -1 +0,0 @@
1
- Subproject commit 51d4c22303680b4434c3c0d3a34694c0ebbca1a1
 
vendor/pimple/pimple/.travis.yml DELETED
@@ -1,40 +0,0 @@
1
- language: php
2
-
3
- env:
4
- matrix:
5
- - PIMPLE_EXT=no
6
- - PIMPLE_EXT=yes
7
- global:
8
- - REPORT_EXIT_STATUS=1
9
-
10
- php:
11
- - 5.3
12
- - 5.4
13
- - 5.5
14
- - 5.6
15
- - 7.0
16
- - 7.1
17
-
18
- before_script:
19
- - composer self-update
20
- - COMPOSER_ROOT_VERSION=dev-master composer install
21
- - if [ "$PIMPLE_EXT" == "yes" ]; then sh -c "cd ext/pimple && phpize && ./configure && make && sudo make install"; fi
22
- - if [ "$PIMPLE_EXT" == "yes" ]; then echo "extension=pimple.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
23
-
24
- script:
25
- - cd ext/pimple
26
- - if [ "$PIMPLE_EXT" == "yes" ]; then yes n | make test | tee output ; grep -E 'Tests failed +. +0' output; fi
27
- - if [ "$PIMPLE_EXT" == "yes" ]; then export SYMFONY_DEPRECATIONS_HELPER=weak; fi
28
- - cd ../..
29
- - ./vendor/bin/simple-phpunit
30
-
31
- matrix:
32
- include:
33
- - php: hhvm
34
- dist: trusty
35
- env: PIMPLE_EXT=no
36
- exclude:
37
- - php: 7.0
38
- env: PIMPLE_EXT=yes
39
- - php: 7.1
40
- env: PIMPLE_EXT=yes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/CHANGELOG DELETED
@@ -1,59 +0,0 @@
1
- * 3.2.3 (2017-XX-XX)
2
-
3
- * n/a
4
-
5
- * 3.2.2 (2017-07-23)
6
-
7
- * reverted extending a protected closure throws an exception (deprecated it instead)
8
-
9
- * 3.2.1 (2017-07-17)
10
-
11
- * fixed PHP error
12
-
13
- * 3.2.0 (2017-07-17)
14
-
15
- * added a PSR-11 service locator
16
- * added a PSR-11 wrapper
17
- * added ServiceIterator
18
- * fixed extending a protected closure (now throws InvalidServiceIdentifierException)
19
-
20
- * 3.1.0 (2017-07-03)
21
-
22
- * deprecated the C extension
23
- * added support for PSR-11 exceptions
24
-
25
- * 3.0.2 (2015-09-11)
26
-
27
- * refactored the C extension
28
- * minor non-significant changes
29
-
30
- * 3.0.1 (2015-07-30)
31
-
32
- * simplified some code
33
- * fixed a segfault in the C extension
34
-
35
- * 3.0.0 (2014-07-24)
36
-
37
- * removed the Pimple class alias (use Pimple\Container instead)
38
-
39
- * 2.1.1 (2014-07-24)
40
-
41
- * fixed compiler warnings for the C extension
42
- * fixed code when dealing with circular references
43
-
44
- * 2.1.0 (2014-06-24)
45
-
46
- * moved the Pimple to Pimple\Container (with a BC layer -- Pimple is now a
47
- deprecated alias which will be removed in Pimple 3.0)
48
- * added Pimple\ServiceProviderInterface (and Pimple::register())
49
-
50
- * 2.0.0 (2014-02-10)
51
-
52
- * changed extend to automatically re-assign the extended service and keep it as shared or factory
53
- (to keep BC, extend still returns the extended service)
54
- * changed services to be shared by default (use factory() for factory
55
- services)
56
-
57
- * 1.0.0
58
-
59
- * initial version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2009-2017 Fabien Potencier
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/README.rst DELETED
@@ -1,326 +0,0 @@
1
- Pimple
2
- ======
3
-
4
- .. caution::
5
-
6
- This is the documentation for Pimple 3.x. If you are using Pimple 1.x, read
7
- the `Pimple 1.x documentation`_. Reading the Pimple 1.x code is also a good
8
- way to learn more about how to create a simple Dependency Injection
9
- Container (recent versions of Pimple are more focused on performance).
10
-
11
- Pimple is a small Dependency Injection Container for PHP.
12
-
13
- Installation
14
- ------------
15
-
16
- Before using Pimple in your project, add it to your ``composer.json`` file:
17
-
18
- .. code-block:: bash
19
-
20
- $ ./composer.phar require pimple/pimple "^3.0"
21
-
22
- Usage
23
- -----
24
-
25
- Creating a container is a matter of creating a ``Container`` instance:
26
-
27
- .. code-block:: php
28
-
29
- use Pimple\Container;
30
-
31
- $container = new Container();
32
-
33
- As many other dependency injection containers, Pimple manages two different
34
- kind of data: **services** and **parameters**.
35
-
36
- Defining Services
37
- ~~~~~~~~~~~~~~~~~
38
-
39
- A service is an object that does something as part of a larger system. Examples
40
- of services: a database connection, a templating engine, or a mailer. Almost
41
- any **global** object can be a service.
42
-
43
- Services are defined by **anonymous functions** that return an instance of an
44
- object:
45
-
46
- .. code-block:: php
47
-
48
- // define some services
49
- $container['session_storage'] = function ($c) {
50
- return new SessionStorage('SESSION_ID');
51
- };
52
-
53
- $container['session'] = function ($c) {
54
- return new Session($c['session_storage']);
55
- };
56
-
57
- Notice that the anonymous function has access to the current container
58
- instance, allowing references to other services or parameters.
59
-
60
- As objects are only created when you get them, the order of the definitions
61
- does not matter.
62
-
63
- Using the defined services is also very easy:
64
-
65
- .. code-block:: php
66
-
67
- // get the session object
68
- $session = $container['session'];
69
-
70
- // the above call is roughly equivalent to the following code:
71
- // $storage = new SessionStorage('SESSION_ID');
72
- // $session = new Session($storage);
73
-
74
- Defining Factory Services
75
- ~~~~~~~~~~~~~~~~~~~~~~~~~
76
-
77
- By default, each time you get a service, Pimple returns the **same instance**
78
- of it. If you want a different instance to be returned for all calls, wrap your
79
- anonymous function with the ``factory()`` method
80
-
81
- .. code-block:: php
82
-
83
- $container['session'] = $container->factory(function ($c) {
84
- return new Session($c['session_storage']);
85
- });
86
-
87
- Now, each call to ``$container['session']`` returns a new instance of the
88
- session.
89
-
90
- Defining Parameters
91
- ~~~~~~~~~~~~~~~~~~~
92
-
93
- Defining a parameter allows to ease the configuration of your container from
94
- the outside and to store global values:
95
-
96
- .. code-block:: php
97
-
98
- // define some parameters
99
- $container['cookie_name'] = 'SESSION_ID';
100
- $container['session_storage_class'] = 'SessionStorage';
101
-
102
- If you change the ``session_storage`` service definition like below:
103
-
104
- .. code-block:: php
105
-
106
- $container['session_storage'] = function ($c) {
107
- return new $c['session_storage_class']($c['cookie_name']);
108
- };
109
-
110
- You can now easily change the cookie name by overriding the
111
- ``cookie_name`` parameter instead of redefining the service
112
- definition.
113
-
114
- Protecting Parameters
115
- ~~~~~~~~~~~~~~~~~~~~~
116
-
117
- Because Pimple sees anonymous functions as service definitions, you need to
118
- wrap anonymous functions with the ``protect()`` method to store them as
119
- parameters:
120
-
121
- .. code-block:: php
122
-
123
- $container['random_func'] = $container->protect(function () {
124
- return rand();
125
- });
126
-
127
- Modifying Services after Definition
128
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129
-
130
- In some cases you may want to modify a service definition after it has been
131
- defined. You can use the ``extend()`` method to define additional code to be
132
- run on your service just after it is created:
133
-
134
- .. code-block:: php
135
-
136
- $container['session_storage'] = function ($c) {
137
- return new $c['session_storage_class']($c['cookie_name']);
138
- };
139
-
140
- $container->extend('session_storage', function ($storage, $c) {
141
- $storage->...();
142
-
143
- return $storage;
144
- });
145
-
146
- The first argument is the name of the service to extend, the second a function
147
- that gets access to the object instance and the container.
148
-
149
- Extending a Container
150
- ~~~~~~~~~~~~~~~~~~~~~
151
-
152
- If you use the same libraries over and over, you might want to reuse some
153
- services from one project to the next one; package your services into a
154
- **provider** by implementing ``Pimple\ServiceProviderInterface``:
155
-
156
- .. code-block:: php
157
-
158
- use Pimple\Container;
159
-
160
- class FooProvider implements Pimple\ServiceProviderInterface
161
- {
162
- public function register(Container $pimple)
163
- {
164
- // register some services and parameters
165
- // on $pimple
166
- }
167
- }
168
-
169
- Then, register the provider on a Container:
170
-
171
- .. code-block:: php
172
-
173
- $pimple->register(new FooProvider());
174
-
175
- Fetching the Service Creation Function
176
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177
-
178
- When you access an object, Pimple automatically calls the anonymous function
179
- that you defined, which creates the service object for you. If you want to get
180
- raw access to this function, you can use the ``raw()`` method:
181
-
182
- .. code-block:: php
183
-
184
- $container['session'] = function ($c) {
185
- return new Session($c['session_storage']);
186
- };
187
-
188
- $sessionFunction = $container->raw('session');
189
-
190
- PSR-11 compatibility
191
- --------------------
192
-
193
- For historical reasons, the ``Container`` class does not implement the PSR-11
194
- ``ContainerInterface``. However, Pimple provides a helper class that will let
195
- you decouple your code from the Pimple container class.
196
-
197
- The PSR-11 container class
198
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
199
-
200
- The ``Pimple\Psr11\Container`` class lets you access the content of an
201
- underlying Pimple container using ``Psr\Container\ContainerInterface``
202
- methods:
203
-
204
- .. code-block:: php
205
-
206
- use Pimple\Container;
207
- use Pimple\Psr11\Container as PsrContainer;
208
-
209
- $container = new Container();
210
- $container['service'] = function ($c) {
211
- return new Service();
212
- };
213
- $psr11 = new PsrContainer($container);
214
-
215
- $controller = function (PsrContainer $container) {
216
- $service = $container->get('service');
217
- };
218
- $controller($psr11);
219
-
220
- Using the PSR-11 ServiceLocator
221
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222
-
223
- Sometimes, a service needs access to several other services without being sure
224
- that all of them will actually be used. In those cases, you may want the
225
- instantiation of the services to be lazy.
226
-
227
- The traditional solution is to inject the entire service container to get only
228
- the services really needed. However, this is not recommended because it gives
229
- services a too broad access to the rest of the application and it hides their
230
- actual dependencies.
231
-
232
- The ``ServiceLocator`` is intended to solve this problem by giving access to a
233
- set of predefined services while instantiating them only when actually needed.
234
-
235
- It also allows you to make your services available under a different name than
236
- the one used to register them. For instance, you may want to use an object
237
- that expects an instance of ``EventDispatcherInterface`` to be available under
238
- the name ``event_dispatcher`` while your event dispatcher has been
239
- registered under the name ``dispatcher``:
240
-
241
- .. code-block:: php
242
-
243
- use Monolog\Logger;
244
- use Pimple\Psr11\ServiceLocator;
245
- use Psr\Container\ContainerInterface;
246
- use Symfony\Component\EventDispatcher\EventDispatcher;
247
-
248
- class MyService
249
- {
250
- /**
251
- * "logger" must be an instance of Psr\Log\LoggerInterface
252
- * "event_dispatcher" must be an instance of Symfony\Component\EventDispatcher\EventDispatcherInterface
253
- */
254
- private $services;
255
-
256
- public function __construct(ContainerInterface $services)
257
- {
258
- $this->services = $services;
259
- }
260
- }
261
-
262
- $container['logger'] = function ($c) {
263
- return new Monolog\Logger();
264
- };
265
- $container['dispatcher'] = function () {
266
- return new EventDispatcher();
267
- };
268
-
269
- $container['service'] = function ($c) {
270
- $locator = new ServiceLocator($c, array('logger', 'event_dispatcher' => 'dispatcher'));
271
-
272
- return new MyService($locator);
273
- };
274
-
275
- Referencing a Collection of Services Lazily
276
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277
-
278
- Passing a collection of services instances in an array may prove inefficient
279
- if the class that consumes the collection only needs to iterate over it at a
280
- later stage, when one of its method is called. It can also lead to problems
281
- if there is a circular dependency between one of the services stored in the
282
- collection and the class that consumes it.
283
-
284
- The ``ServiceIterator`` class helps you solve these issues. It receives a
285
- list of service names during instantiation and will retrieve the services
286
- when iterated over:
287
-
288
- .. code-block:: php
289
-
290
- use Pimple\Container;
291
- use Pimple\ServiceIterator;
292
-
293
- class AuthorizationService
294
- {
295
- private $voters;
296
-
297
- public function __construct($voters)
298
- {
299
- $this->voters = $voters;
300
- }
301
-
302
- public function canAccess($resource)
303
- {
304
- foreach ($this->voters as $voter) {
305
- if (true === $voter->canAccess($resource) {
306
- return true;
307
- }
308
- }
309
-
310
- return false;
311
- }
312
- }
313
-
314
- $container = new Container();
315
-
316
- $container['voter1'] = function ($c) {
317
- return new SomeVoter();
318
- }
319
- $container['voter2'] = function ($c) {
320
- return new SomeOtherVoter($c['auth']);
321
- }
322
- $container['auth'] = function ($c) {
323
- return new AuthorizationService(new ServiceIterator($c, array('voter1', 'voter2'));
324
- }
325
-
326
- .. _Pimple 1.x documentation: https://github.com/silexphp/Pimple/tree/1.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/composer.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "name": "pimple/pimple",
3
- "type": "library",
4
- "description": "Pimple, a simple Dependency Injection Container",
5
- "keywords": ["dependency injection", "container"],
6
- "homepage": "http://pimple.sensiolabs.org",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Fabien Potencier",
11
- "email": "fabien@symfony.com"
12
- }
13
- ],
14
- "require": {
15
- "php": ">=5.3.0",
16
- "psr/container": "^1.0"
17
- },
18
- "require-dev": {
19
- "symfony/phpunit-bridge": "^3.2"
20
- },
21
- "autoload": {
22
- "psr-0": { "Pimple": "src/" }
23
- },
24
- "extra": {
25
- "branch-alias": {
26
- "dev-master": "3.2.x-dev"
27
- }
28
- }
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/README.md DELETED
@@ -1,12 +0,0 @@
1
- This is Pimple 2 implemented in C
2
-
3
- * PHP >= 5.3
4
- * Not tested under Windows, might work
5
-
6
- Install
7
- =======
8
-
9
- > phpize
10
- > ./configure
11
- > make
12
- > make install
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/config.m4 DELETED
@@ -1,63 +0,0 @@
1
- dnl $Id$
2
- dnl config.m4 for extension pimple
3
-
4
- dnl Comments in this file start with the string 'dnl'.
5
- dnl Remove where necessary. This file will not work
6
- dnl without editing.
7
-
8
- dnl If your extension references something external, use with:
9
-
10
- dnl PHP_ARG_WITH(pimple, for pimple support,
11
- dnl Make sure that the comment is aligned:
12
- dnl [ --with-pimple Include pimple support])
13
-
14
- dnl Otherwise use enable:
15
-
16
- PHP_ARG_ENABLE(pimple, whether to enable pimple support,
17
- dnl Make sure that the comment is aligned:
18
- [ --enable-pimple Enable pimple support])
19
-
20
- if test "$PHP_PIMPLE" != "no"; then
21
- dnl Write more examples of tests here...
22
-
23
- dnl # --with-pimple -> check with-path
24
- dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
25
- dnl SEARCH_FOR="/include/pimple.h" # you most likely want to change this
26
- dnl if test -r $PHP_PIMPLE/$SEARCH_FOR; then # path given as parameter
27
- dnl PIMPLE_DIR=$PHP_PIMPLE
28
- dnl else # search default path list
29
- dnl AC_MSG_CHECKING([for pimple files in default path])
30
- dnl for i in $SEARCH_PATH ; do
31
- dnl if test -r $i/$SEARCH_FOR; then
32
- dnl PIMPLE_DIR=$i
33
- dnl AC_MSG_RESULT(found in $i)
34
- dnl fi
35
- dnl done
36
- dnl fi
37
- dnl
38
- dnl if test -z "$PIMPLE_DIR"; then
39
- dnl AC_MSG_RESULT([not found])
40
- dnl AC_MSG_ERROR([Please reinstall the pimple distribution])
41
- dnl fi
42
-
43
- dnl # --with-pimple -> add include path
44
- dnl PHP_ADD_INCLUDE($PIMPLE_DIR/include)
45
-
46
- dnl # --with-pimple -> check for lib and symbol presence
47
- dnl LIBNAME=pimple # you may want to change this
48
- dnl LIBSYMBOL=pimple # you most likely want to change this
49
-
50
- dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
51
- dnl [
52
- dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PIMPLE_DIR/lib, PIMPLE_SHARED_LIBADD)
53
- dnl AC_DEFINE(HAVE_PIMPLELIB,1,[ ])
54
- dnl ],[
55
- dnl AC_MSG_ERROR([wrong pimple lib version or lib not found])
56
- dnl ],[
57
- dnl -L$PIMPLE_DIR/lib -lm
58
- dnl ])
59
- dnl
60
- dnl PHP_SUBST(PIMPLE_SHARED_LIBADD)
61
-
62
- PHP_NEW_EXTENSION(pimple, pimple.c, $ext_shared)
63
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/config.w32 DELETED
@@ -1,13 +0,0 @@
1
- // $Id$
2
- // vim:ft=javascript
3
-
4
- // If your extension references something external, use ARG_WITH
5
- // ARG_WITH("pimple", "for pimple support", "no");
6
-
7
- // Otherwise, use ARG_ENABLE
8
- // ARG_ENABLE("pimple", "enable pimple support", "no");
9
-
10
- if (PHP_PIMPLE != "no") {
11
- EXTENSION("pimple", "pimple.c");
12
- }
13
-
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/php_pimple.h DELETED
@@ -1,137 +0,0 @@
1
-
2
- /*
3
- * This file is part of Pimple.
4
- *
5
- * Copyright (c) 2014 Fabien Potencier
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is furnished
12
- * to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- */
25
-
26
- #ifndef PHP_PIMPLE_H
27
- #define PHP_PIMPLE_H
28
-
29
- extern zend_module_entry pimple_module_entry;
30
- #define phpext_pimple_ptr &pimple_module_entry
31
-
32
- #ifdef PHP_WIN32
33
- # define PHP_PIMPLE_API __declspec(dllexport)
34
- #elif defined(__GNUC__) && __GNUC__ >= 4
35
- # define PHP_PIMPLE_API __attribute__ ((visibility("default")))
36
- #else
37
- # define PHP_PIMPLE_API
38
- #endif
39
-
40
- #ifdef ZTS
41
- #include "TSRM.h"
42
- #endif
43
-
44
- #define PIMPLE_VERSION "3.2.3-DEV"
45
-
46
- #define PIMPLE_NS "Pimple"
47
- #define PSR_CONTAINER_NS "Psr\\Container"
48
- #define PIMPLE_EXCEPTION_NS "Pimple\\Exception"
49
-
50
- #define PIMPLE_DEFAULT_ZVAL_CACHE_NUM 5
51
- #define PIMPLE_DEFAULT_ZVAL_VALUES_NUM 10
52
-
53
- #define PIMPLE_DEPRECATE do { \
54
- int er = EG(error_reporting); \
55
- EG(error_reporting) = 0;\
56
- php_error(E_DEPRECATED, "The Pimple C extension is deprecated since version 3.1 and will be removed in 4.0."); \
57
- EG(error_reporting) = er; \
58
- } while (0);
59
-
60
- zend_module_entry *get_module(void);
61
-
62
- PHP_MINIT_FUNCTION(pimple);
63
- PHP_MINFO_FUNCTION(pimple);
64
-
65
- PHP_METHOD(FrozenServiceException, __construct);
66
- PHP_METHOD(InvalidServiceIdentifierException, __construct);
67
- PHP_METHOD(UnknownIdentifierException, __construct);
68
-
69
- PHP_METHOD(Pimple, __construct);
70
- PHP_METHOD(Pimple, factory);
71
- PHP_METHOD(Pimple, protect);
72
- PHP_METHOD(Pimple, raw);
73
- PHP_METHOD(Pimple, extend);
74
- PHP_METHOD(Pimple, keys);
75
- PHP_METHOD(Pimple, register);
76
- PHP_METHOD(Pimple, offsetSet);
77
- PHP_METHOD(Pimple, offsetUnset);
78
- PHP_METHOD(Pimple, offsetGet);
79
- PHP_METHOD(Pimple, offsetExists);
80
-
81
- PHP_METHOD(PimpleClosure, invoker);
82
-
83
- typedef struct _pimple_bucket_value {
84
- zval *value; /* Must be the first element */
85
- zval *raw;
86
- zend_object_handle handle_num;
87
- enum {
88
- PIMPLE_IS_PARAM = 0,
89
- PIMPLE_IS_SERVICE = 2
90
- } type;
91
- zend_bool initialized;
92
- zend_fcall_info_cache fcc;
93
- } pimple_bucket_value;
94
-
95
- typedef struct _pimple_object {
96
- zend_object zobj;
97
- HashTable values;
98
- HashTable factories;
99
- HashTable protected;
100
- } pimple_object;
101
-
102
- typedef struct _pimple_closure_object {
103
- zend_object zobj;
104
- zval *callable;
105
- zval *factory;
106
- } pimple_closure_object;
107
-
108
- static const char sensiolabs_logo[] = "<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAUCAMAAABvRTlyAAAAz1BMVEUAAAAAAAAAAAAsThWB5j4AAACD6T8AAACC6D+C6D6C6D+C6D4AAAAAAACC6D4AAAAAAACC6D8AAAAAAAAAAAAAAAAAAAAAAACC6D4AAAAAAAAAAACC6D4AAAAAAAAAAAAAAAAAAAAAAACC6D8AAACC6D4AAAAAAAAAAAAAAAAAAACC6D8AAACC6D6C6D+B6D+C6D+C6D+C6D8AAACC6D6C6D4AAACC6D/K/2KC6D+B6D6C6D6C6D+C6D8sTxUyWRhEeiEAAACC6D+C5z6B6D7drnEVAAAAQXRSTlMAE3oCNSUuDHFHzxaF9UFsu+irX+zlKzYimaJXktyOSFD6BolxqT7QGMMdarMIpuO28r9EolXKgR16OphfXYd4V14GtB4AAAMpSURBVEjHvVSJctowEF1jjME2RziMwUCoMfd9heZqG4n//6buLpJjkmYm03byZmxJa2nf6u2uQcG2bfhqRN4LoTKBzyGDm68M7mAwcOEdjo4zhA/Rf9Go/CVtTgiRhXfIC3EDH8F/eUX1/9KexRo+QgOdtHDsEe/sM7QT32/+K61Z1LFXcXJxN4pTbu1aTQUzuy2PIA0rDo0/0Aa5XFaJvKaVTrubywXvaa1Wq4Vu/Snr3Y7Aojh4VccwykW2N2oQ8wmjyut6+Q1t5ywIG5Npj1sh5E0B7YOzFDjfuRfaOh3O+MbbVNfTWS9COZk3Obd2su5d0a6IU9KLREbw8gEehWSr1r2sPWciXLG38r5NdW0xu9eioU87omjC9yNaMi5GNf6WppVSOqXCFkmCvMB3p9SROLoYQn5pDgQOujA1xjYvqH+plUdkwnmII8VxR/PKYkrfLLomhVlE3b/LhNbNr7hp0H2JaOc4v8dFB58HSsFTSafaqtY1sT3GO8wsy5rhokYPlRJdjPMajyYqTt1EHF/2uqSWQWmAjCUSmQ1MS3g8Btf1XOsy7YIC0CB1b5Xw1Vhba0zbxiCAQLH9TNPmHJXQUtJAN0KcDsoqLxsNvJrJExa7mKIdp2lRE2WexiS4pqWk/0jROlw6K6bV9YOBDGAuqMJ0bnuUKGB0L27bxgRhGEbzihbhxxXaQC88Vkwq8ldCi86RApWUb0Q+4VDosBCc+1s81lUdnBavH4Zp2mm3O44USwOfvSo9oBiwpFg71lMS1VKJLKljS3j9p+fOTvXXlsSNuEv6YPaZda9uRope0VJfKdo7fPiYfSmvFjXQbkhY0d9hCbBWIktRgEDieDhf1N3wbbkmNNgRy8hyl620yGQat/grV3HMpc2HDKTVmOPFz6ylPCKt/nXcAyV260jaAowwIW0YuBzrOgb/KrddZS9OmJaLgpWK4JX2DDuklcLZSDGcn8Vmx9YDNvT6UsjyBApRyFQVX7Vxm9TGxE16nmfRd8/zQoDmggQOTRh5Hv8pMt9Q/L2JmSwkMCE7dA4BuDjHJwfu0Om4QAhOjrN5XkIatglfiN/bUPdCQFjTYgAAAABJRU5ErkJggg==\">";
109
-
110
- static void pimple_exception_call_parent_constructor(zval *this_ptr, const char *format, const char *arg1 TSRMLS_DC);
111
-
112
- static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC);
113
- static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC);
114
-
115
- static void pimple_bucket_dtor(pimple_bucket_value *bucket);
116
- static void pimple_free_bucket(pimple_bucket_value *bucket);
117
-
118
- static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC);
119
- static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC);
120
- static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC);
121
- static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC);
122
- static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC);
123
- static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC);
124
-
125
- static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC);
126
- static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC);
127
- static zend_function *pimple_closure_get_constructor(zval * TSRMLS_DC);
128
- static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC);
129
-
130
- #ifdef ZTS
131
- #define PIMPLE_G(v) TSRMG(pimple_globals_id, zend_pimple_globals *, v)
132
- #else
133
- #define PIMPLE_G(v) (pimple_globals.v)
134
- #endif
135
-
136
- #endif /* PHP_PIMPLE_H */
137
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/pimple.c DELETED
@@ -1,1114 +0,0 @@
1
-
2
- /*
3
- * This file is part of Pimple.
4
- *
5
- * Copyright (c) 2014 Fabien Potencier
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is furnished
12
- * to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- */
25
-
26
- #ifdef HAVE_CONFIG_H
27
- #include "config.h"
28
- #endif
29
-
30
- #include "php.h"
31
- #include "php_ini.h"
32
- #include "ext/standard/info.h"
33
- #include "php_pimple.h"
34
- #include "pimple_compat.h"
35
- #include "zend_interfaces.h"
36
- #include "zend.h"
37
- #include "Zend/zend_closures.h"
38
- #include "ext/spl/spl_exceptions.h"
39
- #include "Zend/zend_exceptions.h"
40
- #include "main/php_output.h"
41
- #include "SAPI.h"
42
-
43
- static zend_class_entry *pimple_ce_PsrContainerInterface;
44
- static zend_class_entry *pimple_ce_PsrContainerExceptionInterface;
45
- static zend_class_entry *pimple_ce_PsrNotFoundExceptionInterface;
46
-
47
- static zend_class_entry *pimple_ce_ExpectedInvokableException;
48
- static zend_class_entry *pimple_ce_FrozenServiceException;
49
- static zend_class_entry *pimple_ce_InvalidServiceIdentifierException;
50
- static zend_class_entry *pimple_ce_UnknownIdentifierException;
51
-
52
- static zend_class_entry *pimple_ce;
53
- static zend_object_handlers pimple_object_handlers;
54
- static zend_class_entry *pimple_closure_ce;
55
- static zend_class_entry *pimple_serviceprovider_ce;
56
- static zend_object_handlers pimple_closure_object_handlers;
57
- static zend_internal_function pimple_closure_invoker_function;
58
-
59
- #define FETCH_DIM_HANDLERS_VARS pimple_object *pimple_obj = NULL; \
60
- ulong index; \
61
- pimple_obj = (pimple_object *)zend_object_store_get_object(object TSRMLS_CC); \
62
-
63
- #define PIMPLE_OBJECT_HANDLE_INHERITANCE_OBJECT_HANDLERS do { \
64
- if (ce != pimple_ce) { \
65
- zend_hash_find(&ce->function_table, ZEND_STRS("offsetget"), (void **)&function); \
66
- if (function->common.scope != ce) { /* if the function is not defined in this actual class */ \
67
- pimple_object_handlers.read_dimension = pimple_object_read_dimension; /* then overwrite the handler to use custom one */ \
68
- } \
69
- zend_hash_find(&ce->function_table, ZEND_STRS("offsetset"), (void **)&function); \
70
- if (function->common.scope != ce) { \
71
- pimple_object_handlers.write_dimension = pimple_object_write_dimension; \
72
- } \
73
- zend_hash_find(&ce->function_table, ZEND_STRS("offsetexists"), (void **)&function); \
74
- if (function->common.scope != ce) { \
75
- pimple_object_handlers.has_dimension = pimple_object_has_dimension; \
76
- } \
77
- zend_hash_find(&ce->function_table, ZEND_STRS("offsetunset"), (void **)&function); \
78
- if (function->common.scope != ce) { \
79
- pimple_object_handlers.unset_dimension = pimple_object_unset_dimension; \
80
- } \
81
- } else { \
82
- pimple_object_handlers.read_dimension = pimple_object_read_dimension; \
83
- pimple_object_handlers.write_dimension = pimple_object_write_dimension; \
84
- pimple_object_handlers.has_dimension = pimple_object_has_dimension; \
85
- pimple_object_handlers.unset_dimension = pimple_object_unset_dimension; \
86
- }\
87
- } while(0);
88
-
89
- #define PIMPLE_CALL_CB do { \
90
- zend_fcall_info_argn(&fci TSRMLS_CC, 1, &object); \
91
- fci.size = sizeof(fci); \
92
- fci.object_ptr = retval->fcc.object_ptr; \
93
- fci.function_name = retval->value; \
94
- fci.no_separation = 1; \
95
- fci.retval_ptr_ptr = &retval_ptr_ptr; \
96
- \
97
- zend_call_function(&fci, &retval->fcc TSRMLS_CC); \
98
- efree(fci.params); \
99
- if (EG(exception)) { \
100
- return EG(uninitialized_zval_ptr); \
101
- } \
102
- } while(0);
103
-
104
-
105
- /* Psr\Container\ContainerInterface */
106
- ZEND_BEGIN_ARG_INFO_EX(arginfo_pimple_PsrContainerInterface_get, 0, 0, 1)
107
- ZEND_ARG_INFO(0, id)
108
- ZEND_END_ARG_INFO()
109
-
110
- ZEND_BEGIN_ARG_INFO_EX(arginfo_pimple_PsrContainerInterface_has, 0, 0, 1)
111
- ZEND_ARG_INFO(0, id)
112
- ZEND_END_ARG_INFO()
113
-
114
- static const zend_function_entry pimple_ce_PsrContainerInterface_functions[] = {
115
- PHP_ABSTRACT_ME(ContainerInterface, get, arginfo_pimple_PsrContainerInterface_get)
116
- PHP_ABSTRACT_ME(ContainerInterface, has, arginfo_pimple_PsrContainerInterface_has)
117
- PHP_FE_END
118
- };
119
-
120
- /* Psr\Container\ContainerExceptionInterface */
121
- static const zend_function_entry pimple_ce_PsrContainerExceptionInterface_functions[] = {
122
- PHP_FE_END
123
- };
124
-
125
- /* Psr\Container\NotFoundExceptionInterface */
126
- static const zend_function_entry pimple_ce_PsrNotFoundExceptionInterface_functions[] = {
127
- PHP_FE_END
128
- };
129
-
130
- /* Pimple\Exception\FrozenServiceException */
131
- ZEND_BEGIN_ARG_INFO_EX(arginfo_FrozenServiceException___construct, 0, 0, 1)
132
- ZEND_ARG_INFO(0, id)
133
- ZEND_END_ARG_INFO()
134
-
135
- static const zend_function_entry pimple_ce_FrozenServiceException_functions[] = {
136
- PHP_ME(FrozenServiceException, __construct, arginfo_FrozenServiceException___construct, ZEND_ACC_PUBLIC)
137
- PHP_FE_END
138
- };
139
-
140
- /* Pimple\Exception\InvalidServiceIdentifierException */
141
- ZEND_BEGIN_ARG_INFO_EX(arginfo_InvalidServiceIdentifierException___construct, 0, 0, 1)
142
- ZEND_ARG_INFO(0, id)
143
- ZEND_END_ARG_INFO()
144
-
145
- static const zend_function_entry pimple_ce_InvalidServiceIdentifierException_functions[] = {
146
- PHP_ME(InvalidServiceIdentifierException, __construct, arginfo_InvalidServiceIdentifierException___construct, ZEND_ACC_PUBLIC)
147
- PHP_FE_END
148
- };
149
-
150
- /* Pimple\Exception\UnknownIdentifierException */
151
- ZEND_BEGIN_ARG_INFO_EX(arginfo_UnknownIdentifierException___construct, 0, 0, 1)
152
- ZEND_ARG_INFO(0, id)
153
- ZEND_END_ARG_INFO()
154
-
155
- static const zend_function_entry pimple_ce_UnknownIdentifierException_functions[] = {
156
- PHP_ME(UnknownIdentifierException, __construct, arginfo_UnknownIdentifierException___construct, ZEND_ACC_PUBLIC)
157
- PHP_FE_END
158
- };
159
-
160
- /* Pimple\Container */
161
- ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, 0, 0, 0)
162
- ZEND_ARG_ARRAY_INFO(0, value, 0)
163
- ZEND_END_ARG_INFO()
164
-
165
- ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetset, 0, 0, 2)
166
- ZEND_ARG_INFO(0, offset)
167
- ZEND_ARG_INFO(0, value)
168
- ZEND_END_ARG_INFO()
169
-
170
- ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetget, 0, 0, 1)
171
- ZEND_ARG_INFO(0, offset)
172
- ZEND_END_ARG_INFO()
173
-
174
- ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetexists, 0, 0, 1)
175
- ZEND_ARG_INFO(0, offset)
176
- ZEND_END_ARG_INFO()
177
-
178
- ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetunset, 0, 0, 1)
179
- ZEND_ARG_INFO(0, offset)
180
- ZEND_END_ARG_INFO()
181
-
182
- ZEND_BEGIN_ARG_INFO_EX(arginfo_factory, 0, 0, 1)
183
- ZEND_ARG_INFO(0, callable)
184
- ZEND_END_ARG_INFO()
185
-
186
- ZEND_BEGIN_ARG_INFO_EX(arginfo_protect, 0, 0, 1)
187
- ZEND_ARG_INFO(0, callable)
188
- ZEND_END_ARG_INFO()
189
-
190
- ZEND_BEGIN_ARG_INFO_EX(arginfo_raw, 0, 0, 1)
191
- ZEND_ARG_INFO(0, id)
192
- ZEND_END_ARG_INFO()
193
-
194
- ZEND_BEGIN_ARG_INFO_EX(arginfo_extend, 0, 0, 2)
195
- ZEND_ARG_INFO(0, id)
196
- ZEND_ARG_INFO(0, callable)
197
- ZEND_END_ARG_INFO()
198
-
199
- ZEND_BEGIN_ARG_INFO_EX(arginfo_keys, 0, 0, 0)
200
- ZEND_END_ARG_INFO()
201
-
202
- ZEND_BEGIN_ARG_INFO_EX(arginfo_register, 0, 0, 1)
203
- ZEND_ARG_OBJ_INFO(0, provider, Pimple\\ServiceProviderInterface, 0)
204
- ZEND_ARG_ARRAY_INFO(0, values, 1)
205
- ZEND_END_ARG_INFO()
206
-
207
- static const zend_function_entry pimple_ce_functions[] = {
208
- PHP_ME(Pimple, __construct, arginfo___construct, ZEND_ACC_PUBLIC)
209
- PHP_ME(Pimple, factory, arginfo_factory, ZEND_ACC_PUBLIC)
210
- PHP_ME(Pimple, protect, arginfo_protect, ZEND_ACC_PUBLIC)
211
- PHP_ME(Pimple, raw, arginfo_raw, ZEND_ACC_PUBLIC)
212
- PHP_ME(Pimple, extend, arginfo_extend, ZEND_ACC_PUBLIC)
213
- PHP_ME(Pimple, keys, arginfo_keys, ZEND_ACC_PUBLIC)
214
- PHP_ME(Pimple, register, arginfo_register, ZEND_ACC_PUBLIC)
215
-
216
- PHP_ME(Pimple, offsetSet, arginfo_offsetset, ZEND_ACC_PUBLIC)
217
- PHP_ME(Pimple, offsetGet, arginfo_offsetget, ZEND_ACC_PUBLIC)
218
- PHP_ME(Pimple, offsetExists, arginfo_offsetexists, ZEND_ACC_PUBLIC)
219
- PHP_ME(Pimple, offsetUnset, arginfo_offsetunset, ZEND_ACC_PUBLIC)
220
- PHP_FE_END
221
- };
222
-
223
- /* Pimple\ServiceProviderInterface */
224
- ZEND_BEGIN_ARG_INFO_EX(arginfo_serviceprovider_register, 0, 0, 1)
225
- ZEND_ARG_OBJ_INFO(0, pimple, Pimple\\Container, 0)
226
- ZEND_END_ARG_INFO()
227
-
228
- static const zend_function_entry pimple_serviceprovider_iface_ce_functions[] = {
229
- PHP_ABSTRACT_ME(ServiceProviderInterface, register, arginfo_serviceprovider_register)
230
- PHP_FE_END
231
- };
232
-
233
- /* parent::__construct(sprintf("Something with %s", $arg1)) */
234
- static void pimple_exception_call_parent_constructor(zval *this_ptr, const char *format, const char *arg1 TSRMLS_DC)
235
- {
236
- zend_class_entry *ce = Z_OBJCE_P(this_ptr);
237
- char *message = NULL;
238
- int message_len;
239
- zval *constructor_arg;
240
-
241
- message_len = spprintf(&message, 0, format, arg1);
242
- ALLOC_INIT_ZVAL(constructor_arg);
243
- ZVAL_STRINGL(constructor_arg, message, message_len, 1);
244
-
245
- zend_call_method_with_1_params(&this_ptr, ce, &ce->parent->constructor, "__construct", NULL, constructor_arg);
246
-
247
- efree(message);
248
- zval_ptr_dtor(&constructor_arg);
249
- }
250
-
251
- /**
252
- * Pass a single string parameter to exception constructor and throw
253
- */
254
- static void pimple_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len TSRMLS_DC)
255
- {
256
- zval *exception, *param;
257
-
258
- ALLOC_INIT_ZVAL(exception);
259
- object_init_ex(exception, ce);
260
-
261
- ALLOC_INIT_ZVAL(param);
262
- ZVAL_STRINGL(param, message, message_len, 1);
263
-
264
- zend_call_method_with_1_params(&exception, ce, &ce->constructor, "__construct", NULL, param);
265
-
266
- zend_throw_exception_object(exception TSRMLS_CC);
267
-
268
- zval_ptr_dtor(&param);
269
- }
270
-
271
- static void pimple_closure_free_object_storage(pimple_closure_object *obj TSRMLS_DC)
272
- {
273
- zend_object_std_dtor(&obj->zobj TSRMLS_CC);
274
- if (obj->factory) {
275
- zval_ptr_dtor(&obj->factory);
276
- }
277
- if (obj->callable) {
278
- zval_ptr_dtor(&obj->callable);
279
- }
280
- efree(obj);
281
- }
282
-
283
- static void pimple_free_object_storage(pimple_object *obj TSRMLS_DC)
284
- {
285
- zend_hash_destroy(&obj->factories);
286
- zend_hash_destroy(&obj->protected);
287
- zend_hash_destroy(&obj->values);
288
- zend_object_std_dtor(&obj->zobj TSRMLS_CC);
289
- efree(obj);
290
- }
291
-
292
- static void pimple_free_bucket(pimple_bucket_value *bucket)
293
- {
294
- if (bucket->raw) {
295
- zval_ptr_dtor(&bucket->raw);
296
- }
297
- }
298
-
299
- static zend_object_value pimple_closure_object_create(zend_class_entry *ce TSRMLS_DC)
300
- {
301
- zend_object_value retval;
302
- pimple_closure_object *pimple_closure_obj = NULL;
303
-
304
- pimple_closure_obj = ecalloc(1, sizeof(pimple_closure_object));
305
- ZEND_OBJ_INIT(&pimple_closure_obj->zobj, ce);
306
-
307
- pimple_closure_object_handlers.get_constructor = pimple_closure_get_constructor;
308
- retval.handlers = &pimple_closure_object_handlers;
309
- retval.handle = zend_objects_store_put(pimple_closure_obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) pimple_closure_free_object_storage, NULL TSRMLS_CC);
310
-
311
- return retval;
312
- }
313
-
314
- static zend_function *pimple_closure_get_constructor(zval *obj TSRMLS_DC)
315
- {
316
- zend_error(E_ERROR, "Pimple\\ContainerClosure is an internal class and cannot be instantiated");
317
-
318
- return NULL;
319
- }
320
-
321
- static int pimple_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, union _zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC)
322
- {
323
- *zobj_ptr = obj;
324
- *ce_ptr = Z_OBJCE_P(obj);
325
- *fptr_ptr = (zend_function *)&pimple_closure_invoker_function;
326
-
327
- return SUCCESS;
328
- }
329
-
330
- static zend_object_value pimple_object_create(zend_class_entry *ce TSRMLS_DC)
331
- {
332
- zend_object_value retval;
333
- pimple_object *pimple_obj = NULL;
334
- zend_function *function = NULL;
335
-
336
- pimple_obj = emalloc(sizeof(pimple_object));
337
- ZEND_OBJ_INIT(&pimple_obj->zobj, ce);
338
-
339
- PIMPLE_OBJECT_HANDLE_INHERITANCE_OBJECT_HANDLERS
340
-
341
- retval.handlers = &pimple_object_handlers;
342
- retval.handle = zend_objects_store_put(pimple_obj, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) pimple_free_object_storage, NULL TSRMLS_CC);
343
-
344
- zend_hash_init(&pimple_obj->factories, PIMPLE_DEFAULT_ZVAL_CACHE_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0);
345
- zend_hash_init(&pimple_obj->protected, PIMPLE_DEFAULT_ZVAL_CACHE_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0);
346
- zend_hash_init(&pimple_obj->values, PIMPLE_DEFAULT_ZVAL_VALUES_NUM, NULL, (dtor_func_t)pimple_bucket_dtor, 0);
347
-
348
- return retval;
349
- }
350
-
351
- static void pimple_object_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
352
- {
353
- FETCH_DIM_HANDLERS_VARS
354
-
355
- pimple_bucket_value pimple_value = {0}, *found_value = NULL;
356
- ulong hash;
357
-
358
- pimple_zval_to_pimpleval(value, &pimple_value TSRMLS_CC);
359
-
360
- if (!offset) {/* $p[] = 'foo' when not overloaded */
361
- zend_hash_next_index_insert(&pimple_obj->values, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL);
362
- Z_ADDREF_P(value);
363
- return;
364
- }
365
-
366
- switch (Z_TYPE_P(offset)) {
367
- case IS_STRING:
368
- hash = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
369
- zend_hash_quick_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hash, (void **)&found_value);
370
- if (found_value && found_value->type == PIMPLE_IS_SERVICE && found_value->initialized == 1) {
371
- pimple_free_bucket(&pimple_value);
372
- pimple_throw_exception_string(pimple_ce_FrozenServiceException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
373
- return;
374
- }
375
- if (zend_hash_quick_update(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hash, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL) == FAILURE) {
376
- pimple_free_bucket(&pimple_value);
377
- return;
378
- }
379
- Z_ADDREF_P(value);
380
- break;
381
- case IS_DOUBLE:
382
- case IS_BOOL:
383
- case IS_LONG:
384
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
385
- index = (ulong)Z_DVAL_P(offset);
386
- } else {
387
- index = Z_LVAL_P(offset);
388
- }
389
- zend_hash_index_find(&pimple_obj->values, index, (void **)&found_value);
390
- if (found_value && found_value->type == PIMPLE_IS_SERVICE && found_value->initialized == 1) {
391
- pimple_free_bucket(&pimple_value);
392
- convert_to_string(offset);
393
- pimple_throw_exception_string(pimple_ce_FrozenServiceException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
394
- return;
395
- }
396
- if (zend_hash_index_update(&pimple_obj->values, index, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL) == FAILURE) {
397
- pimple_free_bucket(&pimple_value);
398
- return;
399
- }
400
- Z_ADDREF_P(value);
401
- break;
402
- case IS_NULL: /* $p[] = 'foo' when overloaded */
403
- zend_hash_next_index_insert(&pimple_obj->values, (void *)&pimple_value, sizeof(pimple_bucket_value), NULL);
404
- Z_ADDREF_P(value);
405
- break;
406
- default:
407
- pimple_free_bucket(&pimple_value);
408
- zend_error(E_WARNING, "Unsupported offset type");
409
- }
410
- }
411
-
412
- static void pimple_object_unset_dimension(zval *object, zval *offset TSRMLS_DC)
413
- {
414
- FETCH_DIM_HANDLERS_VARS
415
-
416
- switch (Z_TYPE_P(offset)) {
417
- case IS_STRING:
418
- zend_symtable_del(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
419
- zend_symtable_del(&pimple_obj->factories, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
420
- zend_symtable_del(&pimple_obj->protected, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
421
- break;
422
- case IS_DOUBLE:
423
- case IS_BOOL:
424
- case IS_LONG:
425
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
426
- index = (ulong)Z_DVAL_P(offset);
427
- } else {
428
- index = Z_LVAL_P(offset);
429
- }
430
- zend_hash_index_del(&pimple_obj->values, index);
431
- zend_hash_index_del(&pimple_obj->factories, index);
432
- zend_hash_index_del(&pimple_obj->protected, index);
433
- break;
434
- default:
435
- zend_error(E_WARNING, "Unsupported offset type");
436
- }
437
- }
438
-
439
- static int pimple_object_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC)
440
- {
441
- FETCH_DIM_HANDLERS_VARS
442
-
443
- pimple_bucket_value *retval = NULL;
444
-
445
- switch (Z_TYPE_P(offset)) {
446
- case IS_STRING:
447
- if (zend_symtable_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **)&retval) == SUCCESS) {
448
- switch (check_empty) {
449
- case 0: /* isset */
450
- return 1; /* Differs from PHP behavior (Z_TYPE_P(retval->value) != IS_NULL;) */
451
- case 1: /* empty */
452
- default:
453
- return zend_is_true(retval->value);
454
- }
455
- }
456
- return 0;
457
- break;
458
- case IS_DOUBLE:
459
- case IS_BOOL:
460
- case IS_LONG:
461
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
462
- index = (ulong)Z_DVAL_P(offset);
463
- } else {
464
- index = Z_LVAL_P(offset);
465
- }
466
- if (zend_hash_index_find(&pimple_obj->values, index, (void **)&retval) == SUCCESS) {
467
- switch (check_empty) {
468
- case 0: /* isset */
469
- return 1; /* Differs from PHP behavior (Z_TYPE_P(retval->value) != IS_NULL;)*/
470
- case 1: /* empty */
471
- default:
472
- return zend_is_true(retval->value);
473
- }
474
- }
475
- return 0;
476
- break;
477
- default:
478
- zend_error(E_WARNING, "Unsupported offset type");
479
- return 0;
480
- }
481
- }
482
-
483
- static zval *pimple_object_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
484
- {
485
- FETCH_DIM_HANDLERS_VARS
486
-
487
- pimple_bucket_value *retval = NULL;
488
- zend_fcall_info fci = {0};
489
- zval *retval_ptr_ptr = NULL;
490
-
491
- switch (Z_TYPE_P(offset)) {
492
- case IS_STRING:
493
- if (zend_symtable_find(&pimple_obj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **)&retval) == FAILURE) {
494
- pimple_throw_exception_string(pimple_ce_UnknownIdentifierException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
495
-
496
- return EG(uninitialized_zval_ptr);
497
- }
498
- break;
499
- case IS_DOUBLE:
500
- case IS_BOOL:
501
- case IS_LONG:
502
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
503
- index = (ulong)Z_DVAL_P(offset);
504
- } else {
505
- index = Z_LVAL_P(offset);
506
- }
507
- if (zend_hash_index_find(&pimple_obj->values, index, (void **)&retval) == FAILURE) {
508
- return EG(uninitialized_zval_ptr);
509
- }
510
- break;
511
- case IS_NULL: /* $p[][3] = 'foo' first dim access */
512
- return EG(uninitialized_zval_ptr);
513
- break;
514
- default:
515
- zend_error(E_WARNING, "Unsupported offset type");
516
- return EG(uninitialized_zval_ptr);
517
- }
518
-
519
- if(retval->type == PIMPLE_IS_PARAM) {
520
- return retval->value;
521
- }
522
-
523
- if (zend_hash_index_exists(&pimple_obj->protected, retval->handle_num)) {
524
- /* Service is protected, return the value every time */
525
- return retval->value;
526
- }
527
-
528
- if (zend_hash_index_exists(&pimple_obj->factories, retval->handle_num)) {
529
- /* Service is a factory, call it every time and never cache its result */
530
- PIMPLE_CALL_CB
531
- Z_DELREF_P(retval_ptr_ptr); /* fetch dim addr will increment refcount */
532
- return retval_ptr_ptr;
533
- }
534
-
535
- if (retval->initialized == 1) {
536
- /* Service has already been called, return its cached value */
537
- return retval->value;
538
- }
539
-
540
- ALLOC_INIT_ZVAL(retval->raw);
541
- MAKE_COPY_ZVAL(&retval->value, retval->raw);
542
-
543
- PIMPLE_CALL_CB
544
-
545
- retval->initialized = 1;
546
- zval_ptr_dtor(&retval->value);
547
- retval->value = retval_ptr_ptr;
548
-
549
- return retval->value;
550
- }
551
-
552
- static int pimple_zval_is_valid_callback(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC)
553
- {
554
- if (Z_TYPE_P(_zval) != IS_OBJECT) {
555
- return FAILURE;
556
- }
557
-
558
- if (_pimple_bucket_value->fcc.called_scope) {
559
- return SUCCESS;
560
- }
561
-
562
- if (Z_OBJ_HANDLER_P(_zval, get_closure) && Z_OBJ_HANDLER_P(_zval, get_closure)(_zval, &_pimple_bucket_value->fcc.calling_scope, &_pimple_bucket_value->fcc.function_handler, &_pimple_bucket_value->fcc.object_ptr TSRMLS_CC) == SUCCESS) {
563
- _pimple_bucket_value->fcc.called_scope = _pimple_bucket_value->fcc.calling_scope;
564
- return SUCCESS;
565
- } else {
566
- return FAILURE;
567
- }
568
- }
569
-
570
- static int pimple_zval_to_pimpleval(zval *_zval, pimple_bucket_value *_pimple_bucket_value TSRMLS_DC)
571
- {
572
- _pimple_bucket_value->value = _zval;
573
-
574
- if (Z_TYPE_P(_zval) != IS_OBJECT) {
575
- return PIMPLE_IS_PARAM;
576
- }
577
-
578
- if (pimple_zval_is_valid_callback(_zval, _pimple_bucket_value TSRMLS_CC) == SUCCESS) {
579
- _pimple_bucket_value->type = PIMPLE_IS_SERVICE;
580
- _pimple_bucket_value->handle_num = Z_OBJ_HANDLE_P(_zval);
581
- }
582
-
583
- return PIMPLE_IS_SERVICE;
584
- }
585
-
586
- static void pimple_bucket_dtor(pimple_bucket_value *bucket)
587
- {
588
- zval_ptr_dtor(&bucket->value);
589
- pimple_free_bucket(bucket);
590
- }
591
-
592
- PHP_METHOD(FrozenServiceException, __construct)
593
- {
594
- char *id = NULL;
595
- int id_len;
596
-
597
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_len) == FAILURE) {
598
- return;
599
- }
600
- pimple_exception_call_parent_constructor(getThis(), "Cannot override frozen service \"%s\".", id TSRMLS_CC);
601
- }
602
-
603
- PHP_METHOD(InvalidServiceIdentifierException, __construct)
604
- {
605
- char *id = NULL;
606
- int id_len;
607
-
608
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_len) == FAILURE) {
609
- return;
610
- }
611
- pimple_exception_call_parent_constructor(getThis(), "Identifier \"%s\" does not contain an object definition.", id TSRMLS_CC);
612
- }
613
-
614
- PHP_METHOD(UnknownIdentifierException, __construct)
615
- {
616
- char *id = NULL;
617
- int id_len;
618
-
619
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_len) == FAILURE) {
620
- return;
621
- }
622
- pimple_exception_call_parent_constructor(getThis(), "Identifier \"%s\" is not defined.", id TSRMLS_CC);
623
- }
624
-
625
- PHP_METHOD(Pimple, protect)
626
- {
627
- zval *protected = NULL;
628
- pimple_object *pobj = NULL;
629
- pimple_bucket_value bucket = {0};
630
-
631
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &protected) == FAILURE) {
632
- return;
633
- }
634
-
635
- if (pimple_zval_is_valid_callback(protected, &bucket TSRMLS_CC) == FAILURE) {
636
- pimple_free_bucket(&bucket);
637
- zend_throw_exception(pimple_ce_ExpectedInvokableException, "Callable is not a Closure or invokable object.", 0 TSRMLS_CC);
638
- return;
639
- }
640
-
641
- pimple_zval_to_pimpleval(protected, &bucket TSRMLS_CC);
642
- pobj = (pimple_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
643
-
644
- if (zend_hash_index_update(&pobj->protected, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL) == SUCCESS) {
645
- Z_ADDREF_P(protected);
646
- RETURN_ZVAL(protected, 1 , 0);
647
- } else {
648
- pimple_free_bucket(&bucket);
649
- }
650
- RETURN_FALSE;
651
- }
652
-
653
- PHP_METHOD(Pimple, raw)
654
- {
655
- zval *offset = NULL;
656
- pimple_object *pobj = NULL;
657
- pimple_bucket_value *value = NULL;
658
- ulong index;
659
-
660
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) {
661
- return;
662
- }
663
-
664
- pobj = zend_object_store_get_object(getThis() TSRMLS_CC);
665
-
666
- switch (Z_TYPE_P(offset)) {
667
- case IS_STRING:
668
- if (zend_symtable_find(&pobj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void *)&value) == FAILURE) {
669
- pimple_throw_exception_string(pimple_ce_UnknownIdentifierException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
670
- RETURN_NULL();
671
- }
672
- break;
673
- case IS_DOUBLE:
674
- case IS_BOOL:
675
- case IS_LONG:
676
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
677
- index = (ulong)Z_DVAL_P(offset);
678
- } else {
679
- index = Z_LVAL_P(offset);
680
- }
681
- if (zend_hash_index_find(&pobj->values, index, (void *)&value) == FAILURE) {
682
- RETURN_NULL();
683
- }
684
- break;
685
- case IS_NULL:
686
- default:
687
- zend_error(E_WARNING, "Unsupported offset type");
688
- }
689
-
690
- if (value->raw) {
691
- RETVAL_ZVAL(value->raw, 1, 0);
692
- } else {
693
- RETVAL_ZVAL(value->value, 1, 0);
694
- }
695
- }
696
-
697
- PHP_METHOD(Pimple, extend)
698
- {
699
- zval *offset = NULL, *callable = NULL, *pimple_closure_obj = NULL;
700
- pimple_bucket_value bucket = {0}, *value = NULL;
701
- pimple_object *pobj = NULL;
702
- pimple_closure_object *pcobj = NULL;
703
- ulong index;
704
-
705
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &offset, &callable) == FAILURE) {
706
- return;
707
- }
708
-
709
- pobj = zend_object_store_get_object(getThis() TSRMLS_CC);
710
-
711
- switch (Z_TYPE_P(offset)) {
712
- case IS_STRING:
713
- if (zend_symtable_find(&pobj->values, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void *)&value) == FAILURE) {
714
- pimple_throw_exception_string(pimple_ce_UnknownIdentifierException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
715
- RETURN_NULL();
716
- }
717
-
718
- if (value->type != PIMPLE_IS_SERVICE) {
719
- pimple_throw_exception_string(pimple_ce_InvalidServiceIdentifierException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
720
- RETURN_NULL();
721
- }
722
- if (zend_hash_index_exists(&pobj->protected, value->handle_num)) {
723
- int er = EG(error_reporting);
724
- EG(error_reporting) = 0;
725
- php_error(E_DEPRECATED, "How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure \"%s\" should be protected?", Z_STRVAL_P(offset));
726
- EG(error_reporting) = er;
727
- }
728
- break;
729
- case IS_DOUBLE:
730
- case IS_BOOL:
731
- case IS_LONG:
732
- if (Z_TYPE_P(offset) == IS_DOUBLE) {
733
- index = (ulong)Z_DVAL_P(offset);
734
- } else {
735
- index = Z_LVAL_P(offset);
736
- }
737
- if (zend_hash_index_find(&pobj->values, index, (void *)&value) == FAILURE) {
738
- convert_to_string(offset);
739
- pimple_throw_exception_string(pimple_ce_UnknownIdentifierException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
740
- RETURN_NULL();
741
- }
742
- if (value->type != PIMPLE_IS_SERVICE) {
743
- convert_to_string(offset);
744
- pimple_throw_exception_string(pimple_ce_InvalidServiceIdentifierException, Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC);
745
- RETURN_NULL();
746
- }
747
- if (zend_hash_index_exists(&pobj->protected, value->handle_num)) {
748
- int er = EG(error_reporting);
749
- EG(error_reporting) = 0;
750
- php_error(E_DEPRECATED, "How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure \"%ld\" should be protected?", index);
751
- EG(error_reporting) = er;
752
- }
753
- break;
754
- case IS_NULL:
755
- default:
756
- zend_error(E_WARNING, "Unsupported offset type");
757
- }
758
-
759
- if (pimple_zval_is_valid_callback(callable, &bucket TSRMLS_CC) == FAILURE) {
760
- pimple_free_bucket(&bucket);
761
- zend_throw_exception(pimple_ce_ExpectedInvokableException, "Extension service definition is not a Closure or invokable object.", 0 TSRMLS_CC);
762
- RETURN_NULL();
763
- }
764
- pimple_free_bucket(&bucket);
765
-
766
- ALLOC_INIT_ZVAL(pimple_closure_obj);
767
- object_init_ex(pimple_closure_obj, pimple_closure_ce);
768
-
769
- pcobj = zend_object_store_get_object(pimple_closure_obj TSRMLS_CC);
770
- pcobj->callable = callable;
771
- pcobj->factory = value->value;
772
- Z_ADDREF_P(callable);
773
- Z_ADDREF_P(value->value);
774
-
775
- if (zend_hash_index_exists(&pobj->factories, value->handle_num)) {
776
- pimple_zval_to_pimpleval(pimple_closure_obj, &bucket TSRMLS_CC);
777
- zend_hash_index_del(&pobj->factories, value->handle_num);
778
- zend_hash_index_update(&pobj->factories, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL);
779
- Z_ADDREF_P(pimple_closure_obj);
780
- }
781
-
782
- pimple_object_write_dimension(getThis(), offset, pimple_closure_obj TSRMLS_CC);
783
-
784
- RETVAL_ZVAL(pimple_closure_obj, 1, 1);
785
- }
786
-
787
- PHP_METHOD(Pimple, keys)
788
- {
789
- HashPosition pos;
790
- pimple_object *pobj = NULL;
791
- zval **value = NULL;
792
- zval *endval = NULL;
793
- char *str_index = NULL;
794
- int str_len;
795
- ulong num_index;
796
-
797
- if (zend_parse_parameters_none() == FAILURE) {
798
- return;
799
- }
800
-
801
- pobj = zend_object_store_get_object(getThis() TSRMLS_CC);
802
- array_init_size(return_value, zend_hash_num_elements(&pobj->values));
803
-
804
- zend_hash_internal_pointer_reset_ex(&pobj->values, &pos);
805
-
806
- while(zend_hash_get_current_data_ex(&pobj->values, (void **)&value, &pos) == SUCCESS) {
807
- MAKE_STD_ZVAL(endval);
808
- switch (zend_hash_get_current_key_ex(&pobj->values, &str_index, (uint *)&str_len, &num_index, 0, &pos)) {
809
- case HASH_KEY_IS_STRING:
810
- ZVAL_STRINGL(endval, str_index, str_len - 1, 1);
811
- zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &endval, sizeof(zval *), NULL);
812
- break;
813
- case HASH_KEY_IS_LONG:
814
- ZVAL_LONG(endval, num_index);
815
- zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &endval, sizeof(zval *), NULL);
816
- break;
817
- }
818
- zend_hash_move_forward_ex(&pobj->values, &pos);
819
- }
820
- }
821
-
822
- PHP_METHOD(Pimple, factory)
823
- {
824
- zval *factory = NULL;
825
- pimple_object *pobj = NULL;
826
- pimple_bucket_value bucket = {0};
827
-
828
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &factory) == FAILURE) {
829
- return;
830
- }
831
-
832
- if (pimple_zval_is_valid_callback(factory, &bucket TSRMLS_CC) == FAILURE) {
833
- pimple_free_bucket(&bucket);
834
- zend_throw_exception(pimple_ce_ExpectedInvokableException, "Service definition is not a Closure or invokable object.", 0 TSRMLS_CC);
835
- return;
836
- }
837
-
838
- pimple_zval_to_pimpleval(factory, &bucket TSRMLS_CC);
839
- pobj = (pimple_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
840
-
841
- if (zend_hash_index_update(&pobj->factories, bucket.handle_num, (void *)&bucket, sizeof(pimple_bucket_value), NULL) == SUCCESS) {
842
- Z_ADDREF_P(factory);
843
- RETURN_ZVAL(factory, 1 , 0);
844
- } else {
845
- pimple_free_bucket(&bucket);
846
- }
847
-
848
- RETURN_FALSE;
849
- }
850
-
851
- PHP_METHOD(Pimple, offsetSet)
852
- {
853
- zval *offset = NULL, *value = NULL;
854
-
855
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &offset, &value) == FAILURE) {
856
- return;
857
- }
858
-
859
- pimple_object_write_dimension(getThis(), offset, value TSRMLS_CC);
860
- }
861
-
862
- PHP_METHOD(Pimple, offsetGet)
863
- {
864
- zval *offset = NULL, *retval = NULL;
865
-
866
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) {
867
- return;
868
- }
869
-
870
- retval = pimple_object_read_dimension(getThis(), offset, 0 TSRMLS_CC);
871
-
872
- RETVAL_ZVAL(retval, 1, 0);
873
- }
874
-
875
- PHP_METHOD(Pimple, offsetUnset)
876
- {
877
- zval *offset = NULL;
878
-
879
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) {
880
- return;
881
- }
882
-
883
- pimple_object_unset_dimension(getThis(), offset TSRMLS_CC);
884
- }
885
-
886
- PHP_METHOD(Pimple, offsetExists)
887
- {
888
- zval *offset = NULL;
889
-
890
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &offset) == FAILURE) {
891
- return;
892
- }
893
-
894
- RETVAL_BOOL(pimple_object_has_dimension(getThis(), offset, 1 TSRMLS_CC));
895
- }
896
-
897
- PHP_METHOD(Pimple, register)
898
- {
899
- zval *provider;
900
- zval **data;
901
- zval *retval = NULL;
902
- zval key;
903
-
904
- HashTable *array = NULL;
905
- HashPosition pos;
906
-
907
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|h", &provider, pimple_serviceprovider_ce, &array) == FAILURE) {
908
- return;
909
- }
910
-
911
- RETVAL_ZVAL(getThis(), 1, 0);
912
-
913
- zend_call_method_with_1_params(&provider, Z_OBJCE_P(provider), NULL, "register", &retval, getThis());
914
-
915
- if (retval) {
916
- zval_ptr_dtor(&retval);
917
- }
918
-
919
- if (!array) {
920
- return;
921
- }
922
-
923
- zend_hash_internal_pointer_reset_ex(array, &pos);
924
-
925
- while(zend_hash_get_current_data_ex(array, (void **)&data, &pos) == SUCCESS) {
926
- zend_hash_get_current_key_zval_ex(array, &key, &pos);
927
- pimple_object_write_dimension(getThis(), &key, *data TSRMLS_CC);
928
- zend_hash_move_forward_ex(array, &pos);
929
- }
930
- }
931
-
932
- PHP_METHOD(Pimple, __construct)
933
- {
934
- zval *values = NULL, **pData = NULL, offset;
935
- HashPosition pos;
936
- char *str_index = NULL;
937
- zend_uint str_length;
938
- ulong num_index;
939
-
940
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &values) == FAILURE) {
941
- return;
942
- }
943
-
944
- PIMPLE_DEPRECATE
945
-
946
- if (!values) {
947
- return;
948
- }
949
-
950
- zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos);
951
- while (zend_hash_has_more_elements_ex(Z_ARRVAL_P(values), &pos) == SUCCESS) {
952
- zend_hash_get_current_data_ex(Z_ARRVAL_P(values), (void **)&pData, &pos);
953
- zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &str_index, &str_length, &num_index, 0, &pos);
954
- INIT_ZVAL(offset);
955
- if (zend_hash_get_current_key_type_ex(Z_ARRVAL_P(values), &pos) == HASH_KEY_IS_LONG) {
956
- ZVAL_LONG(&offset, num_index);
957
- } else {
958
- ZVAL_STRINGL(&offset, str_index, (str_length - 1), 0);
959
- }
960
- pimple_object_write_dimension(getThis(), &offset, *pData TSRMLS_CC);
961
- zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos);
962
- }
963
- }
964
-
965
- /*
966
- * This is PHP code snippet handling extend()s calls :
967
-
968
- $extended = function ($c) use ($callable, $factory) {
969
- return $callable($factory($c), $c);
970
- };
971
-
972
- */
973
- PHP_METHOD(PimpleClosure, invoker)
974
- {
975
- pimple_closure_object *pcobj = NULL;
976
- zval *arg = NULL, *retval = NULL, *newretval = NULL;
977
- zend_fcall_info fci = {0};
978
- zval **args[2];
979
-
980
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
981
- return;
982
- }
983
-
984
- pcobj = zend_object_store_get_object(getThis() TSRMLS_CC);
985
-
986
- fci.function_name = pcobj->factory;
987
- args[0] = &arg;
988
- zend_fcall_info_argp(&fci TSRMLS_CC, 1, args);
989
- fci.retval_ptr_ptr = &retval;
990
- fci.size = sizeof(fci);
991
-
992
- if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE || EG(exception)) {
993
- efree(fci.params);
994
- return; /* Should here return default zval */
995
- }
996
-
997
- efree(fci.params);
998
- memset(&fci, 0, sizeof(fci));
999
- fci.size = sizeof(fci);
1000
-
1001
- fci.function_name = pcobj->callable;
1002
- args[0] = &retval;
1003
- args[1] = &arg;
1004
- zend_fcall_info_argp(&fci TSRMLS_CC, 2, args);
1005
- fci.retval_ptr_ptr = &newretval;
1006
-
1007
- if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE || EG(exception)) {
1008
- efree(fci.params);
1009
- zval_ptr_dtor(&retval);
1010
- return;
1011
- }
1012
-
1013
- efree(fci.params);
1014
- zval_ptr_dtor(&retval);
1015
-
1016
- RETVAL_ZVAL(newretval, 1 ,1);
1017
- }
1018
-
1019
- PHP_MINIT_FUNCTION(pimple)
1020
- {
1021
- zend_class_entry tmp_ce_PsrContainerInterface, tmp_ce_PsrContainerExceptionInterface, tmp_ce_PsrNotFoundExceptionInterface;
1022
- zend_class_entry tmp_ce_ExpectedInvokableException, tmp_ce_FrozenServiceException, tmp_ce_InvalidServiceIdentifierException, tmp_ce_UnknownIdentifierException;
1023
- zend_class_entry tmp_pimple_ce, tmp_pimple_closure_ce, tmp_pimple_serviceprovider_iface_ce;
1024
-
1025
- /* Psr\Container namespace */
1026
- INIT_NS_CLASS_ENTRY(tmp_ce_PsrContainerInterface, PSR_CONTAINER_NS, "ContainerInterface", pimple_ce_PsrContainerInterface_functions);
1027
- INIT_NS_CLASS_ENTRY(tmp_ce_PsrContainerExceptionInterface, PSR_CONTAINER_NS, "ContainerExceptionInterface", pimple_ce_PsrContainerExceptionInterface_functions);
1028
- INIT_NS_CLASS_ENTRY(tmp_ce_PsrNotFoundExceptionInterface, PSR_CONTAINER_NS, "NotFoundExceptionInterface", pimple_ce_PsrNotFoundExceptionInterface_functions);
1029
-
1030
- pimple_ce_PsrContainerInterface = zend_register_internal_interface(&tmp_ce_PsrContainerInterface TSRMLS_CC);
1031
- pimple_ce_PsrContainerExceptionInterface = zend_register_internal_interface(&tmp_ce_PsrContainerExceptionInterface TSRMLS_CC);
1032
- pimple_ce_PsrNotFoundExceptionInterface = zend_register_internal_interface(&tmp_ce_PsrNotFoundExceptionInterface TSRMLS_CC);
1033
-
1034
- zend_class_implements(pimple_ce_PsrNotFoundExceptionInterface TSRMLS_CC, 1, pimple_ce_PsrContainerExceptionInterface);
1035
-
1036
- /* Pimple\Exception namespace */
1037
- INIT_NS_CLASS_ENTRY(tmp_ce_ExpectedInvokableException, PIMPLE_EXCEPTION_NS, "ExpectedInvokableException", NULL);
1038
- INIT_NS_CLASS_ENTRY(tmp_ce_FrozenServiceException, PIMPLE_EXCEPTION_NS, "FrozenServiceException", pimple_ce_FrozenServiceException_functions);
1039
- INIT_NS_CLASS_ENTRY(tmp_ce_InvalidServiceIdentifierException, PIMPLE_EXCEPTION_NS, "InvalidServiceIdentifierException", pimple_ce_InvalidServiceIdentifierException_functions);
1040
- INIT_NS_CLASS_ENTRY(tmp_ce_UnknownIdentifierException, PIMPLE_EXCEPTION_NS, "UnknownIdentifierException", pimple_ce_UnknownIdentifierException_functions);
1041
-
1042
- pimple_ce_ExpectedInvokableException = zend_register_internal_class_ex(&tmp_ce_ExpectedInvokableException, spl_ce_InvalidArgumentException, NULL TSRMLS_CC);
1043
- pimple_ce_FrozenServiceException = zend_register_internal_class_ex(&tmp_ce_FrozenServiceException, spl_ce_RuntimeException, NULL TSRMLS_CC);
1044
- pimple_ce_InvalidServiceIdentifierException = zend_register_internal_class_ex(&tmp_ce_InvalidServiceIdentifierException, spl_ce_InvalidArgumentException, NULL TSRMLS_CC);
1045
- pimple_ce_UnknownIdentifierException = zend_register_internal_class_ex(&tmp_ce_UnknownIdentifierException, spl_ce_InvalidArgumentException, NULL TSRMLS_CC);
1046
-
1047
- zend_class_implements(pimple_ce_ExpectedInvokableException TSRMLS_CC, 1, pimple_ce_PsrContainerExceptionInterface);
1048
- zend_class_implements(pimple_ce_FrozenServiceException TSRMLS_CC, 1, pimple_ce_PsrContainerExceptionInterface);
1049
- zend_class_implements(pimple_ce_InvalidServiceIdentifierException TSRMLS_CC, 1, pimple_ce_PsrContainerExceptionInterface);
1050
- zend_class_implements(pimple_ce_UnknownIdentifierException TSRMLS_CC, 1, pimple_ce_PsrNotFoundExceptionInterface);
1051
-
1052
- /* Pimple namespace */
1053
- INIT_NS_CLASS_ENTRY(tmp_pimple_ce, PIMPLE_NS, "Container", pimple_ce_functions);
1054
- INIT_NS_CLASS_ENTRY(tmp_pimple_closure_ce, PIMPLE_NS, "ContainerClosure", NULL);
1055
- INIT_NS_CLASS_ENTRY(tmp_pimple_serviceprovider_iface_ce, PIMPLE_NS, "ServiceProviderInterface", pimple_serviceprovider_iface_ce_functions);
1056
-
1057
- tmp_pimple_ce.create_object = pimple_object_create;
1058
- tmp_pimple_closure_ce.create_object = pimple_closure_object_create;
1059
-
1060
- pimple_ce = zend_register_internal_class(&tmp_pimple_ce TSRMLS_CC);
1061
- zend_class_implements(pimple_ce TSRMLS_CC, 1, zend_ce_arrayaccess);
1062
-
1063
- pimple_closure_ce = zend_register_internal_class(&tmp_pimple_closure_ce TSRMLS_CC);
1064
- pimple_closure_ce->ce_flags |= ZEND_ACC_FINAL_CLASS;
1065
-
1066
- pimple_serviceprovider_ce = zend_register_internal_interface(&tmp_pimple_serviceprovider_iface_ce TSRMLS_CC);
1067
-
1068
- memcpy(&pimple_closure_object_handlers, zend_get_std_object_handlers(), sizeof(*zend_get_std_object_handlers()));
1069
- pimple_object_handlers = std_object_handlers;
1070
- pimple_closure_object_handlers.get_closure = pimple_closure_get_closure;
1071
-
1072
- pimple_closure_invoker_function.function_name = "Pimple closure internal invoker";
1073
- pimple_closure_invoker_function.fn_flags |= ZEND_ACC_CLOSURE;
1074
- pimple_closure_invoker_function.handler = ZEND_MN(PimpleClosure_invoker);
1075
- pimple_closure_invoker_function.num_args = 1;
1076
- pimple_closure_invoker_function.required_num_args = 1;
1077
- pimple_closure_invoker_function.scope = pimple_closure_ce;
1078
- pimple_closure_invoker_function.type = ZEND_INTERNAL_FUNCTION;
1079
- pimple_closure_invoker_function.module = &pimple_module_entry;
1080
-
1081
- return SUCCESS;
1082
- }
1083
-
1084
- PHP_MINFO_FUNCTION(pimple)
1085
- {
1086
- php_info_print_table_start();
1087
- php_info_print_table_header(2, "SensioLabs Pimple C support", "enabled");
1088
- php_info_print_table_row(2, "Pimple supported version", PIMPLE_VERSION);
1089
- php_info_print_table_end();
1090
-
1091
- php_info_print_box_start(0);
1092
- php_write((void *)ZEND_STRL("SensioLabs Pimple C support developed by Julien Pauli") TSRMLS_CC);
1093
- if (!sapi_module.phpinfo_as_text) {
1094
- php_write((void *)ZEND_STRL(sensiolabs_logo) TSRMLS_CC);
1095
- }
1096
- php_info_print_box_end();
1097
- }
1098
-
1099
- zend_module_entry pimple_module_entry = {
1100
- STANDARD_MODULE_HEADER,
1101
- "pimple",
1102
- NULL,
1103
- PHP_MINIT(pimple),
1104
- NULL,
1105
- NULL,
1106
- NULL,
1107
- PHP_MINFO(pimple),
1108
- PIMPLE_VERSION,
1109
- STANDARD_MODULE_PROPERTIES
1110
- };
1111
-
1112
- #ifdef COMPILE_DL_PIMPLE
1113
- ZEND_GET_MODULE(pimple)
1114
- #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/pimple_compat.h DELETED
@@ -1,81 +0,0 @@
1
-
2
- /*
3
- * This file is part of Pimple.
4
- *
5
- * Copyright (c) 2014 Fabien Potencier
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is furnished
12
- * to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- */
25
-
26
- #ifndef PIMPLE_COMPAT_H_
27
- #define PIMPLE_COMPAT_H_
28
-
29
- #include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
30
-
31
- #define PHP_5_0_X_API_NO 220040412
32
- #define PHP_5_1_X_API_NO 220051025
33
- #define PHP_5_2_X_API_NO 220060519
34
- #define PHP_5_3_X_API_NO 220090626
35
- #define PHP_5_4_X_API_NO 220100525
36
- #define PHP_5_5_X_API_NO 220121212
37
- #define PHP_5_6_X_API_NO 220131226
38
-
39
- #define IS_PHP_56 ZEND_EXTENSION_API_NO == PHP_5_6_X_API_NO
40
- #define IS_AT_LEAST_PHP_56 ZEND_EXTENSION_API_NO >= PHP_5_6_X_API_NO
41
-
42
- #define IS_PHP_55 ZEND_EXTENSION_API_NO == PHP_5_5_X_API_NO
43
- #define IS_AT_LEAST_PHP_55 ZEND_EXTENSION_API_NO >= PHP_5_5_X_API_NO
44
-
45
- #define IS_PHP_54 ZEND_EXTENSION_API_NO == PHP_5_4_X_API_NO
46
- #define IS_AT_LEAST_PHP_54 ZEND_EXTENSION_API_NO >= PHP_5_4_X_API_NO
47
-
48
- #define IS_PHP_53 ZEND_EXTENSION_API_NO == PHP_5_3_X_API_NO
49
- #define IS_AT_LEAST_PHP_53 ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
50
-
51
- #if IS_PHP_53
52
- #define object_properties_init(obj, ce) do { \
53
- zend_hash_copy(obj->properties, &ce->default_properties, zval_copy_property_ctor(ce), NULL, sizeof(zval *)); \
54
- } while (0);
55
- #endif
56
-
57
- #define ZEND_OBJ_INIT(obj, ce) do { \
58
- zend_object_std_init(obj, ce TSRMLS_CC); \
59
- object_properties_init((obj), (ce)); \
60
- } while(0);
61
-
62
- #if IS_PHP_53 || IS_PHP_54
63
- static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) {
64
- Bucket *p;
65
-
66
- p = pos ? (*pos) : ht->pInternalPointer;
67
-
68
- if (!p) {
69
- Z_TYPE_P(key) = IS_NULL;
70
- } else if (p->nKeyLength) {
71
- Z_TYPE_P(key) = IS_STRING;
72
- Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1);
73
- Z_STRLEN_P(key) = p->nKeyLength - 1;
74
- } else {
75
- Z_TYPE_P(key) = IS_LONG;
76
- Z_LVAL_P(key) = p->h;
77
- }
78
- }
79
- #endif
80
-
81
- #endif /* PIMPLE_COMPAT_H_ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/001.phpt DELETED
@@ -1,45 +0,0 @@
1
- --TEST--
2
- Test for read_dim/write_dim handlers
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- $p[42] = 'foo';
9
- $p['foo'] = 42;
10
-
11
- echo $p[42];
12
- echo "\n";
13
- echo $p['foo'];
14
- echo "\n";
15
- try {
16
- var_dump($p['nonexistant']);
17
- echo "Exception excpected";
18
- } catch (InvalidArgumentException $e) { }
19
-
20
- $p[54.2] = 'foo2';
21
- echo $p[54];
22
- echo "\n";
23
- $p[242.99] = 'foo99';
24
- echo $p[242];
25
-
26
- echo "\n";
27
-
28
- $p[5] = 'bar';
29
- $p[5] = 'baz';
30
- echo $p[5];
31
-
32
- echo "\n";
33
-
34
- $p['str'] = 'str';
35
- $p['str'] = 'strstr';
36
- echo $p['str'];
37
- ?>
38
-
39
- --EXPECTF--
40
- foo
41
- 42
42
- foo2
43
- foo99
44
- baz
45
- strstr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/002.phpt DELETED
@@ -1,15 +0,0 @@
1
- --TEST--
2
- Test for constructor
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- var_dump($p[42]);
9
-
10
- $p = new Pimple\Container(array(42=>'foo'));
11
- var_dump($p[42]);
12
- ?>
13
- --EXPECT--
14
- NULL
15
- string(3) "foo"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/003.phpt DELETED
@@ -1,16 +0,0 @@
1
- --TEST--
2
- Test empty dimensions
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- $p[] = 42;
9
- var_dump($p[0]);
10
- $p[41] = 'foo';
11
- $p[] = 'bar';
12
- var_dump($p[42]);
13
- ?>
14
- --EXPECT--
15
- int(42)
16
- string(3) "bar"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/004.phpt DELETED
@@ -1,30 +0,0 @@
1
- --TEST--
2
- Test has/unset dim handlers
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- $p[] = 42;
9
- var_dump($p[0]);
10
- unset($p[0]);
11
- var_dump($p[0]);
12
- $p['foo'] = 'bar';
13
- var_dump(isset($p['foo']));
14
- unset($p['foo']);
15
- try {
16
- var_dump($p['foo']);
17
- echo "Excpected exception";
18
- } catch (InvalidArgumentException $e) { }
19
- var_dump(isset($p['bar']));
20
- $p['bar'] = NULL;
21
- var_dump(isset($p['bar']));
22
- var_dump(empty($p['bar']));
23
- ?>
24
- --EXPECT--
25
- int(42)
26
- NULL
27
- bool(true)
28
- bool(false)
29
- bool(true)
30
- bool(true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/005.phpt DELETED
@@ -1,27 +0,0 @@
1
- --TEST--
2
- Test simple class inheritance
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- class MyPimple extends Pimple\Container
8
- {
9
- public $someAttr = 'fooAttr';
10
-
11
- public function offsetget($o)
12
- {
13
- var_dump("hit");
14
- return parent::offsetget($o);
15
- }
16
- }
17
-
18
- $p = new MyPimple;
19
- $p[42] = 'foo';
20
- echo $p[42];
21
- echo "\n";
22
- echo $p->someAttr;
23
- ?>
24
- --EXPECT--
25
- string(3) "hit"
26
- foo
27
- fooAttr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/006.phpt DELETED
@@ -1,51 +0,0 @@
1
- --TEST--
2
- Test complex class inheritance
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- class MyPimple extends Pimple\Container
8
- {
9
- public function offsetget($o)
10
- {
11
- var_dump("hit offsetget in " . __CLASS__);
12
- return parent::offsetget($o);
13
- }
14
- }
15
-
16
- class TestPimple extends MyPimple
17
- {
18
- public function __construct($values)
19
- {
20
- array_shift($values);
21
- parent::__construct($values);
22
- }
23
-
24
- public function offsetget($o)
25
- {
26
- var_dump('hit offsetget in ' . __CLASS__);
27
- return parent::offsetget($o);
28
- }
29
-
30
- public function offsetset($o, $v)
31
- {
32
- var_dump('hit offsetset');
33
- return parent::offsetset($o, $v);
34
- }
35
- }
36
-
37
- $defaultValues = array('foo' => 'bar', 88 => 'baz');
38
-
39
- $p = new TestPimple($defaultValues);
40
- $p[42] = 'foo';
41
- var_dump($p[42]);
42
- var_dump($p[0]);
43
- ?>
44
- --EXPECT--
45
- string(13) "hit offsetset"
46
- string(27) "hit offsetget in TestPimple"
47
- string(25) "hit offsetget in MyPimple"
48
- string(3) "foo"
49
- string(27) "hit offsetget in TestPimple"
50
- string(25) "hit offsetget in MyPimple"
51
- string(3) "baz"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/007.phpt DELETED
@@ -1,22 +0,0 @@
1
- --TEST--
2
- Test for read_dim/write_dim handlers
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- $p[42] = 'foo';
9
- $p['foo'] = 42;
10
-
11
- echo $p[42];
12
- echo "\n";
13
- echo $p['foo'];
14
- echo "\n";
15
- try {
16
- var_dump($p['nonexistant']);
17
- echo "Exception excpected";
18
- } catch (InvalidArgumentException $e) { }
19
- ?>
20
- --EXPECTF--
21
- foo
22
- 42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/008.phpt DELETED
@@ -1,29 +0,0 @@
1
- --TEST--
2
- Test frozen services
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- $p[42] = 'foo';
9
- $p[42] = 'bar';
10
-
11
- $p['foo'] = function () { };
12
- $p['foo'] = function () { };
13
-
14
- $a = $p['foo'];
15
-
16
- try {
17
- $p['foo'] = function () { };
18
- echo "Exception excpected";
19
- } catch (RuntimeException $e) { }
20
-
21
- $p[42] = function() { };
22
- $a = $p[42];
23
-
24
- try {
25
- $p[42] = function () { };
26
- echo "Exception excpected";
27
- } catch (RuntimeException $e) { }
28
- ?>
29
- --EXPECTF--
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/009.phpt DELETED
@@ -1,13 +0,0 @@
1
- --TEST--
2
- Test service is called as callback, and only once
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- $p = new Pimple\Container();
8
- $p['foo'] = function($arg) use ($p) { var_dump($p === $arg); };
9
- $a = $p['foo'];
10
- $b = $p['foo']; /* should return not calling the callback */
11
- ?>
12
- --EXPECTF--
13
- bool(true)
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/010.phpt DELETED
@@ -1,45 +0,0 @@
1
- --TEST--
2
- Test service is called as callback for every callback type
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- function callme()
8
- {
9
- return 'called';
10
- }
11
-
12
- $a = function() { return 'called'; };
13
-
14
- class Foo
15
- {
16
- public static function bar()
17
- {
18
- return 'called';
19
- }
20
- }
21
-
22
- $p = new Pimple\Container();
23
- $p['foo'] = 'callme';
24
- echo $p['foo'] . "\n";
25
-
26
- $p['bar'] = $a;
27
- echo $p['bar'] . "\n";
28
-
29
- $p['baz'] = "Foo::bar";
30
- echo $p['baz'] . "\n";
31
-
32
- $p['foobar'] = array('Foo', 'bar');
33
- var_dump($p['foobar']);
34
-
35
- ?>
36
- --EXPECTF--
37
- callme
38
- called
39
- Foo::bar
40
- array(2) {
41
- [0]=>
42
- string(3) "Foo"
43
- [1]=>
44
- string(3) "bar"
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/011.phpt DELETED
@@ -1,19 +0,0 @@
1
- --TEST--
2
- Test service callback throwing an exception
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- class CallBackException extends RuntimeException { }
8
-
9
- $p = new Pimple\Container();
10
- $p['foo'] = function () { throw new CallBackException; };
11
- try {
12
- echo $p['foo'] . "\n";
13
- echo "should not come here";
14
- } catch (CallBackException $e) {
15
- echo "all right!";
16
- }
17
- ?>
18
- --EXPECTF--
19
- all right!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/012.phpt DELETED
@@ -1,28 +0,0 @@
1
- --TEST--
2
- Test service factory
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- $p = new Pimple\Container();
9
-
10
- $p->factory($f = function() { var_dump('called-1'); return 'ret-1';});
11
-
12
- $p[] = $f;
13
-
14
- $p[] = function () { var_dump('called-2'); return 'ret-2'; };
15
-
16
- var_dump($p[0]);
17
- var_dump($p[0]);
18
- var_dump($p[1]);
19
- var_dump($p[1]);
20
- ?>
21
- --EXPECTF--
22
- string(8) "called-1"
23
- string(5) "ret-1"
24
- string(8) "called-1"
25
- string(5) "ret-1"
26
- string(8) "called-2"
27
- string(5) "ret-2"
28
- string(5) "ret-2"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/013.phpt DELETED
@@ -1,33 +0,0 @@
1
- --TEST--
2
- Test keys()
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- $p = new Pimple\Container();
9
-
10
- var_dump($p->keys());
11
-
12
- $p['foo'] = 'bar';
13
- $p[] = 'foo';
14
-
15
- var_dump($p->keys());
16
-
17
- unset($p['foo']);
18
-
19
- var_dump($p->keys());
20
- ?>
21
- --EXPECTF--
22
- array(0) {
23
- }
24
- array(2) {
25
- [0]=>
26
- string(3) "foo"
27
- [1]=>
28
- int(0)
29
- }
30
- array(1) {
31
- [0]=>
32
- int(0)
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/014.phpt DELETED
@@ -1,30 +0,0 @@
1
- --TEST--
2
- Test raw()
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- $p = new Pimple\Container();
9
- $f = function () { var_dump('called-2'); return 'ret-2'; };
10
-
11
- $p['foo'] = $f;
12
- $p[42] = $f;
13
-
14
- var_dump($p['foo']);
15
- var_dump($p->raw('foo'));
16
- var_dump($p[42]);
17
-
18
- unset($p['foo']);
19
-
20
- try {
21
- $p->raw('foo');
22
- echo "expected exception";
23
- } catch (InvalidArgumentException $e) { }
24
- --EXPECTF--
25
- string(8) "called-2"
26
- string(5) "ret-2"
27
- object(Closure)#%i (0) {
28
- }
29
- string(8) "called-2"
30
- string(5) "ret-2"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/015.phpt DELETED
@@ -1,17 +0,0 @@
1
- --TEST--
2
- Test protect()
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- $p = new Pimple\Container();
9
- $f = function () { return 'foo'; };
10
- $p['foo'] = $f;
11
-
12
- $p->protect($f);
13
-
14
- var_dump($p['foo']);
15
- --EXPECTF--
16
- object(Closure)#%i (0) {
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/016.phpt DELETED
@@ -1,24 +0,0 @@
1
- --TEST--
2
- Test extend()
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
- /*
8
- This is part of Pimple::extend() code :
9
-
10
- $extended = function ($c) use ($callable, $factory) {
11
- return $callable($factory($c), $c);
12
- };
13
- */
14
-
15
- $p = new Pimple\Container();
16
- $p[12] = function ($v) { var_dump($v); return 'foo';}; /* $factory in code above */
17
-
18
- $c = $p->extend(12, function ($w) { var_dump($w); return 'bar'; }); /* $callable in code above */
19
-
20
- var_dump($c('param'));
21
- --EXPECTF--
22
- string(5) "param"
23
- string(3) "foo"
24
- string(3) "bar"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/017.phpt DELETED
@@ -1,17 +0,0 @@
1
- --TEST--
2
- Test extend() with exception in service extension
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- $p = new Pimple\Container();
9
- $p[12] = function ($v) { return 'foo';};
10
-
11
- $c = $p->extend(12, function ($w) { throw new BadMethodCallException; });
12
-
13
- try {
14
- $p[12];
15
- echo "Exception expected";
16
- } catch (BadMethodCallException $e) { }
17
- --EXPECTF--
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/017_1.phpt DELETED
@@ -1,17 +0,0 @@
1
- --TEST--
2
- Test extend() with exception in service factory
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- $p = new Pimple\Container();
9
- $p[12] = function ($v) { throw new BadMethodCallException; };
10
-
11
- $c = $p->extend(12, function ($w) { return 'foobar'; });
12
-
13
- try {
14
- $p[12];
15
- echo "Exception expected";
16
- } catch (BadMethodCallException $e) { }
17
- --EXPECTF--
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/018.phpt DELETED
@@ -1,23 +0,0 @@
1
- --TEST--
2
- Test register()
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- class Foo implements Pimple\ServiceProviderInterface
9
- {
10
- public function register(Pimple\Container $p)
11
- {
12
- var_dump($p);
13
- }
14
- }
15
-
16
- $p = new Pimple\Container();
17
- $p->register(new Foo, array(42 => 'bar'));
18
-
19
- var_dump($p[42]);
20
- --EXPECTF--
21
- object(Pimple\Container)#1 (0) {
22
- }
23
- string(3) "bar"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/019.phpt DELETED
@@ -1,18 +0,0 @@
1
- --TEST--
2
- Test register() returns static and is a fluent interface
3
- --SKIPIF--
4
- <?php if (!extension_loaded("pimple")) print "skip"; ?>
5
- --FILE--
6
- <?php
7
-
8
- class Foo implements Pimple\ServiceProviderInterface
9
- {
10
- public function register(Pimple\Container $p)
11
- {
12
- }
13
- }
14
-
15
- $p = new Pimple\Container();
16
- var_dump($p === $p->register(new Foo));
17
- --EXPECTF--
18
- bool(true)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/bench.phpb DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
-
3
- if (!class_exists('Pimple\Container')) {
4
- require_once __DIR__ . '/../../../src/Pimple/Container.php';
5
- } else {
6
- echo "pimple-c extension detected, using...\n\n";
7
- }
8
-
9
- $time = microtime(true);
10
-
11
- function foo() { }
12
- $factory = function () { };
13
-
14
- for ($i=0; $i<10000; $i++) {
15
-
16
- $p = new Pimple\Container;
17
-
18
- $p['foo'] = 'bar';
19
-
20
- if (!isset($p[3])) {
21
- $p[3] = $p['foo'];
22
- $p[] = 'bar';
23
- }
24
-
25
- $p[2] = 42;
26
-
27
- if (isset($p[2])) {
28
- unset($p[2]);
29
- }
30
-
31
- $p[42] = $p['foo'];
32
-
33
- $p['cb'] = function($arg) { };
34
-
35
- $p[] = $p['cb'];
36
-
37
- echo $p['cb'];
38
- echo $p['cb'];
39
- echo $p['cb'];
40
-
41
- //$p->factory($factory);
42
-
43
- $p['factory'] = $factory;
44
-
45
- echo $p['factory'];
46
- echo $p['factory'];
47
- echo $p['factory'];
48
-
49
- }
50
-
51
- echo microtime(true) - $time;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/ext/pimple/tests/bench_shared.phpb DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- if (!class_exists('Pimple\Container')) {
4
- require_once __DIR__ . '/../../../src/Pimple/Container.php';
5
- } else {
6
- echo "pimple-c extension detected, using...\n\n";
7
- }
8
-
9
- $time = microtime(true);
10
-
11
-
12
- $service = function ($arg) { return "I'm a service"; };
13
-
14
- for ($i=0; $i<10000; $i++) {
15
-
16
- $p = new Pimple\Container;
17
- $p['my_service'] = $service;
18
-
19
- $a = $p['my_service'];
20
- $b = $p['my_service'];
21
-
22
- }
23
-
24
- echo microtime(true) - $time;
25
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/phpunit.xml.dist DELETED
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
5
- backupGlobals="false"
6
- colors="true"
7
- bootstrap="vendor/autoload.php"
8
- >
9
- <testsuites>
10
- <testsuite name="Pimple Test Suite">
11
- <directory>./src/Pimple/Tests</directory>
12
- </testsuite>
13
- </testsuites>
14
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Container.php DELETED
@@ -1,298 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple;
28
-
29
- use Pimple\Exception\ExpectedInvokableException;
30
- use Pimple\Exception\FrozenServiceException;
31
- use Pimple\Exception\InvalidServiceIdentifierException;
32
- use Pimple\Exception\UnknownIdentifierException;
33
-
34
- /**
35
- * Container main class.
36
- *
37
- * @author Fabien Potencier
38
- */
39
- class Container implements \ArrayAccess
40
- {
41
- private $values = array();
42
- private $factories;
43
- private $protected;
44
- private $frozen = array();
45
- private $raw = array();
46
- private $keys = array();
47
-
48
- /**
49
- * Instantiates the container.
50
- *
51
- * Objects and parameters can be passed as argument to the constructor.
52
- *
53
- * @param array $values The parameters or objects
54
- */
55
- public function __construct(array $values = array())
56
- {
57
- $this->factories = new \SplObjectStorage();
58
- $this->protected = new \SplObjectStorage();
59
-
60
- foreach ($values as $key => $value) {
61
- $this->offsetSet($key, $value);
62
- }
63
- }
64
-
65
- /**
66
- * Sets a parameter or an object.
67
- *
68
- * Objects must be defined as Closures.
69
- *
70
- * Allowing any PHP callable leads to difficult to debug problems
71
- * as function names (strings) are callable (creating a function with
72
- * the same name as an existing parameter would break your container).
73
- *
74
- * @param string $id The unique identifier for the parameter or object
75
- * @param mixed $value The value of the parameter or a closure to define an object
76
- *
77
- * @throws FrozenServiceException Prevent override of a frozen service
78
- */
79
- public function offsetSet($id, $value)
80
- {
81
- if (isset($this->frozen[$id])) {
82
- throw new FrozenServiceException($id);
83
- }
84
-
85
- $this->values[$id] = $value;
86
- $this->keys[$id] = true;
87
- }
88
-
89
- /**
90
- * Gets a parameter or an object.
91
- *
92
- * @param string $id The unique identifier for the parameter or object
93
- *
94
- * @return mixed The value of the parameter or an object
95
- *
96
- * @throws UnknownIdentifierException If the identifier is not defined
97
- */
98
- public function offsetGet($id)
99
- {
100
- if (!isset($this->keys[$id])) {
101
- throw new UnknownIdentifierException($id);
102
- }
103
-
104
- if (
105
- isset($this->raw[$id])
106
- || !\is_object($this->values[$id])
107
- || isset($this->protected[$this->values[$id]])
108
- || !\method_exists($this->values[$id], '__invoke')
109
- ) {
110
- return $this->values[$id];
111
- }
112
-
113
- if (isset($this->factories[$this->values[$id]])) {
114
- return $this->values[$id]($this);
115
- }
116
-
117
- $raw = $this->values[$id];
118
- $val = $this->values[$id] = $raw($this);
119
- $this->raw[$id] = $raw;
120
-
121
- $this->frozen[$id] = true;
122
-
123
- return $val;
124
- }
125
-
126
- /**
127
- * Checks if a parameter or an object is set.
128
- *
129
- * @param string $id The unique identifier for the parameter or object
130
- *
131
- * @return bool
132
- */
133
- public function offsetExists($id)
134
- {
135
- return isset($this->keys[$id]);
136
- }
137
-
138
- /**
139
- * Unsets a parameter or an object.
140
- *
141
- * @param string $id The unique identifier for the parameter or object
142
- */
143
- public function offsetUnset($id)
144
- {
145
- if (isset($this->keys[$id])) {
146
- if (\is_object($this->values[$id])) {
147
- unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]);
148
- }
149
-
150
- unset($this->values[$id], $this->frozen[$id], $this->raw[$id], $this->keys[$id]);
151
- }
152
- }
153
-
154
- /**
155
- * Marks a callable as being a factory service.
156
- *
157
- * @param callable $callable A service definition to be used as a factory
158
- *
159
- * @return callable The passed callable
160
- *
161
- * @throws ExpectedInvokableException Service definition has to be a closure or an invokable object
162
- */
163
- public function factory($callable)
164
- {
165
- if (!\method_exists($callable, '__invoke')) {
166
- throw new ExpectedInvokableException('Service definition is not a Closure or invokable object.');
167
- }
168
-
169
- $this->factories->attach($callable);
170
-
171
- return $callable;
172
- }
173
-
174
- /**
175
- * Protects a callable from being interpreted as a service.
176
- *
177
- * This is useful when you want to store a callable as a parameter.
178
- *
179
- * @param callable $callable A callable to protect from being evaluated
180
- *
181
- * @return callable The passed callable
182
- *
183
- * @throws ExpectedInvokableException Service definition has to be a closure or an invokable object
184
- */
185
- public function protect($callable)
186
- {
187
- if (!\method_exists($callable, '__invoke')) {
188
- throw new ExpectedInvokableException('Callable is not a Closure or invokable object.');
189
- }
190
-
191
- $this->protected->attach($callable);
192
-
193
- return $callable;
194
- }
195
-
196
- /**
197
- * Gets a parameter or the closure defining an object.
198
- *
199
- * @param string $id The unique identifier for the parameter or object
200
- *
201
- * @return mixed The value of the parameter or the closure defining an object
202
- *
203
- * @throws UnknownIdentifierException If the identifier is not defined
204
- */
205
- public function raw($id)
206
- {
207
- if (!isset($this->keys[$id])) {
208
- throw new UnknownIdentifierException($id);
209
- }
210
-
211
- if (isset($this->raw[$id])) {
212
- return $this->raw[$id];
213
- }
214
-
215
- return $this->values[$id];
216
- }
217
-
218
- /**
219
- * Extends an object definition.
220
- *
221
- * Useful when you want to extend an existing object definition,
222
- * without necessarily loading that object.
223
- *
224
- * @param string $id The unique identifier for the object
225
- * @param callable $callable A service definition to extend the original
226
- *
227
- * @return callable The wrapped callable
228
- *
229
- * @throws UnknownIdentifierException If the identifier is not defined
230
- * @throws FrozenServiceException If the service is frozen
231
- * @throws InvalidServiceIdentifierException If the identifier belongs to a parameter
232
- * @throws ExpectedInvokableException If the extension callable is not a closure or an invokable object
233
- */
234
- public function extend($id, $callable)
235
- {
236
- if (!isset($this->keys[$id])) {
237
- throw new UnknownIdentifierException($id);
238
- }
239
-
240
- if (isset($this->frozen[$id])) {
241
- throw new FrozenServiceException($id);
242
- }
243
-
244
- if (!\is_object($this->values[$id]) || !\method_exists($this->values[$id], '__invoke')) {
245
- throw new InvalidServiceIdentifierException($id);
246
- }
247
-
248
- if (isset($this->protected[$this->values[$id]])) {
249
- @\trigger_error(\sprintf('How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "%s" should be protected?', $id), \E_USER_DEPRECATED);
250
- }
251
-
252
- if (!\is_object($callable) || !\method_exists($callable, '__invoke')) {
253
- throw new ExpectedInvokableException('Extension service definition is not a Closure or invokable object.');
254
- }
255
-
256
- $factory = $this->values[$id];
257
-
258
- $extended = function ($c) use ($callable, $factory) {
259
- return $callable($factory($c), $c);
260
- };
261
-
262
- if (isset($this->factories[$factory])) {
263
- $this->factories->detach($factory);
264
- $this->factories->attach($extended);
265
- }
266
-
267
- return $this[$id] = $extended;
268
- }
269
-
270
- /**
271
- * Returns all defined value names.
272
- *
273
- * @return array An array of value names
274
- */
275
- public function keys()
276
- {
277
- return \array_keys($this->values);
278
- }
279
-
280
- /**
281
- * Registers a service provider.
282
- *
283
- * @param ServiceProviderInterface $provider A ServiceProviderInterface instance
284
- * @param array $values An array of values that customizes the provider
285
- *
286
- * @return static
287
- */
288
- public function register(ServiceProviderInterface $provider, array $values = array())
289
- {
290
- $provider->register($this);
291
-
292
- foreach ($values as $key => $value) {
293
- $this[$key] = $value;
294
- }
295
-
296
- return $this;
297
- }
298
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Exception;
28
-
29
- use Psr\Container\ContainerExceptionInterface;
30
-
31
- /**
32
- * A closure or invokable object was expected.
33
- *
34
- * @author Pascal Luna <skalpa@zetareticuli.org>
35
- */
36
- class ExpectedInvokableException extends \InvalidArgumentException implements ContainerExceptionInterface
37
- {
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Exception;
28
-
29
- use Psr\Container\ContainerExceptionInterface;
30
-
31
- /**
32
- * An attempt to modify a frozen service was made.
33
- *
34
- * @author Pascal Luna <skalpa@zetareticuli.org>
35
- */
36
- class FrozenServiceException extends \RuntimeException implements ContainerExceptionInterface
37
- {
38
- /**
39
- * @param string $id Identifier of the frozen service
40
- */
41
- public function __construct($id)
42
- {
43
- parent::__construct(\sprintf('Cannot override frozen service "%s".', $id));
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Exception;
28
-
29
- use Psr\Container\NotFoundExceptionInterface;
30
-
31
- /**
32
- * An attempt to perform an operation that requires a service identifier was made.
33
- *
34
- * @author Pascal Luna <skalpa@zetareticuli.org>
35
- */
36
- class InvalidServiceIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface
37
- {
38
- /**
39
- * @param string $id The invalid identifier
40
- */
41
- public function __construct($id)
42
- {
43
- parent::__construct(\sprintf('Identifier "%s" does not contain an object definition.', $id));
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Exception;
28
-
29
- use Psr\Container\NotFoundExceptionInterface;
30
-
31
- /**
32
- * The identifier of a valid service or parameter was expected.
33
- *
34
- * @author Pascal Luna <skalpa@zetareticuli.org>
35
- */
36
- class UnknownIdentifierException extends \InvalidArgumentException implements NotFoundExceptionInterface
37
- {
38
- /**
39
- * @param string $id The unknown identifier
40
- */
41
- public function __construct($id)
42
- {
43
- parent::__construct(\sprintf('Identifier "%s" is not defined.', $id));
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Psr11/Container.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009-2017 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Psr11;
28
-
29
- use Pimple\Container as PimpleContainer;
30
- use Psr\Container\ContainerInterface;
31
-
32
- /**
33
- * PSR-11 compliant wrapper.
34
- *
35
- * @author Pascal Luna <skalpa@zetareticuli.org>
36
- */
37
- final class Container implements ContainerInterface
38
- {
39
- private $pimple;
40
-
41
- public function __construct(PimpleContainer $pimple)
42
- {
43
- $this->pimple = $pimple;
44
- }
45
-
46
- public function get($id)
47
- {
48
- return $this->pimple[$id];
49
- }
50
-
51
- public function has($id)
52
- {
53
- return isset($this->pimple[$id]);
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Psr11;
28
-
29
- use Pimple\Container as PimpleContainer;
30
- use Pimple\Exception\UnknownIdentifierException;
31
- use Psr\Container\ContainerInterface;
32
-
33
- /**
34
- * Pimple PSR-11 service locator.
35
- *
36
- * @author Pascal Luna <skalpa@zetareticuli.org>
37
- */
38
- class ServiceLocator implements ContainerInterface
39
- {
40
- private $container;
41
- private $aliases = array();
42
-
43
- /**
44
- * @param PimpleContainer $container The Container instance used to locate services
45
- * @param array $ids Array of service ids that can be located. String keys can be used to define aliases
46
- */
47
- public function __construct(PimpleContainer $container, array $ids)
48
- {
49
- $this->container = $container;
50
-
51
- foreach ($ids as $key => $id) {
52
- $this->aliases[\is_int($key) ? $id : $key] = $id;
53
- }
54
- }
55
-
56
- /**
57
- * {@inheritdoc}
58
- */
59
- public function get($id)
60
- {
61
- if (!isset($this->aliases[$id])) {
62
- throw new UnknownIdentifierException($id);
63
- }
64
-
65
- return $this->container[$this->aliases[$id]];
66
- }
67
-
68
- /**
69
- * {@inheritdoc}
70
- */
71
- public function has($id)
72
- {
73
- return isset($this->aliases[$id]) && isset($this->container[$this->aliases[$id]]);
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/ServiceIterator.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple;
28
-
29
- /**
30
- * Lazy service iterator.
31
- *
32
- * @author Pascal Luna <skalpa@zetareticuli.org>
33
- */
34
- final class ServiceIterator implements \Iterator
35
- {
36
- private $container;
37
- private $ids;
38
-
39
- public function __construct(Container $container, array $ids)
40
- {
41
- $this->container = $container;
42
- $this->ids = $ids;
43
- }
44
-
45
- public function rewind()
46
- {
47
- \reset($this->ids);
48
- }
49
-
50
- public function current()
51
- {
52
- return $this->container[\current($this->ids)];
53
- }
54
-
55
- public function key()
56
- {
57
- return \current($this->ids);
58
- }
59
-
60
- public function next()
61
- {
62
- \next($this->ids);
63
- }
64
-
65
- public function valid()
66
- {
67
- return null !== \key($this->ids);
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple;
28
-
29
- /**
30
- * Pimple service provider interface.
31
- *
32
- * @author Fabien Potencier
33
- * @author Dominik Zogg
34
- */
35
- interface ServiceProviderInterface
36
- {
37
- /**
38
- * Registers services on the given container.
39
- *
40
- * This method should only be used to configure services and parameters.
41
- * It should not get services.
42
- *
43
- * @param Container $pimple A container instance
44
- */
45
- public function register(Container $pimple);
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests\Fixtures;
28
-
29
- class Invokable
30
- {
31
- public function __invoke($value = null)
32
- {
33
- $service = new Service();
34
- $service->value = $value;
35
-
36
- return $service;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests\Fixtures;
28
-
29
- class NonInvokable
30
- {
31
- public function __call($a, $b)
32
- {
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests\Fixtures;
28
-
29
- use Pimple\Container;
30
- use Pimple\ServiceProviderInterface;
31
-
32
- class PimpleServiceProvider implements ServiceProviderInterface
33
- {
34
- /**
35
- * Registers services on the given container.
36
- *
37
- * This method should only be used to configure services and parameters.
38
- * It should not get services.
39
- *
40
- * @param Container $pimple An Container instance
41
- */
42
- public function register(Container $pimple)
43
- {
44
- $pimple['param'] = 'value';
45
-
46
- $pimple['service'] = function () {
47
- return new Service();
48
- };
49
-
50
- $pimple['factory'] = $pimple->factory(function () {
51
- return new Service();
52
- });
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests\Fixtures;
28
-
29
- /**
30
- * @author Igor Wiedler <igor@wiedler.ch>
31
- */
32
- class Service
33
- {
34
- public $value;
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests;
28
-
29
- use Pimple\Container;
30
-
31
- /**
32
- * @author Dominik Zogg <dominik.zogg@gmail.com>
33
- */
34
- class PimpleServiceProviderInterfaceTest extends \PHPUnit_Framework_TestCase
35
- {
36
- public function testProvider()
37
- {
38
- $pimple = new Container();
39
-
40
- $pimpleServiceProvider = new Fixtures\PimpleServiceProvider();
41
- $pimpleServiceProvider->register($pimple);
42
-
43
- $this->assertEquals('value', $pimple['param']);
44
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']);
45
-
46
- $serviceOne = $pimple['factory'];
47
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
48
-
49
- $serviceTwo = $pimple['factory'];
50
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
51
-
52
- $this->assertNotSame($serviceOne, $serviceTwo);
53
- }
54
-
55
- public function testProviderWithRegisterMethod()
56
- {
57
- $pimple = new Container();
58
-
59
- $pimple->register(new Fixtures\PimpleServiceProvider(), array(
60
- 'anotherParameter' => 'anotherValue',
61
- ));
62
-
63
- $this->assertEquals('value', $pimple['param']);
64
- $this->assertEquals('anotherValue', $pimple['anotherParameter']);
65
-
66
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']);
67
-
68
- $serviceOne = $pimple['factory'];
69
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
70
-
71
- $serviceTwo = $pimple['factory'];
72
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
73
-
74
- $this->assertNotSame($serviceOne, $serviceTwo);
75
- }
76
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php DELETED
@@ -1,589 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests;
28
-
29
- use Pimple\Container;
30
-
31
- /**
32
- * @author Igor Wiedler <igor@wiedler.ch>
33
- */
34
- class PimpleTest extends \PHPUnit_Framework_TestCase
35
- {
36
- public function testWithString()
37
- {
38
- $pimple = new Container();
39
- $pimple['param'] = 'value';
40
-
41
- $this->assertEquals('value', $pimple['param']);
42
- }
43
-
44
- public function testWithClosure()
45
- {
46
- $pimple = new Container();
47
- $pimple['service'] = function () {
48
- return new Fixtures\Service();
49
- };
50
-
51
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['service']);
52
- }
53
-
54
- public function testServicesShouldBeDifferent()
55
- {
56
- $pimple = new Container();
57
- $pimple['service'] = $pimple->factory(function () {
58
- return new Fixtures\Service();
59
- });
60
-
61
- $serviceOne = $pimple['service'];
62
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
63
-
64
- $serviceTwo = $pimple['service'];
65
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
66
-
67
- $this->assertNotSame($serviceOne, $serviceTwo);
68
- }
69
-
70
- public function testShouldPassContainerAsParameter()
71
- {
72
- $pimple = new Container();
73
- $pimple['service'] = function () {
74
- return new Fixtures\Service();
75
- };
76
- $pimple['container'] = function ($container) {
77
- return $container;
78
- };
79
-
80
- $this->assertNotSame($pimple, $pimple['service']);
81
- $this->assertSame($pimple, $pimple['container']);
82
- }
83
-
84
- public function testIsset()
85
- {
86
- $pimple = new Container();
87
- $pimple['param'] = 'value';
88
- $pimple['service'] = function () {
89
- return new Fixtures\Service();
90
- };
91
-
92
- $pimple['null'] = null;
93
-
94
- $this->assertTrue(isset($pimple['param']));
95
- $this->assertTrue(isset($pimple['service']));
96
- $this->assertTrue(isset($pimple['null']));
97
- $this->assertFalse(isset($pimple['non_existent']));
98
- }
99
-
100
- public function testConstructorInjection()
101
- {
102
- $params = array('param' => 'value');
103
- $pimple = new Container($params);
104
-
105
- $this->assertSame($params['param'], $pimple['param']);
106
- }
107
-
108
- /**
109
- * @expectedException \Pimple\Exception\UnknownIdentifierException
110
- * @expectedExceptionMessage Identifier "foo" is not defined.
111
- */
112
- public function testOffsetGetValidatesKeyIsPresent()
113
- {
114
- $pimple = new Container();
115
- echo $pimple['foo'];
116
- }
117
-
118
- /**
119
- * @group legacy
120
- * @expectedException \InvalidArgumentException
121
- * @expectedExceptionMessage Identifier "foo" is not defined.
122
- */
123
- public function testLegacyOffsetGetValidatesKeyIsPresent()
124
- {
125
- $pimple = new Container();
126
- echo $pimple['foo'];
127
- }
128
-
129
- public function testOffsetGetHonorsNullValues()
130
- {
131
- $pimple = new Container();
132
- $pimple['foo'] = null;
133
- $this->assertNull($pimple['foo']);
134
- }
135
-
136
- public function testUnset()
137
- {
138
- $pimple = new Container();
139
- $pimple['param'] = 'value';
140
- $pimple['service'] = function () {
141
- return new Fixtures\Service();
142
- };
143
-
144
- unset($pimple['param'], $pimple['service']);
145
- $this->assertFalse(isset($pimple['param']));
146
- $this->assertFalse(isset($pimple['service']));
147
- }
148
-
149
- /**
150
- * @dataProvider serviceDefinitionProvider
151
- */
152
- public function testShare($service)
153
- {
154
- $pimple = new Container();
155
- $pimple['shared_service'] = $service;
156
-
157
- $serviceOne = $pimple['shared_service'];
158
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
159
-
160
- $serviceTwo = $pimple['shared_service'];
161
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
162
-
163
- $this->assertSame($serviceOne, $serviceTwo);
164
- }
165
-
166
- /**
167
- * @dataProvider serviceDefinitionProvider
168
- */
169
- public function testProtect($service)
170
- {
171
- $pimple = new Container();
172
- $pimple['protected'] = $pimple->protect($service);
173
-
174
- $this->assertSame($service, $pimple['protected']);
175
- }
176
-
177
- public function testGlobalFunctionNameAsParameterValue()
178
- {
179
- $pimple = new Container();
180
- $pimple['global_function'] = 'strlen';
181
- $this->assertSame('strlen', $pimple['global_function']);
182
- }
183
-
184
- public function testRaw()
185
- {
186
- $pimple = new Container();
187
- $pimple['service'] = $definition = $pimple->factory(function () { return 'foo'; });
188
- $this->assertSame($definition, $pimple->raw('service'));
189
- }
190
-
191
- public function testRawHonorsNullValues()
192
- {
193
- $pimple = new Container();
194
- $pimple['foo'] = null;
195
- $this->assertNull($pimple->raw('foo'));
196
- }
197
-
198
- public function testFluentRegister()
199
- {
200
- $pimple = new Container();
201
- $this->assertSame($pimple, $pimple->register($this->getMockBuilder('Pimple\ServiceProviderInterface')->getMock()));
202
- }
203
-
204
- /**
205
- * @expectedException \Pimple\Exception\UnknownIdentifierException
206
- * @expectedExceptionMessage Identifier "foo" is not defined.
207
- */
208
- public function testRawValidatesKeyIsPresent()
209
- {
210
- $pimple = new Container();
211
- $pimple->raw('foo');
212
- }
213
-
214
- /**
215
- * @group legacy
216
- * @expectedException \InvalidArgumentException
217
- * @expectedExceptionMessage Identifier "foo" is not defined.
218
- */
219
- public function testLegacyRawValidatesKeyIsPresent()
220
- {
221
- $pimple = new Container();
222
- $pimple->raw('foo');
223
- }
224
-
225
- /**
226
- * @dataProvider serviceDefinitionProvider
227
- */
228
- public function testExtend($service)
229
- {
230
- $pimple = new Container();
231
- $pimple['shared_service'] = function () {
232
- return new Fixtures\Service();
233
- };
234
- $pimple['factory_service'] = $pimple->factory(function () {
235
- return new Fixtures\Service();
236
- });
237
-
238
- $pimple->extend('shared_service', $service);
239
- $serviceOne = $pimple['shared_service'];
240
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
241
- $serviceTwo = $pimple['shared_service'];
242
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
243
- $this->assertSame($serviceOne, $serviceTwo);
244
- $this->assertSame($serviceOne->value, $serviceTwo->value);
245
-
246
- $pimple->extend('factory_service', $service);
247
- $serviceOne = $pimple['factory_service'];
248
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceOne);
249
- $serviceTwo = $pimple['factory_service'];
250
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $serviceTwo);
251
- $this->assertNotSame($serviceOne, $serviceTwo);
252
- $this->assertNotSame($serviceOne->value, $serviceTwo->value);
253
- }
254
-
255
- public function testExtendDoesNotLeakWithFactories()
256
- {
257
- if (extension_loaded('pimple')) {
258
- $this->markTestSkipped('Pimple extension does not support this test');
259
- }
260
- $pimple = new Container();
261
-
262
- $pimple['foo'] = $pimple->factory(function () { return; });
263
- $pimple['foo'] = $pimple->extend('foo', function ($foo, $pimple) { return; });
264
- unset($pimple['foo']);
265
-
266
- $p = new \ReflectionProperty($pimple, 'values');
267
- $p->setAccessible(true);
268
- $this->assertEmpty($p->getValue($pimple));
269
-
270
- $p = new \ReflectionProperty($pimple, 'factories');
271
- $p->setAccessible(true);
272
- $this->assertCount(0, $p->getValue($pimple));
273
- }
274
-
275
- /**
276
- * @expectedException \Pimple\Exception\UnknownIdentifierException
277
- * @expectedExceptionMessage Identifier "foo" is not defined.
278
- */
279
- public function testExtendValidatesKeyIsPresent()
280
- {
281
- $pimple = new Container();
282
- $pimple->extend('foo', function () {});
283
- }
284
-
285
- /**
286
- * @group legacy
287
- * @expectedException \InvalidArgumentException
288
- * @expectedExceptionMessage Identifier "foo" is not defined.
289
- */
290
- public function testLegacyExtendValidatesKeyIsPresent()
291
- {
292
- $pimple = new Container();
293
- $pimple->extend('foo', function () {});
294
- }
295
-
296
- public function testKeys()
297
- {
298
- $pimple = new Container();
299
- $pimple['foo'] = 123;
300
- $pimple['bar'] = 123;
301
-
302
- $this->assertEquals(array('foo', 'bar'), $pimple->keys());
303
- }
304
-
305
- /** @test */
306
- public function settingAnInvokableObjectShouldTreatItAsFactory()
307
- {
308
- $pimple = new Container();
309
- $pimple['invokable'] = new Fixtures\Invokable();
310
-
311
- $this->assertInstanceOf('Pimple\Tests\Fixtures\Service', $pimple['invokable']);
312
- }
313
-
314
- /** @test */
315
- public function settingNonInvokableObjectShouldTreatItAsParameter()
316
- {
317
- $pimple = new Container();
318
- $pimple['non_invokable'] = new Fixtures\NonInvokable();
319
-
320
- $this->assertInstanceOf('Pimple\Tests\Fixtures\NonInvokable', $pimple['non_invokable']);
321
- }
322
-
323
- /**
324
- * @dataProvider badServiceDefinitionProvider
325
- * @expectedException \Pimple\Exception\ExpectedInvokableException
326
- * @expectedExceptionMessage Service definition is not a Closure or invokable object.
327
- */
328
- public function testFactoryFailsForInvalidServiceDefinitions($service)
329
- {
330
- $pimple = new Container();
331
- $pimple->factory($service);
332
- }
333
-
334
- /**
335
- * @group legacy
336
- * @dataProvider badServiceDefinitionProvider
337
- * @expectedException \InvalidArgumentException
338
- * @expectedExceptionMessage Service definition is not a Closure or invokable object.
339
- */
340
- public function testLegacyFactoryFailsForInvalidServiceDefinitions($service)
341
- {
342
- $pimple = new Container();
343
- $pimple->factory($service);
344
- }
345
-
346
- /**
347
- * @dataProvider badServiceDefinitionProvider
348
- * @expectedException \Pimple\Exception\ExpectedInvokableException
349
- * @expectedExceptionMessage Callable is not a Closure or invokable object.
350
- */
351
- public function testProtectFailsForInvalidServiceDefinitions($service)
352
- {
353
- $pimple = new Container();
354
- $pimple->protect($service);
355
- }
356
-
357
- /**
358
- * @group legacy
359
- * @dataProvider badServiceDefinitionProvider
360
- * @expectedException \InvalidArgumentException
361
- * @expectedExceptionMessage Callable is not a Closure or invokable object.
362
- */
363
- public function testLegacyProtectFailsForInvalidServiceDefinitions($service)
364
- {
365
- $pimple = new Container();
366
- $pimple->protect($service);
367
- }
368
-
369
- /**
370
- * @dataProvider badServiceDefinitionProvider
371
- * @expectedException \Pimple\Exception\InvalidServiceIdentifierException
372
- * @expectedExceptionMessage Identifier "foo" does not contain an object definition.
373
- */
374
- public function testExtendFailsForKeysNotContainingServiceDefinitions($service)
375
- {
376
- $pimple = new Container();
377
- $pimple['foo'] = $service;
378
- $pimple->extend('foo', function () {});
379
- }
380
-
381
- /**
382
- * @group legacy
383
- * @dataProvider badServiceDefinitionProvider
384
- * @expectedException \InvalidArgumentException
385
- * @expectedExceptionMessage Identifier "foo" does not contain an object definition.
386
- */
387
- public function testLegacyExtendFailsForKeysNotContainingServiceDefinitions($service)
388
- {
389
- $pimple = new Container();
390
- $pimple['foo'] = $service;
391
- $pimple->extend('foo', function () {});
392
- }
393
-
394
- /**
395
- * @group legacy
396
- * @expectedDeprecation How Pimple behaves when extending protected closures will be fixed in Pimple 4. Are you sure "foo" should be protected?
397
- */
398
- public function testExtendingProtectedClosureDeprecation()
399
- {
400
- $pimple = new Container();
401
- $pimple['foo'] = $pimple->protect(function () {
402
- return 'bar';
403
- });
404
-
405
- $pimple->extend('foo', function ($value) {
406
- return $value.'-baz';
407
- });
408
-
409
- $this->assertSame('bar-baz', $pimple['foo']);
410
- }
411
-
412
- /**
413
- * @dataProvider badServiceDefinitionProvider
414
- * @expectedException \Pimple\Exception\ExpectedInvokableException
415
- * @expectedExceptionMessage Extension service definition is not a Closure or invokable object.
416
- */
417
- public function testExtendFailsForInvalidServiceDefinitions($service)
418
- {
419
- $pimple = new Container();
420
- $pimple['foo'] = function () {};
421
- $pimple->extend('foo', $service);
422
- }
423
-
424
- /**
425
- * @group legacy
426
- * @dataProvider badServiceDefinitionProvider
427
- * @expectedException \InvalidArgumentException
428
- * @expectedExceptionMessage Extension service definition is not a Closure or invokable object.
429
- */
430
- public function testLegacyExtendFailsForInvalidServiceDefinitions($service)
431
- {
432
- $pimple = new Container();
433
- $pimple['foo'] = function () {};
434
- $pimple->extend('foo', $service);
435
- }
436
-
437
- /**
438
- * @expectedException \Pimple\Exception\FrozenServiceException
439
- * @expectedExceptionMessage Cannot override frozen service "foo".
440
- */
441
- public function testExtendFailsIfFrozenServiceIsNonInvokable()
442
- {
443
- $pimple = new Container();
444
- $pimple['foo'] = function () {
445
- return new Fixtures\NonInvokable();
446
- };
447
- $foo = $pimple['foo'];
448
-
449
- $pimple->extend('foo', function () {});
450
- }
451
-
452
- /**
453
- * @expectedException \Pimple\Exception\FrozenServiceException
454
- * @expectedExceptionMessage Cannot override frozen service "foo".
455
- */
456
- public function testExtendFailsIfFrozenServiceIsInvokable()
457
- {
458
- $pimple = new Container();
459
- $pimple['foo'] = function () {
460
- return new Fixtures\Invokable();
461
- };
462
- $foo = $pimple['foo'];
463
-
464
- $pimple->extend('foo', function () {});
465
- }
466
-
467
- /**
468
- * Provider for invalid service definitions.
469
- */
470
- public function badServiceDefinitionProvider()
471
- {
472
- return array(
473
- array(123),
474
- array(new Fixtures\NonInvokable()),
475
- );
476
- }
477
-
478
- /**
479
- * Provider for service definitions.
480
- */
481
- public function serviceDefinitionProvider()
482
- {
483
- return array(
484
- array(function ($value) {
485
- $service = new Fixtures\Service();
486
- $service->value = $value;
487
-
488
- return $service;
489
- }),
490
- array(new Fixtures\Invokable()),
491
- );
492
- }
493
-
494
- public function testDefiningNewServiceAfterFreeze()
495
- {
496
- $pimple = new Container();
497
- $pimple['foo'] = function () {
498
- return 'foo';
499
- };
500
- $foo = $pimple['foo'];
501
-
502
- $pimple['bar'] = function () {
503
- return 'bar';
504
- };
505
- $this->assertSame('bar', $pimple['bar']);
506
- }
507
-
508
- /**
509
- * @expectedException \Pimple\Exception\FrozenServiceException
510
- * @expectedExceptionMessage Cannot override frozen service "foo".
511
- */
512
- public function testOverridingServiceAfterFreeze()
513
- {
514
- $pimple = new Container();
515
- $pimple['foo'] = function () {
516
- return 'foo';
517
- };
518
- $foo = $pimple['foo'];
519
-
520
- $pimple['foo'] = function () {
521
- return 'bar';
522
- };
523
- }
524
-
525
- /**
526
- * @group legacy
527
- * @expectedException \RuntimeException
528
- * @expectedExceptionMessage Cannot override frozen service "foo".
529
- */
530
- public function testLegacyOverridingServiceAfterFreeze()
531
- {
532
- $pimple = new Container();
533
- $pimple['foo'] = function () {
534
- return 'foo';
535
- };
536
- $foo = $pimple['foo'];
537
-
538
- $pimple['foo'] = function () {
539
- return 'bar';
540
- };
541
- }
542
-
543
- public function testRemovingServiceAfterFreeze()
544
- {
545
- $pimple = new Container();
546
- $pimple['foo'] = function () {
547
- return 'foo';
548
- };
549
- $foo = $pimple['foo'];
550
-
551
- unset($pimple['foo']);
552
- $pimple['foo'] = function () {
553
- return 'bar';
554
- };
555
- $this->assertSame('bar', $pimple['foo']);
556
- }
557
-
558
- public function testExtendingService()
559
- {
560
- $pimple = new Container();
561
- $pimple['foo'] = function () {
562
- return 'foo';
563
- };
564
- $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) {
565
- return "$foo.bar";
566
- });
567
- $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) {
568
- return "$foo.baz";
569
- });
570
- $this->assertSame('foo.bar.baz', $pimple['foo']);
571
- }
572
-
573
- public function testExtendingServiceAfterOtherServiceFreeze()
574
- {
575
- $pimple = new Container();
576
- $pimple['foo'] = function () {
577
- return 'foo';
578
- };
579
- $pimple['bar'] = function () {
580
- return 'bar';
581
- };
582
- $foo = $pimple['foo'];
583
-
584
- $pimple['bar'] = $pimple->extend('bar', function ($bar, $app) {
585
- return "$bar.baz";
586
- });
587
- $this->assertSame('bar.baz', $pimple['bar']);
588
- }
589
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php DELETED
@@ -1,77 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009-2017 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests\Psr11;
28
-
29
- use PHPUnit\Framework\TestCase;
30
- use Pimple\Container;
31
- use Pimple\Psr11\Container as PsrContainer;
32
- use Pimple\Tests\Fixtures\Service;
33
-
34
- class ContainerTest extends TestCase
35
- {
36
- public function testGetReturnsExistingService()
37
- {
38
- $pimple = new Container();
39
- $pimple['service'] = function () {
40
- return new Service();
41
- };
42
- $psr = new PsrContainer($pimple);
43
-
44
- $this->assertSame($pimple['service'], $psr->get('service'));
45
- }
46
-
47
- /**
48
- * @expectedException \Psr\Container\NotFoundExceptionInterface
49
- * @expectedExceptionMessage Identifier "service" is not defined.
50
- */
51
- public function testGetThrowsExceptionIfServiceIsNotFound()
52
- {
53
- $pimple = new Container();
54
- $psr = new PsrContainer($pimple);
55
-
56
- $psr->get('service');
57
- }
58
-
59
- public function testHasReturnsTrueIfServiceExists()
60
- {
61
- $pimple = new Container();
62
- $pimple['service'] = function () {
63
- return new Service();
64
- };
65
- $psr = new PsrContainer($pimple);
66
-
67
- $this->assertTrue($psr->has('service'));
68
- }
69
-
70
- public function testHasReturnsFalseIfServiceDoesNotExist()
71
- {
72
- $pimple = new Container();
73
- $psr = new PsrContainer($pimple);
74
-
75
- $this->assertFalse($psr->has('service'));
76
- }
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php DELETED
@@ -1,134 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests\Psr11;
28
-
29
- use PHPUnit\Framework\TestCase;
30
- use Pimple\Container;
31
- use Pimple\Psr11\ServiceLocator;
32
- use Pimple\Tests\Fixtures;
33
-
34
- /**
35
- * ServiceLocator test case.
36
- *
37
- * @author Pascal Luna <skalpa@zetareticuli.org>
38
- */
39
- class ServiceLocatorTest extends TestCase
40
- {
41
- public function testCanAccessServices()
42
- {
43
- $pimple = new Container();
44
- $pimple['service'] = function () {
45
- return new Fixtures\Service();
46
- };
47
- $locator = new ServiceLocator($pimple, array('service'));
48
-
49
- $this->assertSame($pimple['service'], $locator->get('service'));
50
- }
51
-
52
- public function testCanAccessAliasedServices()
53
- {
54
- $pimple = new Container();
55
- $pimple['service'] = function () {
56
- return new Fixtures\Service();
57
- };
58
- $locator = new ServiceLocator($pimple, array('alias' => 'service'));
59
-
60
- $this->assertSame($pimple['service'], $locator->get('alias'));
61
- }
62
-
63
- /**
64
- * @expectedException \Pimple\Exception\UnknownIdentifierException
65
- * @expectedExceptionMessage Identifier "service" is not defined.
66
- */
67
- public function testCannotAccessAliasedServiceUsingRealIdentifier()
68
- {
69
- $pimple = new Container();
70
- $pimple['service'] = function () {
71
- return new Fixtures\Service();
72
- };
73
- $locator = new ServiceLocator($pimple, array('alias' => 'service'));
74
-
75
- $service = $locator->get('service');
76
- }
77
-
78
- /**
79
- * @expectedException \Pimple\Exception\UnknownIdentifierException
80
- * @expectedExceptionMessage Identifier "foo" is not defined.
81
- */
82
- public function testGetValidatesServiceCanBeLocated()
83
- {
84
- $pimple = new Container();
85
- $pimple['service'] = function () {
86
- return new Fixtures\Service();
87
- };
88
- $locator = new ServiceLocator($pimple, array('alias' => 'service'));
89
-
90
- $service = $locator->get('foo');
91
- }
92
-
93
- /**
94
- * @expectedException \Pimple\Exception\UnknownIdentifierException
95
- * @expectedExceptionMessage Identifier "invalid" is not defined.
96
- */
97
- public function testGetValidatesTargetServiceExists()
98
- {
99
- $pimple = new Container();
100
- $pimple['service'] = function () {
101
- return new Fixtures\Service();
102
- };
103
- $locator = new ServiceLocator($pimple, array('alias' => 'invalid'));
104
-
105
- $service = $locator->get('alias');
106
- }
107
-
108
- public function testHasValidatesServiceCanBeLocated()
109
- {
110
- $pimple = new Container();
111
- $pimple['service1'] = function () {
112
- return new Fixtures\Service();
113
- };
114
- $pimple['service2'] = function () {
115
- return new Fixtures\Service();
116
- };
117
- $locator = new ServiceLocator($pimple, array('service1'));
118
-
119
- $this->assertTrue($locator->has('service1'));
120
- $this->assertFalse($locator->has('service2'));
121
- }
122
-
123
- public function testHasChecksIfTargetServiceExists()
124
- {
125
- $pimple = new Container();
126
- $pimple['service'] = function () {
127
- return new Fixtures\Service();
128
- };
129
- $locator = new ServiceLocator($pimple, array('foo' => 'service', 'bar' => 'invalid'));
130
-
131
- $this->assertTrue($locator->has('foo'));
132
- $this->assertFalse($locator->has('bar'));
133
- }
134
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Pimple.
5
- *
6
- * Copyright (c) 2009 Fabien Potencier
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is furnished
13
- * to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in all
16
- * copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- namespace Pimple\Tests;
28
-
29
- use PHPUnit\Framework\TestCase;
30
- use Pimple\Container;
31
- use Pimple\ServiceIterator;
32
- use Pimple\Tests\Fixtures\Service;
33
-
34
- class ServiceIteratorTest extends TestCase
35
- {
36
- public function testIsIterable()
37
- {
38
- $pimple = new Container();
39
- $pimple['service1'] = function () {
40
- return new Service();
41
- };
42
- $pimple['service2'] = function () {
43
- return new Service();
44
- };
45
- $pimple['service3'] = function () {
46
- return new Service();
47
- };
48
- $iterator = new ServiceIterator($pimple, array('service1', 'service2'));
49
-
50
- $this->assertSame(array('service1' => $pimple['service1'], 'service2' => $pimple['service2']), iterator_to_array($iterator));
51
- }
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/psr/container/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2013-2016 container-interop
4
- Copyright (c) 2016 PHP Framework Interoperability Group
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy of
7
- this software and associated documentation files (the "Software"), to deal in
8
- the Software without restriction, including without limitation the rights to
9
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
- the Software, and to permit persons to whom the Software is furnished to do so,
11
- subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/psr/container/README.md DELETED
@@ -1,5 +0,0 @@
1
- # PSR Container
2
-
3
- This repository holds all interfaces/classes/traits related to [PSR-11](https://github.com/container-interop/fig-standards/blob/master/proposed/container.md).
4
-
5
- Note that this is not a container implementation of its own. See the specification for more details.
 
 
 
 
 
vendor/psr/container/composer.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "name": "psr/container",
3
- "type": "library",
4
- "description": "Common Container Interface (PHP FIG PSR-11)",
5
- "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"],
6
- "homepage": "https://github.com/php-fig/container",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "PHP-FIG",
11
- "homepage": "http://www.php-fig.org/"
12
- }
13
- ],
14
- "require": {
15
- "php": ">=5.3.0"
16
- },
17
- "autoload": {
18
- "psr-4": {
19
- "Psr\\Container\\": "src/"
20
- }
21
- },
22
- "extra": {
23
- "branch-alias": {
24
- "dev-master": "1.0.x-dev"
25
- }
26
- }
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/psr/container/src/ContainerExceptionInterface.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace Psr\Container;
7
-
8
- /**
9
- * Base interface representing a generic exception in a container.
10
- */
11
- interface ContainerExceptionInterface
12
- {
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/psr/container/src/ContainerInterface.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace Psr\Container;
7
-
8
- /**
9
- * Describes the interface of a container that exposes methods to read its entries.
10
- */
11
- interface ContainerInterface
12
- {
13
- /**
14
- * Finds an entry of the container by its identifier and returns it.
15
- *
16
- * @param string $id Identifier of the entry to look for.
17
- *
18
- * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
19
- * @throws ContainerExceptionInterface Error while retrieving the entry.
20
- *
21
- * @return mixed Entry.
22
- */
23
- public function get($id);
24
-
25
- /**
26
- * Returns true if the container can return an entry for the given identifier.
27
- * Returns false otherwise.
28
- *
29
- * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
30
- * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
31
- *
32
- * @param string $id Identifier of the entry to look for.
33
- *
34
- * @return bool
35
- */
36
- public function has($id);
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/psr/container/src/NotFoundExceptionInterface.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- /**
3
- * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
- */
5
-
6
- namespace Psr\Container;
7
-
8
- /**
9
- * No entry was found in the container.
10
- */
11
- interface NotFoundExceptionInterface extends ContainerExceptionInterface
12
- {
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/publishpress/edd-license-handler DELETED
@@ -1 +0,0 @@
1
- Subproject commit 0cf8447b2dd73d4a916b2bdcf1e364c89218b25d
 
vendor/publishpress/wordpress-edd-license-integration DELETED
@@ -1 +0,0 @@
1
- Subproject commit 12c9768df10b7d16d12f2583a1dca9a6822cad7a
 
vendor/wpdevelopers/embera ADDED
@@ -0,0 +1 @@
 
1
+ Subproject commit 5f521fbe77fdfc992dc399ee39e5fdb338ea1f04