Plugin Directory

Changeset 2519174


Ignore:
Timestamp:
04/21/2021 02:27:46 PM (5 years ago)
Author:
shutterstockplugins
Message:

Release version 1.3.5

Location:
shutterstock
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shutterstock/tags/1.3.5/README.txt

    r2469573 r2519174  
    33Tags: shutterstock, stock photography, images, editorial images, licensing, media library, stock
    44Requires at least: 5.5
    5 Tested up to: 5.6
    6 Stable tag: 1.3.4
     5Tested up to: 5.7
     6Stable tag: 1.3.5
    77Requires PHP: 7.1
    88License: MIT
     
    112112
    113113== Changelog ==
     114= 1.3.5 =
     115* Bug fixes related to Screen options
     116
    114117= 1.3.4 =
    115118* Documentation updates
  • shutterstock/tags/1.3.5/admin/css/shutterstock-admin.css

    r2466651 r2519174  
    44 */
    55
    6 .user-settings-table {
     6.shutterstock-user-settings-table {
    77 border-spacing: 0;
    88}
    99
    10 .user-settings-table th {
     10.shutterstock-user-settings-table th {
    1111  border-top: 1px solid #7e8993;
    1212  padding-left: 10px;
    1313}
    14 .user-settings-table td:last-child,
    15 .user-settings-table th:last-child {
     14.shutterstock-user-settings-table td:last-child,
     15.shutterstock-user-settings-table th:last-child {
    1616  border-right: 1px solid #7e8993;
    1717}
    1818
    19 .user-settings-table td,
    20 .user-settings-table th {
     19.shutterstock-user-settings-table td,
     20.shutterstock-user-settings-table th {
    2121  border-bottom: 1px solid #7e8993;
    2222  border-left: 1px solid #7e8993;
    2323}
    2424
    25 .connected,
     25.shutterstock-connected,
    2626p.shutterstock-token {
    2727    word-wrap: break-word;
     
    4848}
    4949
    50 button.logout, input.login {
     50button.shutterstock-logout, input.shutterstock-login {
    5151    cursor: pointer;
    5252}
    5353
    54 .connected {
     54.shutterstock-connected {
    5555  padding-top: 5px;
    5656}
    5757
    58 .hidden {
     58.shutterstock-hidden {
    5959  display: none !important;
    6060}
  • shutterstock/tags/1.3.5/admin/partials/shutterstock-admin-field-shutterstock-login-button.php

    r2466651 r2519174  
    1818                  var pre = \'<p class="' . esc_attr($atts['context']['connected_class']) . '">' . esc_html__('wordpress:logging_out', 'shutterstock') . '</p>\';
    1919                  jQuery(".shutterstock-token").replaceWith(pre);
    20                   jQuery(".connected").addClass("hidden");
     20                  jQuery(".shutterstock-connected").addClass("shutterstock-hidden");
    2121                }
    2222            </script>
     
    2727                name="' . esc_attr($atts['name']) . '"
    2828                value="' . esc_textarea($atts['value']) . '"
    29                 class="' . esc_attr($atts['context']['connected_class']) . ' hidden">' .
     29                class="' . esc_attr($atts['context']['connected_class']) . ' shutterstock-hidden">' .
    3030                    esc_textarea($atts['value']) .
    3131                '</textarea>';
    3232
    33             echo '<div class="connected">'. esc_html__('wordpress:connected', 'shutterstock') .'</div>';
    34             echo '<button class="logout" onclick="logout()">' . esc_attr($atts['context']['has_value_button_text']) . '</button>';
     33            echo '<div class="shutterstock-connected">'. esc_html__('wordpress:connected', 'shutterstock') .'</div>';
     34            echo '<button class="shutterstock-logout" onclick="logout()">' . esc_attr($atts['context']['has_value_button_text']) . '</button>';
    3535        } else {
    3636            echo '
     
    4949            </script>
    5050            <input
    51                 class="login"
     51                class="shutterstock-login"
    5252                type="button"
    5353                value="' . esc_attr($atts['context']['no_value_button_text']) . '"
  • shutterstock/tags/1.3.5/admin/partials/shutterstock-admin-field-user-settings.php

    r2466651 r2519174  
    1818
    1919?>
    20 <table class="user-settings-table">
     20<table class="shutterstock-user-settings-table">
    2121    <thead>
    2222      <th><?php echo esc_html_e('wordpress:text_user_type', 'shutterstock') ?></th>
  • shutterstock/tags/1.3.5/admin/shutterstock-media-page/index.asset.php

    r2463623 r2519174  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'a12dd5a3fd2c760ed1eba6a1d1411b29');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'ad1fbcbe1ae62bfc0fe883dd43a5fba6');
  • shutterstock/tags/1.3.5/admin/shutterstock-media-page/index.css

    r2463623 r2519174  
    1 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPg0KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiIHN0cm9rZS13aWR0aD0iMiI+DQogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+DQogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPg0KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtDQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSINCiAgICAgICAgICAgICAgICAgICAgdHlwZT0icm90YXRlIg0KICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICBkdXI9IjFzIg0KICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPg0KICAgICAgICAgICAgPC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
     1.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    22
    33.components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
  • shutterstock/tags/1.3.5/admin/shutterstock-media-page/index.js

    r2463623 r2519174  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,r){var n=r(11),o=r(12),i=r(13),c=r(15);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(n=(c=s.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(e,t,r){var n=r(14);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(8),i=r.n(o),c=r(2),s=r.n(c),a=r(5),u=r.n(a),l=r(4),p=r.n(l),g=r(7),d=r.n(g),b=r(1),m=r(6),f=r.n(m),I=r(3),y=r(9);r(16);var w="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9ImRvd25sb2FkLWNvbXAiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4NCiAgICAgICAgPC9nPg0KICAgIDwvZz4NCjwvc3ZnPg==";function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(){var e=u()(s.a.mark((function e(t){var r,n,o,i,c,a,u,l,g,b=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,f()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return c=e.sent,e.next=8,f()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,l=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return v(v({},e),{},p()({},n,o))}),{}),g=c.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return v(v({},e),{},{details_for_image:v({},l["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(l||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return v(v({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=u()(s.a.mark((function e(){var t,r,n,o=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,f()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),C=j;function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=function(e){var t=e.timeout,r=void 0===t?5e3:t,o=e.onRemoveSnackbar,i=Object(n.useState)({show:!1,text:""}),c=d()(i,2),s=c[0],a=c[1];return Object(n.useEffect)((function(){var e=setTimeout((function(){a(M(M({},s),{},{show:!1,text:""})),o&&o()}),r);return function(){return clearTimeout(e)}}),[s.show]),{snackbar:s,setSnackbar:a}},x=r(10),k=(r(17),function(e){var t=e.text;return t&&Object(n.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(n.createElement)(x.Snackbar,null,"Shutterstock: ",t))});function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[_(_({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIGZpbGw9IiMzRjYwNzgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8c3R5bGU+DQogICAgICAgIHBhdGggew0KICAgICAgICAgICAgZmlsbDogYmxhY2s7DQogICAgICAgIH0NCiAgICA8L3N0eWxlPg0KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+DQogICAgICAgICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiPjwvcmVjdD4NCiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNSwyMCBMMTUsMjIgTDksMjIgTDksMjAgTDE1LDIwIFogTTcsMjAgTDcsMjIgTDIsMjIgTDIsMjAgTDcsMjAgWiBNMjIsMjAgTDIyLDIyIEwxNywyMiBMMTcsMjAgTDIyLDIwIFogTTEzLDIgTDEzLDE0LjIgTDE3LjMsOS45IEwxOC43LDExLjMgTDEyLDE4IEw1LjMsMTEuMyBMNi43LDkuOSBMMTEsMTQuMiBMMTEsMiBMMTMsMiBaIiBpZD0iU2hhcGUiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+"})],assetInfo:t}}};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(){var e=u()(s.a.mark((function e(t,r){var n,o,i,c,a,u,l,p,g,d,b,m,y,w,h,v,j,O,C,L;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,o=r.licenseId,i=r.size,c=r.setAttributes,a=r.closeModal,u=r.handleError,l=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(I.__)("wordpress:downloading_image","shutterstock")),d=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,b="",!d){e.next=10;break}return e.next=8,f()({path:"shutterstock/contributor/".concat(d)});case 8:w=e.sent,b=(null==w||null===(m=w.data)||void 0===m||null===(y=m[0])||void 0===y?void 0:y.display_name)||d;case 10:return e.next=12,f()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return h=e.sent,v=h.assets,e.next=16,f()({path:"shutterstock/images/licenses/".concat(o,"/downloads"),method:"POST",contentType:"application/json",data:A({mediaType:"images",size:i,contributorName:b,imageId:t.id,description:t.description},null==v?void 0:v["".concat(i,"_jpg")])});case 16:(null==(j=e.sent)?void 0:j.success)?(O=j.data,C=O.url,L=O.id,l?l&&p(Object(I.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:A(A({},t),{},{licensedImageUrl:C,contributorName:b,uploadedImageId:L})}),a()),n(!1)):u(j),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),u(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var G=function(e){var t,r=e.closeModal,n=e.handleError,o=e.isMediaPage,i=e.routesConfig,c=e.setAttributes,a=e.showSnackbar,l=e.toggleOverlay,p=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;i[0].props=N(N({},i[0].props),{},{assetInfo:e}),p.current.updateRoutes({routesConfig:i}),p.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(I.__)(o?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:w,onClick:function(e,t,i){e.preventDefault(),T(t,N(N({},i),{},{toggleOverlay:l,handleError:n,isMediaPage:o,setAttributes:c,showSnackbar:a,closeModal:r}))}}]}}};function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.assetInfo,n=e.closeModal,o=e.commonLicensingProps,i=e.handleError,c=e.isMediaPage,a=e.setAttributes,l=e.showSnackbar,p=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[z(z({},o),{},{onClick:(t=u()(s.a.mark((function e(t,r,o){var u,p,d,b,m,y,w,h,v,j,O,C,L,M;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=o.subscription,e.prev=1,g(!0,Object(I.__)("wordpress:text_licensing_image_please_wait","shutterstock")),b=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,m=null==r?void 0:r.media_type,w=(y="editorial"===m)?null==r?void 0:r.byline:"",!b||y){e.next=12;break}return e.next=10,f()({path:"shutterstock/contributor/".concat(b)});case 10:j=e.sent,w=(null==j||null===(h=j.data)||void 0===h||null===(v=h[0])||void 0===v?void 0:v.display_name)||b;case 12:return e.next=14,f()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:z(z(z({subscription_id:null==u?void 0:u.id,size:null==u?void 0:u.size,id:r.id,description:r.description},(null==u?void 0:u.metadata)?{metadata:u.metadata}:{}),{},{contributorName:w},null==u?void 0:u.details_for_image),{},{mediaType:m,license:null==u?void 0:u.license,country:null===(d=shutterstock)||void 0===d?void 0:d.country,search_id:r.searchId})});case 14:(null==(O=e.sent)?void 0:O.success)?(C=O.data,L=C.url,M=C.id,c?c&&l(Object(I.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:z(z({},r),{},{licensedImageUrl:L,contributorName:w,uploadedImageId:M})}),n()),g(!1)):i(O),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),i(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:p}}};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=/<\/?[a-z][^>]*?>/gi,J=/\r?\n|\r/gi,F=function(e){var t,r,o,c=e.setAttributes,a=e.closeModal,l=e.canLicense,p=void 0!==l&&l,g=e.assetInfo,m=void 0===g?{}:g,f=e.licenseImage,h=void 0!==f&&f,v=e.subscriptions,j=void 0===v?[]:v,L=e.isMediaPage,M=void 0!==L&&L,x=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),P=Object(b.useRef)(),_=Object(b.useState)({show:!1,text:""}),S=d()(_,2),A=S[0],T=S[1],Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return T(H(H({},A),{},{show:e,text:t}))},N=D({timeout:5e3}),B=N.snackbar,z=N.setSnackbar,W=function(e){return z(H(H({},B),{},{show:!0,text:e}))},F=function(e){var t,r,n,o=Object(I.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(o=null==e||null===(n=e.data)||void 0===n?void 0:n.message);W(o),Z(!1)},U={label:Object(I.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),c({img:t}),a()}},Y=M?[]:[H(H({},U),{},{icon:w})],X=[E({assetInfo:m,commonInsertPreviewProps:U,isMediaPage:M})];if(p){var V={label:Object(I.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5zaG9wcGluZy1jYXJ0PC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9InNob3BwaW5nLWNhcnQiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+DQogICAgICAgIDwvZz4NCiAgICA8L2c+DQo8L3N2Zz4=",isPrimary:!0,onClick:(o=u()(s.a.mark((function e(t,r,n){var o,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,o=r.media_type,Z(!0,Object(I.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,C(r.id,o);case 6:i=e.sent,X[1].props=H(H({},X[1].props),{},{assetInfo:r,subscriptions:i,searchId:r.searchId}),P.current.updateRoutes({routesConfig:X}),P.current.toggleLoadingIndicator(!1),Z(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),P.current.toggleLoadingIndicator(!1),Z(!1),F(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return o.apply(this,arguments)})};Y.push(H({},V)),X[0].props.buttons.push(H({},V)),X.push(R({assetInfo:m,closeModal:a,commonLicensingProps:V,handleError:F,isMediaPage:M,setAttributes:c,showSnackbar:W,subscriptions:j,toggleOverlay:Z}),G({closeModal:a,handleError:F,isMediaPage:M,routesConfig:X,setAttributes:c,showSnackbar:W,toggleOverlay:Z,widgetRef:P}))}Object(b.useEffect)((function(){var e,t,r,n,o=[{label:Object(I.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(I.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],c=H({mediaType:"images",imageType:["photo"],subtitle:"",container:P.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),X[0].props=H(H({},X[0].props),{},{assetInfo:t}),P.current.updateRoutes({routesConfig:X}),P.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:H(H({},h?{initialRoute:"/license/images/".concat(m.id)}:{}),{},{routesConfig:X,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:Y,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:H({showFilterDrawer:!0,images:{orientationFilter:!0}},x?{searchBarDropdownFilters:o}:{})},M?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(y.__unstableStripHTML)("".concat(e," ").concat(t)).replace(Q,"").replace(J,"").trim()}},title:Object(I.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":i()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(c);s.search({query:""}),P.current=s}}),[]);var K=M?"media-page":"";return Object(n.createElement)(n.Fragment,null,p&&Object(n.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(A.show?"disabled":""," ").concat(K)},Object(n.createElement)("a",{onClick:function(e,t){P.current.getHistory().push("/")}},Object(I.__)("wordpress:text_home","shutterstock")),Object(n.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Z(!0,Object(I.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,O("images");case 4:r=e.sent,X[2].props=H(H({},X[2].props),{},{licenseHistory:r}),P.current.updateRoutes({routesConfig:X}),P.current.toggleLoadingIndicator(!1),Z(!1),P.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),P.current.toggleLoadingIndicator(!1),Z(!1),F(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(I.__)("wordpress:text_downloads","shutterstock"))),Object(n.createElement)("div",{ref:P,className:"components-shutterstock-ui__widget-container ".concat(K)}),A.show&&Object(n.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(K)},A.text&&Object(n.createElement)("div",{className:"text"},A.text)),B.show&&Object(n.createElement)(k,{text:B.text}))},U=(r(18),function(){return Object(n.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(n.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(n.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737\r 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789\r 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737\r 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632\r 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211\r 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316\r 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947\r 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737\r 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474\r 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632\r 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053\r 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579\r C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26\r 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421\r 107.280323,15.2791053 104.443726,14.7782632"}),Object(n.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263\r L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526\r L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947\r 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737\r L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737\r 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526\r L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(n.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474\r 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632\r 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316\r 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368\r C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26\r 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158\r C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211\r C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895\r L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(n.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263\r 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526\r 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789\r 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947\r 162.551046 15.5438947"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__o"},Object(n.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158\r 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053\r L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421\r 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(n.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474\r 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579\r L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105\r 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(n.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526\r L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737\r 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737\r L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947\r 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526\r L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737\r 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737\r L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947\r 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526\r L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263\r L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263\r L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316\r L64.1032319,7.30805263"}),Object(n.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263\r 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316\r L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579\r C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158\r C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421\r L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421\r C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(n.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263\r 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579\r 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263\r L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26\r C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263\r L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(n.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737\r 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789\r 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737\r 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632\r 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211\r 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316\r 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947\r 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737\r 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474\r 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632\r 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053\r 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579\r C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26\r 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421\r 11.573289,15.2791053 8.73802281,14.7782632"}),Object(n.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474\r C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263\r C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211\r L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789\r 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474\r 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158\r C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26\r 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895\r C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282\r C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789\r L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579\r L84.148384,13.2531579 Z"}),Object(n.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947\r L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053\r 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526\r 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947\r 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474\r 86.5764259,10.0613158 86.5764259,13.26"}))))});r(19);window.onload=function(){Object(n.render)(Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"components-shutterstock-media-page__logo"},Object(n.createElement)(U,null)),Object(n.createElement)(F,{isMediaPage:!0,canLicense:!0})),document.getElementById("shutterstock-widget"))}}]);
     1!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,r){var n=r(11),o=r(12),i=r(13),c=r(15);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(n=(c=s.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(e,t,r){var n=r(14);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(8),i=r.n(o),c=r(2),s=r.n(c),a=r(5),u=r.n(a),l=r(4),p=r.n(l),g=r(7),d=r.n(g),b=r(1),m=r(6),I=r.n(m),f=r(3),y=r(9);r(16);var w="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){var e=u()(s.a.mark((function e(t){var r,n,o,i,c,a,u,l,g,b=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,I()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return c=e.sent,e.next=8,I()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,l=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return h(h({},e),{},p()({},n,o))}),{}),g=c.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return h(h({},e),{},{details_for_image:h({},l["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(l||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return h(h({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=u()(s.a.mark((function e(){var t,r,n,o=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,I()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),j=O;function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=function(e){var t=e.timeout,r=void 0===t?5e3:t,o=e.onRemoveSnackbar,i=Object(n.useState)({show:!1,text:""}),c=d()(i,2),s=c[0],a=c[1];return Object(n.useEffect)((function(){var e=setTimeout((function(){a(M(M({},s),{},{show:!1,text:""})),o&&o()}),r);return function(){return clearTimeout(e)}}),[s.show]),{snackbar:s,setSnackbar:a}},D=r(10),P=(r(17),function(e){var t=e.text;return t&&Object(n.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(n.createElement)(D.Snackbar,null,"Shutterstock: ",t))});function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[E(E({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],assetInfo:t}}};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Z=function(){var e=u()(s.a.mark((function e(t,r){var n,o,i,c,a,u,l,p,g,d,b,m,y,w,v,h,O,C,j,L;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,o=r.licenseId,i=r.size,c=r.setAttributes,a=r.closeModal,u=r.handleError,l=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(f.__)("wordpress:downloading_image","shutterstock")),d=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,b="",!d){e.next=10;break}return e.next=8,I()({path:"shutterstock/contributor/".concat(d)});case 8:w=e.sent,b=(null==w||null===(m=w.data)||void 0===m||null===(y=m[0])||void 0===y?void 0:y.display_name)||d;case 10:return e.next=12,I()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return v=e.sent,h=v.assets,e.next=16,I()({path:"shutterstock/images/licenses/".concat(o,"/downloads"),method:"POST",contentType:"application/json",data:A({mediaType:"images",size:i,contributorName:b,imageId:t.id,description:t.description},null==h?void 0:h["".concat(i,"_jpg")])});case 16:(null==(O=e.sent)?void 0:O.success)?(C=O.data,j=C.url,L=C.id,l?l&&p(Object(f.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:A(A({},t),{},{licensedImageUrl:j,contributorName:b,uploadedImageId:L})}),a()),n(!1)):u(O),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),u(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var G=function(e){var t,r=e.closeModal,n=e.handleError,o=e.isMediaPage,i=e.routesConfig,c=e.setAttributes,a=e.showSnackbar,l=e.toggleOverlay,p=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;i[0].props=N(N({},i[0].props),{},{assetInfo:e}),p.current.updateRoutes({routesConfig:i}),p.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(f.__)(o?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:w,onClick:function(e,t,i){e.preventDefault(),Z(t,N(N({},i),{},{toggleOverlay:l,handleError:n,isMediaPage:o,setAttributes:c,showSnackbar:a,closeModal:r}))}}]}}};function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t,r=e.assetInfo,n=e.closeModal,o=e.commonLicensingProps,i=e.handleError,c=e.isMediaPage,a=e.setAttributes,l=e.showSnackbar,p=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[W(W({},o),{},{onClick:(t=u()(s.a.mark((function e(t,r,o){var u,p,d,b,m,y,w,v,h,O,C,j,L,M;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=o.subscription,e.prev=1,g(!0,Object(f.__)("wordpress:text_licensing_image_please_wait","shutterstock")),b=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,m=null==r?void 0:r.media_type,w=(y="editorial"===m)?null==r?void 0:r.byline:"",!b||y){e.next=12;break}return e.next=10,I()({path:"shutterstock/contributor/".concat(b)});case 10:O=e.sent,w=(null==O||null===(v=O.data)||void 0===v||null===(h=v[0])||void 0===h?void 0:h.display_name)||b;case 12:return e.next=14,I()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:W(W(W({subscription_id:null==u?void 0:u.id,size:null==u?void 0:u.size,id:r.id,description:r.description},(null==u?void 0:u.metadata)?{metadata:u.metadata}:{}),{},{contributorName:w},null==u?void 0:u.details_for_image),{},{mediaType:m,license:null==u?void 0:u.license,country:null===(d=shutterstock)||void 0===d?void 0:d.country,search_id:r.searchId})});case 14:(null==(C=e.sent)?void 0:C.success)?(j=C.data,L=j.url,M=j.id,c?c&&l(Object(f.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:W(W({},r),{},{licensedImageUrl:L,contributorName:w,uploadedImageId:M})}),n()),g(!1)):i(C),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),i(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:p}}};function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var U=/<\/?[a-z][^>]*?>/gi,F=/\r?\n|\r/gi,J=function(e){var t,r,o,c=e.setAttributes,a=e.closeModal,l=e.canLicense,p=void 0!==l&&l,g=e.assetInfo,m=void 0===g?{}:g,I=e.licenseImage,v=void 0!==I&&I,h=e.subscriptions,O=void 0===h?[]:h,L=e.isMediaPage,M=void 0!==L&&L,D=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),k=Object(b.useRef)(),E=Object(b.useState)({show:!1,text:""}),S=d()(E,2),A=S[0],Z=S[1],T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Z(R(R({},A),{},{show:e,text:t}))},N=x({timeout:5e3}),B=N.snackbar,W=N.setSnackbar,H=function(e){return W(R(R({},B),{},{show:!0,text:e}))},J=function(e){var t,r,n,o=Object(f.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(o=null==e||null===(n=e.data)||void 0===n?void 0:n.message);H(o),T(!1)},Q={label:Object(f.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),c({img:t}),a()}},V=M?[]:[R(R({},Q),{},{icon:w})],Y=[_({assetInfo:m,commonInsertPreviewProps:Q,isMediaPage:M})];if(p){var K={label:Object(f.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(o=u()(s.a.mark((function e(t,r,n){var o,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,o=r.media_type,T(!0,Object(f.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,j(r.id,o);case 6:i=e.sent,Y[1].props=R(R({},Y[1].props),{},{assetInfo:r,subscriptions:i,searchId:r.searchId}),k.current.updateRoutes({routesConfig:Y}),k.current.toggleLoadingIndicator(!1),T(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),k.current.toggleLoadingIndicator(!1),T(!1),J(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return o.apply(this,arguments)})};V.push(R({},K)),Y[0].props.buttons.push(R({},K)),Y.push(z({assetInfo:m,closeModal:a,commonLicensingProps:K,handleError:J,isMediaPage:M,setAttributes:c,showSnackbar:H,subscriptions:O,toggleOverlay:T}),G({closeModal:a,handleError:J,isMediaPage:M,routesConfig:Y,setAttributes:c,showSnackbar:H,toggleOverlay:T,widgetRef:k}))}Object(b.useEffect)((function(){var e,t,r,n,o=[{label:Object(f.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(f.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],c=R({mediaType:"images",imageType:["photo"],subtitle:"",container:k.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),Y[0].props=R(R({},Y[0].props),{},{assetInfo:t}),k.current.updateRoutes({routesConfig:Y}),k.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:R(R({},v?{initialRoute:"/license/images/".concat(m.id)}:{}),{},{routesConfig:Y,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:V,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:R({showFilterDrawer:!0,images:{orientationFilter:!0}},D?{searchBarDropdownFilters:o}:{})},M?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(y.__unstableStripHTML)("".concat(e," ").concat(t)).replace(U,"").replace(F,"").trim()}},title:Object(f.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":i()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(c);s.search({query:""}),k.current=s}}),[]);var X=M?"media-page":"";return Object(n.createElement)(n.Fragment,null,p&&Object(n.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(A.show?"disabled":""," ").concat(X)},Object(n.createElement)("a",{onClick:function(e,t){k.current.getHistory().push("/")}},Object(f.__)("wordpress:text_home","shutterstock")),Object(n.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,T(!0,Object(f.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,C("images");case 4:r=e.sent,Y[2].props=R(R({},Y[2].props),{},{licenseHistory:r}),k.current.updateRoutes({routesConfig:Y}),k.current.toggleLoadingIndicator(!1),T(!1),k.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),k.current.toggleLoadingIndicator(!1),T(!1),J(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(f.__)("wordpress:text_downloads","shutterstock"))),Object(n.createElement)("div",{ref:k,className:"components-shutterstock-ui__widget-container ".concat(X)}),A.show&&Object(n.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(X)},A.text&&Object(n.createElement)("div",{className:"text"},A.text)),B.show&&Object(n.createElement)(P,{text:B.text}))},Q=(r(18),function(){return Object(n.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(n.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(n.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(n.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(n.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(n.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__o"},Object(n.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(n.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(n.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(n.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(n.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(n.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(n.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(n.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))});r(19);window.onload=function(){Object(n.render)(Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"components-shutterstock-media-page__logo"},Object(n.createElement)(Q,null)),Object(n.createElement)(J,{isMediaPage:!0,canLicense:!0})),document.getElementById("shutterstock-widget"))}}]);
  • shutterstock/tags/1.3.5/includes/class-shutterstock.php

    r2469573 r2519174  
    7171            $this->version = SHUTTERSTOCK_VERSION;
    7272        } else {
    73             $this->version = '1.3.4';
     73            $this->version = '1.3.5';
    7474        }
    7575        $this->shutterstock = 'shutterstock';
  • shutterstock/tags/1.3.5/public/shutterstock-block/build/index.asset.php

    r2464382 r2519174  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'bfe06f10ff22ac5a49cc33160d929da0');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f82a7a3f573966b77006471e908ebd58');
  • shutterstock/tags/1.3.5/public/shutterstock-block/build/index.css

    r2466651 r2519174  
    1 .wp-block-shutterstock-shutterstock-block{border:1px solid;padding:1em;background:#ffffff;clear:both}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-size:18pt;font-weight:400;vertical-align:middle;margin-left:18px;font-family:"Roboto",sans-serif}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{width:30px;height:30px;display:inline-block;vertical-align:middle;margin-left:-5px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{position:absolute;height:40px;background:#f54336;border-radius:20px;color:white;font-size:13px;font-family:'Roboto';font-weight:bold;bottom:0;right:0;margin-bottom:60px;margin-right:15px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,0.8);color:rgba(255,255,255,0.5);opacity:0.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{width:25px;overflow:hidden;height:20px;background-position:center center;background-repeat:no-repeat;background-size:15px 15px;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPg0KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiIHN0cm9rZS13aWR0aD0iMiI+DQogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+DQogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPg0KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtDQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSINCiAgICAgICAgICAgICAgICAgICAgdHlwZT0icm90YXRlIg0KICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICBkdXI9IjFzIg0KICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPg0KICAgICAgICAgICAgPC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);margin-right:2px}
     1.wp-block-shutterstock-shutterstock-block{border:1px solid;padding:1em;background:#ffffff;clear:both}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-size:18pt;font-weight:400;vertical-align:middle;margin-left:18px;font-family:"Roboto",sans-serif}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{width:30px;height:30px;display:inline-block;vertical-align:middle;margin-left:-5px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{position:absolute;height:40px;background:#f54336;border-radius:20px;color:white;font-size:13px;font-family:'Roboto';font-weight:bold;bottom:0;right:0;margin-bottom:60px;margin-right:15px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,0.8);color:rgba(255,255,255,0.5);opacity:0.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{width:25px;overflow:hidden;height:20px;background-position:center center;background-repeat:no-repeat;background-size:15px 15px;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);margin-right:2px}
    22
    33.components-shutterstock-icon{width:30px;height:30px}.components-shutterstock-icon__rectangle{fill:#ffffff}
    44
    5 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPg0KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiIHN0cm9rZS13aWR0aD0iMiI+DQogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+DQogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPg0KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtDQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSINCiAgICAgICAgICAgICAgICAgICAgdHlwZT0icm90YXRlIg0KICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICBkdXI9IjFzIg0KICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPg0KICAgICAgICAgICAgPC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
     5.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    66
    77.components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
  • shutterstock/tags/1.3.5/public/shutterstock-block/build/index.js

    r2464382 r2519174  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(13),o=r(14),i=r(15),c=r(17);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(n=(c=s.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(e,t,r){var n=r(16);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(9),o=r(1),i=r(2),c=r.n(i),s=r(5),a=r.n(s),u=r(4),l=r.n(u),d=r(6),p=r.n(d),g=r(0),b=r(8),m=r(10),f=(r(18),r(3)),v=(r(19),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},Object(g.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),Object(g.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),Object(g.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"}))}),I=r(11),h=r.n(I),y=r(7),w=r.n(y),j=r(12);r(20);var O="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9ImRvd25sb2FkLWNvbXAiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4NCiAgICAgICAgPC9nPg0KICAgIDwvZz4NCjwvc3ZnPg==";function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _=function(){var e=a()(c.a.mark((function e(t){var r,n,o,i,s,a,u,d,g,b=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,w()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return s=e.sent,e.next=8,w()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,d=Object.entries(u).filter((function(e){var t=p()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=p()(t,2),n=r[0],o=r[1];return L(L({},e),{},l()({},n,o))}),{}),g=s.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return L(L({},e),{},{details_for_image:L({},d["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(d||{}).map((function(e){var t,r=p()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return L(L({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),M=function(){var e=a()(c.a.mark((function e(){var t,r,n,o=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,w()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),k=_;function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){var t=e.timeout,r=void 0===t?5e3:t,n=e.onRemoveSnackbar,o=Object(g.useState)({show:!1,text:""}),i=p()(o,2),c=i[0],s=i[1];return Object(g.useEffect)((function(){var e=setTimeout((function(){s(D(D({},c),{},{show:!1,text:""})),n&&n()}),r);return function(){return clearTimeout(e)}}),[c.show]),{snackbar:c,setSnackbar:s}},P=(r(21),function(e){var t=e.text;return t&&Object(g.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(g.createElement)(b.Snackbar,null,"Shutterstock: ",t))});function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[A(A({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIGZpbGw9IiMzRjYwNzgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8c3R5bGU+DQogICAgICAgIHBhdGggew0KICAgICAgICAgICAgZmlsbDogYmxhY2s7DQogICAgICAgIH0NCiAgICA8L3N0eWxlPg0KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+DQogICAgICAgICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiPjwvcmVjdD4NCiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNSwyMCBMMTUsMjIgTDksMjIgTDksMjAgTDE1LDIwIFogTTcsMjAgTDcsMjIgTDIsMjIgTDIsMjAgTDcsMjAgWiBNMjIsMjAgTDIyLDIyIEwxNywyMiBMMTcsMjAgTDIyLDIwIFogTTEzLDIgTDEzLDE0LjIgTDE3LjMsOS45IEwxOC43LDExLjMgTDEyLDE4IEw1LjMsMTEuMyBMNi43LDkuOSBMMTEsMTQuMiBMMTEsMiBMMTMsMiBaIiBpZD0iU2hhcGUiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+"})],assetInfo:t}}};function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(){var e=a()(c.a.mark((function e(t,r){var n,i,s,a,u,l,d,p,g,b,m,f,v,I,h,y,j,O,C,L;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,i=r.licenseId,s=r.size,a=r.setAttributes,u=r.closeModal,l=r.handleError,d=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(o.__)("wordpress:downloading_image","shutterstock")),b=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,m="",!b){e.next=10;break}return e.next=8,w()({path:"shutterstock/contributor/".concat(b)});case 8:I=e.sent,m=(null==I||null===(f=I.data)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.display_name)||b;case 10:return e.next=12,w()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return h=e.sent,y=h.assets,e.next=16,w()({path:"shutterstock/images/licenses/".concat(i,"/downloads"),method:"POST",contentType:"application/json",data:Z({mediaType:"images",size:s,contributorName:m,imageId:t.id,description:t.description},null==y?void 0:y["".concat(s,"_jpg")])});case 16:(null==(j=e.sent)?void 0:j.success)?(O=j.data,C=O.url,L=O.id,d?d&&p(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:Z(Z({},t),{},{licensedImageUrl:C,contributorName:m,uploadedImageId:L})}),u()),n(!1)):l(j),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),l(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.closeModal,n=e.handleError,i=e.isMediaPage,s=e.routesConfig,u=e.setAttributes,l=e.showSnackbar,d=e.toggleOverlay,p=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;s[0].props=z(z({},s[0].props),{},{assetInfo:e}),p.current.updateRoutes({routesConfig:s}),p.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=a()(c.a.mark((function e(t){var r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(o.__)(i?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:O,onClick:function(e,t,o){e.preventDefault(),B(t,z(z({},o),{},{toggleOverlay:d,handleError:n,isMediaPage:i,setAttributes:u,showSnackbar:l,closeModal:r}))}}]}}};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=function(e){var t,r=e.assetInfo,n=e.closeModal,i=e.commonLicensingProps,s=e.handleError,u=e.isMediaPage,l=e.setAttributes,d=e.showSnackbar,p=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[H(H({},i),{},{onClick:(t=a()(c.a.mark((function e(t,r,i){var a,p,b,m,f,v,I,h,y,j,O,C,L,_;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.subscription,e.prev=1,g(!0,Object(o.__)("wordpress:text_licensing_image_please_wait","shutterstock")),m=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,f=null==r?void 0:r.media_type,I=(v="editorial"===f)?null==r?void 0:r.byline:"",!m||v){e.next=12;break}return e.next=10,w()({path:"shutterstock/contributor/".concat(m)});case 10:j=e.sent,I=(null==j||null===(h=j.data)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.display_name)||m;case 12:return e.next=14,w()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:H(H(H({subscription_id:null==a?void 0:a.id,size:null==a?void 0:a.size,id:r.id,description:r.description},(null==a?void 0:a.metadata)?{metadata:a.metadata}:{}),{},{contributorName:I},null==a?void 0:a.details_for_image),{},{mediaType:f,license:null==a?void 0:a.license,country:null===(b=shutterstock)||void 0===b?void 0:b.country,search_id:r.searchId})});case 14:(null==(O=e.sent)?void 0:O.success)?(C=O.data,L=C.url,_=C.id,u?u&&d(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(l({img:H(H({},r),{},{licensedImageUrl:L,contributorName:I,uploadedImageId:_})}),n()),g(!1)):s(O),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),s(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:p}}};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=/<\/?[a-z][^>]*?>/gi,Y=/\r?\n|\r/gi,V=function(e){var t,r,n,i=e.setAttributes,s=e.closeModal,u=e.canLicense,l=void 0!==u&&u,d=e.assetInfo,b=void 0===d?{}:d,m=e.licenseImage,v=void 0!==m&&m,I=e.subscriptions,y=void 0===I?[]:I,w=e.isMediaPage,C=void 0!==w&&w,L=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),_=Object(f.useRef)(),x=Object(f.useState)({show:!1,text:""}),D=p()(x,2),S=D[0],A=D[1],N=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return A(U(U({},S),{},{show:e,text:t}))},Z=E({timeout:5e3}),B=Z.snackbar,G=Z.setSnackbar,z=function(e){return G(U(U({},B),{},{show:!0,text:e}))},W=function(e){var t,r,n,i=Object(o.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(i=null==e||null===(n=e.data)||void 0===n?void 0:n.message);z(i),N(!1)},H={label:Object(o.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),i({img:t}),s()}},J=C?[]:[U(U({},H),{},{icon:O})],V=[T({assetInfo:b,commonInsertPreviewProps:H,isMediaPage:C})];if(l){var X={label:Object(o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5zaG9wcGluZy1jYXJ0PC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9InNob3BwaW5nLWNhcnQiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+DQogICAgICAgIDwvZz4NCiAgICA8L2c+DQo8L3N2Zz4=",isPrimary:!0,onClick:(n=a()(c.a.mark((function e(t,r,n){var i,s;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,i=r.media_type,N(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,k(r.id,i);case 6:s=e.sent,V[1].props=U(U({},V[1].props),{},{assetInfo:r,subscriptions:s,searchId:r.searchId}),_.current.updateRoutes({routesConfig:V}),_.current.toggleLoadingIndicator(!1),N(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),_.current.toggleLoadingIndicator(!1),N(!1),W(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return n.apply(this,arguments)})};J.push(U({},X)),V[0].props.buttons.push(U({},X)),V.push(Q({assetInfo:b,closeModal:s,commonLicensingProps:X,handleError:W,isMediaPage:C,setAttributes:i,showSnackbar:z,subscriptions:y,toggleOverlay:N}),R({closeModal:s,handleError:W,isMediaPage:C,routesConfig:V,setAttributes:i,showSnackbar:z,toggleOverlay:N,widgetRef:_}))}Object(f.useEffect)((function(){var e,t,r,n,i=[{label:Object(o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],c=U({mediaType:"images",imageType:["photo"],subtitle:"",container:_.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),V[0].props=U(U({},V[0].props),{},{assetInfo:t}),_.current.updateRoutes({routesConfig:V}),_.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:U(U({},v?{initialRoute:"/license/images/".concat(b.id)}:{}),{},{routesConfig:V,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:J,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:U({showFilterDrawer:!0,images:{orientationFilter:!0}},L?{searchBarDropdownFilters:i}:{})},C?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(j.__unstableStripHTML)("".concat(e," ").concat(t)).replace(F,"").replace(Y,"").trim()}},title:Object(o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":h()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(c);s.search({query:""}),_.current=s}}),[]);var K=C?"media-page":"";return Object(g.createElement)(g.Fragment,null,l&&Object(g.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(S.show?"disabled":""," ").concat(K)},Object(g.createElement)("a",{onClick:function(e,t){_.current.getHistory().push("/")}},Object(o.__)("wordpress:text_home","shutterstock")),Object(g.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=a()(c.a.mark((function e(t){var r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,M("images");case 4:r=e.sent,V[2].props=U(U({},V[2].props),{},{licenseHistory:r}),_.current.updateRoutes({routesConfig:V}),_.current.toggleLoadingIndicator(!1),N(!1),_.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),_.current.toggleLoadingIndicator(!1),N(!1),W(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(o.__)("wordpress:text_downloads","shutterstock"))),Object(g.createElement)("div",{ref:_,className:"components-shutterstock-ui__widget-container ".concat(K)}),S.show&&Object(g.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(K)},S.text&&Object(g.createElement)("div",{className:"text"},S.text)),B.show&&Object(g.createElement)(P,{text:B.text}))},X=(r(22),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(g.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(g.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(g.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737\r 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789\r 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737\r 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632\r 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211\r 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316\r 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947\r 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737\r 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474\r 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632\r 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053\r 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579\r C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26\r 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421\r 107.280323,15.2791053 104.443726,14.7782632"}),Object(g.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263\r L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526\r L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947\r 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737\r L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737\r 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526\r L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(g.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474\r 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632\r 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316\r 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368\r C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26\r 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158\r C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211\r C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895\r L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(g.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263\r 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526\r 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789\r 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947\r 162.551046 15.5438947"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__o"},Object(g.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158\r 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053\r L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421\r 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(g.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474\r 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579\r L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105\r 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(g.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526\r L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737\r 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737\r L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947\r 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526\r L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737\r 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737\r L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947\r 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526\r L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263\r L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263\r L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316\r L64.1032319,7.30805263"}),Object(g.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263\r 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316\r L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579\r C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158\r C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421\r L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421\r C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(g.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263\r 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579\r 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263\r L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26\r C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263\r L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(g.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737\r 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789\r 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737\r 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632\r 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211\r 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316\r 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947\r 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737\r 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474\r 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632\r 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053\r 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579\r C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26\r 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421\r 11.573289,15.2791053 8.73802281,14.7782632"}),Object(g.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474\r C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263\r C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211\r L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789\r 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474\r 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158\r C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26\r 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895\r C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282\r C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789\r L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579\r L84.148384,13.2531579 Z"}),Object(g.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947\r L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053\r 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526\r 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947\r 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474\r 86.5764259,10.0613158 86.5764259,13.26"}))))}),K=(r(23),function(e){var t=e.setAttributes,r=e.closeModal,n=e.canLicense,o=e.assetInfo,i=e.licenseImage,c=e.subscriptions;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(b.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:Object(g.createElement)(X,null),onRequestClose:r},Object(g.createElement)("div",{style:{width:"100%"}},Object(g.createElement)(V,{setAttributes:t,closeModal:r,canLicense:n,assetInfo:o,licenseImage:i,subscriptions:c}))))});function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=Object(m.withDispatch)((function(e){return{replaceBlock:e("core/block-editor").replaceBlock}}))((function(e){var t,r,i,s,u,l,d,m,f,I,h,y,w=Object(g.useState)(!1),j=p()(w,2),O=j[0],C=j[1],L=Object(g.useState)(!1),_=p()(L,2),M=_[0],x=_[1],D=Object(g.useState)(!1),S=p()(D,2),A=S[0],T=S[1],N=Object(g.useState)(!1),Z=p()(N,2),B=Z[0],G=Z[1],z=Object(g.useState)([]),R=p()(z,2),W=R[0],H=R[1],Q=function(){return C(!0)},J=(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.media_type)||"image",U="editorial"===J,F=shutterstock.permissions,Y=void 0===F?{}:F,V=Y.includes("can_user_license_all_shutterstock_images"),X=Y.includes("can_user_license_shutterstock_editorial_image"),q=Y.includes("can_user_license_shutterstock_photos"),ee=!1;(V||U&&X||!U&&q)&&(ee=!0);var te=function(e){x(e),G(e)},re=E({onRemoveSnackbar:function(){return te(!1)}}),ne=re.snackbar,oe=re.setSnackbar;return Object(g.useEffect)((function(){var t,r;if(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl){var o=e.attributes.img,i=o.licensedImageUrl,c=o.contributorName,s=o.uploadedImageId,a=o.description,u=Object(n.createBlock)("core/image",{url:i,id:s,caption:"Image: ".concat(c,", Shutterstock"),alt:a,align:"center"});e.replaceBlock(e.clientId,u)}}),[null===(i=e.attributes)||void 0===i||null===(s=i.img)||void 0===s?void 0:s.licensedImageUrl]),Object(g.createElement)("div",{className:e.className},Object(g.createElement)("div",null,Object(g.createElement)("span",{className:"components-edit__shutterstock-icon"},Object(g.createElement)(v,null)),Object(g.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?Object(g.createElement)("div",{className:"components-edit__image-container"},Object(g.createElement)("img",{src:(null===(u=e.attributes)||void 0===u||null===(l=u.img)||void 0===l?void 0:l.licensedImageUrl)||(null===(d=e.attributes)||void 0===d||null===(m=d.img)||void 0===m||null===(f=m.preview_1500)||void 0===f?void 0:f.url),onLoad:function(){return T(!0)}}),ee&&A&&!(null===(I=e.attributes)||void 0===I||null===(h=I.img)||void 0===h?void 0:h.licensedImageUrl)&&Object(g.createElement)(b.Button,{disabled:B,onClick:a()(c.a.mark((function t(){var r,n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,te(!0),t.next=4,k(null===(r=e.attributes)||void 0===r?void 0:r.img.id,J);case 4:n=t.sent,H(n),Q(),G(!1),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),i=t.t0,c=void 0,s=void 0,a=void 0,a=Object(o.__)("wordpress:text_something_went_wrong","shutterstock"),500!==(null==i||null===(c=i.data)||void 0===c?void 0:c.statusCode)&&(null==i||null===(s=i.data)||void 0===s?void 0:s.message)&&(a=i.data.message),oe($($({},ne),{},{show:!0,text:a}));case 13:case"end":return t.stop()}var i,c,s,a}),t,null,[[0,10]])}))),className:"components-edit__license-image-button"},B&&Object(g.createElement)("span",{className:"loading-spinner"}),Object(g.createElement)("span",null,Object(o.__)("wordpress:text_license_this_image","shutterstock")))):Object(g.createElement)("span",null),Object(g.createElement)("div",{className:"components-edit__paragraph"},Object(o.__)("wordpress:text_block_paragraph","shutterstock")),Object(g.createElement)(b.Button,{disabled:B,onClick:function(){Q(),x(!1)},className:"components-shutterstock-modal__open-modal-button "},Object(o.__)("wordpress:text_browse","shutterstock")),O&&Object(g.createElement)(K,{setAttributes:e.setAttributes,closeModal:function(){return C(!1)},canLicense:ee,assetInfo:null==e||null===(y=e.attributes)||void 0===y?void 0:y.img,licenseImage:M,subscriptions:W}),ne.show&&!O&&Object(g.createElement)(P,{text:ne.text}))}));Object(n.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:Object(o.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:v,supports:{html:!1},edit:ee,save:function(e){var t,r,n,i,c;return Object(g.createElement)("img",{alt:Object(o.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl)||(null===(n=e.attributes)||void 0===n||null===(i=n.img)||void 0===i||null===(c=i.preview_1500)||void 0===c?void 0:c.url)})},attributes:{img:{type:"object"}}})}]);
     1!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,c,i){try{var s=e[c](i),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var i=e.apply(t,n);function s(e){r(i,o,c,s,a,"next",e)}function a(e){r(i,o,c,s,a,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(13),o=r(14),c=r(15),i=r(17);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw c}}return r}}},function(e,t,r){var n=r(16);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(9),o=r(1),c=r(2),i=r.n(c),s=r(5),a=r.n(s),u=r(4),l=r.n(u),p=r(6),d=r.n(p),g=r(0),b=r(8),m=r(10),f=(r(18),r(3)),v=(r(19),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},Object(g.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),Object(g.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),Object(g.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"}))}),I=r(11),y=r.n(I),h=r(7),w=r.n(h),O=r(12);r(20);var j="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var L=function(){var e=a()(i.a.mark((function e(t){var r,n,o,c,s,a,u,p,g,b=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,c="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,w()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return s=e.sent,e.next=8,w()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(c)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,p=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return _(_({},e),{},l()({},n,o))}),{}),g=s.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return _(_({},e),{},{details_for_image:_({},p["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(p||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return _(_({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=a()(i.a.mark((function e(){var t,r,n,o=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,w()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=L;function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=function(e){var t=e.timeout,r=void 0===t?5e3:t,n=e.onRemoveSnackbar,o=Object(g.useState)({show:!1,text:""}),c=d()(o,2),i=c[0],s=c[1];return Object(g.useEffect)((function(){var e=setTimeout((function(){s(E(E({},i),{},{show:!1,text:""})),n&&n()}),r);return function(){return clearTimeout(e)}}),[i.show]),{snackbar:i,setSnackbar:s}},P=(r(21),function(e){var t=e.text;return t&&Object(g.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(g.createElement)(b.Snackbar,null,"Shutterstock: ",t))});function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[A(A({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],assetInfo:t}}};function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(){var e=a()(i.a.mark((function e(t,r){var n,c,s,a,u,l,p,d,g,b,m,f,v,I,y,h,O,j,C,_;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,c=r.licenseId,s=r.size,a=r.setAttributes,u=r.closeModal,l=r.handleError,p=r.isMediaPage,d=r.showSnackbar,e.prev=1,n(!0,Object(o.__)("wordpress:downloading_image","shutterstock")),b=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,m="",!b){e.next=10;break}return e.next=8,w()({path:"shutterstock/contributor/".concat(b)});case 8:I=e.sent,m=(null==I||null===(f=I.data)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.display_name)||b;case 10:return e.next=12,w()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return y=e.sent,h=y.assets,e.next=16,w()({path:"shutterstock/images/licenses/".concat(c,"/downloads"),method:"POST",contentType:"application/json",data:T({mediaType:"images",size:s,contributorName:m,imageId:t.id,description:t.description},null==h?void 0:h["".concat(s,"_jpg")])});case 16:(null==(O=e.sent)?void 0:O.success)?(j=O.data,C=j.url,_=j.id,p?p&&d(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:T(T({},t),{},{licensedImageUrl:C,contributorName:m,uploadedImageId:_})}),u()),n(!1)):l(O),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),l(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t,r=e.closeModal,n=e.handleError,c=e.isMediaPage,s=e.routesConfig,u=e.setAttributes,l=e.showSnackbar,p=e.toggleOverlay,d=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;s[0].props=W(W({},s[0].props),{},{assetInfo:e}),d.current.updateRoutes({routesConfig:s}),d.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(o.__)(c?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:j,onClick:function(e,t,o){e.preventDefault(),B(t,W(W({},o),{},{toggleOverlay:p,handleError:n,isMediaPage:c,setAttributes:u,showSnackbar:l,closeModal:r}))}}]}}};function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var U=function(e){var t,r=e.assetInfo,n=e.closeModal,c=e.commonLicensingProps,s=e.handleError,u=e.isMediaPage,l=e.setAttributes,p=e.showSnackbar,d=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[R(R({},c),{},{onClick:(t=a()(i.a.mark((function e(t,r,c){var a,d,b,m,f,v,I,y,h,O,j,C,_,L;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=c.subscription,e.prev=1,g(!0,Object(o.__)("wordpress:text_licensing_image_please_wait","shutterstock")),m=null==r||null===(d=r.contributor)||void 0===d?void 0:d.id,f=null==r?void 0:r.media_type,I=(v="editorial"===f)?null==r?void 0:r.byline:"",!m||v){e.next=12;break}return e.next=10,w()({path:"shutterstock/contributor/".concat(m)});case 10:O=e.sent,I=(null==O||null===(y=O.data)||void 0===y||null===(h=y[0])||void 0===h?void 0:h.display_name)||m;case 12:return e.next=14,w()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:R(R(R({subscription_id:null==a?void 0:a.id,size:null==a?void 0:a.size,id:r.id,description:r.description},(null==a?void 0:a.metadata)?{metadata:a.metadata}:{}),{},{contributorName:I},null==a?void 0:a.details_for_image),{},{mediaType:f,license:null==a?void 0:a.license,country:null===(b=shutterstock)||void 0===b?void 0:b.country,search_id:r.searchId})});case 14:(null==(j=e.sent)?void 0:j.success)?(C=j.data,_=C.url,L=C.id,u?u&&p(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(l({img:R(R({},r),{},{licensedImageUrl:_,contributorName:I,uploadedImageId:L})}),n()),g(!1)):s(j),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),s(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:d}}};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J=/<\/?[a-z][^>]*?>/gi,Q=/\r?\n|\r/gi,Y=function(e){var t,r,n,c=e.setAttributes,s=e.closeModal,u=e.canLicense,l=void 0!==u&&u,p=e.assetInfo,b=void 0===p?{}:p,m=e.licenseImage,v=void 0!==m&&m,I=e.subscriptions,h=void 0===I?[]:I,w=e.isMediaPage,C=void 0!==w&&w,_=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),L=Object(f.useRef)(),x=Object(f.useState)({show:!1,text:""}),E=d()(x,2),S=E[0],A=E[1],Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return A(V(V({},S),{},{show:e,text:t}))},T=D({timeout:5e3}),B=T.snackbar,G=T.setSnackbar,W=function(e){return G(V(V({},B),{},{show:!0,text:e}))},H=function(e){var t,r,n,c=Object(o.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(c=null==e||null===(n=e.data)||void 0===n?void 0:n.message);W(c),Z(!1)},R={label:Object(o.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),c({img:t}),s()}},F=C?[]:[V(V({},R),{},{icon:j})],Y=[N({assetInfo:b,commonInsertPreviewProps:R,isMediaPage:C})];if(l){var K={label:Object(o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(n=a()(i.a.mark((function e(t,r,n){var c,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,c=r.media_type,Z(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,M(r.id,c);case 6:s=e.sent,Y[1].props=V(V({},Y[1].props),{},{assetInfo:r,subscriptions:s,searchId:r.searchId}),L.current.updateRoutes({routesConfig:Y}),L.current.toggleLoadingIndicator(!1),Z(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),L.current.toggleLoadingIndicator(!1),Z(!1),H(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return n.apply(this,arguments)})};F.push(V({},K)),Y[0].props.buttons.push(V({},K)),Y.push(U({assetInfo:b,closeModal:s,commonLicensingProps:K,handleError:H,isMediaPage:C,setAttributes:c,showSnackbar:W,subscriptions:h,toggleOverlay:Z}),z({closeModal:s,handleError:H,isMediaPage:C,routesConfig:Y,setAttributes:c,showSnackbar:W,toggleOverlay:Z,widgetRef:L}))}Object(f.useEffect)((function(){var e,t,r,n,c=[{label:Object(o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],i=V({mediaType:"images",imageType:["photo"],subtitle:"",container:L.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),Y[0].props=V(V({},Y[0].props),{},{assetInfo:t}),L.current.updateRoutes({routesConfig:Y}),L.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:V(V({},v?{initialRoute:"/license/images/".concat(b.id)}:{}),{},{routesConfig:Y,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:F,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:V({showFilterDrawer:!0,images:{orientationFilter:!0}},_?{searchBarDropdownFilters:c}:{})},C?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(O.__unstableStripHTML)("".concat(e," ").concat(t)).replace(J,"").replace(Q,"").trim()}},title:Object(o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":y()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(i);s.search({query:""}),L.current=s}}),[]);var X=C?"media-page":"";return Object(g.createElement)(g.Fragment,null,l&&Object(g.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(S.show?"disabled":""," ").concat(X)},Object(g.createElement)("a",{onClick:function(e,t){L.current.getHistory().push("/")}},Object(o.__)("wordpress:text_home","shutterstock")),Object(g.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Z(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,k("images");case 4:r=e.sent,Y[2].props=V(V({},Y[2].props),{},{licenseHistory:r}),L.current.updateRoutes({routesConfig:Y}),L.current.toggleLoadingIndicator(!1),Z(!1),L.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),L.current.toggleLoadingIndicator(!1),Z(!1),H(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(o.__)("wordpress:text_downloads","shutterstock"))),Object(g.createElement)("div",{ref:L,className:"components-shutterstock-ui__widget-container ".concat(X)}),S.show&&Object(g.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(X)},S.text&&Object(g.createElement)("div",{className:"text"},S.text)),B.show&&Object(g.createElement)(P,{text:B.text}))},K=(r(22),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(g.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(g.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(g.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(g.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(g.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(g.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__o"},Object(g.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(g.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(g.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(g.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(g.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(g.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(g.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(g.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))}),X=(r(23),function(e){var t=e.setAttributes,r=e.closeModal,n=e.canLicense,o=e.assetInfo,c=e.licenseImage,i=e.subscriptions;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(b.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:Object(g.createElement)(K,null),onRequestClose:r},Object(g.createElement)("div",{style:{width:"100%"}},Object(g.createElement)(Y,{setAttributes:t,closeModal:r,canLicense:n,assetInfo:o,licenseImage:c,subscriptions:i}))))});function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=Object(m.withDispatch)((function(e){return{replaceBlock:e("core/block-editor").replaceBlock}}))((function(e){var t,r,c,s,u,l,p,m,f,I,y,h,w=Object(g.useState)(!1),O=d()(w,2),j=O[0],C=O[1],_=Object(g.useState)(!1),L=d()(_,2),k=L[0],x=L[1],E=Object(g.useState)(!1),S=d()(E,2),A=S[0],N=S[1],Z=Object(g.useState)(!1),T=d()(Z,2),B=T[0],G=T[1],W=Object(g.useState)([]),z=d()(W,2),H=z[0],R=z[1],U=function(){return C(!0)},F=(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.media_type)||"image",V="editorial"===F,J=shutterstock.permissions,Q=void 0===J?{}:J,Y=Q.includes("can_user_license_all_shutterstock_images"),K=Q.includes("can_user_license_shutterstock_editorial_image"),q=Q.includes("can_user_license_shutterstock_photos"),ee=!1;(Y||V&&K||!V&&q)&&(ee=!0);var te=function(e){x(e),G(e)},re=D({onRemoveSnackbar:function(){return te(!1)}}),ne=re.snackbar,oe=re.setSnackbar;return Object(g.useEffect)((function(){var t,r;if(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl){var o=e.attributes.img,c=o.licensedImageUrl,i=o.contributorName,s=o.uploadedImageId,a=o.description,u=Object(n.createBlock)("core/image",{url:c,id:s,caption:"Image: ".concat(i,", Shutterstock"),alt:a,align:"center"});e.replaceBlock(e.clientId,u)}}),[null===(c=e.attributes)||void 0===c||null===(s=c.img)||void 0===s?void 0:s.licensedImageUrl]),Object(g.createElement)("div",{className:e.className},Object(g.createElement)("div",null,Object(g.createElement)("span",{className:"components-edit__shutterstock-icon"},Object(g.createElement)(v,null)),Object(g.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?Object(g.createElement)("div",{className:"components-edit__image-container"},Object(g.createElement)("img",{src:(null===(u=e.attributes)||void 0===u||null===(l=u.img)||void 0===l?void 0:l.licensedImageUrl)||(null===(p=e.attributes)||void 0===p||null===(m=p.img)||void 0===m||null===(f=m.preview_1500)||void 0===f?void 0:f.url),onLoad:function(){return N(!0)}}),ee&&A&&!(null===(I=e.attributes)||void 0===I||null===(y=I.img)||void 0===y?void 0:y.licensedImageUrl)&&Object(g.createElement)(b.Button,{disabled:B,onClick:a()(i.a.mark((function t(){var r,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,te(!0),t.next=4,M(null===(r=e.attributes)||void 0===r?void 0:r.img.id,F);case 4:n=t.sent,R(n),U(),G(!1),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),c=t.t0,i=void 0,s=void 0,a=void 0,a=Object(o.__)("wordpress:text_something_went_wrong","shutterstock"),500!==(null==c||null===(i=c.data)||void 0===i?void 0:i.statusCode)&&(null==c||null===(s=c.data)||void 0===s?void 0:s.message)&&(a=c.data.message),oe($($({},ne),{},{show:!0,text:a}));case 13:case"end":return t.stop()}var c,i,s,a}),t,null,[[0,10]])}))),className:"components-edit__license-image-button"},B&&Object(g.createElement)("span",{className:"loading-spinner"}),Object(g.createElement)("span",null,Object(o.__)("wordpress:text_license_this_image","shutterstock")))):Object(g.createElement)("span",null),Object(g.createElement)("div",{className:"components-edit__paragraph"},Object(o.__)("wordpress:text_block_paragraph","shutterstock")),Object(g.createElement)(b.Button,{disabled:B,onClick:function(){U(),x(!1)},className:"components-shutterstock-modal__open-modal-button "},Object(o.__)("wordpress:text_browse","shutterstock")),j&&Object(g.createElement)(X,{setAttributes:e.setAttributes,closeModal:function(){return C(!1)},canLicense:ee,assetInfo:null==e||null===(h=e.attributes)||void 0===h?void 0:h.img,licenseImage:k,subscriptions:H}),ne.show&&!j&&Object(g.createElement)(P,{text:ne.text}))}));Object(n.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:Object(o.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:v,supports:{html:!1},edit:ee,save:function(e){var t,r,n,c,i;return Object(g.createElement)("img",{alt:Object(o.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl)||(null===(n=e.attributes)||void 0===n||null===(c=n.img)||void 0===c||null===(i=c.preview_1500)||void 0===i?void 0:i.url)})},attributes:{img:{type:"object"}}})}]);
  • shutterstock/tags/1.3.5/shutterstock.php

    r2469573 r2519174  
    1616 * Plugin Name:       Shutterstock
    1717 * Description:       Access exceptional, royalty-free content straight from WordPress.
    18  * Version:           1.3.4
     18 * Version:           1.3.5
    1919 * Author:            Shutterstock
    2020 * License:           MIT
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'SHUTTERSTOCK_VERSION', '1.3.4' );
     36define( 'SHUTTERSTOCK_VERSION', '1.3.5' );
    3737
    3838/**
  • shutterstock/trunk/README.txt

    r2469573 r2519174  
    33Tags: shutterstock, stock photography, images, editorial images, licensing, media library, stock
    44Requires at least: 5.5
    5 Tested up to: 5.6
    6 Stable tag: 1.3.4
     5Tested up to: 5.7
     6Stable tag: 1.3.5
    77Requires PHP: 7.1
    88License: MIT
     
    112112
    113113== Changelog ==
     114= 1.3.5 =
     115* Bug fixes related to Screen options
     116
    114117= 1.3.4 =
    115118* Documentation updates
  • shutterstock/trunk/admin/css/shutterstock-admin.css

    r2466651 r2519174  
    44 */
    55
    6 .user-settings-table {
     6.shutterstock-user-settings-table {
    77 border-spacing: 0;
    88}
    99
    10 .user-settings-table th {
     10.shutterstock-user-settings-table th {
    1111  border-top: 1px solid #7e8993;
    1212  padding-left: 10px;
    1313}
    14 .user-settings-table td:last-child,
    15 .user-settings-table th:last-child {
     14.shutterstock-user-settings-table td:last-child,
     15.shutterstock-user-settings-table th:last-child {
    1616  border-right: 1px solid #7e8993;
    1717}
    1818
    19 .user-settings-table td,
    20 .user-settings-table th {
     19.shutterstock-user-settings-table td,
     20.shutterstock-user-settings-table th {
    2121  border-bottom: 1px solid #7e8993;
    2222  border-left: 1px solid #7e8993;
    2323}
    2424
    25 .connected,
     25.shutterstock-connected,
    2626p.shutterstock-token {
    2727    word-wrap: break-word;
     
    4848}
    4949
    50 button.logout, input.login {
     50button.shutterstock-logout, input.shutterstock-login {
    5151    cursor: pointer;
    5252}
    5353
    54 .connected {
     54.shutterstock-connected {
    5555  padding-top: 5px;
    5656}
    5757
    58 .hidden {
     58.shutterstock-hidden {
    5959  display: none !important;
    6060}
  • shutterstock/trunk/admin/partials/shutterstock-admin-field-shutterstock-login-button.php

    r2466651 r2519174  
    1818                  var pre = \'<p class="' . esc_attr($atts['context']['connected_class']) . '">' . esc_html__('wordpress:logging_out', 'shutterstock') . '</p>\';
    1919                  jQuery(".shutterstock-token").replaceWith(pre);
    20                   jQuery(".connected").addClass("hidden");
     20                  jQuery(".shutterstock-connected").addClass("shutterstock-hidden");
    2121                }
    2222            </script>
     
    2727                name="' . esc_attr($atts['name']) . '"
    2828                value="' . esc_textarea($atts['value']) . '"
    29                 class="' . esc_attr($atts['context']['connected_class']) . ' hidden">' .
     29                class="' . esc_attr($atts['context']['connected_class']) . ' shutterstock-hidden">' .
    3030                    esc_textarea($atts['value']) .
    3131                '</textarea>';
    3232
    33             echo '<div class="connected">'. esc_html__('wordpress:connected', 'shutterstock') .'</div>';
    34             echo '<button class="logout" onclick="logout()">' . esc_attr($atts['context']['has_value_button_text']) . '</button>';
     33            echo '<div class="shutterstock-connected">'. esc_html__('wordpress:connected', 'shutterstock') .'</div>';
     34            echo '<button class="shutterstock-logout" onclick="logout()">' . esc_attr($atts['context']['has_value_button_text']) . '</button>';
    3535        } else {
    3636            echo '
     
    4949            </script>
    5050            <input
    51                 class="login"
     51                class="shutterstock-login"
    5252                type="button"
    5353                value="' . esc_attr($atts['context']['no_value_button_text']) . '"
  • shutterstock/trunk/admin/partials/shutterstock-admin-field-user-settings.php

    r2466651 r2519174  
    1818
    1919?>
    20 <table class="user-settings-table">
     20<table class="shutterstock-user-settings-table">
    2121    <thead>
    2222      <th><?php echo esc_html_e('wordpress:text_user_type', 'shutterstock') ?></th>
  • shutterstock/trunk/admin/shutterstock-media-page/index.asset.php

    r2463623 r2519174  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'a12dd5a3fd2c760ed1eba6a1d1411b29');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'ad1fbcbe1ae62bfc0fe883dd43a5fba6');
  • shutterstock/trunk/admin/shutterstock-media-page/index.css

    r2463623 r2519174  
    1 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPg0KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiIHN0cm9rZS13aWR0aD0iMiI+DQogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+DQogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPg0KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtDQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSINCiAgICAgICAgICAgICAgICAgICAgdHlwZT0icm90YXRlIg0KICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICBkdXI9IjFzIg0KICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPg0KICAgICAgICAgICAgPC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
     1.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    22
    33.components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
  • shutterstock/trunk/admin/shutterstock-media-page/index.js

    r2463623 r2519174  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,r){var n=r(11),o=r(12),i=r(13),c=r(15);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(n=(c=s.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(e,t,r){var n=r(14);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(8),i=r.n(o),c=r(2),s=r.n(c),a=r(5),u=r.n(a),l=r(4),p=r.n(l),g=r(7),d=r.n(g),b=r(1),m=r(6),f=r.n(m),I=r(3),y=r(9);r(16);var w="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9ImRvd25sb2FkLWNvbXAiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4NCiAgICAgICAgPC9nPg0KICAgIDwvZz4NCjwvc3ZnPg==";function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(){var e=u()(s.a.mark((function e(t){var r,n,o,i,c,a,u,l,g,b=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,f()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return c=e.sent,e.next=8,f()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,l=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return v(v({},e),{},p()({},n,o))}),{}),g=c.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return v(v({},e),{},{details_for_image:v({},l["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(l||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return v(v({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=u()(s.a.mark((function e(){var t,r,n,o=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,f()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),C=j;function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=function(e){var t=e.timeout,r=void 0===t?5e3:t,o=e.onRemoveSnackbar,i=Object(n.useState)({show:!1,text:""}),c=d()(i,2),s=c[0],a=c[1];return Object(n.useEffect)((function(){var e=setTimeout((function(){a(M(M({},s),{},{show:!1,text:""})),o&&o()}),r);return function(){return clearTimeout(e)}}),[s.show]),{snackbar:s,setSnackbar:a}},x=r(10),k=(r(17),function(e){var t=e.text;return t&&Object(n.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(n.createElement)(x.Snackbar,null,"Shutterstock: ",t))});function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[_(_({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIGZpbGw9IiMzRjYwNzgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8c3R5bGU+DQogICAgICAgIHBhdGggew0KICAgICAgICAgICAgZmlsbDogYmxhY2s7DQogICAgICAgIH0NCiAgICA8L3N0eWxlPg0KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+DQogICAgICAgICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiPjwvcmVjdD4NCiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNSwyMCBMMTUsMjIgTDksMjIgTDksMjAgTDE1LDIwIFogTTcsMjAgTDcsMjIgTDIsMjIgTDIsMjAgTDcsMjAgWiBNMjIsMjAgTDIyLDIyIEwxNywyMiBMMTcsMjAgTDIyLDIwIFogTTEzLDIgTDEzLDE0LjIgTDE3LjMsOS45IEwxOC43LDExLjMgTDEyLDE4IEw1LjMsMTEuMyBMNi43LDkuOSBMMTEsMTQuMiBMMTEsMiBMMTMsMiBaIiBpZD0iU2hhcGUiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+"})],assetInfo:t}}};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(){var e=u()(s.a.mark((function e(t,r){var n,o,i,c,a,u,l,p,g,d,b,m,y,w,h,v,j,O,C,L;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,o=r.licenseId,i=r.size,c=r.setAttributes,a=r.closeModal,u=r.handleError,l=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(I.__)("wordpress:downloading_image","shutterstock")),d=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,b="",!d){e.next=10;break}return e.next=8,f()({path:"shutterstock/contributor/".concat(d)});case 8:w=e.sent,b=(null==w||null===(m=w.data)||void 0===m||null===(y=m[0])||void 0===y?void 0:y.display_name)||d;case 10:return e.next=12,f()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return h=e.sent,v=h.assets,e.next=16,f()({path:"shutterstock/images/licenses/".concat(o,"/downloads"),method:"POST",contentType:"application/json",data:A({mediaType:"images",size:i,contributorName:b,imageId:t.id,description:t.description},null==v?void 0:v["".concat(i,"_jpg")])});case 16:(null==(j=e.sent)?void 0:j.success)?(O=j.data,C=O.url,L=O.id,l?l&&p(Object(I.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:A(A({},t),{},{licensedImageUrl:C,contributorName:b,uploadedImageId:L})}),a()),n(!1)):u(j),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),u(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var G=function(e){var t,r=e.closeModal,n=e.handleError,o=e.isMediaPage,i=e.routesConfig,c=e.setAttributes,a=e.showSnackbar,l=e.toggleOverlay,p=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;i[0].props=N(N({},i[0].props),{},{assetInfo:e}),p.current.updateRoutes({routesConfig:i}),p.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(I.__)(o?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:w,onClick:function(e,t,i){e.preventDefault(),T(t,N(N({},i),{},{toggleOverlay:l,handleError:n,isMediaPage:o,setAttributes:c,showSnackbar:a,closeModal:r}))}}]}}};function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.assetInfo,n=e.closeModal,o=e.commonLicensingProps,i=e.handleError,c=e.isMediaPage,a=e.setAttributes,l=e.showSnackbar,p=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[z(z({},o),{},{onClick:(t=u()(s.a.mark((function e(t,r,o){var u,p,d,b,m,y,w,h,v,j,O,C,L,M;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=o.subscription,e.prev=1,g(!0,Object(I.__)("wordpress:text_licensing_image_please_wait","shutterstock")),b=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,m=null==r?void 0:r.media_type,w=(y="editorial"===m)?null==r?void 0:r.byline:"",!b||y){e.next=12;break}return e.next=10,f()({path:"shutterstock/contributor/".concat(b)});case 10:j=e.sent,w=(null==j||null===(h=j.data)||void 0===h||null===(v=h[0])||void 0===v?void 0:v.display_name)||b;case 12:return e.next=14,f()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:z(z(z({subscription_id:null==u?void 0:u.id,size:null==u?void 0:u.size,id:r.id,description:r.description},(null==u?void 0:u.metadata)?{metadata:u.metadata}:{}),{},{contributorName:w},null==u?void 0:u.details_for_image),{},{mediaType:m,license:null==u?void 0:u.license,country:null===(d=shutterstock)||void 0===d?void 0:d.country,search_id:r.searchId})});case 14:(null==(O=e.sent)?void 0:O.success)?(C=O.data,L=C.url,M=C.id,c?c&&l(Object(I.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:z(z({},r),{},{licensedImageUrl:L,contributorName:w,uploadedImageId:M})}),n()),g(!1)):i(O),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),i(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:p}}};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=/<\/?[a-z][^>]*?>/gi,J=/\r?\n|\r/gi,F=function(e){var t,r,o,c=e.setAttributes,a=e.closeModal,l=e.canLicense,p=void 0!==l&&l,g=e.assetInfo,m=void 0===g?{}:g,f=e.licenseImage,h=void 0!==f&&f,v=e.subscriptions,j=void 0===v?[]:v,L=e.isMediaPage,M=void 0!==L&&L,x=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),P=Object(b.useRef)(),_=Object(b.useState)({show:!1,text:""}),S=d()(_,2),A=S[0],T=S[1],Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return T(H(H({},A),{},{show:e,text:t}))},N=D({timeout:5e3}),B=N.snackbar,z=N.setSnackbar,W=function(e){return z(H(H({},B),{},{show:!0,text:e}))},F=function(e){var t,r,n,o=Object(I.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(o=null==e||null===(n=e.data)||void 0===n?void 0:n.message);W(o),Z(!1)},U={label:Object(I.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),c({img:t}),a()}},Y=M?[]:[H(H({},U),{},{icon:w})],X=[E({assetInfo:m,commonInsertPreviewProps:U,isMediaPage:M})];if(p){var V={label:Object(I.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5zaG9wcGluZy1jYXJ0PC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9InNob3BwaW5nLWNhcnQiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+DQogICAgICAgIDwvZz4NCiAgICA8L2c+DQo8L3N2Zz4=",isPrimary:!0,onClick:(o=u()(s.a.mark((function e(t,r,n){var o,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,o=r.media_type,Z(!0,Object(I.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,C(r.id,o);case 6:i=e.sent,X[1].props=H(H({},X[1].props),{},{assetInfo:r,subscriptions:i,searchId:r.searchId}),P.current.updateRoutes({routesConfig:X}),P.current.toggleLoadingIndicator(!1),Z(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),P.current.toggleLoadingIndicator(!1),Z(!1),F(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return o.apply(this,arguments)})};Y.push(H({},V)),X[0].props.buttons.push(H({},V)),X.push(R({assetInfo:m,closeModal:a,commonLicensingProps:V,handleError:F,isMediaPage:M,setAttributes:c,showSnackbar:W,subscriptions:j,toggleOverlay:Z}),G({closeModal:a,handleError:F,isMediaPage:M,routesConfig:X,setAttributes:c,showSnackbar:W,toggleOverlay:Z,widgetRef:P}))}Object(b.useEffect)((function(){var e,t,r,n,o=[{label:Object(I.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(I.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],c=H({mediaType:"images",imageType:["photo"],subtitle:"",container:P.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),X[0].props=H(H({},X[0].props),{},{assetInfo:t}),P.current.updateRoutes({routesConfig:X}),P.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:H(H({},h?{initialRoute:"/license/images/".concat(m.id)}:{}),{},{routesConfig:X,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:Y,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:H({showFilterDrawer:!0,images:{orientationFilter:!0}},x?{searchBarDropdownFilters:o}:{})},M?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(y.__unstableStripHTML)("".concat(e," ").concat(t)).replace(Q,"").replace(J,"").trim()}},title:Object(I.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":i()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(c);s.search({query:""}),P.current=s}}),[]);var K=M?"media-page":"";return Object(n.createElement)(n.Fragment,null,p&&Object(n.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(A.show?"disabled":""," ").concat(K)},Object(n.createElement)("a",{onClick:function(e,t){P.current.getHistory().push("/")}},Object(I.__)("wordpress:text_home","shutterstock")),Object(n.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Z(!0,Object(I.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,O("images");case 4:r=e.sent,X[2].props=H(H({},X[2].props),{},{licenseHistory:r}),P.current.updateRoutes({routesConfig:X}),P.current.toggleLoadingIndicator(!1),Z(!1),P.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),P.current.toggleLoadingIndicator(!1),Z(!1),F(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(I.__)("wordpress:text_downloads","shutterstock"))),Object(n.createElement)("div",{ref:P,className:"components-shutterstock-ui__widget-container ".concat(K)}),A.show&&Object(n.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(K)},A.text&&Object(n.createElement)("div",{className:"text"},A.text)),B.show&&Object(n.createElement)(k,{text:B.text}))},U=(r(18),function(){return Object(n.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(n.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(n.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737\r 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789\r 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737\r 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632\r 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211\r 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316\r 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947\r 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737\r 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474\r 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632\r 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053\r 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579\r C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26\r 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421\r 107.280323,15.2791053 104.443726,14.7782632"}),Object(n.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263\r L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526\r L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947\r 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737\r L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737\r 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526\r L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(n.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474\r 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632\r 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316\r 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368\r C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26\r 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158\r C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211\r C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895\r L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(n.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263\r 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526\r 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789\r 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947\r 162.551046 15.5438947"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__o"},Object(n.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158\r 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053\r L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421\r 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(n.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474\r 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579\r L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105\r 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(n.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526\r L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737\r 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737\r L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947\r 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526\r L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737\r 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737\r L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947\r 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526\r L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263\r L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263\r L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316\r L64.1032319,7.30805263"}),Object(n.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263\r 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316\r L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579\r C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158\r C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421\r L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421\r C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(n.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263\r 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579\r 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263\r L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26\r C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263\r L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(n.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737\r 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789\r 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737\r 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632\r 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211\r 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316\r 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947\r 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737\r 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474\r 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632\r 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053\r 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579\r C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26\r 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421\r 11.573289,15.2791053 8.73802281,14.7782632"}),Object(n.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474\r C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263\r C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211\r L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789\r 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474\r 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158\r C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26\r 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895\r C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282\r C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789\r L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579\r L84.148384,13.2531579 Z"}),Object(n.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947\r L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053\r 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526\r 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947\r 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474\r 86.5764259,10.0613158 86.5764259,13.26"}))))});r(19);window.onload=function(){Object(n.render)(Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"components-shutterstock-media-page__logo"},Object(n.createElement)(U,null)),Object(n.createElement)(F,{isMediaPage:!0,canLicense:!0})),document.getElementById("shutterstock-widget"))}}]);
     1!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)}))}}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t,r){var n=r(11),o=r(12),i=r(13),c=r(15);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(n=(c=s.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(e,t,r){var n=r(14);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(8),i=r.n(o),c=r(2),s=r.n(c),a=r(5),u=r.n(a),l=r(4),p=r.n(l),g=r(7),d=r.n(g),b=r(1),m=r(6),I=r.n(m),f=r(3),y=r(9);r(16);var w="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){var e=u()(s.a.mark((function e(t){var r,n,o,i,c,a,u,l,g,b=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,I()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return c=e.sent,e.next=8,I()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,l=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return h(h({},e),{},p()({},n,o))}),{}),g=c.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return h(h({},e),{},{details_for_image:h({},l["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(l||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return h(h({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=u()(s.a.mark((function e(){var t,r,n,o=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,I()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),j=O;function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=function(e){var t=e.timeout,r=void 0===t?5e3:t,o=e.onRemoveSnackbar,i=Object(n.useState)({show:!1,text:""}),c=d()(i,2),s=c[0],a=c[1];return Object(n.useEffect)((function(){var e=setTimeout((function(){a(M(M({},s),{},{show:!1,text:""})),o&&o()}),r);return function(){return clearTimeout(e)}}),[s.show]),{snackbar:s,setSnackbar:a}},D=r(10),P=(r(17),function(e){var t=e.text;return t&&Object(n.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(n.createElement)(D.Snackbar,null,"Shutterstock: ",t))});function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[E(E({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],assetInfo:t}}};function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Z=function(){var e=u()(s.a.mark((function e(t,r){var n,o,i,c,a,u,l,p,g,d,b,m,y,w,v,h,O,C,j,L;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,o=r.licenseId,i=r.size,c=r.setAttributes,a=r.closeModal,u=r.handleError,l=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(f.__)("wordpress:downloading_image","shutterstock")),d=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,b="",!d){e.next=10;break}return e.next=8,I()({path:"shutterstock/contributor/".concat(d)});case 8:w=e.sent,b=(null==w||null===(m=w.data)||void 0===m||null===(y=m[0])||void 0===y?void 0:y.display_name)||d;case 10:return e.next=12,I()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return v=e.sent,h=v.assets,e.next=16,I()({path:"shutterstock/images/licenses/".concat(o,"/downloads"),method:"POST",contentType:"application/json",data:A({mediaType:"images",size:i,contributorName:b,imageId:t.id,description:t.description},null==h?void 0:h["".concat(i,"_jpg")])});case 16:(null==(O=e.sent)?void 0:O.success)?(C=O.data,j=C.url,L=C.id,l?l&&p(Object(f.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(c({img:A(A({},t),{},{licensedImageUrl:j,contributorName:b,uploadedImageId:L})}),a()),n(!1)):u(O),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),u(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var G=function(e){var t,r=e.closeModal,n=e.handleError,o=e.isMediaPage,i=e.routesConfig,c=e.setAttributes,a=e.showSnackbar,l=e.toggleOverlay,p=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;i[0].props=N(N({},i[0].props),{},{assetInfo:e}),p.current.updateRoutes({routesConfig:i}),p.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(f.__)(o?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:w,onClick:function(e,t,i){e.preventDefault(),Z(t,N(N({},i),{},{toggleOverlay:l,handleError:n,isMediaPage:o,setAttributes:c,showSnackbar:a,closeModal:r}))}}]}}};function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t,r=e.assetInfo,n=e.closeModal,o=e.commonLicensingProps,i=e.handleError,c=e.isMediaPage,a=e.setAttributes,l=e.showSnackbar,p=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[W(W({},o),{},{onClick:(t=u()(s.a.mark((function e(t,r,o){var u,p,d,b,m,y,w,v,h,O,C,j,L,M;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=o.subscription,e.prev=1,g(!0,Object(f.__)("wordpress:text_licensing_image_please_wait","shutterstock")),b=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,m=null==r?void 0:r.media_type,w=(y="editorial"===m)?null==r?void 0:r.byline:"",!b||y){e.next=12;break}return e.next=10,I()({path:"shutterstock/contributor/".concat(b)});case 10:O=e.sent,w=(null==O||null===(v=O.data)||void 0===v||null===(h=v[0])||void 0===h?void 0:h.display_name)||b;case 12:return e.next=14,I()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:W(W(W({subscription_id:null==u?void 0:u.id,size:null==u?void 0:u.size,id:r.id,description:r.description},(null==u?void 0:u.metadata)?{metadata:u.metadata}:{}),{},{contributorName:w},null==u?void 0:u.details_for_image),{},{mediaType:m,license:null==u?void 0:u.license,country:null===(d=shutterstock)||void 0===d?void 0:d.country,search_id:r.searchId})});case 14:(null==(C=e.sent)?void 0:C.success)?(j=C.data,L=j.url,M=j.id,c?c&&l(Object(f.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:W(W({},r),{},{licensedImageUrl:L,contributorName:w,uploadedImageId:M})}),n()),g(!1)):i(C),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),i(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:p}}};function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){p()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var U=/<\/?[a-z][^>]*?>/gi,F=/\r?\n|\r/gi,J=function(e){var t,r,o,c=e.setAttributes,a=e.closeModal,l=e.canLicense,p=void 0!==l&&l,g=e.assetInfo,m=void 0===g?{}:g,I=e.licenseImage,v=void 0!==I&&I,h=e.subscriptions,O=void 0===h?[]:h,L=e.isMediaPage,M=void 0!==L&&L,D=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),k=Object(b.useRef)(),E=Object(b.useState)({show:!1,text:""}),S=d()(E,2),A=S[0],Z=S[1],T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Z(R(R({},A),{},{show:e,text:t}))},N=x({timeout:5e3}),B=N.snackbar,W=N.setSnackbar,H=function(e){return W(R(R({},B),{},{show:!0,text:e}))},J=function(e){var t,r,n,o=Object(f.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(o=null==e||null===(n=e.data)||void 0===n?void 0:n.message);H(o),T(!1)},Q={label:Object(f.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),c({img:t}),a()}},V=M?[]:[R(R({},Q),{},{icon:w})],Y=[_({assetInfo:m,commonInsertPreviewProps:Q,isMediaPage:M})];if(p){var K={label:Object(f.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(o=u()(s.a.mark((function e(t,r,n){var o,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,o=r.media_type,T(!0,Object(f.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,j(r.id,o);case 6:i=e.sent,Y[1].props=R(R({},Y[1].props),{},{assetInfo:r,subscriptions:i,searchId:r.searchId}),k.current.updateRoutes({routesConfig:Y}),k.current.toggleLoadingIndicator(!1),T(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),k.current.toggleLoadingIndicator(!1),T(!1),J(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return o.apply(this,arguments)})};V.push(R({},K)),Y[0].props.buttons.push(R({},K)),Y.push(z({assetInfo:m,closeModal:a,commonLicensingProps:K,handleError:J,isMediaPage:M,setAttributes:c,showSnackbar:H,subscriptions:O,toggleOverlay:T}),G({closeModal:a,handleError:J,isMediaPage:M,routesConfig:Y,setAttributes:c,showSnackbar:H,toggleOverlay:T,widgetRef:k}))}Object(b.useEffect)((function(){var e,t,r,n,o=[{label:Object(f.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(f.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],c=R({mediaType:"images",imageType:["photo"],subtitle:"",container:k.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),Y[0].props=R(R({},Y[0].props),{},{assetInfo:t}),k.current.updateRoutes({routesConfig:Y}),k.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:R(R({},v?{initialRoute:"/license/images/".concat(m.id)}:{}),{},{routesConfig:Y,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:V,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:R({showFilterDrawer:!0,images:{orientationFilter:!0}},D?{searchBarDropdownFilters:o}:{})},M?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(y.__unstableStripHTML)("".concat(e," ").concat(t)).replace(U,"").replace(F,"").trim()}},title:Object(f.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":i()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(c);s.search({query:""}),k.current=s}}),[]);var X=M?"media-page":"";return Object(n.createElement)(n.Fragment,null,p&&Object(n.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(A.show?"disabled":""," ").concat(X)},Object(n.createElement)("a",{onClick:function(e,t){k.current.getHistory().push("/")}},Object(f.__)("wordpress:text_home","shutterstock")),Object(n.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=u()(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,T(!0,Object(f.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,C("images");case 4:r=e.sent,Y[2].props=R(R({},Y[2].props),{},{licenseHistory:r}),k.current.updateRoutes({routesConfig:Y}),k.current.toggleLoadingIndicator(!1),T(!1),k.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),k.current.toggleLoadingIndicator(!1),T(!1),J(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(f.__)("wordpress:text_downloads","shutterstock"))),Object(n.createElement)("div",{ref:k,className:"components-shutterstock-ui__widget-container ".concat(X)}),A.show&&Object(n.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(X)},A.text&&Object(n.createElement)("div",{className:"text"},A.text)),B.show&&Object(n.createElement)(P,{text:B.text}))},Q=(r(18),function(){return Object(n.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(n.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(n.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(n.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(n.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(n.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__o"},Object(n.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(n.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(n.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(n.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(n.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(n.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(n.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(n.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(n.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))});r(19);window.onload=function(){Object(n.render)(Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"components-shutterstock-media-page__logo"},Object(n.createElement)(Q,null)),Object(n.createElement)(J,{isMediaPage:!0,canLicense:!0})),document.getElementById("shutterstock-widget"))}}]);
  • shutterstock/trunk/includes/class-shutterstock.php

    r2469573 r2519174  
    7171            $this->version = SHUTTERSTOCK_VERSION;
    7272        } else {
    73             $this->version = '1.3.4';
     73            $this->version = '1.3.5';
    7474        }
    7575        $this->shutterstock = 'shutterstock';
  • shutterstock/trunk/public/shutterstock-block/build/index.asset.php

    r2464382 r2519174  
    1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'bfe06f10ff22ac5a49cc33160d929da0');
     1<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f82a7a3f573966b77006471e908ebd58');
  • shutterstock/trunk/public/shutterstock-block/build/index.css

    r2466651 r2519174  
    1 .wp-block-shutterstock-shutterstock-block{border:1px solid;padding:1em;background:#ffffff;clear:both}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-size:18pt;font-weight:400;vertical-align:middle;margin-left:18px;font-family:"Roboto",sans-serif}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{width:30px;height:30px;display:inline-block;vertical-align:middle;margin-left:-5px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{position:absolute;height:40px;background:#f54336;border-radius:20px;color:white;font-size:13px;font-family:'Roboto';font-weight:bold;bottom:0;right:0;margin-bottom:60px;margin-right:15px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,0.8);color:rgba(255,255,255,0.5);opacity:0.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{width:25px;overflow:hidden;height:20px;background-position:center center;background-repeat:no-repeat;background-size:15px 15px;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPg0KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiIHN0cm9rZS13aWR0aD0iMiI+DQogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+DQogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPg0KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtDQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSINCiAgICAgICAgICAgICAgICAgICAgdHlwZT0icm90YXRlIg0KICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICBkdXI9IjFzIg0KICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPg0KICAgICAgICAgICAgPC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);margin-right:2px}
     1.wp-block-shutterstock-shutterstock-block{border:1px solid;padding:1em;background:#ffffff;clear:both}.wp-block-shutterstock-shutterstock-block .components-edit__heading{font-size:18pt;font-weight:400;vertical-align:middle;margin-left:18px;font-family:"Roboto",sans-serif}.wp-block-shutterstock-shutterstock-block .components-edit__paragraph{font-size:13px}.wp-block-shutterstock-shutterstock-block .components-edit__shutterstock-icon{width:30px;height:30px;display:inline-block;vertical-align:middle;margin-left:-5px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container{position:relative}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button{position:absolute;height:40px;background:#f54336;border-radius:20px;color:white;font-size:13px;font-family:'Roboto';font-weight:bold;bottom:0;right:0;margin-bottom:60px;margin-right:15px}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button:disabled{background-color:rgba(245,67,54,0.8);color:rgba(255,255,255,0.5);opacity:0.8}.wp-block-shutterstock-shutterstock-block .components-edit__image-container .components-edit__license-image-button .loading-spinner{width:25px;overflow:hidden;height:20px;background-position:center center;background-repeat:no-repeat;background-size:15px 15px;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);margin-right:2px}
    22
    33.components-shutterstock-icon{width:30px;height:30px}.components-shutterstock-icon__rectangle{fill:#ffffff}
    44
    5 .components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPg0KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiIHN0cm9rZS13aWR0aD0iMiI+DQogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+DQogICAgICAgICAgICA8cGF0aCBkPSJNMzYgMThjMC05Ljk0LTguMDYtMTgtMTgtMTgiPg0KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtDQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSINCiAgICAgICAgICAgICAgICAgICAgdHlwZT0icm90YXRlIg0KICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4Ig0KICAgICAgICAgICAgICAgICAgICBkdXI9IjFzIg0KICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPg0KICAgICAgICAgICAgPC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
     5.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input{border:none;border-top-left-radius:8px;border-bottom-left-radius:8px}.components-shutterstock-ui__inputgroup .components-shutterstock-ui__input:focus{box-shadow:none}.components-shutterstock-ui__radio_button{width:initial;height:initial}.components-shutterstock-ui__widget-container{height:100vh;overflow-y:scroll}.components-shutterstock-ui__widget-container>div{top:90px;position:relative}.components-shutterstock-ui__widget-container .components-shutterstock-ui__searchContainer .components-shutterstock-ui__filterButtonWrapper{width:initial}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden;padding-bottom:5%}.components-shutterstock-ui__widget-container.media-page>div{top:0;padding-top:1px;padding-bottom:5px}.components-shutterstock-ui__widget-container-overlay{position:fixed;top:2px;left:0;width:100%;overflow:hidden;height:100%;background-color:rgba(0,0,0,0.55);background-position:center center;background-repeat:no-repeat;background-size:60px 60px;transition:opacity .1s;opacity:1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIiBzdHJva2Utd2lkdGg9IjIiPgogICAgICAgICAgICA8Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuNSIgY3g9IjE4IiBjeT0iMTgiIHI9IjE4Ii8+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMXMiCiAgICAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);z-index:111;top:60px}.components-shutterstock-ui__widget-container-overlay .text{max-width:300px;height:100px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;transform:translate(0, 100%);text-align:center;font-size:18px;color:#ffffff !important;cursor:default}.components-shutterstock-ui__widget-container-overlay.media-page{top:32px}.components-shutterstock-ui__filterDrawerContainer .components-shutterstock-ui__widget-drawer-position-fixed{position:fixed}.components-shutterstock-ui__searchForm{flex:1}.components-shutterstock-ui__navigation{z-index:111111111;position:absolute;margin-left:180px;top:19px;font-weight:bold}.components-shutterstock-ui__navigation a{margin:0 10px;cursor:pointer;color:#444}.components-shutterstock-ui__navigation.media-page{top:72px}.components-shutterstock-ui__navigation.disabled a{pointer-events:none}@media (min-width: 600px){.components-shutterstock-ui__widget-container{height:calc(100vh - 126px)}.components-shutterstock-ui__widget-container.media-page{height:initial;overflow:hidden}.components-shutterstock-ui__navigation.media-page{top:0;margin-top:5px}}
    66
    77.components-shutterstock-snackbar__container{display:flex;justify-content:center;position:absolute;width:100%;position:fixed;bottom:0;left:0;right:0;margin:auto;margin-bottom:20px;z-index:11111}
  • shutterstock/trunk/public/shutterstock-block/build/index.js

    r2464382 r2519174  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(13),o=r(14),i=r(15),c=r(17);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(n=(c=s.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(e,t,r){var n=r(16);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(9),o=r(1),i=r(2),c=r.n(i),s=r(5),a=r.n(s),u=r(4),l=r.n(u),d=r(6),p=r.n(d),g=r(0),b=r(8),m=r(10),f=(r(18),r(3)),v=(r(19),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},Object(g.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),Object(g.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),Object(g.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"}))}),I=r(11),h=r.n(I),y=r(7),w=r.n(y),j=r(12);r(20);var O="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9ImRvd25sb2FkLWNvbXAiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4NCiAgICAgICAgPC9nPg0KICAgIDwvZz4NCjwvc3ZnPg==";function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var _=function(){var e=a()(c.a.mark((function e(t){var r,n,o,i,s,a,u,d,g,b=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,i="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,w()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return s=e.sent,e.next=8,w()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(i)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,d=Object.entries(u).filter((function(e){var t=p()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=p()(t,2),n=r[0],o=r[1];return L(L({},e),{},l()({},n,o))}),{}),g=s.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return L(L({},e),{},{details_for_image:L({},d["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(d||{}).map((function(e){var t,r=p()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return L(L({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),M=function(){var e=a()(c.a.mark((function e(){var t,r,n,o=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,w()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),k=_;function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){var t=e.timeout,r=void 0===t?5e3:t,n=e.onRemoveSnackbar,o=Object(g.useState)({show:!1,text:""}),i=p()(o,2),c=i[0],s=i[1];return Object(g.useEffect)((function(){var e=setTimeout((function(){s(D(D({},c),{},{show:!1,text:""})),n&&n()}),r);return function(){return clearTimeout(e)}}),[c.show]),{snackbar:c,setSnackbar:s}},P=(r(21),function(e){var t=e.text;return t&&Object(g.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(g.createElement)(b.Snackbar,null,"Shutterstock: ",t))});function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[A(A({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIGZpbGw9IiMzRjYwNzgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5kb3dubG9hZC1jb21wPC90aXRsZT4NCiAgICA8c3R5bGU+DQogICAgICAgIHBhdGggew0KICAgICAgICAgICAgZmlsbDogYmxhY2s7DQogICAgICAgIH0NCiAgICA8L3N0eWxlPg0KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+DQogICAgICAgICAgICA8cmVjdCBpZD0iUmVjdGFuZ2xlIiB4PSIwIiB5PSIwIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiPjwvcmVjdD4NCiAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNSwyMCBMMTUsMjIgTDksMjIgTDksMjAgTDE1LDIwIFogTTcsMjAgTDcsMjIgTDIsMjIgTDIsMjAgTDcsMjAgWiBNMjIsMjAgTDIyLDIyIEwxNywyMiBMMTcsMjAgTDIyLDIwIFogTTEzLDIgTDEzLDE0LjIgTDE3LjMsOS45IEwxOC43LDExLjMgTDEyLDE4IEw1LjMsMTEuMyBMNi43LDkuOSBMMTEsMTQuMiBMMTEsMiBMMTMsMiBaIiBpZD0iU2hhcGUiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+"})],assetInfo:t}}};function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(){var e=a()(c.a.mark((function e(t,r){var n,i,s,a,u,l,d,p,g,b,m,f,v,I,h,y,j,O,C,L;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,i=r.licenseId,s=r.size,a=r.setAttributes,u=r.closeModal,l=r.handleError,d=r.isMediaPage,p=r.showSnackbar,e.prev=1,n(!0,Object(o.__)("wordpress:downloading_image","shutterstock")),b=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,m="",!b){e.next=10;break}return e.next=8,w()({path:"shutterstock/contributor/".concat(b)});case 8:I=e.sent,m=(null==I||null===(f=I.data)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.display_name)||b;case 10:return e.next=12,w()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return h=e.sent,y=h.assets,e.next=16,w()({path:"shutterstock/images/licenses/".concat(i,"/downloads"),method:"POST",contentType:"application/json",data:Z({mediaType:"images",size:s,contributorName:m,imageId:t.id,description:t.description},null==y?void 0:y["".concat(s,"_jpg")])});case 16:(null==(j=e.sent)?void 0:j.success)?(O=j.data,C=O.url,L=O.id,d?d&&p(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:Z(Z({},t),{},{licensedImageUrl:C,contributorName:m,uploadedImageId:L})}),u()),n(!1)):l(j),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),l(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.closeModal,n=e.handleError,i=e.isMediaPage,s=e.routesConfig,u=e.setAttributes,l=e.showSnackbar,d=e.toggleOverlay,p=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;s[0].props=z(z({},s[0].props),{},{assetInfo:e}),p.current.updateRoutes({routesConfig:s}),p.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=a()(c.a.mark((function e(t){var r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(o.__)(i?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:O,onClick:function(e,t,o){e.preventDefault(),B(t,z(z({},o),{},{toggleOverlay:d,handleError:n,isMediaPage:i,setAttributes:u,showSnackbar:l,closeModal:r}))}}]}}};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=function(e){var t,r=e.assetInfo,n=e.closeModal,i=e.commonLicensingProps,s=e.handleError,u=e.isMediaPage,l=e.setAttributes,d=e.showSnackbar,p=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[H(H({},i),{},{onClick:(t=a()(c.a.mark((function e(t,r,i){var a,p,b,m,f,v,I,h,y,j,O,C,L,_;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.subscription,e.prev=1,g(!0,Object(o.__)("wordpress:text_licensing_image_please_wait","shutterstock")),m=null==r||null===(p=r.contributor)||void 0===p?void 0:p.id,f=null==r?void 0:r.media_type,I=(v="editorial"===f)?null==r?void 0:r.byline:"",!m||v){e.next=12;break}return e.next=10,w()({path:"shutterstock/contributor/".concat(m)});case 10:j=e.sent,I=(null==j||null===(h=j.data)||void 0===h||null===(y=h[0])||void 0===y?void 0:y.display_name)||m;case 12:return e.next=14,w()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:H(H(H({subscription_id:null==a?void 0:a.id,size:null==a?void 0:a.size,id:r.id,description:r.description},(null==a?void 0:a.metadata)?{metadata:a.metadata}:{}),{},{contributorName:I},null==a?void 0:a.details_for_image),{},{mediaType:f,license:null==a?void 0:a.license,country:null===(b=shutterstock)||void 0===b?void 0:b.country,search_id:r.searchId})});case 14:(null==(O=e.sent)?void 0:O.success)?(C=O.data,L=C.url,_=C.id,u?u&&d(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(l({img:H(H({},r),{},{licensedImageUrl:L,contributorName:I,uploadedImageId:_})}),n()),g(!1)):s(O),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),s(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:p}}};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var F=/<\/?[a-z][^>]*?>/gi,Y=/\r?\n|\r/gi,V=function(e){var t,r,n,i=e.setAttributes,s=e.closeModal,u=e.canLicense,l=void 0!==u&&u,d=e.assetInfo,b=void 0===d?{}:d,m=e.licenseImage,v=void 0!==m&&m,I=e.subscriptions,y=void 0===I?[]:I,w=e.isMediaPage,C=void 0!==w&&w,L=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),_=Object(f.useRef)(),x=Object(f.useState)({show:!1,text:""}),D=p()(x,2),S=D[0],A=D[1],N=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return A(U(U({},S),{},{show:e,text:t}))},Z=E({timeout:5e3}),B=Z.snackbar,G=Z.setSnackbar,z=function(e){return G(U(U({},B),{},{show:!0,text:e}))},W=function(e){var t,r,n,i=Object(o.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(i=null==e||null===(n=e.data)||void 0===n?void 0:n.message);z(i),N(!1)},H={label:Object(o.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),i({img:t}),s()}},J=C?[]:[U(U({},H),{},{icon:O})],V=[T({assetInfo:b,commonInsertPreviewProps:H,isMediaPage:C})];if(l){var X={label:Object(o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDx0aXRsZT5zaG9wcGluZy1jYXJ0PC90aXRsZT4NCiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4NCiAgICAgICAgPGcgaWQ9InNob3BwaW5nLWNhcnQiPg0KICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48L3JlY3Q+DQogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+DQogICAgICAgIDwvZz4NCiAgICA8L2c+DQo8L3N2Zz4=",isPrimary:!0,onClick:(n=a()(c.a.mark((function e(t,r,n){var i,s;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,i=r.media_type,N(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,k(r.id,i);case 6:s=e.sent,V[1].props=U(U({},V[1].props),{},{assetInfo:r,subscriptions:s,searchId:r.searchId}),_.current.updateRoutes({routesConfig:V}),_.current.toggleLoadingIndicator(!1),N(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),_.current.toggleLoadingIndicator(!1),N(!1),W(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return n.apply(this,arguments)})};J.push(U({},X)),V[0].props.buttons.push(U({},X)),V.push(Q({assetInfo:b,closeModal:s,commonLicensingProps:X,handleError:W,isMediaPage:C,setAttributes:i,showSnackbar:z,subscriptions:y,toggleOverlay:N}),R({closeModal:s,handleError:W,isMediaPage:C,routesConfig:V,setAttributes:i,showSnackbar:z,toggleOverlay:N,widgetRef:_}))}Object(f.useEffect)((function(){var e,t,r,n,i=[{label:Object(o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],c=U({mediaType:"images",imageType:["photo"],subtitle:"",container:_.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),V[0].props=U(U({},V[0].props),{},{assetInfo:t}),_.current.updateRoutes({routesConfig:V}),_.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:U(U({},v?{initialRoute:"/license/images/".concat(b.id)}:{}),{},{routesConfig:V,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:J,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:U({showFilterDrawer:!0,images:{orientationFilter:!0}},L?{searchBarDropdownFilters:i}:{})},C?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(j.__unstableStripHTML)("".concat(e," ").concat(t)).replace(F,"").replace(Y,"").trim()}},title:Object(o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":h()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(c);s.search({query:""}),_.current=s}}),[]);var K=C?"media-page":"";return Object(g.createElement)(g.Fragment,null,l&&Object(g.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(S.show?"disabled":""," ").concat(K)},Object(g.createElement)("a",{onClick:function(e,t){_.current.getHistory().push("/")}},Object(o.__)("wordpress:text_home","shutterstock")),Object(g.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=a()(c.a.mark((function e(t){var r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,N(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,M("images");case 4:r=e.sent,V[2].props=U(U({},V[2].props),{},{licenseHistory:r}),_.current.updateRoutes({routesConfig:V}),_.current.toggleLoadingIndicator(!1),N(!1),_.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),_.current.toggleLoadingIndicator(!1),N(!1),W(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(o.__)("wordpress:text_downloads","shutterstock"))),Object(g.createElement)("div",{ref:_,className:"components-shutterstock-ui__widget-container ".concat(K)}),S.show&&Object(g.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(K)},S.text&&Object(g.createElement)("div",{className:"text"},S.text)),B.show&&Object(g.createElement)(P,{text:B.text}))},X=(r(22),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(g.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(g.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(g.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737\r 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789\r 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737\r 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632\r 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211\r 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316\r 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947\r 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737\r 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474\r 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632\r 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053\r 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579\r C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26\r 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421\r 107.280323,15.2791053 104.443726,14.7782632"}),Object(g.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263\r L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526\r L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947\r 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737\r L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737\r 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526\r L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(g.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474\r 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632\r 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316\r 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368\r C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26\r 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158\r C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211\r C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895\r L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(g.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263\r 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526\r 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789\r 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947\r 162.551046 15.5438947"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__o"},Object(g.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158\r 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053\r L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421\r 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(g.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474\r 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579\r L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105\r 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(g.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526\r L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737\r 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737\r L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947\r 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526\r L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737\r 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737\r L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947\r 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526\r L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263\r L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263\r L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316\r L64.1032319,7.30805263"}),Object(g.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263\r 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316\r L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579\r C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158\r C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421\r L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421\r C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(g.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263\r 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579\r 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263\r L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26\r C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263\r L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(g.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737\r 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789\r 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737\r 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632\r 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211\r 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316\r 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947\r 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737\r 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474\r 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632\r 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053\r 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579\r C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26\r 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421\r 11.573289,15.2791053 8.73802281,14.7782632"}),Object(g.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474\r C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263\r C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211\r L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789\r 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474\r 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158\r C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26\r 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895\r C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282\r C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789\r L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579\r L84.148384,13.2531579 Z"}),Object(g.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947\r L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053\r 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526\r 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947\r 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474\r 86.5764259,10.0613158 86.5764259,13.26"}))))}),K=(r(23),function(e){var t=e.setAttributes,r=e.closeModal,n=e.canLicense,o=e.assetInfo,i=e.licenseImage,c=e.subscriptions;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(b.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:Object(g.createElement)(X,null),onRequestClose:r},Object(g.createElement)("div",{style:{width:"100%"}},Object(g.createElement)(V,{setAttributes:t,closeModal:r,canLicense:n,assetInfo:o,licenseImage:i,subscriptions:c}))))});function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=Object(m.withDispatch)((function(e){return{replaceBlock:e("core/block-editor").replaceBlock}}))((function(e){var t,r,i,s,u,l,d,m,f,I,h,y,w=Object(g.useState)(!1),j=p()(w,2),O=j[0],C=j[1],L=Object(g.useState)(!1),_=p()(L,2),M=_[0],x=_[1],D=Object(g.useState)(!1),S=p()(D,2),A=S[0],T=S[1],N=Object(g.useState)(!1),Z=p()(N,2),B=Z[0],G=Z[1],z=Object(g.useState)([]),R=p()(z,2),W=R[0],H=R[1],Q=function(){return C(!0)},J=(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.media_type)||"image",U="editorial"===J,F=shutterstock.permissions,Y=void 0===F?{}:F,V=Y.includes("can_user_license_all_shutterstock_images"),X=Y.includes("can_user_license_shutterstock_editorial_image"),q=Y.includes("can_user_license_shutterstock_photos"),ee=!1;(V||U&&X||!U&&q)&&(ee=!0);var te=function(e){x(e),G(e)},re=E({onRemoveSnackbar:function(){return te(!1)}}),ne=re.snackbar,oe=re.setSnackbar;return Object(g.useEffect)((function(){var t,r;if(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl){var o=e.attributes.img,i=o.licensedImageUrl,c=o.contributorName,s=o.uploadedImageId,a=o.description,u=Object(n.createBlock)("core/image",{url:i,id:s,caption:"Image: ".concat(c,", Shutterstock"),alt:a,align:"center"});e.replaceBlock(e.clientId,u)}}),[null===(i=e.attributes)||void 0===i||null===(s=i.img)||void 0===s?void 0:s.licensedImageUrl]),Object(g.createElement)("div",{className:e.className},Object(g.createElement)("div",null,Object(g.createElement)("span",{className:"components-edit__shutterstock-icon"},Object(g.createElement)(v,null)),Object(g.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?Object(g.createElement)("div",{className:"components-edit__image-container"},Object(g.createElement)("img",{src:(null===(u=e.attributes)||void 0===u||null===(l=u.img)||void 0===l?void 0:l.licensedImageUrl)||(null===(d=e.attributes)||void 0===d||null===(m=d.img)||void 0===m||null===(f=m.preview_1500)||void 0===f?void 0:f.url),onLoad:function(){return T(!0)}}),ee&&A&&!(null===(I=e.attributes)||void 0===I||null===(h=I.img)||void 0===h?void 0:h.licensedImageUrl)&&Object(g.createElement)(b.Button,{disabled:B,onClick:a()(c.a.mark((function t(){var r,n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,te(!0),t.next=4,k(null===(r=e.attributes)||void 0===r?void 0:r.img.id,J);case 4:n=t.sent,H(n),Q(),G(!1),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),i=t.t0,c=void 0,s=void 0,a=void 0,a=Object(o.__)("wordpress:text_something_went_wrong","shutterstock"),500!==(null==i||null===(c=i.data)||void 0===c?void 0:c.statusCode)&&(null==i||null===(s=i.data)||void 0===s?void 0:s.message)&&(a=i.data.message),oe($($({},ne),{},{show:!0,text:a}));case 13:case"end":return t.stop()}var i,c,s,a}),t,null,[[0,10]])}))),className:"components-edit__license-image-button"},B&&Object(g.createElement)("span",{className:"loading-spinner"}),Object(g.createElement)("span",null,Object(o.__)("wordpress:text_license_this_image","shutterstock")))):Object(g.createElement)("span",null),Object(g.createElement)("div",{className:"components-edit__paragraph"},Object(o.__)("wordpress:text_block_paragraph","shutterstock")),Object(g.createElement)(b.Button,{disabled:B,onClick:function(){Q(),x(!1)},className:"components-shutterstock-modal__open-modal-button "},Object(o.__)("wordpress:text_browse","shutterstock")),O&&Object(g.createElement)(K,{setAttributes:e.setAttributes,closeModal:function(){return C(!1)},canLicense:ee,assetInfo:null==e||null===(y=e.attributes)||void 0===y?void 0:y.img,licenseImage:M,subscriptions:W}),ne.show&&!O&&Object(g.createElement)(P,{text:ne.text}))}));Object(n.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:Object(o.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:v,supports:{html:!1},edit:ee,save:function(e){var t,r,n,i,c;return Object(g.createElement)("img",{alt:Object(o.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl)||(null===(n=e.attributes)||void 0===n||null===(i=n.img)||void 0===i||null===(c=i.preview_1500)||void 0===c?void 0:c.url)})},attributes:{img:{type:"object"}}})}]);
     1!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){function r(e,t,r,n,o,c,i){try{var s=e[c](i),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,c){var i=e.apply(t,n);function s(e){r(i,o,c,s,a,"next",e)}function a(e){r(i,o,c,s,a,"throw",e)}s(void 0)}))}}},function(e,t,r){var n=r(13),o=r(14),c=r(15),i=r(17);e.exports=function(e,t){return n(e)||o(e,t)||c(e,t)||i()}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){!function(){e.exports=this.wp.dom}()},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,c=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,c=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw c}}return r}}},function(e,t,r){var n=r(16);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n=r(9),o=r(1),c=r(2),i=r.n(c),s=r(5),a=r.n(s),u=r(4),l=r.n(u),p=r(6),d=r.n(p),g=r(0),b=r(8),m=r(10),f=(r(18),r(3)),v=(r(19),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},Object(g.createElement)("rect",{className:"components-shutterstock-icon__rectangle",width:"36",height:"36",rx:"2",ry:"2"}),Object(g.createElement)("path",{d:"M20.3,11.3h-5.7c-0.9,0-1.7,0.7-1.7,1.5v5.7H7.3v-5.7c0-3.7,3.3-6.7,7.3-6.7h5.7V11.3"}),Object(g.createElement)("path",{d:"M15.7,24.7h5.8c0.9,0,1.7-0.7,1.7-1.5v-5.7h5.7v5.7c0,3.7-3.3,6.7-7.3,6.7h-5.8V24.7"}))}),I=r(11),y=r.n(I),h=r(7),w=r.n(h),O=r(12);r(20);var j="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==";function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var L=function(){var e=a()(i.a.mark((function e(t){var r,n,o,c,s,a,u,p,g,b=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=b.length>1&&void 0!==b[1]?b[1]:"image",e.prev=1,c="editorial"===r&&(null===(n=shutterstock)||void 0===n?void 0:n.country)?"&country=".concat(null===(o=shutterstock)||void 0===o?void 0:o.country):"",e.next=5,w()({path:"shutterstock/user/subscriptions?mediaType=".concat(r)});case 5:return s=e.sent,e.next=8,w()({path:"shutterstock/images/".concat(t,"?mediaType=").concat(r).concat(c)});case 8:return a=e.sent,u=a.assets,a.id,a.is_editorial,p=Object.entries(u).filter((function(e){var t=d()(e,2);t[0];return t[1].is_licensable})).reduce((function(e,t){var r=d()(t,2),n=r[0],o=r[1];return _(_({},e),{},l()({},n,o))}),{}),g=s.map((function(e){var t,n=null==e||null===(t=e.formats)||void 0===t?void 0:t.filter((function(e){var t=e.size,r=e.format;return!t.match(/supersize/i)&&"tiff"!==r&&"eps"!==r&&void 0!==r})).sort((function(e,t){return e.min_resolution-t.min_resolution})).map((function(e){return _(_({},e),{},{details_for_image:_({},p["".concat(e.size,"_").concat(e.format)])})}));if("editorial"===r){n=Object.entries(p||{}).map((function(e){var t,r=d()(e,2),n=r[0];return{details_for_image:r[1],size:(t=n,{small_jpg:"small",medium_jpg:"medium",original:"original"}[t])}}))}return _(_({},e),{},{formats:n})})),e.abrupt("return",g);case 17:throw e.prev=17,e.t0=e.catch(1),e.t0;case 20:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),k=function(){var e=a()(i.a.mark((function e(){var t,r,n,o=arguments;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"images",r=o.length>1&&void 0!==o[1]?o[1]:1,e.prev=2,e.next=5,w()({path:"shutterstock/images/licenses?mediaType=".concat(t,"&page=").concat(r)});case 5:return n=e.sent,e.abrupt("return",n);case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}(),M=L;function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var D=function(e){var t=e.timeout,r=void 0===t?5e3:t,n=e.onRemoveSnackbar,o=Object(g.useState)({show:!1,text:""}),c=d()(o,2),i=c[0],s=c[1];return Object(g.useEffect)((function(){var e=setTimeout((function(){s(E(E({},i),{},{show:!1,text:""})),n&&n()}),r);return function(){return clearTimeout(e)}}),[i.show]),{snackbar:i,setSnackbar:s}},P=(r(21),function(e){var t=e.text;return t&&Object(g.createElement)("div",{className:"components-shutterstock-snackbar__container"},Object(g.createElement)(b.Snackbar,null,"Shutterstock: ",t))});function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(e){var t=e.assetInfo,r=e.isMediaPage,n=e.commonInsertPreviewProps;return{name:"imageDetailsPage",path:"/images/:id",component:ShutterstockWidget.components.ImageDetailsPage,props:{buttons:r?[]:[A(A({},n),{},{icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgZmlsbD0iIzNGNjA3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZG93bmxvYWQtY29tcDwvdGl0bGU+CiAgICA8c3R5bGU+CiAgICAgICAgcGF0aCB7CiAgICAgICAgICAgIGZpbGw6IGJsYWNrOwogICAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iZG93bmxvYWQtY29tcCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTUsMjAgTDE1LDIyIEw5LDIyIEw5LDIwIEwxNSwyMCBaIE03LDIwIEw3LDIyIEwyLDIyIEwyLDIwIEw3LDIwIFogTTIyLDIwIEwyMiwyMiBMMTcsMjIgTDE3LDIwIEwyMiwyMCBaIE0xMywyIEwxMywxNC4yIEwxNy4zLDkuOSBMMTguNywxMS4zIEwxMiwxOCBMNS4zLDExLjMgTDYuNyw5LjkgTDExLDE0LjIgTDExLDIgTDEzLDIgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjRkZGRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="})],assetInfo:t}}};function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(){var e=a()(i.a.mark((function e(t,r){var n,c,s,a,u,l,p,d,g,b,m,f,v,I,y,h,O,j,C,_;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.toggleOverlay,c=r.licenseId,s=r.size,a=r.setAttributes,u=r.closeModal,l=r.handleError,p=r.isMediaPage,d=r.showSnackbar,e.prev=1,n(!0,Object(o.__)("wordpress:downloading_image","shutterstock")),b=null==t||null===(g=t.contributor)||void 0===g?void 0:g.id,m="",!b){e.next=10;break}return e.next=8,w()({path:"shutterstock/contributor/".concat(b)});case 8:I=e.sent,m=(null==I||null===(f=I.data)||void 0===f||null===(v=f[0])||void 0===v?void 0:v.display_name)||b;case 10:return e.next=12,w()({path:"shutterstock/images/".concat(t.id,"?mediaType=images")});case 12:return y=e.sent,h=y.assets,e.next=16,w()({path:"shutterstock/images/licenses/".concat(c,"/downloads"),method:"POST",contentType:"application/json",data:T({mediaType:"images",size:s,contributorName:m,imageId:t.id,description:t.description},null==h?void 0:h["".concat(s,"_jpg")])});case 16:(null==(O=e.sent)?void 0:O.success)?(j=O.data,C=j.url,_=j.id,p?p&&d(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(a({img:T(T({},t),{},{licensedImageUrl:C,contributorName:m,uploadedImageId:_})}),u()),n(!1)):l(O),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(1),n(!1),l(e.t0);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t,r){return e.apply(this,arguments)}}();function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var z=function(e){var t,r=e.closeModal,n=e.handleError,c=e.isMediaPage,s=e.routesConfig,u=e.setAttributes,l=e.showSnackbar,p=e.toggleOverlay,d=e.widgetRef;return{name:"licenseHistoryPage",path:"/license-history",component:ShutterstockWidget.components.LicenseHistoryPage,props:{theme:{container:"components-shutterstock-media-page__license-history-container"},onLicenseHistoryItemClick:function(e,t){var r=t.history;s[0].props=W(W({},s[0].props),{},{assetInfo:e}),d.current.updateRoutes({routesConfig:s}),d.current.toggleLoadingIndicator(!1),r.push("/images/".concat(e.id))},getMoreResults:(t=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k("images",t+1);case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)}),licenseHistory:[],overlayActions:[{label:Object(o.__)(c?"wordpress:text_download":"wordpress:text_dowbload_and_insert","shutterstock"),icon:j,onClick:function(e,t,o){e.preventDefault(),B(t,W(W({},o),{},{toggleOverlay:p,handleError:n,isMediaPage:c,setAttributes:u,showSnackbar:l,closeModal:r}))}}]}}};function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var U=function(e){var t,r=e.assetInfo,n=e.closeModal,c=e.commonLicensingProps,s=e.handleError,u=e.isMediaPage,l=e.setAttributes,p=e.showSnackbar,d=e.subscriptions,g=e.toggleOverlay;return{name:"licensingPage",path:"/license/images/:id",component:ShutterstockWidget.components.LicensingImagePage,props:{buttons:[R(R({},c),{},{onClick:(t=a()(i.a.mark((function e(t,r,c){var a,d,b,m,f,v,I,y,h,O,j,C,_,L;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=c.subscription,e.prev=1,g(!0,Object(o.__)("wordpress:text_licensing_image_please_wait","shutterstock")),m=null==r||null===(d=r.contributor)||void 0===d?void 0:d.id,f=null==r?void 0:r.media_type,I=(v="editorial"===f)?null==r?void 0:r.byline:"",!m||v){e.next=12;break}return e.next=10,w()({path:"shutterstock/contributor/".concat(m)});case 10:O=e.sent,I=(null==O||null===(y=O.data)||void 0===y||null===(h=y[0])||void 0===h?void 0:h.display_name)||m;case 12:return e.next=14,w()({path:"shutterstock/images/licenses",method:"POST",contentType:"application/json",data:R(R(R({subscription_id:null==a?void 0:a.id,size:null==a?void 0:a.size,id:r.id,description:r.description},(null==a?void 0:a.metadata)?{metadata:a.metadata}:{}),{},{contributorName:I},null==a?void 0:a.details_for_image),{},{mediaType:f,license:null==a?void 0:a.license,country:null===(b=shutterstock)||void 0===b?void 0:b.country,search_id:r.searchId})});case 14:(null==(j=e.sent)?void 0:j.success)?(C=j.data,_=C.url,L=C.id,u?u&&p(Object(o.__)("wordpress:text_image_stored_in_media_library","shutterstock")):(l({img:R(R({},r),{},{licensedImageUrl:_,contributorName:I,uploadedImageId:L})}),n()),g(!1)):s(j),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(1),g(!1),s(e.t0);case 22:case"end":return e.stop()}}),e,null,[[1,18]])}))),function(e,r,n){return t.apply(this,arguments)})})],assetInfo:r,subscriptions:d}}};function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J=/<\/?[a-z][^>]*?>/gi,Q=/\r?\n|\r/gi,Y=function(e){var t,r,n,c=e.setAttributes,s=e.closeModal,u=e.canLicense,l=void 0!==u&&u,p=e.assetInfo,b=void 0===p?{}:p,m=e.licenseImage,v=void 0!==m&&m,I=e.subscriptions,h=void 0===I?[]:I,w=e.isMediaPage,C=void 0!==w&&w,_=null===(t=shutterstock)||void 0===t||null===(r=t.permissions)||void 0===r?void 0:r.includes("can_user_search_editorial_images"),L=Object(f.useRef)(),x=Object(f.useState)({show:!1,text:""}),E=d()(x,2),S=E[0],A=E[1],Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return A(V(V({},S),{},{show:e,text:t}))},T=D({timeout:5e3}),B=T.snackbar,G=T.setSnackbar,W=function(e){return G(V(V({},B),{},{show:!0,text:e}))},H=function(e){var t,r,n,c=Object(o.__)("wordpress:text_something_went_wrong","shutterstock");500!==(null==e||null===(t=e.data)||void 0===t?void 0:t.statusCode)&&(null==e||null===(r=e.data)||void 0===r?void 0:r.message)&&(c=null==e||null===(n=e.data)||void 0===n?void 0:n.message);W(c),Z(!1)},R={label:Object(o.__)("wordpress:text_insert_preview","shutterstock"),onClick:function(e,t){e.preventDefault(),c({img:t}),s()}},F=C?[]:[V(V({},R),{},{icon:j})],Y=[N({assetInfo:b,commonInsertPreviewProps:R,isMediaPage:C})];if(l){var K={label:Object(o.__)("wordpress:text_license","shutterstock"),icon:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+c2hvcHBpbmctY2FydDwvdGl0bGU+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0ic2hvcHBpbmctY2FydCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTcsMTggQzE1LjksMTggMTUsMTguOSAxNSwyMCBDMTUsMjEuMSAxNS45LDIyIDE3LDIyIEMxOC4xLDIyIDE5LDIxLjEgMTksMjAgQzE5LDE4LjkgMTguMSwxOCAxNywxOCBaIE05LDE4IEM3LjksMTggNywxOC45IDcsMjAgQzcsMjEuMSA3LjksMjIgOSwyMiBDMTAuMSwyMiAxMSwyMS4xIDExLDIwIEMxMSwxOC45IDEwLjEsMTggOSwxOCBaIE0yMCw5IEwyMCw1IEw3LjMsNSBMNi45LDIgTDYsMiBMMywyIEMzLDMuMSAzLjksNCA1LDQgTDUuMSw0IEw3LjEsMTcgTDE1LDE3IEwxOSwxNyBDMTksMTUuOSAxOC4xLDE1IDE3LDE1IEw4LjksMTUgTDguNiwxMyBMMTYsMTMgQzE4LjIsMTMgMjAsMTEuMiAyMCw5IFogTTguMiwxMSBMNy42LDcgTDE4LDcgTDE4LDkgQzE4LDEwLjEgMTcuMSwxMSAxNiwxMSBMOC4yLDExIFoiIGlkPSJTaGFwZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJub256ZXJvIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",isPrimary:!0,onClick:(n=a()(i.a.mark((function e(t,r,n){var c,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.prev=1,c=r.media_type,Z(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=6,M(r.id,c);case 6:s=e.sent,Y[1].props=V(V({},Y[1].props),{},{assetInfo:r,subscriptions:s,searchId:r.searchId}),L.current.updateRoutes({routesConfig:Y}),L.current.toggleLoadingIndicator(!1),Z(!1),n.history.push("/license/images/".concat(r.id)),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),L.current.toggleLoadingIndicator(!1),Z(!1),H(e.t0);case 19:case"end":return e.stop()}}),e,null,[[1,14]])}))),function(e,t,r){return n.apply(this,arguments)})};F.push(V({},K)),Y[0].props.buttons.push(V({},K)),Y.push(U({assetInfo:b,closeModal:s,commonLicensingProps:K,handleError:H,isMediaPage:C,setAttributes:c,showSnackbar:W,subscriptions:h,toggleOverlay:Z}),z({closeModal:s,handleError:H,isMediaPage:C,routesConfig:Y,setAttributes:c,showSnackbar:W,toggleOverlay:Z,widgetRef:L}))}Object(f.useEffect)((function(){var e,t,r,n,c=[{label:Object(o.__)("wordpress:text_images","shutterstock"),assetType:"images"},{label:Object(o.__)("wordpress:text_editorial","shutterstock"),assetType:"editorial"}],i=V({mediaType:"images",imageType:["photo"],subtitle:"",container:L.current,showMore:!0,key:null===(e=shutterstock)||void 0===e?void 0:e.api_key,languageCode:null===(t=shutterstock)||void 0===t?void 0:t.language,dynamicTitle:!0,dynamicSubtitle:!0,showSearchBar:!0,assetsPerPage:26,onItemClick:function(e,t,r){e.preventDefault(),Y[0].props=V(V({},Y[0].props),{},{assetInfo:t}),L.current.updateRoutes({routesConfig:Y}),L.current.toggleLoadingIndicator(!1),r.history.push("/images/".concat(t.id))},theme:{searchBar:{searchForm:"components-shutterstock-ui__searchForm",searchContainer:"components-shutterstock-ui__searchContainer",inputGroup:"components-shutterstock-ui__inputgroup",formControlInput:"components-shutterstock-ui__input",filterDrawer:{filterDrawerContainer:"components-shutterstock-ui__filterDrawerContainer",overlay:"components-shutterstock-ui__widget-drawer-position-fixed",filterDrawer:"components-shutterstock-ui__widget-drawer-position-fixed",filterButtonWrapper:"components-shutterstock-ui__filterButtonWrapper"}}},extraRoutes:V(V({},v?{initialRoute:"/license/images/".concat(b.id)}:{}),{},{routesConfig:Y,excludeSearchBarRoutes:["^/license-history$"]}),overlayActions:F,customHeaders:{"x-shutterstock-application":"Wordpress/".concat(null===(r=shutterstock)||void 0===r?void 0:r.version)},editorialCountry:null===(n=shutterstock)||void 0===n?void 0:n.country,searchFilters:V({showFilterDrawer:!0,images:{orientationFilter:!0}},_?{searchBarDropdownFilters:c}:{})},C?{}:{searchSuggestions:{enable:!0,textProvider:function(){var e=wp.data.select("core/editor").getEditedPostAttribute("title")||"",t=wp.data.select("core/editor").getEditedPostContent()||"";return Object(O.__unstableStripHTML)("".concat(e," ").concat(t)).replace(J,"").replace(Q,"").trim()}},title:Object(o.__)("wordpress:text_add_shuttersock_content_to_post","shutterstock")});if("object"===("undefined"==typeof window?"undefined":y()(window))&&window.ShutterstockWidget){var s=new window.ShutterstockWidget(i);s.search({query:""}),L.current=s}}),[]);var X=C?"media-page":"";return Object(g.createElement)(g.Fragment,null,l&&Object(g.createElement)("div",{className:"components-shutterstock-ui__navigation ".concat(S.show?"disabled":""," ").concat(X)},Object(g.createElement)("a",{onClick:function(e,t){L.current.getHistory().push("/")}},Object(o.__)("wordpress:text_home","shutterstock")),Object(g.createElement)("a",{className:"components-shutterstock-ui__download",onClick:function(){var e=a()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Z(!0,Object(o.__)("wordpress:text_loading_please_wait","shutterstock")),e.next=4,k("images");case 4:r=e.sent,Y[2].props=V(V({},Y[2].props),{},{licenseHistory:r}),L.current.updateRoutes({routesConfig:Y}),L.current.toggleLoadingIndicator(!1),Z(!1),L.current.getHistory().push("/license-history"),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),L.current.toggleLoadingIndicator(!1),Z(!1),H(e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})));return function(t){return e.apply(this,arguments)}}()},Object(o.__)("wordpress:text_downloads","shutterstock"))),Object(g.createElement)("div",{ref:L,className:"components-shutterstock-ui__widget-container ".concat(X)}),S.show&&Object(g.createElement)("div",{className:"components-shutterstock-ui__widget-container-overlay ".concat(X)},S.text&&Object(g.createElement)("div",{className:"text"},S.text)),B.show&&Object(g.createElement)(P,{text:B.text}))},K=(r(22),function(){return Object(g.createElement)("svg",{className:"components-shutterstock-logo",viewBox:"0 0 175 26",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(g.createElement)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Object(g.createElement)("g",{className:"components-shutterstock-logo__stck"},Object(g.createElement)("path",{d:"M104.443726,14.7782632 C104.178897,14.7303684 103.290589,14.5784737 103.030418,14.5292105 C101.627091,14.2698947 100.42538,13.9325789 100.42538,12.4806842 C100.42538,11.2340526 101.696293,10.6524737 103.277947,10.6524737 C105.631464,10.6524737 107.695532,11.7492632 107.931084,11.8703684 L109.221293,8.37063158 C108.724905,8.10584211 106.624905,6.95226316 103.317871,6.95226316 C100.288973,6.95226316 96.5893536,8.58752632 96.5893536,12.6565263 C96.5893536,16.2978947 99.1198669,17.4665263 101.558555,17.9078421 C101.895247,17.9714737 102.953897,18.1575789 103.256654,18.2116316 C104.896863,18.4969474 105.797814,19.1250526 105.797814,20.2286842 C105.797814,21.6292632 104.518251,22.2861053 102.581274,22.2861053 C99.4798479,22.2861053 97.659981,21.3357368 97.1343156,21.1133684 L95.705038,24.5371579 C96.1488593,24.7725263 98.2661597,26 102.397624,26 C106.406654,26 109.623859,23.9583158 109.623859,20.1582105 C109.592586,16.6208421 107.280323,15.2791053 104.443726,14.7782632"}),Object(g.createElement)("path",{d:"M116.685076,0.579526316 L112.89097,2.73752632 L112.89097,7.30805263 L110.893441,7.30805263 L110.893441,11.0390526 L112.89097,11.0390526 L112.89097,19.1052105 C112.89097,22.5508947 114.268346,25.6448947 119.126426,25.6448947 L120.645532,25.6448947 L120.645532,21.9104737 L120.075951,21.9104737 C117.687833,21.9104737 116.685076,20.4934737 116.685076,18.5687895 L116.685076,11.0390526 L121.042776,11.0390526 L121.042776,7.30805263 L116.685076,7.30805263 L116.685076,0.579526316"}),Object(g.createElement)("path",{d:"M146.327281,10.7455263 C147.80846,10.7455263 149.324905,11.4379474 149.780038,13.1135789 L153.222814,11.7670526 C152.25865,8.26252632 149.092681,6.95226316 146.3,6.95226316 C141.296198,6.95226316 139.278707,10.1475263 139.278707,13.2531579 L139.278707,19.6977368 C139.278707,22.802 141.296198,26 146.3,26 C149.092681,26 152.25865,24.6876842 153.222814,21.1831579 L149.780038,19.8373158 C149.324905,21.5108947 147.80846,22.2074211 146.327281,22.2074211 C143.749525,22.2074211 143.06616,20.7562105 143.06616,19.1017895 L143.06616,13.8477368 C143.06616,12.1953684 143.749525,10.7455263 146.327281,10.7455263"}),Object(g.createElement)("polyline",{points:"162.551046 15.5438947 169.644202 7.30805263 164.978422 7.30805263 158.877376 14.4867895 158.877376 0.580210526 155.079943 0.580210526 155.079943 25.6448947 158.877376 25.6448947 158.877376 19.8085789 160.123004 18.3621579 165.555989 25.6448947 170.109316 25.6448947 162.551046 15.5438947"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__o"},Object(g.createElement)("path",{d:"M131.656559,11.3093158 L127.711407,11.3093158 C127.083935,11.3093158 126.574905,11.8334211 126.574905,12.4758947 L126.574905,16.8781053 L122.682985,16.8781053 L122.682985,12.4758947 C122.682985,9.62068421 124.9327,7.30805263 127.711407,7.30805263 L131.656559,7.30805263 L131.656559,11.3093158"}),Object(g.createElement)("path",{d:"M128.445342,21.6429474 L132.393156,21.6429474 C133.017966,21.6429474 133.528327,21.1195263 133.528327,20.475 L133.528327,16.0741579 L137.419582,16.0741579 L137.419582,20.475 C137.419582,23.3302105 135.169202,25.6448947 132.393156,25.6448947 L128.445342,25.6448947 L128.445342,21.6429474"})),Object(g.createElement)("g",{className:"components-shutterstock-logo__shutter"},Object(g.createElement)("path",{d:"M64.1032319,7.30805263 L68.4596008,7.30805263 L68.4596008,11.0390526 L64.1032319,11.0390526 L64.1032319,18.5687895 C64.1032319,20.4934737 65.1053232,21.9104737 67.4914449,21.9104737 L68.0610266,21.9104737 L68.0610266,25.6448947 L66.5412548,25.6448947 C61.6818441,25.6448947 60.3084601,22.5508947 60.3084601,19.1052105 L60.3084601,11.0390526 L53.9226236,11.0390526 L53.9226236,18.5687895 C53.9226236,20.4934737 54.926711,21.9104737 57.3128327,21.9104737 L57.8804183,21.9104737 L57.8804183,25.6448947 L56.359981,25.6448947 C51.5025665,25.6448947 50.1265209,22.5508947 50.1265209,19.1052105 L50.1265209,11.0390526 L48.2028517,11.0390526 L48.2028517,7.30805263 L50.1265209,7.30805263 L50.1265209,2.73752632 L53.9226236,0.579526316 L53.9226236,7.30805263 L60.3084601,7.30805263 L60.3084601,2.73752632 L64.1032319,0.579526316 L64.1032319,7.30805263"}),Object(g.createElement)("path",{d:"M23.1419202,6.95226316 C21.9415399,6.95226316 20.7238593,7.19105263 19.6279468,7.66863158 L19.6279468,0.579526316 L15.8331749,0.579526316 L15.8331749,25.6448947 L19.6279468,25.6448947 L19.6279468,11.3161579 C20.3904943,10.8235263 21.4877376,10.5293158 22.5603612,10.5293158 C24.9458175,10.5293158 26.068346,11.8929474 26.068346,13.9038421 L26.068346,25.6448947 L29.8597909,25.6448947 L29.8597909,13.3708421 C29.8597909,9.66994737 27.2527567,6.95226316 23.1419202,6.95226316"}),Object(g.createElement)("path",{d:"M42.3746198,21.9980526 C41.653327,22.3983158 40.7403992,22.6275263 39.8321293,22.6275263 C37.0001901,22.6275263 35.9355513,21.1441579 35.9355513,19.0983684 L35.9355513,7.30805263 L32.1414449,7.30805263 L32.1414449,19.1702105 C32.1414449,23.7811053 34.7331749,26 39.365019,26 C41.5834601,26 44.0401141,25.4232105 46.1673954,24.4762632 L46.1673954,7.30805263 L42.3746198,7.30805263 L42.3746198,21.9980526"}),Object(g.createElement)("path",{d:"M8.73802281,14.7782632 C8.47519011,14.7303684 7.58555133,14.5784737 7.32471483,14.5292105 C5.92404943,14.2698947 4.71967681,13.9325789 4.71967681,12.4806842 C4.71967681,11.2340526 5.98925856,10.6524737 7.57290875,10.6524737 C9.92576046,10.6524737 11.9898289,11.7492632 12.2253802,11.8703684 L13.514924,8.37063158 C13.0218631,8.10584211 10.9198669,6.95226316 7.6108365,6.95226316 C4.58393536,6.95226316 0.88365019,8.58752632 0.88365019,12.6565263 C0.88365019,16.2978947 3.4115019,17.4665263 5.85351711,17.9078421 C6.18954373,17.9714737 7.24885932,18.1575789 7.55361217,18.2116316 C9.19315589,18.4969474 10.0901141,19.1250526 10.0901141,20.2286842 C10.0901141,21.6292632 8.81454373,22.2861053 6.87823194,22.2861053 C3.77414449,22.2861053 1.95427757,21.3357368 1.42794677,21.1133684 L0,24.5371579 C0.445152091,24.7725263 2.56178707,26 6.69325095,26 C10.7022814,26 13.9194867,23.9583158 13.9194867,20.1582105 C13.8848859,16.6208421 11.573289,15.2791053 8.73802281,14.7782632"}),Object(g.createElement)("path",{d:"M80.3536122,15.0861579 L73.9557985,15.0861579 L73.9557985,13.7519474 C73.9557985,12.2637895 74.6824144,10.6675263 77.1743346,10.6675263 C79.5764259,10.6675263 80.3536122,12.2220526 80.3536122,13.6794211 L80.3536122,15.0861579 Z M84.148384,13.2531579 C84.148384,9.89915789 81.6624525,6.95089474 77.1923004,6.95089474 C72.1179658,6.95089474 70.1696768,10.2091053 70.1696768,13.2531579 L70.1696768,19.3433158 C70.1696768,23.5566842 72.7880228,26 77.1923004,26 C81.0775665,26 83.0943916,23.6901053 83.693251,22.3025263 L80.490019,20.3237895 C80.2165399,21.1386842 78.948289,22.282 77.2175856,22.282 C74.8713878,22.282 73.9691065,20.9361579 73.9691065,19.2495789 L73.9557985,18.2451579 L84.148384,18.2451579 L84.148384,13.2531579 L84.148384,13.2531579 Z"}),Object(g.createElement)("path",{d:"M86.5764259,13.26 L86.5764259,25.6448947 L90.3678707,25.6448947 L90.3678707,13.5932105 C90.3678707,12.5408947 90.9487643,10.7421053 93.7334601,10.7421053 C94.1706274,10.7421053 95.1587452,10.8700526 95.4748099,10.9309474 L95.4748099,7.14863158 C95.1327947,7.06378947 94.3489544,6.95089474 93.5391635,6.95089474 C88.7163498,6.95089474 86.5764259,10.0613158 86.5764259,13.26"}))))}),X=(r(23),function(e){var t=e.setAttributes,r=e.closeModal,n=e.canLicense,o=e.assetInfo,c=e.licenseImage,i=e.subscriptions;return Object(g.createElement)(g.Fragment,null,Object(g.createElement)(b.Modal,{overlayClassName:"overlay",shouldCloseOnClickOutside:!1,className:"components-shutterstock-modal__content",title:Object(g.createElement)(K,null),onRequestClose:r},Object(g.createElement)("div",{style:{width:"100%"}},Object(g.createElement)(Y,{setAttributes:t,closeModal:r,canLicense:n,assetInfo:o,licenseImage:c,subscriptions:i}))))});function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ee=Object(m.withDispatch)((function(e){return{replaceBlock:e("core/block-editor").replaceBlock}}))((function(e){var t,r,c,s,u,l,p,m,f,I,y,h,w=Object(g.useState)(!1),O=d()(w,2),j=O[0],C=O[1],_=Object(g.useState)(!1),L=d()(_,2),k=L[0],x=L[1],E=Object(g.useState)(!1),S=d()(E,2),A=S[0],N=S[1],Z=Object(g.useState)(!1),T=d()(Z,2),B=T[0],G=T[1],W=Object(g.useState)([]),z=d()(W,2),H=z[0],R=z[1],U=function(){return C(!0)},F=(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.media_type)||"image",V="editorial"===F,J=shutterstock.permissions,Q=void 0===J?{}:J,Y=Q.includes("can_user_license_all_shutterstock_images"),K=Q.includes("can_user_license_shutterstock_editorial_image"),q=Q.includes("can_user_license_shutterstock_photos"),ee=!1;(Y||V&&K||!V&&q)&&(ee=!0);var te=function(e){x(e),G(e)},re=D({onRemoveSnackbar:function(){return te(!1)}}),ne=re.snackbar,oe=re.setSnackbar;return Object(g.useEffect)((function(){var t,r;if(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl){var o=e.attributes.img,c=o.licensedImageUrl,i=o.contributorName,s=o.uploadedImageId,a=o.description,u=Object(n.createBlock)("core/image",{url:c,id:s,caption:"Image: ".concat(i,", Shutterstock"),alt:a,align:"center"});e.replaceBlock(e.clientId,u)}}),[null===(c=e.attributes)||void 0===c||null===(s=c.img)||void 0===s?void 0:s.licensedImageUrl]),Object(g.createElement)("div",{className:e.className},Object(g.createElement)("div",null,Object(g.createElement)("span",{className:"components-edit__shutterstock-icon"},Object(g.createElement)(v,null)),Object(g.createElement)("span",{className:"components-edit__heading"},"Shutterstock")),e.attributes.img?Object(g.createElement)("div",{className:"components-edit__image-container"},Object(g.createElement)("img",{src:(null===(u=e.attributes)||void 0===u||null===(l=u.img)||void 0===l?void 0:l.licensedImageUrl)||(null===(p=e.attributes)||void 0===p||null===(m=p.img)||void 0===m||null===(f=m.preview_1500)||void 0===f?void 0:f.url),onLoad:function(){return N(!0)}}),ee&&A&&!(null===(I=e.attributes)||void 0===I||null===(y=I.img)||void 0===y?void 0:y.licensedImageUrl)&&Object(g.createElement)(b.Button,{disabled:B,onClick:a()(i.a.mark((function t(){var r,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,te(!0),t.next=4,M(null===(r=e.attributes)||void 0===r?void 0:r.img.id,F);case 4:n=t.sent,R(n),U(),G(!1),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),c=t.t0,i=void 0,s=void 0,a=void 0,a=Object(o.__)("wordpress:text_something_went_wrong","shutterstock"),500!==(null==c||null===(i=c.data)||void 0===i?void 0:i.statusCode)&&(null==c||null===(s=c.data)||void 0===s?void 0:s.message)&&(a=c.data.message),oe($($({},ne),{},{show:!0,text:a}));case 13:case"end":return t.stop()}var c,i,s,a}),t,null,[[0,10]])}))),className:"components-edit__license-image-button"},B&&Object(g.createElement)("span",{className:"loading-spinner"}),Object(g.createElement)("span",null,Object(o.__)("wordpress:text_license_this_image","shutterstock")))):Object(g.createElement)("span",null),Object(g.createElement)("div",{className:"components-edit__paragraph"},Object(o.__)("wordpress:text_block_paragraph","shutterstock")),Object(g.createElement)(b.Button,{disabled:B,onClick:function(){U(),x(!1)},className:"components-shutterstock-modal__open-modal-button "},Object(o.__)("wordpress:text_browse","shutterstock")),j&&Object(g.createElement)(X,{setAttributes:e.setAttributes,closeModal:function(){return C(!1)},canLicense:ee,assetInfo:null==e||null===(h=e.attributes)||void 0===h?void 0:h.img,licenseImage:k,subscriptions:H}),ne.show&&!j&&Object(g.createElement)(P,{text:ne.text}))}));Object(n.registerBlockType)("shutterstock/shutterstock-block",{title:"Shutterstock",description:Object(o.__)("wordpress:text_block_description_in_sidebar","shutterstock"),category:"common",icon:v,supports:{html:!1},edit:ee,save:function(e){var t,r,n,c,i;return Object(g.createElement)("img",{alt:Object(o.__)("Alt text"),className:"wp-block-shutterstock-shutterstock-block",src:(null===(t=e.attributes)||void 0===t||null===(r=t.img)||void 0===r?void 0:r.licensedImageUrl)||(null===(n=e.attributes)||void 0===n||null===(c=n.img)||void 0===c||null===(i=c.preview_1500)||void 0===i?void 0:i.url)})},attributes:{img:{type:"object"}}})}]);
  • shutterstock/trunk/shutterstock.php

    r2469573 r2519174  
    1616 * Plugin Name:       Shutterstock
    1717 * Description:       Access exceptional, royalty-free content straight from WordPress.
    18  * Version:           1.3.4
     18 * Version:           1.3.5
    1919 * Author:            Shutterstock
    2020 * License:           MIT
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'SHUTTERSTOCK_VERSION', '1.3.4' );
     36define( 'SHUTTERSTOCK_VERSION', '1.3.5' );
    3737
    3838/**
Note: See TracChangeset for help on using the changeset viewer.