diff --git a/.eslintrc.json b/.eslintrc.json index 42a5e8b6a..8f8f8ae8f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,6 +7,7 @@ "jQuery": "readonly", "$": "readonly", "CLDN": "readonly", + "CLDLB": "readonly", "CLD_GLOBAL_TRANSFORMATIONS": "readonly", "samplePlayer": "readonly", "CLDCACHE": "readonly" diff --git a/.version b/.version index a4dd9dba4..24172f4d4 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.7.4 +2.7.5-rc-3 diff --git a/css/cloudinary.css b/css/cloudinary.css index bab83e705..97ce746a1 100644 --- a/css/cloudinary.css +++ b/css/cloudinary.css @@ -1 +1 @@ -.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem;position:absolute;right:0}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group-heading{display:flex}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group .cld-group .cld-group{padding-left:4px}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group .cld-group .cld-group hr{display:none}.cld-group-heading{display:flex;justify-content:space-between}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file diff --git a/css/src/components/_ui.scss b/css/src/components/_ui.scss index 737dfb3b8..963245f48 100644 --- a/css/src/components/_ui.scss +++ b/css/src/components/_ui.scss @@ -198,8 +198,6 @@ align-self: center; padding: 0 0.45rem; cursor: pointer; - position: absolute; - right: 0; } &-title { @@ -318,6 +316,9 @@ } &-group { + .cld-group .cld-group { + padding-left: 4px; + } hr { border-top: 1px solid $color-light-grey; @@ -325,9 +326,13 @@ clear: both; } + .cld-group .cld-group hr { + display: none; + } + &-heading { display: flex; - + justify-content: space-between; h3 { font-size: 0.9rem; diff --git a/js/cloudinary.js b/js/cloudinary.js index 139f62874..99caacb48 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=n(11)},function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(r){const i=e(this),o=e(i.attr("href"));r.preventDefault(),t.removeClass("active"),n.removeClass("active"),i.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",i)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const r in n){let i=e("#field-"+r);const o=n[r],a=t.closest("tr");i.length||(i=e(`[id^=field-${r}-]`));let s=!1;i.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=v.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return $n}));n(9),n(10);var r=n(2),i=n.n(r),o=n(3),a=n.n(o);const s={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:A(C(e))}function T(e,t){var n;void 0===t&&(t=[]);var r=A(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=v(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(T(C(a)))}function P(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=v(e),n=S(e);n&&P(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=C(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===v(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=g?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=g?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t){return t===q?me(function(e){var t=v(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=g(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ge(e,t,n){var r="clippingParents"===t?function(e){var t=T(C(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ve(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,v=ye("number"!=typeof h?h:be(h,R)),g=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?g:u],O=ge(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,C={top:O.top-k.top+v.top,bottom:k.bottom-O.bottom+v.bottom,left:O.left-k.left+v.left,right:k.right-O.right+v.right},A=e.modifiersData.offset;if(u===U&&A){var T=A[i];Object.keys(C).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";C[e]+=T[n]*t}))}return C}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!h?[de(v)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,T=A?"width":"height",P=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=A?C?M:F:C?N:I;w[T]>_[T]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(P[k]<=0),s&&H.push(P[S]<=0,P[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var C="y"===w?I:F,A="y"===w?N:M,T="y"===w?"height":"width",P=x[w],S=x[w]+v[C],B=x[w]-v[A],R=f?-E[T]/2:0,H=y===z?O[T]:E[T],q=y===z?-E[T]:-O[T],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[C],G=Q[A],$=_e(0,O[T],W[T]),J=b?O[T]/2-R-$-V-j:H-$-V-j,X=b?-O[T]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,P,f?ie(B,ae):B);x[w]=se,L[w]=se-P}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+v[ce],pe=ue-v[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=D(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=u[p],w=g-d[l]-u[f],_=g/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ce="tippy-svg-arrow",Ae={passive:!0,capture:!0};function Te(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function ze(e){return Pe(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ce,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ce)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,v=[],g=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),g=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Te(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(C()){var o=P(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&C()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=A();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Te(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,C()&&(x.style.visibility="hidden");if(F(),q(),D(),C()){var i=P(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?C()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ne(dt,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",g),g(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function A(){return l||e}function T(){var e=A().parentNode;return e?Qe(e):document}function P(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Te(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){T().removeEventListener("mousemove",g),dt=dt.filter((function(e){return e!==g}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(A().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function q(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function U(e,t){var n=P().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=A().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==A()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=C()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ae),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,vt=n(4),gt=n.n(vt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=t.map((t=>{const n=document.getElementById(t),r=document.getElementById(t+"_size_wrapper");return r&&(n.filesize=0,n.sizespan=r),this._addChild(n,e),n})),this._bindEvents(e),e.masters.forEach((e=>{this._bindEvents(e)}))},_bindEvents(e){e.eventBound||(e.addEventListener("click",(t=>{const n=t.target;n.elements&&(this._checkDown(n),this._evaluateSize(n)),n.masters&&this._checkUp(e)})),e.eventBound=!0)},_addChild(e,t){const n=e.elements?e.elements:[];-1===n.indexOf(t)&&(n.push(t),e.elements=n)},_removeChild(e,t){const n=e.elements.indexOf(t);-1{t.checked!==e.checked&&(t.checked=e.checked,t.disabled&&(t.checked=!1),t.dispatchEvent(new Event("change")))})),e.elements.forEach((t=>{this._checkDown(t),t.elements||this._checkUp(t,e)})))},_checkUp(e,t){e.masters&&[...e.masters].forEach((e=>{e!==t&&this._evaluateCheckStatus(e),this._checkUp(e),this._evaluateSize(e)}))},_evaluateCheckStatus(e){let t=0,n=e.classList.contains("partial");n&&(e.classList.remove("partial"),n=!1),e.elements.forEach((r=>{null!==r.parentNode?(t+=r.checked,r.classList.contains("partial")&&(n=!0)):this._removeChild(e,r)}));let r="some";t===e.elements.length?r="on":0===t?r="off":n=!0,n&&e.classList.add("partial");const i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,e.dispatchEvent(new Event("change")))},_evaluateSize(e){if(e.sizespan&&e.elements){e.filesize=0,e.elements.forEach((t=>{t.checked&&(e.filesize+=t.filesize)}));let t=null;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(5),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function Ct(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+gn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Tn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Pn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(An(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Tn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Pn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Pn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;var Qn={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);c.addEventListener("change",(t=>{this._handleManager(e)})),window.addEventListener("CacheToggle",(e=>{e.detail.cachePoint===t&&this._cacheChange(t,e.detail)})),l.addEventListener("click",(e=>{this._applyChanges(t)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),this.cachePoints["_"+e]=t},close(e){e.classList.add("closed")},open(e){e.classList.remove("closed")},isOpen(e){const t=this.getCachePoint(e);let n=!1;return t&&(n=t.controller.checked&&t.master.checked),n},_bind(e){const t=e.dataset.cachePoint;this.setCachePoint(t,e),this._handleManager(t)},_handleManager(e){const t=this.getCachePoint(e);t&&(this.isOpen(e)?(this.open(t.viewer),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),Wn({path:CLDCACHE.fetch_url,data:{ID:e,page:t.currentPage,search:t.search.value},method:"POST"}).then((e=>{t.removeChild(t.loader),this._buildList(t,e.items),this._buildNav(t,e);const n=t.querySelectorAll("[data-master]");yt.bind(n),t.loaded=!0}))},_cacheChange(e,t){const n=t.checked?t.states.on:t.states.off,r=t.checked?t.states.off:t.states.on;this._removeFromList(e,t.item.ID,r)||this._addToList(e,t.item.ID,n),this._evaluateApply(e)},_evaluateApply(e){this.close(e.apply);const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&this.open(e.apply)},_applyChanges(e){const t=e.apply.cacheChanges;e.apply.disabled="disabled";for(const n in t)t[n].length&&this._set_state(e,n,t[n])},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this.close(e.apply),this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled=""})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_purgeCache(e){Wn({path:CLDCACHE.purge_url,data:{cachePoint:e.dataset.cachePoint},method:"POST"}).then((()=>{this._load(e.dataset.cachePoint)}))},_showSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="visible"}))},_hideSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="hidden"}))},_removeFromList(e,t,n){const r=this._getListIndex(e,t,n);let i=!1;return-1e.apply.cacheChanges[n].indexOf(t),_noCache(e){const t=this._getNote(wp.i18n.__("No files cached.","cloudinary"));e.viewer.appendChild(t),this.close(e.table)},_clearChildren(e){for(;e.children.length;){const t=e.lastChild;t.children.length&&this._clearChildren(t),e.removeChild(t)}},_buildList(e,t){t.forEach((t=>{if(t.note)return void e.appendChild(this._getNote(t.note));const n=this._getRow(t.ID),r=this._getStateSwitch(e,t,{on:"enable",off:"disable"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");if(t.items.length){const t=document.createElement("button");t.type="button",t.className="button",t.innerText=wp.i18n.__("Purge cache point","cloudinary"),t.style.float="left",e.paginate.appendChild(t),t.addEventListener("click",(t=>{confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))&&this._purgeCache(e)}))}n.type="button",n.innerHTML="‹",n.className="button cld-pagenav-prev",1===t.current_page?n.disabled=!0:n.addEventListener("click",(n=>{e.currentPage=t.current_page-1,this._load(e.dataset.cachePoint)})),r.type="button",r.innerHTML="›",r.className="button cld-pagenav-next",t.current_page===t.total_pages||0===t.total_pages?r.disabled=!0:r.addEventListener("click",(n=>{e.currentPage=t.current_page+1,this._load(e.dataset.cachePoint)}));const i=document.createElement("span");i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r)},_getNote(e){const t=this._getRow(),n=document.createElement("td");return n.colSpan=2,n.innerText=e,t.appendChild(n),t},_getRow(e){const t=document.createElement("tr");return e&&(t.id="row_"+e),t},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=[e.dataset.slug+"_selector"],c=this._getListIndex(e,t.ID,"disable");return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const Vn={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c={};yt.bind(a),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,c))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),Qn.init(e)},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){n.bindings[t].value=e.value,"checkbox"!==e.type&&"radio"!==e.type||(n.bindings[t].checked=e.checked);for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",Vn._init(document));var Gn=Vn;window.$=window.jQuery;const $n={UI:Gn,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=n(11)},function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(r){const i=e(this),o=e(i.attr("href"));r.preventDefault(),t.removeClass("active"),n.removeClass("active"),i.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",i)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const r in n){let i=e("#field-"+r);const o=n[r],a=t.closest("tr");i.length||(i=e(`[id^=field-${r}-]`));let s=!1;i.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=v.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return $n}));n(9),n(10);var r=n(2),i=n.n(r),o=n(3),a=n.n(o);const s={sample:{image:document.getElementById("transformation-sample-image"),video:document.getElementById("transformation-sample-video")},preview:{image:document.getElementById("sample-image"),video:document.getElementById("sample-video")},fields:document.getElementsByClassName("cld-ui-input"),button:{image:document.getElementById("refresh-image-preview"),video:document.getElementById("refresh-video-preview")},spinner:{image:document.getElementById("image-loader"),video:document.getElementById("video-loader")},optimization:{image:document.getElementById("image_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:A(C(e))}function T(e,t){var n;void 0===t&&(t=[]);var r=A(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=v(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(T(C(a)))}function P(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=v(e),n=S(e);n&&P(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=C(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===v(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=g?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=g?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ve(e,t){return t===q?me(function(e){var t=v(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=g(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ge(e,t,n){var r="clippingParents"===t?function(e){var t=T(C(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ve(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,v=ye("number"!=typeof h?h:be(h,R)),g=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?g:u],O=ge(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,C={top:O.top-k.top+v.top,bottom:k.bottom-O.bottom+v.bottom,left:O.left-k.left+v.left,right:k.right-O.right+v.right},A=e.modifiersData.offset;if(u===U&&A){var T=A[i];Object.keys(C).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";C[e]+=T[n]*t}))}return C}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!h?[de(v)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,T=A?"width":"height",P=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=A?C?M:F:C?N:I;w[T]>_[T]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(P[k]<=0),s&&H.push(P[S]<=0,P[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var C="y"===w?I:F,A="y"===w?N:M,T="y"===w?"height":"width",P=x[w],S=x[w]+v[C],B=x[w]-v[A],R=f?-E[T]/2:0,H=y===z?O[T]:E[T],q=y===z?-E[T]:-O[T],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[C],G=Q[A],$=_e(0,O[T],W[T]),J=b?O[T]/2-R-$-V-j:H-$-V-j,X=b?-O[T]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,P,f?ie(B,ae):B);x[w]=se,L[w]=se-P}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+v[ce],pe=ue-v[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=D(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=u[p],w=g-d[l]-u[f],_=g/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ce="tippy-svg-arrow",Ae={passive:!0,capture:!0};function Te(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function ze(e){return Pe(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ce,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ce)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,v=[],g=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),g=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Te(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(C()){var o=P(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&C()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=A();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Te(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,C()&&(x.style.visibility="hidden");if(F(),q(),D(),C()){var i=P(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?C()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ne(dt,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",g),g(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function A(){return l||e}function T(){var e=A().parentNode;return e?Qe(e):document}function P(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Te(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){T().removeEventListener("mousemove",g),dt=dt.filter((function(e){return e!==g}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(A().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function q(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function U(e,t){var n=P().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=A().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==A()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=C()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ae),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,vt=n(4),gt=n.n(vt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=t.map((t=>{const n=document.getElementById(t),r=document.getElementById(t+"_size_wrapper");return r&&(n.filesize=0,n.sizespan=r),this._addChild(n,e),n})),this._bindEvents(e),e.masters.forEach((e=>{this._bindEvents(e)}))},_bindEvents(e){e.eventBound||(e.addEventListener("click",(t=>{const n=t.target;n.elements&&(this._checkDown(n),this._evaluateSize(n)),n.masters&&this._checkUp(e)})),e.eventBound=!0)},_addChild(e,t){const n=e.elements?e.elements:[];-1===n.indexOf(t)&&(n.push(t),e.elements=n)},_removeChild(e,t){const n=e.elements.indexOf(t);-1{t.checked!==e.checked&&(t.checked=e.checked,t.disabled&&(t.checked=!1),t.dispatchEvent(new Event("change")))})),e.elements.forEach((t=>{this._checkDown(t),t.elements||this._checkUp(t,e)})))},_checkUp(e,t){e.masters&&[...e.masters].forEach((e=>{e!==t&&this._evaluateCheckStatus(e),this._checkUp(e),this._evaluateSize(e)}))},_evaluateCheckStatus(e){let t=0,n=e.classList.contains("partial");n&&(e.classList.remove("partial"),n=!1),e.elements.forEach((r=>{null!==r.parentNode?(t+=r.checked,r.classList.contains("partial")&&(n=!0)):this._removeChild(e,r)}));let r="some";t===e.elements.length?r="on":0===t?r="off":n=!0,n&&e.classList.add("partial");const i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,e.dispatchEvent(new Event("change")))},_evaluateSize(e){if(e.sizespan&&e.elements){e.filesize=0,e.elements.forEach((t=>{t.checked&&(e.filesize+=t.filesize)}));let t=null;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(5),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function Ct(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+gn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Tn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Pn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(An(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Tn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Pn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Pn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;var Qn={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);c.addEventListener("change",(t=>{this._handleManager(e)})),window.addEventListener("CacheToggle",(e=>{e.detail.cachePoint===t&&this._cacheChange(t,e.detail)})),l.addEventListener("click",(e=>{this._applyChanges(t)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),this.cachePoints["_"+e]=t},close(e){e.classList.add("closed")},open(e){e.classList.remove("closed")},isOpen(e){const t=this.getCachePoint(e);let n=!1;return t&&(n=t.controller.checked&&t.master.checked),n},_bind(e){const t=e.dataset.cachePoint;this.setCachePoint(t,e),this._handleManager(t)},_handleManager(e){const t=this.getCachePoint(e);t&&(this.isOpen(e)?(this.open(t.viewer),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),Wn({path:CLDCACHE.fetch_url,data:{ID:e,page:t.currentPage,search:t.search.value},method:"POST"}).then((e=>{t.removeChild(t.loader),this._buildList(t,e.items),this._buildNav(t,e);const n=t.querySelectorAll("[data-master]");yt.bind(n),t.loaded=!0}))},_cacheChange(e,t){const n=t.checked?t.states.on:t.states.off,r=t.checked?t.states.off:t.states.on;this._removeFromList(e,t.item.ID,r)||this._addToList(e,t.item.ID,n),this._evaluateApply(e)},_evaluateApply(e){this.close(e.apply);const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&this.open(e.apply)},_applyChanges(e){const t=e.apply.cacheChanges;e.apply.disabled="disabled";for(const n in t)t[n].length&&this._set_state(e,n,t[n])},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this.close(e.apply),this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled=""})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_purgeCache(e){Wn({path:CLDCACHE.purge_url,data:{cachePoint:e.dataset.cachePoint},method:"POST"}).then((()=>{this._load(e.dataset.cachePoint)}))},_showSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="visible"}))},_hideSpinners(e){e.forEach((e=>{this.spinners["spinner_"+e].style.visibility="hidden"}))},_removeFromList(e,t,n){const r=this._getListIndex(e,t,n);let i=!1;return-1e.apply.cacheChanges[n].indexOf(t),_noCache(e){const t=this._getNote(wp.i18n.__("No files cached.","cloudinary"));e.viewer.appendChild(t),this.close(e.table)},_clearChildren(e){for(;e.children.length;){const t=e.lastChild;t.children.length&&this._clearChildren(t),e.removeChild(t)}},_buildList(e,t){t.forEach((t=>{if(t.note)return void e.appendChild(this._getNote(t.note));const n=this._getRow(t.ID),r=this._getStateSwitch(e,t,{on:"enable",off:"disable"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");if(t.items.length){const t=document.createElement("button");t.type="button",t.className="button",t.innerText=wp.i18n.__("Purge cache point","cloudinary"),t.style.float="left",e.paginate.appendChild(t),t.addEventListener("click",(t=>{confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))&&this._purgeCache(e)}))}n.type="button",n.innerHTML="‹",n.className="button cld-pagenav-prev",1===t.current_page?n.disabled=!0:n.addEventListener("click",(n=>{e.currentPage=t.current_page-1,this._load(e.dataset.cachePoint)})),r.type="button",r.innerHTML="›",r.className="button cld-pagenav-next",t.current_page===t.total_pages||0===t.total_pages?r.disabled=!0:r.addEventListener("click",(n=>{e.currentPage=t.current_page+1,this._load(e.dataset.cachePoint)}));const i=document.createElement("span");i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r)},_getNote(e){const t=this._getRow(),n=document.createElement("td");return n.colSpan=2,n.innerText=e,t.appendChild(n),t},_getRow(e){const t=document.createElement("tr");return e&&(t.id="row_"+e),t},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=[e.dataset.slug+"_selector"],c=this._getListIndex(e,t.ID,"disable");return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const Vn={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c=e.querySelectorAll("[data-auto-suffix]"),l={};yt.bind(a),c.forEach((e=>this._autoSuffix(e))),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,l))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),Qn.init(e)},_autoSuffix(e){const t=e.dataset.autoSuffix;let n="";const r=[...t.split(";")].map((e=>0===e.indexOf("*")?(n=e.replace("*",""),n):e));e.addEventListener("change",(()=>{const t=e.value.replace(" ",""),i=t.replace(/[^0-9]/g,""),o=t.replace(/[0-9]/g,"").toLowerCase();i&&(-1===r.indexOf(o)?e.value=i+n:e.value=i+o)})),e.dispatchEvent(new Event("change"))},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){n.bindings[t].value=e.value,"checkbox"!==e.type&&"radio"!==e.type||(n.bindings[t].checked=e.checked);for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",Vn._init(document));var Gn=Vn;window.$=window.jQuery;const $n={UI:Gn,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file diff --git a/js/lazy-load.asset.php b/js/lazy-load.asset.php new file mode 100644 index 000000000..506a6dd72 --- /dev/null +++ b/js/lazy-load.asset.php @@ -0,0 +1 @@ + array('wp-polyfill'), 'version' => '4f54b160de748912ea5ea5d8ce80f326'); \ No newline at end of file diff --git a/js/lazy-load.js b/js/lazy-load.js new file mode 100644 index 000000000..a59921968 --- /dev/null +++ b/js/lazy-load.js @@ -0,0 +1 @@ +!function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);oMath.ceil(e)?e:t,t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),o=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1;return o.tope.naturalWidth/r||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),o=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1;return!e.cld_loaded&&o.top<2*this.lazyThreshold&&(t>e.naturalWidth/r||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,o){var r=e-o*Math.floor((e-t)/o);return(r>e||this.config.max_width this._autoSuffix( input ) ); triggers.forEach( ( input ) => this._trigger( input ) ); toggles.forEach( ( toggle ) => this._toggle( toggle ) ); conditions.forEach( ( condition ) => this._bind( condition ) ); @@ -48,6 +49,30 @@ const UI = { // Start cache manager. CacheManage.init( context ); }, + _autoSuffix( input ) { + const suffixes = input.dataset.autoSuffix; + let defaultSuffix = ''; + const valid = [ ...suffixes.split( ';' ) ].map( ( suffix ) => { + if ( 0 === suffix.indexOf( '*' ) ) { + defaultSuffix = suffix.replace( '*', '' ); + return defaultSuffix; + } + return suffix; + } ); + input.addEventListener( 'change', () => { + const value = input.value.replace( ' ', '' ); + const number = value.replace( /[^0-9]/g, '' ); + const type = value.replace( /[0-9]/g, '' ).toLowerCase(); + if ( number ) { + if ( -1 === valid.indexOf( type ) ) { + input.value = number + defaultSuffix; + } else { + input.value = number + type; + } + } + } ); + input.dispatchEvent( new Event( 'change' ) ); + }, _files( file, compilerDebounce ) { const parent = file.dataset.parent; if ( ! parent ) { diff --git a/js/src/lazy-load.js b/js/src/lazy-load.js new file mode 100644 index 000000000..383e6ba9d --- /dev/null +++ b/js/src/lazy-load.js @@ -0,0 +1,200 @@ +const LazyLoad = { + density: window.devicePixelRatio ? window.devicePixelRatio : 'auto', + images: [], + debounce: null, + config: CLDLB ? CLDLB : {}, + lazyThreshold: 0, + _init() { + this._calcThreshold(); + [ ...document.images ].forEach( ( image ) => { + if ( ! image.dataset.src ) { + return; + } + image.originalWidth = image.dataset.width; + this.images.push( image ); + } ); + + // Resize handler. + window.addEventListener( 'resize', ( ev ) => { + this._debounceBuild(); + } ); + window.addEventListener( 'scroll', ( ev ) => { + this._debounceBuild(); + } ); + // Build images. + this._build(); + }, + _calcThreshold() { + const number = this.config.lazy_threshold.replace( /[^0-9]/g, '' ); + const type = this.config.lazy_threshold + .replace( /[0-9]/g, '' ) + .toLowerCase(); + let unit = 0; + switch ( type ) { + case 'em': + unit = + parseFloat( getComputedStyle( document.body ).fontSize ) * + number; + break; + case 'rem': + unit = + parseFloat( + getComputedStyle( document.documentElement ).fontSize + ) * number; + break; + case 'vh': + unit = ( window.innerHeight / number ) * 100; + break; + default: + unit = number; + } + this.lazyThreshold = window.innerHeight + parseInt( unit, 10 ); + }, + _debounceBuild() { + if ( this.debounce ) { + clearTimeout( this.debounce ); + } + this.debounce = setTimeout( () => { + this._build(); + }, 100 ); + }, + _getDensity() { + const maxDensity = CLDLB.dpr ? CLDLB.dpr.replace( 'X', '' ) : 'off'; + if ( 'off' === maxDensity ) { + return 1; + } + let deviceDensity = this.density; + if ( + ! CLDLB.dpr_precise && + 'auto' !== maxDensity && + 'auto' !== deviceDensity + ) { + deviceDensity = + deviceDensity > Math.ceil( maxDensity ) + ? maxDensity + : deviceDensity; + } else if ( 'auto' === CLDLB.dpr && 'auto' !== deviceDensity ) { + deviceDensity = 'auto'; + } + + return deviceDensity; + }, + _build() { + this.images.forEach( ( image ) => { + this.buildSize( image ); + } ); + }, + _shouldRebuild( image ) { + const width = this.scaleSize( + image.originalWidth, + image.width, + this.config.pixel_step + ); + const rect = image.getBoundingClientRect(); + const density = 'auto' !== this.density ? this._getDensity() : 1; + return ( + rect.top < this.lazyThreshold && + ( width > image.naturalWidth / density || ! image.cld_loaded ) + ); + }, + _shouldPlacehold( image ) { + const width = this.scaleSize( + image.originalWidth, + image.width, + this.config.pixel_step + ); + const rect = image.getBoundingClientRect(); + const density = 'auto' !== this.density ? this._getDensity() : 1; + return ( + ! image.cld_loaded && + rect.top < this.lazyThreshold * 2 && + ( width > image.naturalWidth / density || ! image.cld_placehold ) + ); + }, + getResponsiveSteps( image ) { + const steps = Math.ceil( + image.dataset.breakpoints + ? image.originalWidth / image.dataset.breakpoints + : this.responsiveStep + ); + return steps; + }, + getQuality() { + let quality = 'q_auto'; + switch ( + navigator && navigator.connection + ? navigator.connection.effectiveType + : 'none' + ) { + case 'none': + break; + case '4g': + quality = 'q_auto:good'; + break; + case '3g': + quality = 'q_auto:eco'; + break; + case '2g': + case 'slow-2g': + quality = 'q_auto:low'; + break; + default: + quality = 'q_auto:best'; + break; + } + return quality; + }, + scaleSize( original, newSize, responsiveStep ) { + const diff = Math.floor( ( original - newSize ) / responsiveStep ); + let scaledSize = original - responsiveStep * diff; + if ( scaledSize > original ) { + scaledSize = original; + } else if ( this.config.max_width < scaledSize ) { + scaledSize = original; + } + return scaledSize; + }, + buildSize( image ) { + if ( this._shouldRebuild( image ) ) { + if ( image.dataset.srcset ) { + image.srcset = image.dataset.srcset; + } else { + image.src = this.getSizeURL( image ); + } + } else if ( this._shouldPlacehold( image ) ) { + image.src = this.getPlaceholderURL( image ); + } + }, + getSizeURL( image ) { + image.cld_loaded = true; + if ( image.dataset.srcset ) { + image.srcset = image.dataset.srcset; + delete image.dataset.srcset; + return ''; + } + const width = this.scaleSize( + image.originalWidth, + image.width, + this.config.pixel_step + ); + const density = this._getDensity(); + let newSize = ''; + if ( width ) { + newSize += 'w_' + width; + if ( 1 !== density ) { + newSize += ',dpr_' + density; + } + } + return image.dataset.src + .replace( '--size--', newSize ) + .replace( /q_auto(?!:)/gi, this.getQuality() ); + }, + getPlaceholderURL( image ) { + image.cld_placehold = true; + return image.dataset.placeholder.replace( '/--size--', '/' ); + }, +}; +// Init. +window.addEventListener( 'load', () => { + LazyLoad._init(); +} ); diff --git a/js/wp-color-picker-alpha.min.js b/js/wp-color-picker-alpha.min.js new file mode 100644 index 000000000..1aeb1f2b8 --- /dev/null +++ b/js/wp-color-picker-alpha.min.js @@ -0,0 +1,11 @@ +/**! + * wp-color-picker-alpha + * + * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker + * Only run in input and is defined data alpha in true + * + * Version: 3.0.0 + * https://github.com/kallookoo/wp-color-picker-alpha + * Licensed under the GPLv2 license or later. + */ +!function(e,a){var l,o={version:300};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var t=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(t)&&o.version<=t)return}Color.fn.hasOwnProperty("to_s")||(Color.fn.to_s=function(o){"hex"===(o=o||"hex")&&this._alpha<1&&(o="rgba");var a="";return"hex"===o?a=this.toString():this.error||(a=this.toCSS(o).replace(/\(\s+/,"(").replace(/\s+\)/,")")),a},window.wpColorPickerAlpha=o,l="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(o){return o===a&&(o=this._color),this.alphaOptions.alphaEnabled?(o=o.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(o=o.replace(/\s+/g,"")),o):o.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(o){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(i){function o(o){var a=i.val(),t=new Color(a),a=a.replace(/^(#|(rgb|hsl)a?)/,""),r=l.alphaOptions.alphaColorType;i.removeClass("iris-error"),t.error?""!==a&&i.addClass("iris-error"):"hex"===r&&"keyup"===o.type&&a.match(/^[0-9a-fA-F]{3}$/)||t.toIEOctoHex()!==l._color.toIEOctoHex()&&l._setOption("color",l._getColor(t))}var l=this;i.on("change",o).on("keyup",l._debounce(o,100)),l.options.hide&&i.one("focus",function(){l.show()})},_initControls:function(){var t,o,a,r;this._super(),this.alphaOptions.alphaEnabled&&(a=(o=(t=this).controls.strip.clone(!1,!1)).find(".iris-slider-offset"),r={stripAlpha:o,stripAlphaSlider:a},o.addClass("iris-strip-alpha"),a.addClass("iris-slider-offset-alpha"),o.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,function(o,a){t.controls[o]=a}),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,a){t.active="strip",t._color._alpha=parseFloat(a.value/100),t._change.apply(t,arguments)}}))},_dimensions:function(o){if(this._super(o),this.alphaOptions.alphaEnabled){for(var a=this,t=a.options,r=a.controls.square,o=a.picker.find(".iris-strip"),i=Math.round(a.picker.outerWidth(!0)-(t.border?22:0)),l=Math.round(r.outerWidth()),e=Math.round((i-l)/2),s=Math.round(e/2),n=Math.round(l+2*e+2*s);i'):t.toggler.append(''),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":r.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),r.iris({change:function(o,a){t.colorAlpha.css({"background-color":a.color.to_s(t.alphaOptions.alphaColorType)}),e.isFunction(t.options.change)&&t.options.change.call(this,o,a)}}),t.wrap.on("click.wpcolorpicker",function(o){o.stopPropagation()}),t.toggler.click(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()}),r.change(function(o){var a=e(this).val();(r.hasClass("iris-error")||""===a||a.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o))}),t.button.click(function(o){e(this).hasClass("wp-picker-default")?r.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(r.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o),r.trigger("change"))})}}))}(jQuery); \ No newline at end of file diff --git a/php/class-beta.php b/php/class-beta.php index b502f26f0..6a3879733 100644 --- a/php/class-beta.php +++ b/php/class-beta.php @@ -35,14 +35,25 @@ public function __construct( Plugin $plugin ) { $this->plugin = $plugin; $this->components = array( - 'delivery' => array( + 'delivery' => array( 'class' => 'Cloudinary\Delivery', 'name' => __( 'New Delivery method', 'cloudinary' ), 'options' => array(), ), + 'responsive_breakpoints' => array( + 'class' => array( 'Cloudinary\Delivery\Lazy_Load', 'Cloudinary\Delivery\Responsive_Breakpoints' ), + 'name' => __( 'New Lazy Load and Responsive Breakpoints', 'cloudinary' ), + 'options' => array(), + 'deps' => array( 'delivery' ), + ), ); foreach ( $this->components as $key => $data ) { + + if ( ! empty( $data['deps'] ) && empty( array_intersect( $data['deps'], array_keys( $this->plugin->components ) ) ) ) { + continue; + } + /** * Filter to enable beta features for testing. * @@ -53,10 +64,14 @@ public function __construct( Plugin $plugin ) { * @param $feature {string} Optional feature type. * @param $data {array} The beta feature data. * - * @return {bool} + * @return {bool} */ if ( apply_filters( 'cloudinary_beta', false, $key, $data ) ) { - $this->plugin->components[ $key ] = new $data['class']( $this->plugin ); + foreach ( (array) $data['class'] as $class ) { + $namespace = explode( '\\', $class ); + $name = strtolower( array_pop( $namespace ) ); + $this->plugin->components[ $name ] = new $class( $this->plugin ); + } } } } diff --git a/php/class-connect.php b/php/class-connect.php index 029ada4b2..e360df7e2 100644 --- a/php/class-connect.php +++ b/php/class-connect.php @@ -85,7 +85,7 @@ class Connect extends Settings_Component implements Config, Setup, Notice { 'signature' => 'cloudinary_connection_signature', 'version' => 'cloudinary_version', 'url' => 'cloudinary_url', - 'connect' => 'cloudinary_connect', + 'connection' => 'cloudinary_connect', 'status' => 'cloudinary_status', ); @@ -766,7 +766,7 @@ public function maybe_connection_string_constant( $value, $setting ) { } if ( 'signature' === $setting ) { - $value = md5( $url ); + $value = md5( $url ); } if ( 'connect' === $setting ) { diff --git a/php/class-delivery-feature.php b/php/class-delivery-feature.php new file mode 100644 index 000000000..d0374f929 --- /dev/null +++ b/php/class-delivery-feature.php @@ -0,0 +1,188 @@ +plugin = $plugin; + $this->media = $plugin->get_component( 'media' ); + + add_action( 'cloudinary_init_settings', array( $this, 'setup' ) ); + } + + /** + * Register hooks. + */ + public function init() { + $this->config = $this->settings->get_value(); + if ( $this->is_active() ) { + add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_assets' ) ); + } + if ( $this->is_enabled() ) { + $this->setup_hooks(); + } + } + + /** + * Setup hooks used when enabled. + */ + protected function setup_hooks() { + + } + + /** + * Enqueue assets if active and enabled. + */ + public function maybe_enqueue_assets() { + if ( $this->is_enabled() ) { + // Add filter to add features. + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), $this->priority, 3 ); + $this->enqueue_assets(); + } + } + + /** + * Add features to a tag element set. + * + * @param array $tag_element The tag element set. + * @param int $attachment_id The attachment id. + * @param string $original_tag The original html tag. + * + * @return array + */ + public function add_features( $tag_element, $attachment_id, $original_tag ) { + return $tag_element; + } + + /** + * Check if component is active. + * + * @return bool + */ + public function is_active() { + return ! is_admin(); + } + + /** + * Register assets to be used for the class. + */ + public function register_assets() { + } + + /** + * Enqueue Assets. + */ + public function enqueue_assets() { + } + + /** + * Check to see if Breakpoints are enabled. + * + * @return bool + */ + public function is_enabled() { + return isset( $this->config[ $this->enable_slug ] ) && 'on' === $this->config[ $this->enable_slug ]; + } + + /** + * Create the settings. + */ + protected function create_settings() { + $this->settings = $this->plugin->settings->create_setting( $this->settings_slug, $this->settings() ); + } + + /** + * Setup the class. + */ + public function setup() { + $this->create_settings(); + $this->register_settings(); + $this->init(); + } + + /** + * Define the settings. + * + * @return array + */ + public function settings() { + return array(); + } + + /** + * Register the setting under media. + */ + protected function register_settings() { + } +} diff --git a/php/class-delivery.php b/php/class-delivery.php index ce2970d8f..a47cfb018 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -68,6 +68,7 @@ class Delivery implements Setup { * @param Plugin $plugin Global instance of the main plugin. */ public function __construct( Plugin $plugin ) { + $this->plugin = $plugin; $this->plugin->components['replace'] = new String_Replace( $this->plugin ); $this->media = $this->plugin->get_component( 'media' ); @@ -78,10 +79,13 @@ public function __construct( Plugin $plugin ) { * Setup early needed hooks. */ protected function setup_hooks() { + add_filter( 'cloudinary_filter_out_local', '__return_false' ); add_action( 'update_option_cloudinary_media_display', array( $this, 'clear_cache' ) ); + add_action( 'cloudinary_flush_cache', array( $this, 'clear_cache' ) ); add_filter( 'cloudinary_current_post_id', array( $this, 'get_current_post_id' ) ); add_filter( 'the_content', array( $this, 'add_post_id' ) ); + add_filter( 'wp_img_tag_add_srcset_and_sizes_attr', '__return_false' ); // Clear cache on taxonomy update. $taxonomies = get_taxonomies( array( 'show_ui' => true ) ); @@ -94,6 +98,7 @@ protected function setup_hooks() { * Clear cached meta. */ public function clear_cache() { + delete_post_meta_by_key( self::META_CACHE_KEY ); } @@ -105,6 +110,7 @@ public function clear_cache() { * @return string */ public function add_post_id( $content ) { + return str_replace( array( 'wp-image-', @@ -124,6 +130,7 @@ public function add_post_id( $content ) { * @return int|null */ public function get_current_post_id() { + return $this->current_post_id ? $this->current_post_id : null; } @@ -131,6 +138,7 @@ public function get_current_post_id() { * Setup component. */ public function setup() { + $this->filter = $this->media->filter; $this->sync = $this->media->sync; @@ -140,6 +148,26 @@ public function setup() { add_filter( 'post_thumbnail_html', array( $this, 'process_featured_image' ), 100, 3 ); } + /** + * Init delivery. + */ + protected function init_delivery() { + + add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); + + /** + * Action indicating that the delivery is starting.s + * + * @hook cloudinary_pre_image_tag + * @since 2.7.5 + * + * @param $delivery {Delivery} The delivery object. + * + * @return void + */ + do_action( 'cloudinary_init_delivery', $this ); + } + /** * Add classes to the featured image tag. * @@ -150,12 +178,13 @@ public function setup() { * @return string */ public function process_featured_image( $html, $post_id, $attachment_id ) { + // Get tag element. $tag_element = $this->parse_element( $html ); $tag_element['atts']['class'][] = 'wp-image-' . $attachment_id; $tag_element['atts']['class'][] = 'wp-post-' . $post_id; - if ( true === (bool) $this->media->get_post_meta( $post_id, Global_Transformations::META_FEATURED_IMAGE_KEY, true ) ) { + if ( true === (bool) get_post_meta( $post_id, Global_Transformations::META_FEATURED_IMAGE_KEY, true ) ) { $tag_element['atts']['class'][] = 'cld-overwrite'; } @@ -168,6 +197,7 @@ public function process_featured_image( $html, $post_id, $attachment_id ) { * @param int $post_id The post ID to remove cache from. */ public function remove_replace_cache( $post_id ) { + delete_post_meta( $post_id, self::META_CACHE_KEY ); } @@ -179,6 +209,7 @@ public function remove_replace_cache( $post_id ) { * @return array */ public function get_attachment_size_urls( $attachment_id ) { + $urls = array(); $meta = wp_get_attachment_metadata( $attachment_id ); $baseurl = wp_get_attachment_url( $attachment_id ); @@ -187,6 +218,9 @@ public function get_attachment_size_urls( $attachment_id ) { // Ignore getting 'original_image' since this isn't used in the front end. if ( ! empty( $meta['sizes'] ) ) { foreach ( $meta['sizes'] as $data ) { + if ( isset( $urls[ $base . $data['file'] ] ) ) { + continue; + } $urls[ $base . $data['file'] ] = $this->media->cloudinary_url( $attachment_id, array( @@ -208,6 +242,7 @@ public function get_attachment_size_urls( $attachment_id ) { * @return array */ public function find_attachment_size_urls( $urls ) { + global $wpdb; $dirs = wp_get_upload_dir(); $search = array(); @@ -254,6 +289,7 @@ public function find_attachment_size_urls( $urls ) { * @return array */ public function convert_tags( $content ) { + if ( is_singular() ) { $cache_key = self::META_CACHE_KEY; $has_cache = get_post_meta( get_the_ID(), $cache_key, true ); @@ -306,21 +342,16 @@ public function convert_tags( $content ) { * @return string */ public function rebuild_tag( $element, $attachment_id ) { - // Add our filter if not already added. - if ( ! has_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ) ) ) { - add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); - } - // Get tag element. - $tag_element = $this->parse_element( $element ); + $image_meta = wp_get_attachment_metadata( $attachment_id ); + // Check overwrite. + $image_meta['overwrite_transformations'] = (bool) strpos( $element, 'cld-overwrite' ); - // Remove the old srcset if it has one. - if ( isset( $tag_element['atts']['srcset'] ) ) { - unset( $tag_element['atts']['srcset'] ); - } + // Try add srcset if not present. + $element = wp_image_add_srcset_and_sizes( $element, $image_meta, $attachment_id ); - // Get overwrite flag. - $overwrite = in_array( 'cld-overwrite', $tag_element['atts']['class'], true ); + // Get tag element. + $tag_element = $this->parse_element( $element ); // Get size. $size = $this->get_size_from_atts( $tag_element['atts'] ); @@ -328,14 +359,29 @@ public function rebuild_tag( $element, $attachment_id ) { // Get transformations if present. $transformations = $this->get_transformations_maybe( $tag_element['atts']['src'] ); - // Create new src url. - $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $overwrite ); + // Get cloudinary URL, only if overwrite or has inline transformations. Catch all will replace standard urls. + if ( $image_meta['overwrite_transformations'] || $transformations ) { + $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $image_meta['overwrite_transformations'] ); + } + + /** + * Filter the tag element. + * + * @hook cloudinary_pre_image_tag + * @since 2.7.5 + * + * @param $tag_element {array} The tag_element ( tag + attributes array). + * @param $attachment_id {int} The attachment ID. + * @param $element {string} The original HTML tag. + * + * @return array + */ + $tag_element = apply_filters( 'cloudinary_pre_image_tag', $tag_element, $attachment_id, $element ); // Setup new tag. $replace = HTML::build_tag( $tag_element['tag'], $tag_element['atts'] ); - // Add new srcset. - return $this->media->apply_srcset( $replace, $attachment_id, $overwrite ); + return $replace; } /** @@ -346,6 +392,7 @@ public function rebuild_tag( $element, $attachment_id ) { * @return array */ public function parse_element( $element ) { + // Cleanup element. $element = trim( $element, '' ); @@ -370,6 +417,7 @@ public function parse_element( $element ) { * @return array */ protected function get_size_from_atts( $atts ) { + $size = array(); if ( ! empty( $atts['width'] ) ) { $size[] = $atts['width']; @@ -389,6 +437,7 @@ protected function get_size_from_atts( $atts ) { * @return array|null */ protected function get_transformations_maybe( $url ) { + $transformations = null; $query = wp_parse_url( $url, PHP_URL_QUERY ); if ( ! empty( $query ) && false !== strpos( $query, 'cld_params' ) ) { @@ -407,6 +456,7 @@ protected function get_transformations_maybe( $url ) { * @param string $content The HTML to catch URLS from. */ public function catch_urls( $content ) { + $this->init_delivery(); $known = $this->convert_tags( $content ); $urls = wp_extract_urls( $content ); $dirs = wp_get_upload_dir(); diff --git a/php/class-media.php b/php/class-media.php index 51c603675..81470f7ba 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -769,6 +769,9 @@ function ( $part ) { * @return array The array of found transformations within the string. */ public function get_transformations_from_string( $str, $type = 'image' ) { + if ( ! isset( Api::$transformation_index[ $type ] ) ) { + return array(); + } $params = Api::$transformation_index[ $type ]; @@ -955,7 +958,7 @@ public function default_image_freeform_transformations( $default ) { * @return string The converted URL. */ public function cloudinary_url( $attachment_id, $size = array(), $transformations = array(), $cloudinary_id = null, $overwrite_transformations = false ) { - if ( ! ( $cloudinary_id ) ) { + if ( ! $cloudinary_id ) { $cloudinary_id = $this->cloudinary_id( $attachment_id ); if ( ! $cloudinary_id ) { return null; @@ -997,7 +1000,15 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation * * @return string */ - return apply_filters( 'cloudinary_converted_url', $url, $attachment_id, $pre_args ); + $url = apply_filters( 'cloudinary_converted_url', $url, $attachment_id, $pre_args ); + + // Add Cloudinary analytics. + return add_query_arg( + array( + '_i' => 'AA', + ), + $url + ); } /** @@ -1094,12 +1105,17 @@ public function get_cloudinary_folder( $add_trailing_slash = true ) { public function get_public_id( $attachment_id, $suffixed = false ) { // Check for a public_id. if ( $this->has_public_id( $attachment_id ) ) { - $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $public_id = $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); if ( $this->is_folder_synced( $attachment_id ) ) { $public_id = $this->get_cloudinary_folder() . pathinfo( $public_id, PATHINFO_BASENAME ); } - if ( true === $suffixed ) { - $public_id .= $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); + if ( true === $suffixed && ! empty( $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ) ) ) { + $suffix = $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); + if ( false === strrpos( $public_id, $suffix ) ) { + $public_id .= $suffix; + $this->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + } + $this->delete_post_meta( $attachment_id, Sync::META_KEYS['suffix'] ); } } else { $public_id = $this->sync->generate_public_id( $attachment_id ); @@ -1116,7 +1132,10 @@ public function get_public_id( $attachment_id, $suffixed = false ) { * @return bool */ public function has_public_id( $attachment_id ) { - return ! empty( get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ) ); + $new_id = $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + + return ! empty( $new_id ) || ! empty( $id ); } /** @@ -1156,23 +1175,29 @@ public function get_cloudinary_id( $attachment_id ) { * * @param int $attachment_id The ID to get Cloudinary id for. * - * @return string|null the ID or null if not existing. + * @return string|false the ID or false if not existing. */ public function cloudinary_id( $attachment_id ) { + static $cloudinary_ids = array(); - if ( ! $this->is_media( $attachment_id ) ) { - return null; - } // Return cached ID if we've already gotten it before. - if ( isset( $this->cloudinary_ids[ $attachment_id ] ) ) { - return $this->cloudinary_ids[ $attachment_id ]; + if ( isset( $cloudinary_ids[ $attachment_id ] ) ) { + return $cloudinary_ids[ $attachment_id ]; } + + if ( ! $this->is_media( $attachment_id ) ) { + $cloudinary_ids[ $attachment_id ] = false; + return false; + } + if ( ! $this->sync->is_synced( $attachment_id ) && ! defined( 'REST_REQUEST' ) ) { $sync_type = $this->sync->maybe_prepare_sync( $attachment_id ); // Check sync type allows for continued rendering. i.e meta update, breakpoints etc, will still allow the URL to work, // Where is type "file" will not since it's still being uploaded. - if ( ! is_null( $sync_type ) && $this->sync->is_required( $sync_type, $attachment_id ) ) { - return null; // Return and render local URLs. + if ( is_null( $sync_type ) || $this->sync->is_required( $sync_type, $attachment_id ) ) { + // Cache ID to prevent multiple lookups. + $cloudinary_ids[ $attachment_id ] = false; + return false; // Return and render local URLs. } } @@ -1195,8 +1220,9 @@ public function cloudinary_id( $attachment_id ) { * @param int $attachment_id The id of the asset. */ do_action( 'cloudinary_id', $cloudinary_id, $attachment_id ); - // Cache ID to prevent multiple lookups. - $this->cloudinary_ids[ $attachment_id ] = $cloudinary_id; + + $cloudinary_ids[ $attachment_id ] = $cloudinary_id; + return $cloudinary_id; } @@ -1480,7 +1506,8 @@ private function create_attachment( $asset, $public_id ) { $sync_key = $asset['sync_key']; // Capture public_id. Use core update_post_meta since this attachment data doesnt exist yet. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + // Capture version number. $this->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $asset['version'] ); if ( ! empty( $asset['transformations'] ) ) { @@ -1488,10 +1515,13 @@ private function create_attachment( $asset, $public_id ) { $sync_key .= wp_json_encode( $asset['transformations'] ); $this->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset['transformations'] ); } - // create a trackable key in post meta. + + // Create a trackable key in post meta to allow getting the attachment id from URL with transformations. update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); - // record a base to ensure primary isn't deleted. + + // Create a trackable key in post meta to allow getting the attachment id from URL. update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); + // capture the delivery type. $this->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $asset['type'] ); // Capture the ALT Text. @@ -1835,23 +1865,25 @@ public function get_transformation_from_meta( $post_id ) { */ public function get_post_meta( $post_id, $key = '', $single = false ) { - $meta_data = wp_get_attachment_metadata( $post_id, true ); - if ( ! is_array( $meta_data ) ) { - return get_post_meta( $post_id, $key, $single ); + $meta = get_post_meta( $post_id, Sync::META_KEYS['cloudinary'], true ); + if ( empty( $meta ) ) { + /** + * Filter the meta if not found, in order to migrate from a legacy plugin. + * + * @hook cloudinary_migrate_legacy_meta + * @since 2.7.5 + * + * @param $attachment_id {int} The attachment ID. + * + * @return array + */ + $meta = apply_filters( 'cloudinary_migrate_legacy_meta', $post_id ); } - if ( ! isset( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta_data[ Sync::META_KEYS['cloudinary'] ] = array(); + if ( '' !== $key ) { + $meta = isset( $meta[ $key ] ) ? $meta[ $key ] : null; } - if ( '' === $key ) { - $data = $meta_data[ Sync::META_KEYS['cloudinary'] ]; - } elseif ( ! empty( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ) ) { - $data = $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ]; - } else { - $data = $this->build_cached_meta( $post_id, $key, $single ); - } - - return $data; + return $single ? $meta : (array) $meta; } /** @@ -1878,19 +1910,21 @@ public function build_cached_meta( $post_id, $key, $single ) { * @param int $post_id The attachment ID. * @param string $key The meta key to get. * @param string|array $data $the meta data to update. + * + * @return bool */ public function update_post_meta( $post_id, $key, $data ) { - $meta_data = wp_get_attachment_metadata( $post_id, true ); - if ( is_array( $meta_data ) ) { - if ( ! isset( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta_data[ Sync::META_KEYS['cloudinary'] ] = array(); - } - $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] = $data; - wp_update_attachment_metadata( $post_id, $meta_data ); - } else { - // Update core mete data for consistency. - update_post_meta( $post_id, $key, $data ); + + $meta = $this->get_post_meta( $post_id ); + if ( ! isset( $meta[ $key ] ) ) { + $meta[ $key ] = ''; } + + if ( $meta[ $key ] !== $data ) { + $meta[ $key ] = $data; + } + + return update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); } /** @@ -1898,14 +1932,17 @@ public function update_post_meta( $post_id, $key, $data ) { * * @param int $post_id The attachment ID. * @param string $key The meta key to get. + * + * @return bool */ public function delete_post_meta( $post_id, $key ) { - $meta_data = wp_get_attachment_metadata( $post_id, true ); - if ( is_array( $meta_data ) && isset( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) && is_array( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) ) { - // Only do this side if has been set before. - unset( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ); - wp_update_attachment_metadata( $post_id, $meta_data ); + + $meta = $this->get_post_meta( $post_id ); + if ( isset( $meta[ $key ] ) ) { + unset( $meta[ $key ] ); } + + return update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); } /** @@ -1921,12 +1958,12 @@ public function get_breakpoint_options( $attachment_id ) { $settings = $this->settings->get_setting( self::MEDIA_SETTINGS_SLUG )->get_value(); if ( 'on' === $settings['enable_breakpoints'] && wp_attachment_is_image( $attachment_id ) ) { - $meta = wp_get_attachment_metadata( $attachment_id ); + $meta = wp_get_attachment_metadata( $attachment_id, true ); // Get meta image size if non exists. if ( empty( $meta ) ) { $meta = array(); $imagesize = getimagesize( get_attached_file( $attachment_id ) ); - $meta['width'] = $imagesize[0] ? $imagesize[0] : 0; + $meta['width'] = isset( $imagesize[0] ) ? $imagesize[0] : 0; } $max_width = $this->get_max_width(); // Add breakpoints request options. @@ -2078,7 +2115,7 @@ public function get_upload_options( $attachment_id ) { public function maybe_overwrite_featured_image( $attachment_id ) { $overwrite = false; if ( $this->doing_featured_image && $this->doing_featured_image === (int) $attachment_id ) { - $overwrite = (bool) $this->get_post_meta( get_the_ID(), Global_Transformations::META_FEATURED_IMAGE_KEY, true ); + $overwrite = (bool) get_post_meta( get_the_ID(), Global_Transformations::META_FEATURED_IMAGE_KEY, true ); } return $overwrite; diff --git a/php/class-plugin.php b/php/class-plugin.php index ceef9098f..94b276208 100644 --- a/php/class-plugin.php +++ b/php/class-plugin.php @@ -212,6 +212,18 @@ public function setup_settings() { $connect_title = $connect->get_param( 'menu_title' ) . $count; $connect->set_param( 'menu_title', $connect_title ); } + + /** + * Action indicating that the Settings are initialised. + * + * @hook cloudinary_init_settings + * @since 2.7.5 + * + * @param $plugin {Plugin} The core plugin object. + * + * @return void + */ + do_action( 'cloudinary_init_settings', $this ); } /** diff --git a/php/class-report.php b/php/class-report.php index fe7beb66e..b9de63d41 100644 --- a/php/class-report.php +++ b/php/class-report.php @@ -163,7 +163,8 @@ public function image_meta_viewer() { */ public function render( $post ) { if ( 'attachment' === $post->post_type ) { - $meta = wp_get_attachment_metadata( $post->ID ); + $sync = $this->plugin->get_component( 'sync' ); + $meta = get_post_meta( $post->ID, $sync::META_KEYS['cloudinary'], true ); $args = array( 'type' => 'tag', diff --git a/php/class-sync.php b/php/class-sync.php index 31a66b978..e58e9ec8d 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -152,7 +152,7 @@ public function is_active() { public function been_synced( $attachment_id ) { $public_id = $this->managers['media']->has_public_id( $attachment_id ); - $meta = wp_get_attachment_metadata( $attachment_id ); + $meta = wp_get_attachment_metadata( $attachment_id, true ); return ! empty( $public_id ) || ! empty( $meta['cloudinary'] ); // From v1. } @@ -160,24 +160,55 @@ public function been_synced( $attachment_id ) { /** * Checks if an asset is synced and up to date. * - * @param int $post_id The post id to check. + * @param int $post_id The post id to check. + * @param bool $re_check Flag to bypass cache and recheck. * * @return bool */ - public function is_synced( $post_id ) { - $expecting = $this->generate_signature( $post_id ); - - if ( ! is_wp_error( $expecting ) ) { - $signature = $this->get_signature( $post_id ); - // Sort to align orders for comparison. - ksort( $signature ); - ksort( $expecting ); - if ( ! empty( $signature ) && ! empty( $expecting ) && $expecting === $signature ) { - return true; + public function is_synced( $post_id, $re_check = false ) { + static $synced = array(); + if ( isset( $synced[ $post_id ] ) && false === $re_check ) { + return $synced[ $post_id ]; + } + $return = false; + if ( $this->managers['media']->has_public_id( $post_id ) ) { + $expecting = $this->generate_signature( $post_id ); + if ( ! is_wp_error( $expecting ) ) { + $signature = $this->get_signature( $post_id ); + // Sort to align orders for comparison. + ksort( $signature ); + ksort( $expecting ); + if ( ! empty( $signature ) && ! empty( $expecting ) && $expecting === $signature ) { + $return = true; + } } } + $synced[ $post_id ] = $return; - return false; + return $synced[ $post_id ]; + } + + /** + * Log a sync result. + * + * @param int $attachment_id The attachment id. + * @param string $type The sync type. + * @param mixed $result The result. + */ + public function log_sync_result( $attachment_id, $type, $result ) { + $log = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['process_log'], true ); + $keys = array_keys( $this->sync_base_struct ); + if ( empty( $log ) || count( $log ) !== count( $keys ) ) { + $log = array_fill_keys( $keys, array() ); + } + if ( isset( $log[ $type ] ) ) { + + $log[ $type ][ '_' . time() ] = $result; + if ( 5 < count( $log[ $type ] ) ) { + array_shift( $log[ $type ] ); + } + $this->managers['media']->update_post_meta( $attachment_id, self::META_KEYS['process_log'], $log ); + } } /** @@ -472,7 +503,7 @@ public function setup_sync_base_struct() { 'priority' => 25, 'sync' => array( $this->managers['upload'], 'explicit_update' ), 'validate' => function ( $attachment_id ) { - $delivery = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['delivery'] ); + $delivery = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['delivery'], true ); return empty( $delivery ) || 'upload' === $delivery; }, @@ -512,7 +543,7 @@ public function setup_sync_base_struct() { 'sync' => function ( $attachment_id ) { $meta = $this->managers['media']->get_post_meta( $attachment_id ); foreach ( $meta as $key => $value ) { - if ( self::META_KEYS['public_id'] === $key ) { + if ( Sync::META_KEYS['cloudinary'] === $key ) { $this->managers['media']->delete_post_meta( $attachment_id, $key ); continue; } @@ -665,10 +696,17 @@ public function sync_base( $post ) { * @return string | null */ public function maybe_prepare_sync( $attachment_id ) { - - $type = $this->get_sync_type( $attachment_id ); - if ( $type && $this->can_sync( $attachment_id, $type ) ) { - $this->add_to_sync( $attachment_id ); + $type = null; + if ( $this->can_sync( $attachment_id, $type ) ) { + $type = $this->get_sync_type( $attachment_id ); + if ( $type ) { + $this->add_to_sync( $attachment_id ); + } else { + // if null, and can sync but has no type, realtime syncs may have been applied. so recheck. + if ( $this->is_synced( $attachment_id, true ) ) { + $type = true; + } + } } return $type; diff --git a/php/class-utils.php b/php/class-utils.php index 4be4688d9..e28351b52 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -129,4 +129,27 @@ public static function get_tag_attributes( $tag ) { return $return; } + + /** + * Get the depth of an array. + * + * @param array $array The array to check. + * + * @return int + */ + public static function array_depth( array $array ) { + $depth = 0; + + foreach ( $array as $value ) { + if ( is_array( $value ) ) { + $level = self::array_depth( $value ) + 1; + + if ( $level > $depth ) { + $depth = $level; + } + } + } + + return $depth; + } } diff --git a/php/connect/class-api.php b/php/connect/class-api.php index 21767968b..78c8ea5c6 100644 --- a/php/connect/class-api.php +++ b/php/connect/class-api.php @@ -209,6 +209,8 @@ function ( $item ) use ( $transformation_index ) { $key = array_search( $type, $transformation_index, true ); if ( false !== $key ) { $transform[] = $key . '_' . $value; + } elseif ( '$' === $type[0] ) { + $transform[] = $type . '_' . $value; } } @@ -397,6 +399,12 @@ function_exists( 'wp_get_original_image_url' ) && $file_url = wp_get_attachment_url( $attachment_id ); } $media = get_plugin_instance()->get_component( 'media' ); + if ( ! $media->is_local_media( $attachment_id ) ) { + $disable_https_fetch = false; // Remote can upload via url. + // translators: variable is thread name and queue size. + $action_message = sprintf( __( 'Uploading remote url: %1$s.', 'cloudinary' ), $file_url ); + do_action( '_cloudinary_queue_action', $action_message ); + } $tempfile = false; if ( $media && $media->is_cloudinary_url( $file_url ) ) { // If this is a Cloudinary URL, then we can use it to fetch from that location. diff --git a/php/delivery/class-lazy-load.php b/php/delivery/class-lazy-load.php new file mode 100644 index 000000000..9e91f2424 --- /dev/null +++ b/php/delivery/class-lazy-load.php @@ -0,0 +1,293 @@ + array( + array( + '$currWidth' => 'w', + '$currHeight' => 'h', + ), + array( + 'width' => 'iw_div_2', + 'aspect_ratio' => 1, + 'crop' => 'pad', + 'background' => 'auto', + ), + array( + 'crop' => 'crop', + 'width' => 10, + 'height' => 10, + 'gravity' => 'north_east', + ), + array( + 'width' => '$currWidth', + 'height' => '$currHeight', + 'crop' => 'fill', + ), + array( + 'fetch_format' => 'auto', + 'quality' => 'auto', + ), + ), + 'vectorize' => array( + array( + 'effect' => 'vectorize:3:0.1', + 'fetch_format' => 'svg', + ), + ), + 'blur' => array( + array( + 'effect' => 'blur:2000', + 'quality' => 1, + 'fetch_format' => 'auto', + ), + ), + 'pixelate' => array( + array( + 'effect' => 'pixelate', + 'quality' => 1, + 'fetch_format' => 'auto', + ), + ), + ); + + return $transformations[ $placeholder ]; + } + + /** + * Add features to a tag element set. + * + * @param array $tag_element The tag element set. + * @param int $attachment_id The attachment id. + * @param string $original_tag The original html tag. + * + * @return array + */ + public function add_features( $tag_element, $attachment_id, $original_tag ) { + + $settings = $this->settings->get_value(); + + $meta = wp_get_attachment_metadata( $attachment_id, true ); + $size = array( + '100%', + '100%', + ); + if ( isset( $meta['width'] ) ) { + $size[0] = $meta['width']; + } + if ( isset( $meta['height'] ) ) { + $size[1] = $meta['height']; + } + $format = $this->media->get_settings()->get_value( 'image_format' ); + + if ( isset( $tag_element['atts']['srcset'] ) ) { + $tag_element['atts']['data-srcset'] = $tag_element['atts']['srcset']; + unset( $tag_element['atts']['srcset'] ); + } + $src = $tag_element['atts']['src']; + if ( ! $this->media->is_cloudinary_url( $src ) ) { + $src = $this->media->cloudinary_url( $attachment_id ); + } + $tag_element['atts']['data-src'] = $src; + $transformations = $this->media->get_transformations_from_string( $src ); + $placehold_transformations = $transformations; + $original_string = Api::generate_transformation_string( $transformations ); + + // placeholder. + if ( 'off' !== $settings['lazy_placeholder'] ) { + // Remove the optimize (last) transformation. + array_pop( $placehold_transformations ); + $placehold_transformations = array_merge( $placehold_transformations, $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ); + $palcehold_str = Api::generate_transformation_string( $placehold_transformations ); + $placeholder = str_replace( $original_string, $palcehold_str, $src ); + $tag_element['atts']['data-placeholder'] = $placeholder; + } + + $color_str = $settings['lazy_custom_color']; + if ( 'on' === $settings['lazy_animate'] ) { + preg_match_all( '/[0-9.^]+/', $settings['lazy_custom_color'], $custom ); + $colors = array_shift( $custom ); + if ( ! isset( $colors[3] ) ) { + $colors[3] = 1; + } + + $color1 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',' . $colors[3] . ')'; + $color2 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',0)'; + $color_str = $color1 . ';' . $color2 . ';' . $color1; + } + $svg = ''; + $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; + $tag_element['atts']['data-type'] = $format; + + unset( $tag_element['atts']['loading'] ); + $tag_element['atts']['decoding'] = 'async'; + $tag_element['atts']['data-width'] = $size[0]; + + return $tag_element; + } + + /** + * Register front end hooks. + */ + public function register_assets() { + wp_register_script( 'cld-lazy-load', $this->plugin->dir_url . 'js/lazy-load.js', null, $this->plugin->version, false ); + } + + /** + * Apply front end filters on the enqueue_assets hook. + */ + public function enqueue_assets() { + wp_enqueue_script( 'cld-lazy-load' ); + $config = $this->settings->get_parent()->get_value(); // Get top most config. + wp_add_inline_script( 'cld-lazy-load', 'var CLDLB = ' . wp_json_encode( $config ), 'before' ); + } + + /** + * Check if component is active. + * + * @return bool + */ + public function is_active() { + + return ! is_admin(); + } + + /** + * Define the settings. + * + * @return array + */ + public function settings() { + + $args = array( + 'type' => 'group', + 'title' => __( 'Lazy Loading', 'cloudinary' ), + 'priority' => 9, + 'collapsible' => 'open', + array( + 'type' => 'on_off', + 'description' => __( 'Enable lazy loading', 'cloudinary' ), + 'slug' => 'use_lazy_load', + 'default' => 'on', + ), + array( + 'type' => 'group', + 'condition' => array( + 'use_lazy_load' => true, + ), + array( + 'type' => 'text', + 'title' => __( 'Lazy loading threshold', 'cloudinary' ), + 'slug' => 'lazy_threshold', + 'attributes' => array( + 'style' => array( + 'width:100px;display:block;', + ), + 'data-auto-suffix' => '*px;em;rem;vh', + ), + 'default' => '1000px', + ), + array( + 'type' => 'radio', + 'title' => __( 'Placeholder generation', 'cloudinary' ), + 'slug' => 'lazy_placeholder', + 'default' => 'blur', + 'condition' => array( + 'enable_breakpoints' => true, + ), + 'options' => array( + 'blur' => __( 'Blur', 'cloudinary' ), + 'pixelate' => __( 'Pixelate', 'cloudinary' ), + 'vectorize' => __( 'Vectorize', 'cloudinary' ), + 'predominant' => __( 'Dominant Color', 'cloudinary' ), + 'off' => __( 'Off', 'cloudinary' ), + ), + ), + array( + 'type' => 'color', + 'title' => __( 'Use custom color', 'cloudinary' ), + 'slug' => 'lazy_custom_color', + 'default' => 'rgba(153,153,153,0.5)', + ), + array( + 'type' => 'on_off', + 'title' => __( 'Animate', 'cloudinary' ), + 'slug' => 'lazy_animate', + 'default' => 'on', + ), + ), + ); + + return $args; + } + + /** + * Register the setting under media. + */ + protected function register_settings() { + + // Move setting to media. + $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); + + // Add to media. + $media_settings->add_setting( $this->settings ); + + // Reset the option parent. + $this->settings->get_option_parent()->set_value( null ); + + $condition = array( + 'use_lazy_load' => false, + ); + $bk = $media_settings->get_setting( 'breakpoints' ); + $bk->set_param( 'condition', $condition ); + $bk->rebuild_component(); + + $image_breakpoints = $media_settings->get_setting( 'image_breakpoints' ); + $bytes_step = $image_breakpoints->get_setting( 'bytes_step' ); + $condition = array( + 'use_lazy_load' => false, + ); + $bytes_step->set_param( 'condition', $condition ); + $bytes_step->rebuild_component(); + + } +} diff --git a/php/delivery/class-responsive-breakpoints.php b/php/delivery/class-responsive-breakpoints.php new file mode 100644 index 000000000..f92974d4c --- /dev/null +++ b/php/delivery/class-responsive-breakpoints.php @@ -0,0 +1,179 @@ +media->is_cloudinary_url( $tag_element['atts']['src'] ) ) { + $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id ); + } + $transformations = $this->media->get_transformations_from_string( $tag_element['atts']['src'] ); + $original_string = Api::generate_transformation_string( $transformations ); + + // Check if first is a size. + if ( isset( $transformations[0] ) && isset( $transformations[0]['width'] ) || isset( $transformations[0]['height'] ) ) { + // remove the size. + array_shift( $transformations ); + } + $size_str = '--size--'; + if ( ! empty( $transformations ) ) { + $size_str .= '/' . Api::generate_transformation_string( $transformations ); + } + $tag_element['atts']['src'] = str_replace( $original_string, $size_str, $tag_element['atts']['src'] ); + if ( isset( $tag_element['atts']['srcset'] ) ) { + unset( $tag_element['atts']['srcset'], $tag_element['atts']['sizes'] ); + } + + return $tag_element; + } + + /** + * Remove the legacy breakpoints sync type and filters. + * + * @param array $structs The sync types structure. + * + * @return array + */ + public function remove_legacy_breakpoints( $structs ) { + unset( $structs['breakpoints'] ); + + return $structs; + } + + /** + * Check to see if Breakpoints are enabled. + * + * @return bool + */ + public function is_enabled() { + $lazy = $this->plugin->get_component( 'lazy_load' ); + $lazy_enabled = $lazy->is_enabled(); + + return ! is_null( $lazy ) && $lazy->is_enabled() && parent::is_enabled(); + } + + /** + * Remove the srcset filter. + */ + public function remove_srcset_filter() { + remove_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10 ); + } + + /** + * Setup the class. + */ + public function setup() { + parent::setup(); + add_filter( 'cloudinary_sync_base_struct', array( $this, 'remove_legacy_breakpoints' ) ); + } + + /** + * Create Settings. + */ + protected function create_settings() { + $this->settings = $this->media->get_settings()->get_setting( 'image_display' ); + } + + /** + * Register the setting under media. + */ + protected function register_settings() { + + $image_breakpoints = $this->settings->get_setting( 'image_breakpoints' ); + // Add pixel step. + $params = array( + 'type' => 'number', + 'slug' => 'pixel_step', + 'priority' => 9, + 'title' => __( 'Breakpoints distance', 'cloudinary' ), + 'tooltip_text' => __( 'The distance from the original image for responsive breakpoints generation.', 'cloudinary' ), + 'suffix' => __( 'px', 'cloudinary' ), + 'default' => 100, + 'condition' => array( + 'use_lazy_loading' => true, + ), + ); + $image_breakpoints->create_setting( 'pixel_step', $params, $image_breakpoints ); + + $self = $this; + // Add density. + $params = array( + 'type' => 'select', + 'slug' => 'dpr', + 'priority' => 8, + 'title' => __( 'DPR settings', 'cloudinary' ), + 'tooltip_text' => __( 'The distance from the original image for responsive breakpoints generation.', 'cloudinary' ), + 'default' => 'auto', + 'condition' => array( + 'use_lazy_loading' => true, + ), + 'enabled' => function () use ( $self ) { + $settings = $self->settings->get_value(); + + return ! isset( $settings['dpr_precise'] ); + }, + 'options' => array( + 'off' => __( 'None', 'cloudinary' ), + 'auto' => __( 'Auto', 'cloudinary' ), + '2' => __( '2X', 'cloudinary' ), + '3' => __( '3X', 'cloudinary' ), + '4' => __( '4X', 'cloudinary' ), + ), + ); + $image_breakpoints->create_setting( 'dpr', $params, $image_breakpoints )->get_value(); + // Reset the option parent. + $this->settings->get_option_parent()->set_value( null ); + } +} diff --git a/php/media/class-upgrade.php b/php/media/class-upgrade.php index 19f3f23dc..f406225d4 100644 --- a/php/media/class-upgrade.php +++ b/php/media/class-upgrade.php @@ -98,7 +98,7 @@ public function convert_cloudinary_version( $attachment_id ) { if ( empty( $public_id ) ) { $public_id = implode( '/', $parts ); } - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $asset_version ); if ( ! empty( $asset_transformations ) ) { $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset_transformations ); @@ -115,7 +115,7 @@ public function convert_cloudinary_version( $attachment_id ) { } $public_id .= $suffix; $this->media->delete_post_meta( $attachment_id, Sync::META_KEYS['suffix'] ); - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); } // Check folder sync in order. if ( $this->media->is_folder_synced( $attachment_id ) ) { @@ -169,11 +169,58 @@ public function get_fetch_public_id( $path, $attachment_id ) { return ''; } + /** + * Migrate legacy meta data to new meta. + * + * @param int $attachment_id The attachment ID to migrate. + * + * @return array(); + */ + public function migrate_legacy_meta( $attachment_id ) { + $meta = array(); + $old_meta = wp_get_attachment_metadata( $attachment_id, true ); + if ( isset( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { + $meta = $old_meta[ Sync::META_KEYS['cloudinary'] ]; + // Add public ID. + $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $meta[ Sync::META_KEYS['public_id'] ] = $public_id; + update_post_meta( $attachment_id, Sync::META_KEYS['cloudinary'], $meta ); + delete_post_meta( $attachment_id, Sync::META_KEYS['public_id'] ); + } else { + // Attempt old post meta. + $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + if ( isset( $public_id ) ) { + // Loop through all types and create new meta item. + $meta = array( + Sync::META_KEYS['public_id'] => $public_id, + ); + update_post_meta( $attachment_id, Sync::META_KEYS['cloudinary'], $meta ); + foreach ( Sync::META_KEYS as $meta_key ) { + if ( Sync::META_KEYS['cloudinary'] === $meta_key ) { + // Dont use the root as it will be an infinite loop. + continue; + } + $value = get_post_meta( $attachment_id, $meta_key, true ); + if ( ! empty( $value ) ) { + $meta[ $meta_key ] = $value; + $this->media->update_post_meta( $attachment_id, $meta_key, $value ); + } + } + } + } + + return $meta; + } + /** * Setup hooks for the filters. */ public function setup_hooks() { + // Add filter to manage legacy items. + // @todo: cleanup `convert_cloudinary_version` by v2 upgrades to here. + add_filter( 'cloudinary_migrate_legacy_meta', array( $this, 'migrate_legacy_meta' ) ); + // Add a redirection to the new plugin settings, from the old plugin. if ( is_admin() ) { add_action( diff --git a/php/media/class-video.php b/php/media/class-video.php index 443289503..3bed5ebed 100644 --- a/php/media/class-video.php +++ b/php/media/class-video.php @@ -162,7 +162,7 @@ public function filter_video_shortcode( $html, $attr ) { if ( empty( $attr['cloudinary'] ) ) { $video = wp_get_attachment_metadata( $attr['id'] ); $url = $this->media->cloudinary_url( $attr['id'] ); - $attr[ $video['fileformat'] ] = $url; + $attr[ $video['fileformat'] ] = strtok( $url, '?' ); $attr['cloudinary'] = true; // Flag Cloudinary to ensure we don't call it again. $html = wp_video_shortcode( $attr, $html ); } diff --git a/php/settings/class-setting.php b/php/settings/class-setting.php index aa92162e0..f4b8e18d6 100644 --- a/php/settings/class-setting.php +++ b/php/settings/class-setting.php @@ -377,8 +377,8 @@ public function get_setting( $slug, $create = true ) { */ public function setting_exists( $slug ) { $exists = false; - $setting = $this->get_root_setting()->get_setting( $slug, false ); - if ( ! $this->is_private_slug( $slug ) && ! is_null( $setting ) && $setting->get_param( 'is_setup', false ) ) { + $setting = $this->get_root_setting()->get_param( 'index:' . $slug, null ); + if ( ! $this->is_private_slug( $slug ) && ! is_null( $setting ) ) { $exists = true; } @@ -396,19 +396,9 @@ public function find_setting( $slug ) { if ( ! $this->is_root_setting() ) { return $this->get_root_setting()->find_setting( $slug ); } - $parts = explode( ':', $slug ); - $index = $this->get_param( 'index', array() ); + $setting = $this->get_param( 'index:' . $slug, null ); - $slug = sanitize_file_name( trim( array_shift( $parts ) ) ); - if ( isset( $index[ $slug ] ) ) { - if ( ! empty( $parts ) ) { - return $index[ $slug ]->get_setting( implode( ':', $parts ) ); - } - - return $index[ $slug ]; - } - - return $this->get_setting( $slug ); + return $setting ? $setting : $this->create_setting( $slug, null, $this ); // return a dynamic setting. } /** @@ -737,6 +727,14 @@ public function get_component() { return $this->component; } + /** + * Rebuild a component. + */ + public function rebuild_component() { + $this->component = null; + $this->setup_component(); + } + /** * Render the settings Component. * @@ -991,13 +989,23 @@ protected function get_default_values_recursive() { * @return Setting */ public function create_setting( $slug, $params = array(), $parent = null ) { - $slug = sanitize_file_name( $slug ); + $slug = sanitize_file_name( $slug ); + $existing = false; if ( $this->setting_exists( $slug ) ) { - // translators: Placeholder is the slug. - $message = sprintf( __( 'Duplicate setting slug %s. This setting will not be usable.', 'cloudinary' ), $slug ); - $this->add_admin_notice( 'duplicate_setting', $message, 'warning' ); + $existing_maybe = $this->find_setting( $slug ); + if ( $existing_maybe->get_param( 'is_setup' ) ) { + // translators: Placeholder is the slug. + $message = sprintf( __( 'Duplicate setting slug %s. This setting will not be usable.', 'cloudinary' ), $slug ); + $this->add_admin_notice( 'duplicate_setting', $message, 'warning' ); + } else { + // Use existing. + $existing = $existing_maybe; + if ( ! empty( $params ) ) { + $existing->setup_setting( $params ); + } + } } - $new_setting = new Setting( $slug, $params, $this->root_setting ); + $new_setting = $existing ? $existing : new Setting( $slug, $params, $this->root_setting ); $new_setting->set_value( null ); // Set value to null. if ( $parent ) { $parent->add_setting( $new_setting ); diff --git a/php/sync/class-download-sync.php b/php/sync/class-download-sync.php index 932e0e5d9..deb51803b 100644 --- a/php/sync/class-download-sync.php +++ b/php/sync/class-download-sync.php @@ -174,21 +174,9 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { // Prepare the asset. update_attached_file( $attachment_id, $upload['file'] ); - $old_meta = wp_get_attachment_metadata( $attachment_id ); - ob_start(); // Catch possible errors in WordPress's ID3 module when setting meta for transformed videos. - $meta = wp_generate_attachment_metadata( $attachment_id, $upload['file'] ); - $captured_errors = ob_get_clean(); // Capture issues. - // Be sure to record v2 meta. - if ( ! empty( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta[ Sync::META_KEYS['cloudinary'] ] = $old_meta[ Sync::META_KEYS['cloudinary'] ]; - } else { - // Maybe capture newest meta. - $maybe_new = wp_get_attachment_metadata( $attachment_id ); - if ( ! empty( $maybe_new[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta[ Sync::META_KEYS['cloudinary'] ] = $maybe_new[ Sync::META_KEYS['cloudinary'] ]; - } - } - wp_update_attachment_metadata( $attachment_id, $meta ); + + wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $upload['file'] ) ); + // Update the folder synced flag. $public_id = $this->media->get_public_id( $attachment_id ); $asset_folder = strpos( $public_id, '/' ) ? dirname( $public_id ) : '/'; diff --git a/php/sync/class-push-sync.php b/php/sync/class-push-sync.php index 979581c6b..391741ca7 100644 --- a/php/sync/class-push-sync.php +++ b/php/sync/class-push-sync.php @@ -194,8 +194,6 @@ public function process_assets( $attachments = array() ) { $ids = array_map( 'intval', (array) $attachments ); // Handle based on Sync Type. foreach ( $ids as $attachment_id ) { - // Create synced post meta as a way to search for synced / unsynced items. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $this->media->get_public_id( $attachment_id ) ); // Skip external media. if ( ! $this->media->is_local_media( $attachment_id ) ) { @@ -209,21 +207,23 @@ public function process_assets( $attachments = array() ) { update_post_meta( $attachment_id, Sync::META_KEYS['syncing'], time() ); $stat[ $attachment_id ] = array(); while ( $type = $this->sync->get_sync_type( $attachment_id, false ) ) { // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition + // translators: variable is sync type. + $action_message = sprintf( __( 'Sync type: %s', 'cloudinary' ), $type ); + do_action( '_cloudinary_queue_action', $action_message ); if ( isset( $stat[ $attachment_id ][ $type ] ) ) { // Loop prevention. break; } - $stat[ $attachment_id ][ $type ] = $this->sync->run_sync_method( $type, 'sync', $attachment_id ); - } - $prev_stat = $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['process_log'], true ); - if ( empty( $prev_stat ) ) { - $prev_stat = array(); + $stat[ $attachment_id ][ $type ] = true; + $result = $this->sync->run_sync_method( $type, 'sync', $attachment_id ); + if ( ! empty( $result ) ) { + $this->sync->log_sync_result( $attachment_id, $type, $result ); + } } - $stat[ $attachment_id ] = array_merge( $prev_stat, $stat ); + // remove pending. delete_post_meta( $attachment_id, Sync::META_KEYS['pending'] ); - // Record Process log. - $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['process_log'], $stat[ $attachment_id ] ); + // Remove processing flag. delete_post_meta( $attachment_id, Sync::META_KEYS['syncing'] ); diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index 02821973d..d288927a7 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -189,7 +189,9 @@ public function sync( $attachment_id ) { switch ( $this->settings['offload'] ) { case 'cld': $this->remove_local_assets( $attachment_id ); - update_post_meta( $attachment_id, '_wp_attached_file', $this->media->cloudinary_url( $attachment_id ) ); + $cloudinary_url = $this->media->cloudinary_url( $attachment_id, false ); + $cloudinary_url = remove_query_arg( '_i', $cloudinary_url ); + update_post_meta( $attachment_id, '_wp_attached_file', $cloudinary_url ); break; case 'dual_low': $transformations = $this->media->get_transformation_from_meta( $attachment_id ); @@ -220,6 +222,7 @@ public function sync( $attachment_id ) { $this->remove_local_assets( $attachment_id ); } $date = get_post_datetime( $attachment_id ); + $url = remove_query_arg( '_i', $url ); $this->download->download_asset( $attachment_id, $url, $date->format( 'Y/m' ) ); } @@ -288,7 +291,7 @@ public function status() { */ public function get_notices() { $notices = array(); - if ( 'cld' === $this->settings['offload'] ) { + if ( ! empty( $this->settings ) && 'cld' === $this->settings['offload'] ) { $storage = $this->connect->get_usage_stat( 'storage', 'used_percent' ); $transformations = $this->connect->get_usage_stat( 'transformations', 'used_percent' ); $bandwidth = $this->connect->get_usage_stat( 'bandwidth', 'used_percent' ); diff --git a/php/sync/class-sync-queue.php b/php/sync/class-sync-queue.php index 30edb2689..29d006748 100644 --- a/php/sync/class-sync-queue.php +++ b/php/sync/class-sync-queue.php @@ -299,7 +299,7 @@ public function build_queue() { 'compare' => 'NOT EXISTS', ), array( - 'key' => Sync::META_KEYS['public_id'], + 'key' => Sync::META_KEYS['cloudinary'], 'compare' => 'NOT EXISTS', ), array( diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index 2362776a9..107099198 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -163,17 +163,19 @@ public function handle_bulk_actions( $location, $action, $post_ids ) { // It's required to perform a new sync that Cloudinary and WordPress storage is set. if ( - 'dual_full' !== $this->plugin->settings->find_setting( 'offload' )->get_value() && - $this->plugin->components['sync']->is_synced( $post_id ) + $this->plugin->components['sync']->been_synced( $post_id ) && + 'dual_full' !== $this->plugin->settings->find_setting( 'offload' )->get_value() ) { continue; } // Clean up for previous syncs and start over. - $this->sync->delete_cloudinary_meta( $post_id ); - $this->sync->set_signature_item( $post_id, 'file', '' ); - $this->media->delete_post_meta( $post_id, Sync::META_KEYS['public_id'] ); - $this->sync->add_to_sync( $post_id ); + if ( ! $this->media->is_cloudinary_url( get_post_meta( $post_id, '_wp_attached_file', true ) ) ) { + $this->sync->delete_cloudinary_meta( $post_id ); + $this->sync->set_signature_item( $post_id, 'file', '' ); + $this->media->delete_post_meta( $post_id, Sync::META_KEYS['public_id'] ); + $this->sync->add_to_sync( $post_id ); + } } break; } @@ -218,11 +220,12 @@ public function setup() { /** * Upload an asset to Cloudinary. * - * @param int $attachment_id The attachment ID. + * @param int $attachment_id The attachment ID. + * @param string $suffix An optional suffix. * * @return array|\WP_Error */ - public function upload_asset( $attachment_id ) { + public function upload_asset( $attachment_id, $suffix = null ) { add_filter( 'cloudinary_doing_upload', '__return_true' ); @@ -241,17 +244,10 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { $type = $this->sync->get_sync_type( $attachment_id ); $options = $this->media->get_upload_options( $attachment_id ); - $public_id = $options['public_id']; $try_remote = 'cloud_name' !== $type; - // Add the suffix before uploading. - if ( $this->media->get_public_id( $attachment_id ) === $public_id ) { - // Only apply the saved suffix if the public_id is the same. This is to allow filtered ID's a change to have a suffix removed. - $options['public_id'] .= $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); - } else { - // If the public_id has been changed, remove the saved suffix. - $this->media->delete_post_meta( $attachment_id, Sync::META_KEYS['suffix'] ); - } + // Add suffix. + $options['public_id'] .= $suffix; // Run the upload Call. $result = $this->connect->api->upload( $attachment_id, $options, array(), $try_remote ); @@ -262,29 +258,27 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { // Check that this wasn't an existing. if ( ! empty( $result['existing'] ) ) { - // Check to see if this is the same image. - $version = $this->media->get_cloudinary_version( $attachment_id ); - if ( $version !== $result['version'] ) { - // New image with the same name. - // Add a suffix and try again. - $suffix = '_' . $attachment_id . substr( strrev( uniqid() ), 0, 5 ); - $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['suffix'], $suffix ); - - return $this->upload_asset( $attachment_id ); - } + // Add a suffix and try again. + $suffix = '_' . $attachment_id . substr( strrev( uniqid() ), 0, 5 ); + + return $this->upload_asset( $attachment_id, $suffix ); } // Set folder Synced. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['folder_sync'], $this->media->is_folder_synced( $attachment_id ) ); // Set public_id. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $result['public_id'] ); // Set version. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $result['version'] ); // Set the delivery type. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $result['type'] ); - // Set traceable sync keys. + + // Create a trackable key in post meta to allow getting the attachment id from URL with transformations. update_post_meta( $attachment_id, '_' . md5( $options['public_id'] ), true ); + + // Create a trackable key in post meta to allow getting the attachment id from URL. update_post_meta( $attachment_id, '_' . md5( 'base_' . $options['public_id'] ), true ); + // Update signature for all that use the same method. $this->sync->sync_signature_by_type( $attachment_id, $type ); // Update options and public_id as well (full sync). diff --git a/php/traits/trait-cli.php b/php/traits/trait-cli.php index 9e6b071d1..656e014c0 100644 --- a/php/traits/trait-cli.php +++ b/php/traits/trait-cli.php @@ -199,14 +199,13 @@ protected function process_sync( $posts, $total ) { $filename = self::pad_name( basename( $file ), 20, ' ', '*' ); $bar->tick( 1, 'Syncing (' . ( $done ) . ' of ' . $total . ') : ' . $filename ); if ( - ! $this->plugin->get_component( 'sync' )->is_synced( $asset ) + ! $this->plugin->get_component( 'sync' )->is_synced( $asset, true ) && $this->plugin->get_component( 'media' )->is_local_media( $asset ) && $this->plugin->get_component( 'sync' )->is_syncable( $asset ) ) { $this->plugin->get_component( 'sync' )->managers['push']->process_assets( $asset, $bar ); } delete_post_meta( $asset, '_cld_unsynced', true ); - $bar->tick(); } // Done message - reanalyze. if ( $done === $total ) { @@ -249,7 +248,7 @@ protected function process_analyze( $posts, $total ) { ) { // Add a key. $key = '_cld_synced'; - if ( ! $this->plugin->get_component( 'sync' )->is_synced( $asset ) ) { + if ( ! $this->plugin->get_component( 'sync' )->is_synced( $asset, true ) ) { $key = '_cld_unsynced'; add_post_meta( $asset, $key, true, true ); } diff --git a/php/ui/class-component.php b/php/ui/class-component.php index b9f710ff0..3906b417c 100644 --- a/php/ui/class-component.php +++ b/php/ui/class-component.php @@ -86,31 +86,37 @@ public function __construct( $setting ) { // Setup blueprint. $this->blueprint = $this->setting->get_param( 'blueprint', $this->blueprint ); - // Setup conditional logic. - if ( $this->setting->has_param( 'condition' ) ) { - $condition = $this->setting->get_param( 'condition' ); - foreach ( $condition as $slug => $value ) { - $bound = $this->setting->get_root_setting()->get_setting( $slug, false ); - if ( ! is_null( $bound ) ) { - $bound->set_param( 'attributes:input:data-bind-trigger', $bound->get_slug() ); - } else { - $this->setting->set_param( 'condition', null ); - } - } - } - // Setup the components parts for render. $this->setup_component_parts(); // Add scripts. add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + } /** * Setup the component. */ public function setup() { + $this->setup_conditions(); + } + /** + * Setup the conditions. + */ + public function setup_conditions() { + // Setup conditional logic. + if ( $this->setting->has_param( 'condition' ) ) { + $condition = $this->setting->get_param( 'condition' ); + foreach ( $condition as $slug => $value ) { + $bound = $this->setting->get_root_setting()->get_setting( $slug, false ); + if ( ! is_null( $bound ) ) { + $bound->set_param( 'attributes:input:data-bind-trigger', $bound->get_slug() ); + } else { + $this->setting->set_param( 'condition', null ); + } + } + } } /** diff --git a/php/ui/component/class-color.php b/php/ui/component/class-color.php index 1c67cdc0d..635bc10e1 100644 --- a/php/ui/component/class-color.php +++ b/php/ui/component/class-color.php @@ -7,6 +7,8 @@ namespace Cloudinary\UI\Component; +use function Cloudinary\get_plugin_instance; + /** * Class Color Component * @@ -14,6 +16,17 @@ */ class Color extends Text { + /** + * Enqueue scripts. + */ + public function enqueue_scripts() { + parent::enqueue_scripts(); + + $instance = get_plugin_instance(); + wp_enqueue_style( 'wp-color-picker' ); + wp_enqueue_script( 'wp-color-picker-alpha', $instance->dir_url . '/js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), $instance->version, true ); + } + /** * Filter the input parts structure. * @@ -22,10 +35,35 @@ class Color extends Text { * @return array */ protected function input( $struct ) { - $struct = parent::input( $struct ); - $struct['attributes']['type'] = 'text'; + $struct = parent::input( $struct ); + $struct['attributes']['type'] = 'text'; + $struct['attributes']['data-alpha-enabled'] = true; + $struct['attributes']['data-default-color'] = $this->setting->get_param( 'default' ); return $struct; } + /** + * Render the component. + * + * @param false $echo Flag to echo out or return. + * + * @return string|null + */ + public function render( $echo = false ) { + $return = parent::render( $echo ); + ?> + + 1, 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery array( - 'key' => Sync::META_KEYS['public_id'], + 'key' => Sync::META_KEYS['cloudinary'], 'compare' => 'EXISTS', ), diff --git a/php/ui/component/class-on-off.php b/php/ui/component/class-on-off.php index 73e2c0313..bf28dc6ae 100644 --- a/php/ui/component/class-on-off.php +++ b/php/ui/component/class-on-off.php @@ -19,7 +19,7 @@ class On_Off extends Text { * * @var string */ - protected $blueprint = 'label|title|tooltip/|/title|prefix/|/label|wrap|description_left/|control|false_value/|input/|slider/|/control|description/|/wrap'; + protected $blueprint = 'div|label|title|tooltip/|/title|prefix/|/label|wrap|description_left/|control|false_value/|input/|slider/|/control|description/|/wrap|/div'; /** * Filter the false_value parts structure. diff --git a/php/ui/component/class-sync.php b/php/ui/component/class-sync.php index 991ef44f8..95503aa4e 100644 --- a/php/ui/component/class-sync.php +++ b/php/ui/component/class-sync.php @@ -151,7 +151,7 @@ protected function count_to_sync() { 'posts_per_page' => 1, 'meta_query' => array( // phpcs:ignore array( - 'key' => \Cloudinary\Sync::META_KEYS['public_id'], + 'key' => \Cloudinary\Sync::META_KEYS['cloudinary'], 'compare' => 'NOT EXISTS', ), diff --git a/ui-definitions/settings-image.php b/ui-definitions/settings-image.php index 38b82dd1f..5c04a6dfc 100644 --- a/ui-definitions/settings-image.php +++ b/ui-definitions/settings-image.php @@ -87,55 +87,65 @@ ), array( 'type' => 'group', + 'title' => __( 'Image Display', 'cloudinary' ), + 'collapsible' => 'open', + 'slug' => 'image_display', array( - 'type' => 'on_off', - 'slug' => 'enable_breakpoints', + 'type' => 'group', 'title' => __( 'Image breakpoints', 'cloudinary' ), - 'tooltip_text' => __( 'Automatically generate multiple sizes based on the configured breakpoints to enable your images to responsively adjust to different screen sizes. Note that your Cloudinary usage will increase when enabling responsive images.', 'cloudinary' ), - 'description' => __( 'Enable responsive images.', 'cloudinary' ), - 'default' => 'off', - ), - array( - 'type' => 'group', - 'title' => __( 'Image breakpoints', 'cloudinary' ), - 'condition' => array( - 'enable_breakpoints' => true, - ), - array( - 'type' => 'number', - 'slug' => 'breakpoints', - 'title' => __( 'Max breakpoints', 'cloudinary' ), - 'tooltip_text' => __( 'The maximum number of images to be generated when delivering responsive images. For some images, the responsive algorithm may determine that the ideal number of breakpoints is smaller than the value you specify.', 'cloudinary' ), - 'suffix' => __( 'Valid values: 3-200', 'cloudinary' ), - 'default' => 3, - 'attributes' => array( - 'min' => 3, - 'max' => 200, - ), - ), + 'collapsible' => 'open', array( - 'type' => 'number', - 'slug' => 'bytes_step', - 'title' => __( 'Byte step', 'cloudinary' ), - 'tooltip_text' => __( 'The minimum number of bytes between two consecutive breakpoints.', 'cloudinary' ), - 'suffix' => __( 'bytes', 'cloudinary' ), - 'default' => 200, + 'type' => 'on_off', + 'slug' => 'enable_breakpoints', + 'title' => __( 'Breakpoints', 'cloudinary' ), + 'tooltip_text' => __( 'Automatically generate multiple sizes based on the configured breakpoints to enable your images to responsively adjust to different screen sizes. Note that your Cloudinary usage will increase when enabling responsive images.', 'cloudinary' ), + 'description' => __( 'Enable responsive images.', 'cloudinary' ), + 'default' => 'off', ), array( - 'type' => 'number', - 'slug' => 'max_width', - 'title' => __( 'Image width limit', 'cloudinary' ), - 'tooltip_text' => __( 'The minimum and maximum width of an image created as a breakpoint. Leave max as empty to auto detect based on largest registered size in WordPress.', 'cloudinary' ), - 'prefix' => __( 'Max', 'cloudinary' ), - 'suffix' => __( 'px', 'cloudinary' ), - 'default' => $this->default_max_width(), - ), - array( - 'type' => 'number', - 'slug' => 'min_width', - 'prefix' => __( 'Min', 'cloudinary' ), - 'suffix' => __( 'px', 'cloudinary' ), - 'default' => 800, + 'type' => 'group', + 'title' => __( 'Image breakpoints', 'cloudinary' ), + 'slug' => 'image_breakpoints', + 'condition' => array( + 'enable_breakpoints' => true, + ), + 'collapsible' => 'open', + array( + 'type' => 'number', + 'slug' => 'breakpoints', + 'title' => __( 'Max breakpoints', 'cloudinary' ), + 'tooltip_text' => __( 'The maximum number of images to be generated when delivering responsive images. For some images, the responsive algorithm may determine that the ideal number of breakpoints is smaller than the value you specify.', 'cloudinary' ), + 'suffix' => __( 'Valid values: 3-200', 'cloudinary' ), + 'default' => 3, + 'attributes' => array( + 'min' => 3, + 'max' => 200, + ), + ), + array( + 'type' => 'number', + 'slug' => 'bytes_step', + 'title' => __( 'Byte step', 'cloudinary' ), + 'tooltip_text' => __( 'The minimum number of bytes between two consecutive breakpoints.', 'cloudinary' ), + 'suffix' => __( 'bytes', 'cloudinary' ), + 'default' => 200, + ), + array( + 'type' => 'number', + 'slug' => 'max_width', + 'title' => __( 'Image width limit', 'cloudinary' ), + 'tooltip_text' => __( 'The minimum and maximum width of an image created as a breakpoint. Leave max as empty to auto detect based on largest registered size in WordPress.', 'cloudinary' ), + 'prefix' => __( 'Max', 'cloudinary' ), + 'suffix' => __( 'px', 'cloudinary' ), + 'default' => $this->default_max_width(), + ), + array( + 'type' => 'number', + 'slug' => 'min_width', + 'prefix' => __( 'Min', 'cloudinary' ), + 'suffix' => __( 'px', 'cloudinary' ), + 'default' => 800, + ), ), ), ), diff --git a/webpack.config.js b/webpack.config.js index 02de043a7..0bdea27fc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -197,6 +197,14 @@ const cldVideoInit = { }, }; +const cldLazyLoad = { + ...defaultConfig, + ...sharedConfig, + entry: { + 'lazy-load': './js/src/lazy-load.js', + }, +}; + module.exports = [ cldBlockEditor, cldCore, @@ -206,4 +214,5 @@ module.exports = [ cldVideoInit, cldSettingsGallery, cldGalleryUI, + cldLazyLoad, ];