Plugin Directory

Changeset 3113737

Timestamp:
07/07/2024 09:56:16 AM (4 weeks ago)
Author:
antonlukin
Message:

Update to version 3.2 from GitHub

Location:
sharing-image
Files:
30 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sharing-image/tags/3.2/assets/settings/index.asset.php

    r3109241 r3113737  
    1 <?php return array('dependencies' => array(), 'version' => 'a30cb6a378f6631afb19');
     1<?php return array('dependencies' => array(), 'version' => '');
  • sharing-image/tags/3.2/assets/settings/index.css

    r3108262 r3113737  
    22.sharing-image-catalog{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-gap:20px;max-width:100%;padding:20px;position:relative;width:1100px}.sharing-image-catalog .sharing-image-catalog-card{background:#fff;border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.125);display:block;overflow:hidden;position:relative}.sharing-image-catalog .sharing-image-catalog-new{border:2px dashed rgba(0,0,0,.125);border-radius:4px;color:#666;display:block;padding-top:calc(52.5% + 44px);position:relative;text-decoration:none}.sharing-image-catalog .sharing-image-catalog-new h2{align-items:center;color:inherit;display:flex;flex-flow:column nowrap;font-size:15px;font-weight:400;justify-content:center;left:50%;margin:-10px 0 0;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%)}.sharing-image-catalog .sharing-image-catalog-new h2 span{display:block;font-size:11px;font-style:italic;font-weight:400;margin-top:8px;text-align:center}.sharing-image-catalog .sharing-image-catalog-new h2:before{content:"+";display:block;font-size:80px;font-weight:400;line-height:1;opacity:.25}.sharing-image-catalog .sharing-image-catalog-new:hover{background-color:#3582c4;border:2px solid #2a679c;color:#eee}@media screen and (max-width:782px){.sharing-image-catalog .sharing-image-catalog-new{padding-top:calc(52.5% + 54px)}}.sharing-image-catalog .sharing-image-catalog-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);display:block;margin:0;padding:52.5% 0 0;position:relative}.sharing-image-catalog .sharing-image-catalog-preview img{display:block;height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;width:100%}.sharing-image-catalog .sharing-image-catalog-footer{align-items:center;display:flex;height:48px;padding:0 15px;position:relative}.sharing-image-catalog .sharing-image-catalog-footer h2{flex:1 1 auto;font-size:15px;margin-right:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sharing-image-catalog .sharing-image-catalog-footer .button{margin-bottom:0}@media screen and (max-width:782px){.sharing-image-catalog .sharing-image-catalog-footer{height:54px}.sharing-image-catalog{width:75%}}@media screen and (max-width:600px){.sharing-image-catalog{grid-template-columns:1fr;width:100%}}
    33.sharing-image-premium{display:block;max-width:100%;padding:20px;width:700px}.sharing-image-premium h2{margin:12px 0}.sharing-image-premium ul{list-style-type:disc;margin-left:40px}.sharing-image-premium p{margin:12px 0 0}.sharing-image-premium p:first-child{margin-top:0}.sharing-image-premium>*{margin:24px 0}.sharing-image-premium .sharing-image-premium-benefits{display:block}.sharing-image-premium .sharing-image-premium-gratitude,.sharing-image-premium.premium-enabled .sharing-image-premium-benefits{display:none}.sharing-image-premium.premium-enabled .sharing-image-premium-gratitude{display:block}.sharing-image-premium .sharing-image-premium-contacts{border-top:1px solid #ccc;display:block;padding-top:24px}.sharing-image-premium .sharing-image-premium-access,.sharing-image-premium .sharing-image-premium-access strong{display:block}.sharing-image-premium .sharing-image-premium-access.access-loader .spinner{visibility:visible}.sharing-image-premium .sharing-image-premium-verify{align-items:center;display:flex;margin-top:8px}.sharing-image-premium .sharing-image-premium-verify input{flex:1 1 auto;max-width:320px}.sharing-image-premium .sharing-image-premium-verify button{margin-bottom:0;margin-left:8px}.sharing-image-premium .sharing-image-premium-verify .spinner{margin:0 0 0 8px}.sharing-image-premium .sharing-image-premium-revoke{align-items:center;display:flex;flex-flow:row wrap;margin:24px 0}.sharing-image-premium .sharing-image-premium-revoke p{margin:0 0 16px;width:100%}.sharing-image-premium .sharing-image-premium-revoke button{border-color:#b32d2e;color:#b32d2e}.sharing-image-premium .sharing-image-premium-revoke .spinner{margin:0 0 0 8px}.sharing-image-premium .sharing-image-premium-permit{align-items:center;display:flex;margin:24px 0}.sharing-image-premium .sharing-image-premium-permit strong{display:none;margin-left:16px}.sharing-image-premium .sharing-image-premium-permit.permit-visible strong{display:block}.sharing-image-premium .sharing-image-premium-warning{color:#b32d2e;display:none;position:relative}.sharing-image-premium .sharing-image-premium-warning.warning-visible{display:block}
    4 .sharing-image-editor{display:flex;flex-flow:row nowrap;max-width:100%;padding:20px;position:relative;width:1100px}.sharing-image-editor .sharing-image-editor-fieldset{display:block;flex:1 1 auto;margin-bottom:24px;margin-right:48px;min-width:0}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-fieldset{flex:0 1 640px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control{align-items:flex-start;display:flex;flex-flow:column nowrap;margin-bottom:24px;position:relative}.sharing-image-editor .sharing-image-editor-control p{margin:0 0 5px}.sharing-image-editor .sharing-image-editor-control p:last-child{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control h3,.sharing-image-editor .sharing-image-editor-control h4{cursor:default;display:block;font-size:13px;font-weight:600;margin:0 0 5px;width:100%}.sharing-image-editor .sharing-image-editor-control small{cursor:default;display:block;font-size:10px;line-height:1.5;margin-top:6px;width:100%}.sharing-image-editor .sharing-image-editor-control.control-hidden{display:none}.sharing-image-editor .sharing-image-editor-control.control-compact{max-width:100%;width:300px}.sharing-image-editor .sharing-image-editor-control.control-unhelp small{display:none}.sharing-image-editor .sharing-image-editor-control.control-reduced{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-right:54px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:last-child{margin-right:0}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{width:calc(50% - 7px)}.sharing-image-editor .sharing-image-editor-control.control-sizes>:first-child{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-bottom:14px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-select{align-items:center;flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-select>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-select>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-footer{align-items:center;border-top:1px solid #dcdcde;flex-flow:row nowrap;margin-bottom:0;padding-top:20px}.sharing-image-editor .sharing-image-editor-control.control-footer>*{margin-right:28px}.sharing-image-editor .sharing-image-editor-control.control-footer>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-right:54px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-series>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-bottom:24px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-upload{align-items:flex-end;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-upload>:first-child{flex:1 1 auto;margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-upload>:nth-child(2){margin-top:8px}.sharing-image-editor .sharing-image-editor-control.control-extend>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-pulled{margin-top:-10px}.sharing-image-editor .sharing-image-editor-control.control-disabled{opacity:.5}.sharing-image-editor .sharing-image-editor-control.control-disabled>*{pointer-events:none}.sharing-image-editor .sharing-image-editor-control.control-gapped>:first-child{margin-bottom:20px}.sharing-image-editor .sharing-image-editor-designer{display:block;margin-top:-10px;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-more{background:transparent;border:none;border-bottom:1px dashed;color:#3582c4;cursor:pointer;display:block;margin:0;padding:0;transition:border .25s}.sharing-image-editor .sharing-image-editor-more:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-more:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-delete{background:transparent;border:none;border-bottom:1px solid;color:#b32d2e;cursor:pointer;display:block;margin:0;padding:0;text-decoration:none;transition:border .25s}.sharing-image-editor .sharing-image-editor-delete:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-delete:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-collapse{background:transparent;border:none;color:#aaa;cursor:pointer;display:block;font-size:14px;line-height:1;margin-right:8px;padding:3px 0 0;transition:color .25s}.sharing-image-editor .sharing-image-editor-collapse:before{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.sharing-image-editor .sharing-image-editor-collapse:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-collapse:hover:after{color:#787c82}.sharing-image-editor .sharing-image-editor-collapse:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-order{background:transparent;border:none;color:#aaa;cursor:move;display:block;font-size:16px;padding:4px 4px 2px;position:absolute;right:8px;top:12px;transition:color .25s}.sharing-image-editor .sharing-image-editor-order:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-order:hover{color:#787c82}.sharing-image-editor .sharing-image-editor-order:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-layer{animation:fade-in 1s forwards;background-color:#fff;border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.05);display:block;margin:0 0 16px;opacity:0;padding:14px 10px;position:relative}.sharing-image-editor .sharing-image-editor-layer h2{align-items:center;display:flex;font-size:16px;font-weight:600;margin:-14px -10px 0;padding:14px 40px 14px 10px;position:relative;width:calc(100% + 20px)}.sharing-image-editor .sharing-image-editor-layer h2 span{color:#888;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.sharing-image-editor .sharing-image-editor-layer h5{display:block;font-size:13px;font-weight:400;margin:0 10px 24px 0}.sharing-image-editor .sharing-image-editor-layer:first-child .control-upnext{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed{padding-bottom:0}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>*{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>h2{display:flex}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>.sharing-image-editor-order{display:block}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed .sharing-image-editor-collapse:after{content:""}.sharing-image-editor .sharing-image-editor-monitor{display:block;flex:0 0 480px;max-width:100%;order:2}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 0 400px}}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 1 640px}}.sharing-image-editor .sharing-image-editor-viewport{display:block;position:sticky;top:52px;width:100%}.sharing-image-editor .sharing-image-editor-loader{background-color:rgba(0,0,0,.75);display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-loader:after{animation:rotate 1.2s linear infinite;border-color:#999 transparent;border-radius:50%;border-style:solid;border-width:6px;content:" ";display:block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px}.sharing-image-editor .sharing-image-editor-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);border-radius:3px;box-shadow:0 0 3px 0 #777;display:block;overflow:hidden;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-preview img{display:block;height:auto;max-height:400px;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:100%}.sharing-image-editor .sharing-image-editor-preview.preview-blank{padding-top:52.5%}.sharing-image-editor .sharing-image-editor-preview.preview-loader .sharing-image-editor-loader{display:block}.sharing-image-editor .sharing-image-editor-warning{background:#fff;border:1px solid #c3c4c7;border-left:4px solid #b32d2e;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.125);display:none;margin:12px 0 -6px;padding:8px 12px;position:relative}.sharing-image-editor .sharing-image-editor-warning.warning-visible{display:block}.sharing-image-editor .sharing-image-editor-manager{align-items:center;display:flex;flex-flow:row wrap;margin-top:16px;width:100%}.sharing-image-editor .sharing-image-editor-manager button{margin-right:14px}.sharing-image-editor .sharing-image-editor-manager button:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-debug{align-items:center;display:flex;margin:10px 0 10px auto;order:2}.sharing-image-editor .sharing-image-editor-debug input{margin:0 8px 0 0}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:12px;margin-top:0;order:0;width:100%}}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:24px;margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-input{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-radio input{margin-right:8px}.sharing-image-editor .sharing-image-editor-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control-radio small{margin:2px 0 0 33px}.sharing-image-editor .sharing-image-editor-control-radio{margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-editor .sharing-image-editor-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-editor .sharing-image-editor-control-textarea{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-textarea textarea{display:block;min-height:30px;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-range{display:block;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-editor .sharing-image-editor-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-editor .sharing-image-editor-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-editor .sharing-image-editor-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-editor .sharing-image-editor-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-control-media a{margin-left:14px}.sharing-image-editor .sharing-image-editor-control-media button{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control-media small{line-height:1.375;margin-top:10px}.sharing-image-editor .sharing-image-editor-control-color{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-color input[type=color]{cursor:pointer}@media screen and (max-width:1023px){.sharing-image-editor{flex-flow:row wrap}}
    5 .sharing-image-config{display:block;max-width:100%;padding:20px;width:700px}.sharing-image-config h2{margin:12px 0}.sharing-image-config>*{margin:24px 0}.sharing-image-config .sharing-image-config-control{display:grid;grid-template-columns:240px auto;margin:40px 0 24px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control small{line-height:1.375;margin-top:6px}.sharing-image-config .sharing-image-config-control h3{font-size:14px;grid-column:1;margin:6px 0 0}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3{margin-bottom:12px}}.sharing-image-config .sharing-image-config-control h4{margin:0}.sharing-image-config .sharing-image-config-control h3~*{grid-column:2;width:100%}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3~*{grid-column:auto}}.sharing-image-config .sharing-image-config-control.control-extra h3+*+*{margin-top:20px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control{grid-template-columns:1fr}}.sharing-image-config .sharing-image-config-control-fieldset{display:block;margin-bottom:10px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-fieldset a{display:block;margin-top:10px}.sharing-image-config .sharing-image-config-control-list{display:block;list-style-type:disc;margin:0;padding-left:20px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-list li{margin-top:10px}.sharing-image-config .sharing-image-config-control-input{display:block;position:relative}.sharing-image-config .sharing-image-config-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-radio input{margin-right:8px}.sharing-image-config .sharing-image-config-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control-radio small{margin:2px 0 0 33px}.sharing-image-config .sharing-image-config-control-radio{margin-top:10px}}.sharing-image-config .sharing-image-config-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-config .sharing-image-config-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-config .sharing-image-config-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-range{display:block;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-config .sharing-image-config-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-config .sharing-image-config-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-config .sharing-image-config-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-config .sharing-image-config-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-config .sharing-image-config-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-config .sharing-image-config-control-media a{margin-left:14px}.sharing-image-config .sharing-image-config-control-media button{margin-bottom:0}.sharing-image-config .sharing-image-config-control-media small{line-height:1.375;margin-top:10px}
     4.sharing-image-editor{display:flex;flex-flow:row nowrap;max-width:100%;padding:20px;position:relative;width:1100px}.sharing-image-editor .sharing-image-editor-fieldset{display:block;flex:1 1 auto;margin-bottom:24px;margin-right:48px;min-width:0}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-fieldset{flex:0 1 640px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control{align-items:flex-start;display:flex;flex-flow:column nowrap;margin-bottom:24px;position:relative}.sharing-image-editor .sharing-image-editor-control p{margin:0 0 5px}.sharing-image-editor .sharing-image-editor-control p:last-child{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control h3,.sharing-image-editor .sharing-image-editor-control h4{cursor:default;display:block;font-size:13px;font-weight:600;margin:0 0 5px;width:100%}.sharing-image-editor .sharing-image-editor-control small{cursor:default;display:block;font-size:10px;line-height:1.5;margin-top:6px;width:100%}.sharing-image-editor .sharing-image-editor-control.control-hidden{display:none}.sharing-image-editor .sharing-image-editor-control.control-compact{max-width:100%;width:300px}.sharing-image-editor .sharing-image-editor-control.control-unhelp small{display:none}.sharing-image-editor .sharing-image-editor-control.control-reduced{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-right:54px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:last-child{margin-right:0}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{width:calc(50% - 7px)}.sharing-image-editor .sharing-image-editor-control.control-sizes>:first-child{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-bottom:14px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-select{align-items:center;flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-select>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-select>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-footer{align-items:center;border-top:1px solid #dcdcde;flex-flow:row nowrap;margin-bottom:0;padding-top:20px}.sharing-image-editor .sharing-image-editor-control.control-footer>*{margin-right:28px}.sharing-image-editor .sharing-image-editor-control.control-footer>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-right:54px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-series>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-bottom:24px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-upload{align-items:flex-end;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-upload>:first-child{flex:1 1 auto;margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-upload>:nth-child(2){margin-top:8px}.sharing-image-editor .sharing-image-editor-control.control-extend>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-pulled{margin-top:-10px}.sharing-image-editor .sharing-image-editor-control.control-disabled{opacity:.5}.sharing-image-editor .sharing-image-editor-control.control-disabled>*{pointer-events:none}.sharing-image-editor .sharing-image-editor-control.control-gapped>:first-child{margin-bottom:20px}.sharing-image-editor .sharing-image-editor-designer{display:block;margin-top:-10px;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-more{background:transparent;border:none;border-bottom:1px dashed;color:#3582c4;cursor:pointer;display:block;margin:0;padding:0;transition:border .25s}.sharing-image-editor .sharing-image-editor-more:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-more:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-delete{background:transparent;border:none;border-bottom:1px solid;color:#b32d2e;cursor:pointer;display:block;margin:0;padding:0;text-decoration:none;transition:border .25s}.sharing-image-editor .sharing-image-editor-delete:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-delete:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-collapse{background:transparent;border:none;color:#aaa;cursor:pointer;display:block;font-size:14px;line-height:1;margin-right:8px;padding:3px 0 0;transition:color .25s}.sharing-image-editor .sharing-image-editor-collapse:before{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.sharing-image-editor .sharing-image-editor-collapse:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-collapse:hover:after{color:#787c82}.sharing-image-editor .sharing-image-editor-collapse:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-order{background:transparent;border:none;color:#aaa;cursor:move;display:block;font-size:16px;padding:4px 4px 2px;position:absolute;right:8px;top:12px;transition:color .25s}.sharing-image-editor .sharing-image-editor-order:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-order:hover{color:#787c82}.sharing-image-editor .sharing-image-editor-order:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-layer{animation:fade-in 1s forwards;background-color:#fff;border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.05);display:block;margin:0 0 16px;opacity:0;padding:14px 10px;position:relative}.sharing-image-editor .sharing-image-editor-layer h2{align-items:center;display:flex;font-size:16px;font-weight:600;margin:-14px -10px 0;padding:14px 40px 14px 10px;position:relative;width:calc(100% + 20px)}.sharing-image-editor .sharing-image-editor-layer h2 span{color:#888;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.sharing-image-editor .sharing-image-editor-layer h5{display:block;font-size:13px;font-weight:400;margin:0 10px 24px 0}.sharing-image-editor .sharing-image-editor-layer:first-child .control-upnext{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed{padding-bottom:0}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>*{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>h2{display:flex}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>.sharing-image-editor-order{display:block}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed .sharing-image-editor-collapse:after{content:""}.sharing-image-editor .sharing-image-editor-monitor{display:block;flex:0 0 480px;max-width:100%;order:2}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 0 400px}}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 1 640px}}.sharing-image-editor .sharing-image-editor-viewport{display:block;position:sticky;top:52px;width:100%}.sharing-image-editor .sharing-image-editor-loader{background-color:rgba(0,0,0,.75);display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-loader:after{animation:rotate 1.2s linear infinite;border-color:#999 transparent;border-radius:50%;border-style:solid;border-width:6px;content:" ";display:block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px}.sharing-image-editor .sharing-image-editor-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);border-radius:3px;box-shadow:0 0 3px 0 #777;display:block;overflow:hidden;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-preview img{display:block;height:auto;max-height:400px;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:100%}.sharing-image-editor .sharing-image-editor-preview.preview-blank{padding-top:52.5%}.sharing-image-editor .sharing-image-editor-preview.preview-loader .sharing-image-editor-loader{display:block}.sharing-image-editor .sharing-image-editor-warning{background:#fff;border:1px solid #c3c4c7;border-left:4px solid #b32d2e;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.125);display:none;margin:12px 0 -6px;padding:8px 12px;position:relative}.sharing-image-editor .sharing-image-editor-warning.warning-visible{display:block}.sharing-image-editor .sharing-image-editor-manager{align-items:center;display:flex;flex-flow:row wrap;margin-top:16px;width:100%}.sharing-image-editor .sharing-image-editor-manager button{margin-right:14px}.sharing-image-editor .sharing-image-editor-manager button:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-debug{align-items:center;display:flex;margin:10px 0 10px auto;order:2}.sharing-image-editor .sharing-image-editor-debug input{margin:0 8px 0 0}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:12px;margin-top:0;order:0;width:100%}}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:24px;margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-input{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-radio input{margin-right:8px}.sharing-image-editor .sharing-image-editor-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control-radio small{margin:2px 0 0 33px}.sharing-image-editor .sharing-image-editor-control-radio{margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-editor .sharing-image-editor-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-editor .sharing-image-editor-control-textarea{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-textarea textarea{display:block;min-height:30px;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-range{display:block;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-editor .sharing-image-editor-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-editor .sharing-image-editor-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-editor .sharing-image-editor-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-editor .sharing-image-editor-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-control-media a{margin-left:14px}.sharing-image-editor .sharing-image-editor-control-media button{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control-media small{line-height:1.375;margin-top:10px}.sharing-image-editor .sharing-image-editor-control-color{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-color input[type=color]{cursor:pointer}@media screen and (max-width:1023px){.sharing-image-editor{flex-flow:row wrap}}
     5.sharing-image-config{display:block;max-width:100%;padding:20px;width:700px}.sharing-image-config h2{margin:12px 0}.sharing-image-config>*{margin:24px 0}.sharing-image-config .sharing-image-config-control{display:grid;grid-template-columns:240px auto;margin:40px 0 24px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control small{line-height:1.375;margin-top:6px}.sharing-image-config .sharing-image-config-control h3{font-size:14px;grid-column:1;margin:6px 0 0}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3{margin-bottom:12px}}.sharing-image-config .sharing-image-config-control h4{margin:0}.sharing-image-config .sharing-image-config-control h3~*{grid-column:2;width:100%}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3~*{grid-column:auto}}.sharing-image-config .sharing-image-config-control.control-extra h3+*+*{margin-top:20px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control{grid-template-columns:1fr}}.sharing-image-config .sharing-image-config-control-fieldset{display:block;margin-bottom:10px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-fieldset a{display:block;margin-top:10px}.sharing-image-config .sharing-image-config-control-list{display:block;list-style-type:disc;margin:0;padding-left:20px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-list li{margin-top:10px}.sharing-image-config .sharing-image-config-control-input{display:block;position:relative}.sharing-image-config .sharing-image-config-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-radio input{margin-right:8px}.sharing-image-config .sharing-image-config-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control-radio small{margin:2px 0 0 33px}.sharing-image-config .sharing-image-config-control-radio{margin-top:10px}}.sharing-image-config .sharing-image-config-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-config .sharing-image-config-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-config .sharing-image-config-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-range{display:block;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-config .sharing-image-config-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-config .sharing-image-config-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-config .sharing-image-config-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-config .sharing-image-config-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-config .sharing-image-config-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-config .sharing-image-config-control-media a{margin-left:14px}.sharing-image-config .sharing-image-config-control-media button{margin-bottom:0}.sharing-image-config .sharing-image-config-control-media small{line-height:1.375;margin-top:10px}
    66input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent}input[type=range]:focus{outline:none}input[type=range]::-webkit-slider-runnable-track{background:#ddd;border:1px solid #b7b7b7;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#3582c4;border:0;border-radius:50%;cursor:pointer;height:16px;margin-top:-5.5px;width:16px}input[type=range]:focus::-webkit-slider-thumb{background:#2a679c}input[type=range]:hover::-webkit-slider-runnable-track{background:#d0d0d0}input[type=range]:disabled::-webkit-slider-thumb{background-color:#d0d0d0;cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{background-color:#eaeaea;border:1px solid #d0d0d0;cursor:default}input[type=range]::-moz-range-thumb{-moz-appearance:none;appearance:none;background:#3582c4;border:0;border-radius:50%;cursor:pointer;height:16px;margin-top:-5.5px;width:16px}input[type=range]::-moz-range-track{background:#ddd;border:1px solid #c4c4c4;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]::-moz-range-progress{background:#3582c4;border:1px solid #3582c4;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]:focus::-moz-range-thumb{background:#2a679c}input[type=range]:disabled::-moz-range-thumb{background-color:#d0d0d0;cursor:default}input[type=range]:disabled::-moz-range-progress,input[type=range]:disabled::-moz-range-track{background-color:#eaeaea;border:1px solid #d0d0d0;cursor:default}input[type=range]::-ms-track{background:#ddd;border:1px solid #c4c4c4;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]::-ms-thumb{appearance:none;background:#3582c4;border:0;border-radius:50%;cursor:pointer;height:16px;margin-top:-5.5px;width:16px}input[type=range]:focus::-ms-thumb{background:#2a679c}input[type=range]:disabled::-ms-thumb{background-color:#d0d0d0;cursor:default}input[type=range]:disabled::-ms-track{background-color:#eaeaea;border:1px solid #d0d0d0;cursor:default}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}#wpcontent{padding-left:0!important}.notice{margin:20px auto;max-width:calc(100% - 40px);width:1060px}.notice.update-nag{display:none}@media screen and (max-width:782px){.notice{margin:10px auto}}#sharing-image-settings{display:block;position:relative}#sharing-image-settings *{box-sizing:border-box}#sharing-image-settings .sharing-image-content{align-items:center;display:none;flex-flow:column wrap}#sharing-image-settings .sharing-image-content.content-visible{display:flex}#sharing-image-settings .sharing-image-error{color:#b32d2e;margin:40px auto 20px;max-width:660px;text-align:center}#sharing-image-settings .sharing-image-header{background:#fff;border-bottom:1px solid #ddd;border-top:1px solid #ddd;display:block;order:-2;width:100%}#sharing-image-settings .sharing-image-header h1{display:block;font-size:23px;font-weight:600;line-height:1.3;margin:0 0 16px;padding:16px 0 4px;position:relative;text-align:center}#sharing-image-settings .sharing-image-header .sharing-image-menu{display:flex;justify-content:center;margin:0 auto;overflow-x:auto;overflow-y:hidden}@media screen and (max-width:600px){#sharing-image-settings .sharing-image-header .sharing-image-menu{justify-content:flex-start}}#sharing-image-settings .sharing-image-header .sharing-image-tab{color:inherit;display:block;margin:0 10px;padding:8px 10px 15px;text-decoration:none;transition:box-shadow .5s ease-in-out}#sharing-image-settings .sharing-image-header .sharing-image-tab:focus-visible{outline:1px solid #787c82}#sharing-image-settings .sharing-image-header .sharing-image-tab:focus{box-shadow:none}#sharing-image-settings .sharing-image-header .sharing-image-tab.active{box-shadow:inset 0 -3px #3582c4;font-weight:600}
  • sharing-image/tags/3.2/assets/settings/index.js

    r3109241 r3113737  
    1 (()=>{"use strict";let e=e=>crypto.getRandomValues(new Uint8Array(e));const t={param:function(e){return new URL(document.location.href).searchParams.get(e)},attachment:function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()},defaults:function(e,t){return t.forEach((t=>{void 0===e[t]&&(e[t]={})})),e},uniqid:function(){return((t,n=21)=>((e,t,n)=>{let a=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*a*t/e.length);return(o=t)=>{let r="";for(;;){let t=n(i),s=i;for(;s--;)if(r+=e[t[s]&a]||"",r.length===o)return r}}})(t,n,e))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",12)()},dataget:function(e,t,n){const a=e.querySelector(`[data-${t}="${n}"]`);if(a)return a.value}},n=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},a=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("input",{attributes:{type:"text"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if("range"===i.type){const e=p.element("em",{text:i.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});i.addEventListener("change",(()=>{e.textContent=i.value})),i.addEventListener("input",(()=>{e.textContent=i.value})),e.addEventListener("click",(()=>{i.type="text"===i.type?"range":"text"}))}return i},i=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"checkbox"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return i},o=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"radio"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return e.hasOwnProperty("help")&&n("small",{text:e.help,append:a}),i},r=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("select",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}const o=e.options||{};for(const t in o){const a=n("option",{text:o[t],attributes:{value:t},append:i});if(e.hasOwnProperty("selected")){const t=e.selected;t&&t===a.value&&a.setAttribute("selected","selected")}}return i},s=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("textarea",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("content")){const t=e.content;void 0!==t&&(i.innerHTML=t)}return i},l=function(e){const t=n("div",{classes:e.classes||[]});return e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")&&n("h3",{text:e.label,append:t}),e.hasOwnProperty("description")&&n("p",{text:e.description,append:t}),e.hasOwnProperty("fields")&&e.fields.forEach((e=>{switch(e.group){case"input":a(e,t);break;case"textarea":s(e,t);break;case"radio":o(e,t);break;case"select":r(e,t);break;case"checkbox":i(e,t)}})),e.hasOwnProperty("help")&&n("small",{text:e.help,append:t}),t};function c(e,t){let a=e.querySelector("figure");if(a&&e.removeChild(a),!wp.media)return;if(a=n("figure",{prepend:e}),e.querySelector("h4")&&e.insertBefore(a,e.querySelector("h4").nextSibling),!t)return;let i=a.querySelector("img");i&&a.removeChild(i),i=n("img",{append:a}),wp.media.attachment(t).fetch().then((e=>{i.src=e.sizes?.thumbnail?.url||e.url}))}const p={element:n,control:l,layer:function(e){const t=n("div",{classes:e.classes||[]});e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")||(e.label="");const a=n("h2",{text:e.label,append:t});return n("span",{append:a}),e.hasOwnProperty("description")&&n("h5",{text:e.description,append:t}),t},checkbox:i,media:function(e){const a=l({classes:e.classes||[]});if(e.hasOwnProperty("append")&&e.append.appendChild(a),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(a,e.prepend.firstChild),e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}e.labels=e.labels||{};const i=n("input",{attributes:{type:"hidden",name:e.name},append:a}),o=n("button",{classes:["button"],text:e.labels.button,attributes:{type:"button"},append:a}),r=n("a",{classes:["hidden"],text:e.labels.details,attributes:{target:"_blank"}});e.hasOwnProperty("link")&&a.appendChild(r),e.hasOwnProperty("help")&&n("small",{text:e.help,append:a});const s=t=>{i.setAttribute("value",t),i.dispatchEvent(new Event("change",{bubbles:!0}));let n=null;e.hasOwnProperty("link")&&(n=new URL(e.link),n.searchParams.set("item",t),r.setAttribute("href",n.href)),e.remove&&(o.textContent=e.labels.remove),e.image&&c(a,t),r.classList.remove("hidden")},p=()=>{i.setAttribute("value",""),i.dispatchEvent(new Event("change",{bubbles:!0})),o.textContent=e.labels.button,e.image&&c(a,0),r.classList.add("hidden")};return e.image&&c(a,0),e.value&&s(e.value),o.addEventListener("click",(()=>{if(e.remove&&i.value)return p();const n={title:e.labels.heading};e.hasOwnProperty("mime")&&(n.library={},n.library.type=e.mime),t.attachment(n,(e=>{s(e)}))})),a.addEventListener("set_attachment",(e=>{e.detail&&s(e.detail)})),a.addEventListener("remove_attachment",(()=>{p()})),a},input:a,textarea:s,radio:o,select:r};let d=null;let u=null;function g(e,t,n){const a=p.element("div",{classes:["sharing-image-catalog-card"],append:e}),i=p.element("figure",{classes:["sharing-image-catalog-preview"],append:a});t.preview&&p.element("img",{attributes:{src:t.preview,alt:""},append:i});const o=p.element("footer",{classes:["sharing-image-catalog-footer"],append:a});p.element("h2",{text:t.title||wp.i18n.__("Untitled","sharing-image"),append:o});const r=new URL(document.location.href);r.searchParams.set("template",n),p.element("a",{classes:["button"],text:wp.i18n.__("Edit template","sharing-image"),attributes:{href:r.href},append:o})}let h=null,m=null;function f(e,t){const n=[];switch(void 0===t&&(t=wp.i18n.__("Verification unsuccessful.","sharing-image")),n.push(t),e){case"LIMIT_EXCEEDED":n.push(wp.i18n.__("The number of licenses for this key has been exceeded.","sharing-image"));break;case"KEY_NOT_FOUND":n.push(wp.i18n.__("The Premium key is invalid or expired.","sharing-image"));break;case"SERVER_ERROR":n.push(wp.i18n.__("Unable to receive a response from the verification server.","sharing-image"))}return n.join(" ")}function v(e){const t=m.querySelector(".sharing-image-premium-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown request error.","sharing-image"))}function b(){const e=m.querySelector(".sharing-image-premium-warning");null!==e&&e.classList.remove("warning-visible")}function _(e,t){m.classList.add("premium-enabled"),t.develop?v(wp.i18n.__("Using the plugin with a development license is prohibited in production.","sharing-image")):(t.key&&function(e,t){const n=p.element("div",{classes:["sharing-image-premium-permit"],append:e});p.element("button",{classes:["sharing-image-premium-show","button"],text:wp.i18n.__("Show License key","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{n.classList.toggle("permit-visible")})),p.element("strong",{text:t,append:n})}(e,t.key),function(e){const t=p.element("div",{classes:["sharing-image-premium-revoke"],append:e}),n=[];n.push(wp.i18n.__("Disabling premium mode will not remove the license for this domain.","sharing-image")),n.push(wp.i18n.__("Your current key will also be saved in the plugin settings.","sharing-image")),n.push(wp.i18n.__("Use key management tool to delete the license for the site.","sharing-image")),p.element("p",{text:n.join(" "),append:t}),p.element("button",{classes:["button"],text:wp.i18n.__("Disable Premium","sharing-image"),attributes:{type:"submit"},append:t}),p.element("span",{classes:["spinner"],append:t}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_revoke_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(n.data):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e))}function w(){let e=m.querySelector(".sharing-image-premium-access");null!==e&&m.removeChild(e),e=p.element("form",{classes:["sharing-image-premium-access"],attributes:{action:"",method:"POST"},append:m}),m.classList.remove("premium-enabled"),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:h.nonce},append:e});const t=h.license||{};return t.premium||t.develop?_(e,t):function(e,t){t.error&&v(f(t.error)),p.element("strong",{text:wp.i18n.__("Do you already have a key? Enter it here","sharing-image"),append:e});const n=p.element("div",{classes:["sharing-image-premium-verify"],append:e});p.element("input",{label:wp.i18n.__("Your Premium key","sharing-image"),attributes:{type:"text",name:"sharing_image_key",value:t.key},append:n}),p.element("button",{classes:["button"],text:wp.i18n.__("Submit","sharing-image"),attributes:{type:"submit"},append:n}),p.element("span",{classes:["spinner"],append:n}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_verify_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(f(n.code,n.data)):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e,t)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},S.apply(this,arguments)}function D(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var C=D(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),T=D(/Edge/i),P=D(/firefox/i),O=D(/safari/i)&&!D(/chrome/i)&&!D(/android/i),L=D(/iP(ad|od|hone)/i),A=D(/chrome/i)&&D(/android/i),M={capture:!1,passive:!1};function N(e,t,n){e.addEventListener(t,n,!C&&M)}function I(e,t,n){e.removeEventListener(t,n,!C&&M)}function R(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Y(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function j(e,t,n,a){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&R(e,t):R(e,t))||a&&e===n)return e;if(e===n)break}while(e=Y(e))}return null}var F,X=/\s+/g;function q(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(X," ").replace(" "+t+" "," ");e.className=(a+(n?" "+t:"")).replace(X," ")}}function z(e,t,n){var a=e&&e.style;if(a){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in a||-1!==t.indexOf("webkit")||(t="-webkit-"+t),a[t]=n+("string"==typeof n?"":"px")}}function B(e,t){var n="";if("string"==typeof e)n=e;else do{var a=z(e,"transform");a&&"none"!==a&&(n=a+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function U(e,t,n){if(e){var a=e.getElementsByTagName(t),i=0,o=a.length;if(n)for(;i<o;i++)n(a[i],i);return a}return[]}function H(){return document.scrollingElement||document.documentElement}function W(e,t,n,a,i){if(e.getBoundingClientRect||e===window){var o,r,s,l,c,p,d;if(e!==window&&e.parentNode&&e!==H()?(r=(o=e.getBoundingClientRect()).top,s=o.left,l=o.bottom,c=o.right,p=o.height,d=o.width):(r=0,s=0,l=window.innerHeight,c=window.innerWidth,p=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!C))do{if(i&&i.getBoundingClientRect&&("none"!==z(i,"transform")||n&&"static"!==z(i,"position"))){var u=i.getBoundingClientRect();r-=u.top+parseInt(z(i,"border-top-width")),s-=u.left+parseInt(z(i,"border-left-width")),l=r+o.height,c=s+o.width;break}}while(i=i.parentNode);if(a&&e!==window){var g=B(i||e),h=g&&g.a,m=g&&g.d;g&&(l=(r/=m)+(p/=m),c=(s/=h)+(d/=h))}return{top:r,left:s,bottom:l,right:c,width:d,height:p}}}function G(e,t,n){for(var a=Z(e,!0),i=W(e)[t];a;){var o=W(a)[n];if(!("top"===n||"left"===n?i>=o:i<=o))return a;if(a===H())break;a=Z(a,!1)}return!1}function V(e,t,n,a){for(var i=0,o=0,r=e.children;o<r.length;){if("none"!==r[o].style.display&&r[o]!==tt.ghost&&(a||r[o]!==tt.dragged)&&j(r[o],n.draggable,e,!1)){if(i===t)return r[o];i++}o++}return null}function J(e,t){for(var n=e.lastElementChild;n&&(n===tt.ghost||"none"===z(n,"display")||t&&!R(n,t));)n=n.previousElementSibling;return n||null}function $(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===tt.clone||t&&!R(e,t)||n++;return n}function K(e){var t=0,n=0,a=H();if(e)do{var i=B(e),o=i.a,r=i.d;t+=e.scrollLeft*o,n+=e.scrollTop*r}while(e!==a&&(e=e.parentNode));return[t,n]}function Z(e,t){if(!e||!e.getBoundingClientRect)return H();var n=e,a=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=z(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return H();if(a||t)return n;a=!0}}}while(n=n.parentNode);return H()}function Q(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function ee(e,t){return function(){if(!F){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),F=setTimeout((function(){F=void 0}),t)}}}function te(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function ne(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function ae(e,t,n){var a={};return Array.from(e.children).forEach((function(i){var o,r,s,l;if(j(i,t.draggable,e,!1)&&!i.animated&&i!==n){var c=W(i);a.left=Math.min(null!==(o=a.left)&&void 0!==o?o:1/0,c.left),a.top=Math.min(null!==(r=a.top)&&void 0!==r?r:1/0,c.top),a.right=Math.max(null!==(s=a.right)&&void 0!==s?s:-1/0,c.right),a.bottom=Math.max(null!==(l=a.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}var ie="Sortable"+(new Date).getTime();var oe=[],re={initializeByDefault:!0},se={mount:function(e){for(var t in re)re.hasOwnProperty(t)&&!(t in e)&&(e[t]=re[t]);oe.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),oe.push(e)},pluginEvent:function(e,t,n){var a=this;this.eventCanceled=!1,n.cancel=function(){a.eventCanceled=!0};var i=e+"Global";oe.forEach((function(a){t[a.pluginName]&&(t[a.pluginName][i]&&t[a.pluginName][i](x({sortable:t},n)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](x({sortable:t},n)))}))},initializePlugins:function(e,t,n,a){for(var i in oe.forEach((function(a){var i=a.pluginName;if(e.options[i]||a.initializeByDefault){var o=new a(e,t,e.options);o.sortable=e,o.options=e.options,e[i]=o,S(n,o.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var o=this.modifyOption(e,i,e.options[i]);void 0!==o&&(e.options[i]=o)}},getEventProperties:function(e,t){var n={};return oe.forEach((function(a){"function"==typeof a.eventProperties&&S(n,a.eventProperties.call(t[a.pluginName],e))})),n},modifyOption:function(e,t,n){var a;return oe.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(a=i.optionListeners[t].call(e[i.pluginName],n))})),a}};var le=["evt"],ce=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.evt,i=function(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,le);se.pluginEvent.bind(tt)(e,t,x({dragEl:de,parentEl:ue,ghostEl:ge,rootEl:he,nextEl:me,lastDownEl:fe,cloneEl:ve,cloneHidden:be,dragStarted:Le,putSortable:ke,activeSortable:tt.active,originalEvent:a,oldIndex:_e,oldDraggableIndex:ye,newIndex:we,newDraggableIndex:xe,hideGhostForTarget:Ke,unhideGhostForTarget:Ze,cloneNowHidden:function(){be=!0},cloneNowShown:function(){be=!1},dispatchSortableEvent:function(e){pe({sortable:t,name:e,originalEvent:a})}},i))};function pe(e){!function(e){var t=e.sortable,n=e.rootEl,a=e.name,i=e.targetEl,o=e.cloneEl,r=e.toEl,s=e.fromEl,l=e.oldIndex,c=e.newIndex,p=e.oldDraggableIndex,d=e.newDraggableIndex,u=e.originalEvent,g=e.putSortable,h=e.extraEventProperties;if(t=t||n&&n[ie]){var m,f=t.options,v="on"+a.charAt(0).toUpperCase()+a.substr(1);!window.CustomEvent||C||T?(m=document.createEvent("Event")).initEvent(a,!0,!0):m=new CustomEvent(a,{bubbles:!0,cancelable:!0}),m.to=r||n,m.from=s||n,m.item=i||n,m.clone=o,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=p,m.newDraggableIndex=d,m.originalEvent=u,m.pullMode=g?g.lastPutMode:void 0;var b=x(x({},h),se.getEventProperties(a,t));for(var _ in b)m[_]=b[_];n&&n.dispatchEvent(m),f[v]&&f[v].call(t,m)}}(x({putSortable:ke,cloneEl:ve,targetEl:de,rootEl:he,oldIndex:_e,oldDraggableIndex:ye,newIndex:we,newDraggableIndex:xe},e))}var de,ue,ge,he,me,fe,ve,be,_e,we,ye,xe,Ee,ke,Se,De,Ce,Te,Pe,Oe,Le,Ae,Me,Ne,Ie,Re=!1,Ye=!1,je=[],Fe=!1,Xe=!1,qe=[],ze=!1,Be=[],Ue="undefined"!=typeof document,He=L,We=T||C?"cssFloat":"float",Ge=Ue&&!A&&!L&&"draggable"in document.createElement("div"),Ve=function(){if(Ue){if(C)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Je=function(e,t){var n=z(e),a=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=V(e,0,t),o=V(e,1,t),r=i&&z(i),s=o&&z(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+W(i).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+W(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&r.float&&"none"!==r.float){var p="left"===r.float?"left":"right";return!o||"both"!==s.clear&&s.clear!==p?"horizontal":"vertical"}return i&&("block"===r.display||"flex"===r.display||"table"===r.display||"grid"===r.display||l>=a&&"none"===n[We]||o&&"none"===n[We]&&l+c>a)?"vertical":"horizontal"},$e=function(e){function t(e,n){return function(a,i,o,r){var s=a.options.group.name&&i.options.group.name&&a.options.group.name===i.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(a,i,o,r),n)(a,i,o,r);var l=(n?a:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},a=e.group;a&&"object"==E(a)||(a={name:a}),n.name=a.name,n.checkPull=t(a.pull,!0),n.checkPut=t(a.put),n.revertClone=a.revertClone,e.group=n},Ke=function(){!Ve&&ge&&z(ge,"display","none")},Ze=function(){!Ve&&ge&&z(ge,"display","")};Ue&&!A&&document.addEventListener("click",(function(e){if(Ye)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ye=!1,!1}),!0);var Qe=function(e){if(de){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,je.some((function(e){var t=e[ie].options.emptyInsertThreshold;if(t&&!J(e)){var n=W(e),a=i>=n.left-t&&i<=n.right+t,s=o>=n.top-t&&o<=n.bottom+t;return a&&s?r=e:void 0}})),r);if(t){var n={};for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[ie]._onDragOver(n)}}var i,o,r},et=function(e){de&&de.parentNode[ie]._isOutsideThisEl(e.target)};function tt(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=S({},t),e[ie]=this;var n,a,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Je(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==tt.supportPointer&&"PointerEvent"in window&&!O,emptyInsertThreshold:5};for(var o in se.initializePlugins(this,e,i),i)!(o in t)&&(t[o]=i[o]);for(var r in $e(t),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&Ge,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?N(e,"pointerdown",this._onTapStart):(N(e,"mousedown",this._onTapStart),N(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(N(e,"dragover",this),N(e,"dragenter",this)),je.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),S(this,(a=[],{captureAnimationState:function(){a=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==z(e,"display")&&e!==tt.ghost){a.push({target:e,rect:W(e)});var t=x({},a[a.length-1].rect);if(e.thisAnimationDuration){var n=B(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){a.push(e)},removeAnimationState:function(e){a.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var a in t)if(t.hasOwnProperty(a)&&t[a]===e[n][a])return Number(n);return-1}(a,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var i=!1,o=0;a.forEach((function(e){var n=0,a=e.target,r=a.fromRect,s=W(a),l=a.prevFromRect,c=a.prevToRect,p=e.rect,d=B(a,!0);d&&(s.top-=d.f,s.left-=d.e),a.toRect=s,a.thisAnimationDuration&&Q(l,s)&&!Q(r,s)&&(p.top-s.top)/(p.left-s.left)==(r.top-s.top)/(r.left-s.left)&&(n=function(e,t,n,a){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*a.animation}(p,l,c,t.options)),Q(s,r)||(a.prevFromRect=r,a.prevToRect=s,n||(n=t.options.animation),t.animate(a,p,s,n)),n&&(i=!0,o=Math.max(o,n),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),n),a.thisAnimationDuration=n)})),clearTimeout(n),i?n=setTimeout((function(){"function"==typeof e&&e()}),o):"function"==typeof e&&e(),a=[]},animate:function(e,t,n,a){if(a){z(e,"transition",""),z(e,"transform","");var i=B(this.el),o=i&&i.a,r=i&&i.d,s=(t.left-n.left)/(o||1),l=(t.top-n.top)/(r||1);e.animatingX=!!s,e.animatingY=!!l,z(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),z(e,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),z(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){z(e,"transition",""),z(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),a)}}}))}function nt(e,t,n,a,i,o,r,s){var l,c,p=e[ie],d=p.options.onMove;return!window.CustomEvent||C||T?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=a,l.related=i||t,l.relatedRect=o||W(t),l.willInsertAfter=s,l.originalEvent=r,e.dispatchEvent(l),d&&(c=d.call(p,l,r)),c}function at(e){e.draggable=!1}function it(){ze=!1}function ot(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,a=0;n--;)a+=t.charCodeAt(n);return a.toString(36)}function rt(e){return setTimeout(e,0)}function st(e){return clearTimeout(e)}tt.prototype={constructor:tt,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ae=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,de):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,a=this.options,i=a.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=a.filter;if(function(e){Be.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var a=t[n];a.checked&&Be.push(a)}}(n),!de&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||a.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!O||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=j(s,a.draggable,n,!1))&&s.animated||fe===s)){if(_e=$(s),ye=$(s,a.draggable),"function"==typeof c){if(c.call(this,e,s,this))return pe({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),ce("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(a){if(a=j(l,a.trim(),n,!1))return pe({sortable:t,rootEl:a,name:"filter",targetEl:s,fromEl:n,toEl:n}),ce("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());a.handle&&!j(l,a.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var a,i=this,o=i.el,r=i.options,s=o.ownerDocument;if(n&&!de&&n.parentNode===o){var l=W(n);if(he=o,ue=(de=n).parentNode,me=de.nextSibling,fe=n,Ee=r.group,tt.dragged=de,Se={target:de,clientX:(t||e).clientX,clientY:(t||e).clientY},Pe=Se.clientX-l.left,Oe=Se.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,de.style["will-change"]="all",a=function(){ce("delayEnded",i,{evt:e}),tt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!P&&i.nativeDraggable&&(de.draggable=!0),i._triggerDragStart(e,t),pe({sortable:i,name:"choose",originalEvent:e}),q(de,r.chosenClass,!0))},r.ignore.split(",").forEach((function(e){U(de,e.trim(),at)})),N(s,"dragover",Qe),N(s,"mousemove",Qe),N(s,"touchmove",Qe),N(s,"mouseup",i._onDrop),N(s,"touchend",i._onDrop),N(s,"touchcancel",i._onDrop),P&&this.nativeDraggable&&(this.options.touchStartThreshold=4,de.draggable=!0),ce("delayStart",this,{evt:e}),!r.delay||r.delayOnTouchOnly&&!t||this.nativeDraggable&&(T||C))a();else{if(tt.eventCanceled)return void this._onDrop();N(s,"mouseup",i._disableDelayedDrag),N(s,"touchend",i._disableDelayedDrag),N(s,"touchcancel",i._disableDelayedDrag),N(s,"mousemove",i._delayedDragTouchMoveHandler),N(s,"touchmove",i._delayedDragTouchMoveHandler),r.supportPointer&&N(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,r.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){de&&at(de),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;I(e,"mouseup",this._disableDelayedDrag),I(e,"touchend",this._disableDelayedDrag),I(e,"touchcancel",this._disableDelayedDrag),I(e,"mousemove",this._delayedDragTouchMoveHandler),I(e,"touchmove",this._delayedDragTouchMoveHandler),I(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?N(document,"pointermove",this._onTouchMove):N(document,t?"touchmove":"mousemove",this._onTouchMove):(N(de,"dragend",this),N(he,"dragstart",this._onDragStart));try{document.selection?rt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(Re=!1,he&&de){ce("dragStarted",this,{evt:t}),this.nativeDraggable&&N(document,"dragover",et);var n=this.options;!e&&q(de,n.dragClass,!1),q(de,n.ghostClass,!0),tt.active=this,e&&this._appendGhost(),pe({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(De){this._lastX=De.clientX,this._lastY=De.clientY,Ke();for(var e=document.elementFromPoint(De.clientX,De.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(De.clientX,De.clientY))!==t;)t=e;if(de.parentNode[ie]._isOutsideThisEl(e),t)do{if(t[ie]&&t[ie]._onDragOver({clientX:De.clientX,clientY:De.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Ze()}},_onTouchMove:function(e){if(Se){var t=this.options,n=t.fallbackTolerance,a=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=ge&&B(ge,!0),r=ge&&o&&o.a,s=ge&&o&&o.d,l=He&&Ie&&K(Ie),c=(i.clientX-Se.clientX+a.x)/(r||1)+(l?l[0]-qe[0]:0)/(r||1),p=(i.clientY-Se.clientY+a.y)/(s||1)+(l?l[1]-qe[1]:0)/(s||1);if(!tt.active&&!Re){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ge){o?(o.e+=c-(Ce||0),o.f+=p-(Te||0)):o={a:1,b:0,c:0,d:1,e:c,f:p};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");z(ge,"webkitTransform",d),z(ge,"mozTransform",d),z(ge,"msTransform",d),z(ge,"transform",d),Ce=c,Te=p,De=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ge){var e=this.options.fallbackOnBody?document.body:he,t=W(de,!0,He,!0,e),n=this.options;if(He){for(Ie=e;"static"===z(Ie,"position")&&"none"===z(Ie,"transform")&&Ie!==document;)Ie=Ie.parentNode;Ie!==document.body&&Ie!==document.documentElement?(Ie===document&&(Ie=H()),t.top+=Ie.scrollTop,t.left+=Ie.scrollLeft):Ie=H(),qe=K(Ie)}q(ge=de.cloneNode(!0),n.ghostClass,!1),q(ge,n.fallbackClass,!0),q(ge,n.dragClass,!0),z(ge,"transition",""),z(ge,"transform",""),z(ge,"box-sizing","border-box"),z(ge,"margin",0),z(ge,"top",t.top),z(ge,"left",t.left),z(ge,"width",t.width),z(ge,"height",t.height),z(ge,"opacity","0.8"),z(ge,"position",He?"absolute":"fixed"),z(ge,"zIndex","100000"),z(ge,"pointerEvents","none"),tt.ghost=ge,e.appendChild(ge),z(ge,"transform-origin",Pe/parseInt(ge.style.width)*100+"% "+Oe/parseInt(ge.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,a=e.dataTransfer,i=n.options;ce("dragStart",this,{evt:e}),tt.eventCanceled?this._onDrop():(ce("setupClone",this),tt.eventCanceled||((ve=ne(de)).removeAttribute("id"),ve.draggable=!1,ve.style["will-change"]="",this._hideClone(),q(ve,this.options.chosenClass,!1),tt.clone=ve),n.cloneId=rt((function(){ce("clone",n),tt.eventCanceled||(n.options.removeCloneOnHide||he.insertBefore(ve,de),n._hideClone(),pe({sortable:n,name:"clone"}))})),!t&&q(de,i.dragClass,!0),t?(Ye=!0,n._loopId=setInterval(n._emulateDragOver,50)):(I(document,"mouseup",n._onDrop),I(document,"touchend",n._onDrop),I(document,"touchcancel",n._onDrop),a&&(a.effectAllowed="move",i.setData&&i.setData.call(n,a,de)),N(document,"drop",n),z(de,"transform","translateZ(0)")),Re=!0,n._dragStartId=rt(n._dragStarted.bind(n,t,e)),N(document,"selectstart",n),Le=!0,O&&z(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,a,i,o=this.el,r=e.target,s=this.options,l=s.group,c=tt.active,p=Ee===l,d=s.sort,u=ke||c,g=this,h=!1;if(!ze){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),r=j(r,s.draggable,o,!0),O("dragOver"),tt.eventCanceled)return h;if(de.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||g._ignoreWhileAnimating===r)return A(!1);if(Ye=!1,c&&!s.disabled&&(p?d||(a=ue!==he):ke===this||(this.lastPutMode=Ee.checkPull(this,c,de,e))&&l.checkPut(this,c,de,e))){if(i="vertical"===this._getDirection(e,r),t=W(de),O("dragOverValid"),tt.eventCanceled)return h;if(a)return ue=he,L(),this._hideClone(),O("revert"),tt.eventCanceled||(me?he.insertBefore(de,me):he.appendChild(de)),A(!0);var m=J(o,s.draggable);if(!m||function(e,t,n){var a=W(J(n.el,n.options.draggable)),i=ae(n.el,n.options,ge);return t?e.clientX>i.right+10||e.clientY>a.bottom&&e.clientX>a.left:e.clientY>i.bottom+10||e.clientX>a.right&&e.clientY>a.top}(e,i,this)&&!m.animated){if(m===de)return A(!1);if(m&&o===e.target&&(r=m),r&&(n=W(r)),!1!==nt(he,o,de,t,r,n,e,!!r))return L(),m&&m.nextSibling?o.insertBefore(de,m.nextSibling):o.appendChild(de),ue=o,M(),A(!0)}else if(m&&function(e,t,n){var a=W(V(n.el,0,n.options,!0)),i=ae(n.el,n.options,ge);return t?e.clientX<i.left-10||e.clientY<a.top&&e.clientX<a.right:e.clientY<i.top-10||e.clientY<a.bottom&&e.clientX<a.left}(e,i,this)){var f=V(o,0,s,!0);if(f===de)return A(!1);if(n=W(r=f),!1!==nt(he,o,de,t,r,n,e,!1))return L(),o.insertBefore(de,f),ue=o,M(),A(!0)}else if(r.parentNode===o){n=W(r);var v,b,_,w=de.parentNode!==o,y=!function(e,t,n){var a=n?e.left:e.top,i=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return a===r||i===s||a+o/2===r+l/2}(de.animated&&de.toRect||t,r.animated&&r.toRect||n,i),E=i?"top":"left",k=G(r,"top","top")||G(de,"top","top"),S=k?k.scrollTop:void 0;if(Ae!==r&&(b=n[E],Fe=!1,Xe=!y&&s.invertSwap||w),v=function(e,t,n,a,i,o,r,s){var l=a?e.clientY:e.clientX,c=a?n.height:n.width,p=a?n.top:n.left,d=a?n.bottom:n.right,u=!1;if(!r)if(s&&Ne<c*i){if(!Fe&&(1===Me?l>p+c*o/2:l<d-c*o/2)&&(Fe=!0),Fe)u=!0;else if(1===Me?l<p+Ne:l>d-Ne)return-Me}else if(l>p+c*(1-i)/2&&l<d-c*(1-i)/2)return function(e){return $(de)<$(e)?1:-1}(t);return(u=u||r)&&(l<p+c*o/2||l>d-c*o/2)?l>p+c/2?1:-1:0}(e,r,n,i,y?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Xe,Ae===r),0!==v){var D=$(de);do{D-=v,_=ue.children[D]}while(_&&("none"===z(_,"display")||_===ge))}if(0===v||_===r)return A(!1);Ae=r,Me=v;var C=r.nextElementSibling,T=!1,P=nt(he,o,de,t,r,n,e,T=1===v);if(!1!==P)return 1!==P&&-1!==P||(T=1===P),ze=!0,setTimeout(it,30),L(),T&&!C?o.appendChild(de):r.parentNode.insertBefore(de,T?C:r),k&&te(k,0,S-k.scrollTop),ue=de.parentNode,void 0===b||Xe||(Ne=Math.abs(b-W(r)[E])),M(),A(!0)}if(o.contains(de))return A(!1)}return!1}function O(s,l){ce(s,g,x({evt:e,isOwner:p,axis:i?"vertical":"horizontal",revert:a,dragRect:t,targetRect:n,canSort:d,fromSortable:u,target:r,completed:A,onMove:function(n,a){return nt(he,o,de,t,n,W(n),e,a)},changed:M},l))}function L(){O("dragOverAnimationCapture"),g.captureAnimationState(),g!==u&&u.captureAnimationState()}function A(t){return O("dragOverCompleted",{insertion:t}),t&&(p?c._hideClone():c._showClone(g),g!==u&&(q(de,ke?ke.options.ghostClass:c.options.ghostClass,!1),q(de,s.ghostClass,!0)),ke!==g&&g!==tt.active?ke=g:g===tt.active&&ke&&(ke=null),u===g&&(g._ignoreWhileAnimating=r),g.animateAll((function(){O("dragOverAnimationComplete"),g._ignoreWhileAnimating=null})),g!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(r===de&&!de.animated||r===o&&!r.animated)&&(Ae=null),s.dragoverBubble||e.rootEl||r===document||(de.parentNode[ie]._isOutsideThisEl(e.target),!t&&Qe(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),h=!0}function M(){we=$(de),xe=$(de,s.draggable),pe({sortable:g,name:"change",toEl:o,newIndex:we,newDraggableIndex:xe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){I(document,"mousemove",this._onTouchMove),I(document,"touchmove",this._onTouchMove),I(document,"pointermove",this._onTouchMove),I(document,"dragover",Qe),I(document,"mousemove",Qe),I(document,"touchmove",Qe)},_offUpEvents:function(){var e=this.el.ownerDocument;I(e,"mouseup",this._onDrop),I(e,"touchend",this._onDrop),I(e,"pointerup",this._onDrop),I(e,"touchcancel",this._onDrop),I(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;we=$(de),xe=$(de,n.draggable),ce("drop",this,{evt:e}),ue=de&&de.parentNode,we=$(de),xe=$(de,n.draggable),tt.eventCanceled||(Re=!1,Xe=!1,Fe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),st(this.cloneId),st(this._dragStartId),this.nativeDraggable&&(I(document,"drop",this),I(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),O&&z(document.body,"user-select",""),z(de,"transform",""),e&&(Le&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ge&&ge.parentNode&&ge.parentNode.removeChild(ge),(he===ue||ke&&"clone"!==ke.lastPutMode)&&ve&&ve.parentNode&&ve.parentNode.removeChild(ve),de&&(this.nativeDraggable&&I(de,"dragend",this),at(de),de.style["will-change"]="",Le&&!Re&&q(de,ke?ke.options.ghostClass:this.options.ghostClass,!1),q(de,this.options.chosenClass,!1),pe({sortable:this,name:"unchoose",toEl:ue,newIndex:null,newDraggableIndex:null,originalEvent:e}),he!==ue?(we>=0&&(pe({rootEl:ue,name:"add",toEl:ue,fromEl:he,originalEvent:e}),pe({sortable:this,name:"remove",toEl:ue,originalEvent:e}),pe({rootEl:ue,name:"sort",toEl:ue,fromEl:he,originalEvent:e}),pe({sortable:this,name:"sort",toEl:ue,originalEvent:e})),ke&&ke.save()):we!==_e&&we>=0&&(pe({sortable:this,name:"update",toEl:ue,originalEvent:e}),pe({sortable:this,name:"sort",toEl:ue,originalEvent:e})),tt.active&&(null!=we&&-1!==we||(we=_e,xe=ye),pe({sortable:this,name:"end",toEl:ue,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){ce("nulling",this),he=de=ue=ge=me=ve=fe=be=Se=De=Le=we=xe=_e=ye=Ae=Me=ke=Ee=tt.dragged=tt.ghost=tt.clone=tt.active=null,Be.forEach((function(e){e.checked=!0})),Be.length=Ce=Te=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":de&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,a=0,i=n.length,o=this.options;a<i;a++)j(e=n[a],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||ot(e));return t},sort:function(e,t){var n={},a=this.el;this.toArray().forEach((function(e,t){var i=a.children[t];j(i,this.options.draggable,a,!1)&&(n[e]=i)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(a.removeChild(n[e]),a.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return j(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var a=se.modifyOption(this,e,t);n[e]=void 0!==a?a:t,"group"===e&&$e(n)},destroy:function(){ce("destroy",this);var e=this.el;e[ie]=null,I(e,"mousedown",this._onTapStart),I(e,"touchstart",this._onTapStart),I(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(I(e,"dragover",this),I(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),je.splice(je.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!be){if(ce("hideClone",this),tt.eventCanceled)return;z(ve,"display","none"),this.options.removeCloneOnHide&&ve.parentNode&&ve.parentNode.removeChild(ve),be=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(be){if(ce("showClone",this),tt.eventCanceled)return;de.parentNode!=he||this.options.group.revertClone?me?he.insertBefore(ve,me):he.appendChild(ve):he.insertBefore(ve,de),this.options.group.revertClone&&this.animate(de,ve),z(ve,"display",""),be=!1}}else this._hideClone()}},Ue&&N(document,"touchmove",(function(e){(tt.active||Re)&&e.cancelable&&e.preventDefault()})),tt.utils={on:N,off:I,css:z,find:U,is:function(e,t){return!!j(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:ee,closest:j,toggleClass:q,clone:ne,index:$,nextTick:rt,cancelNextTick:st,detectDirection:Je,getChild:V},tt.get=function(e){return e[ie]},tt.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(tt.utils=x(x({},tt.utils),e.utils)),se.mount(e)}))},tt.create=function(e,t){return new tt(e,t)},tt.version="1.15.2";var lt,ct,pt,dt,ut,gt,ht=[],mt=!1;function ft(){ht.forEach((function(e){clearInterval(e.pid)})),ht=[]}function vt(){clearInterval(gt)}var bt=ee((function(e,t,n,a){if(t.scroll){var i,o=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=H(),p=!1;ct!==n&&(ct=n,ft(),lt=t.scroll,i=t.scrollFn,!0===lt&&(lt=Z(n,!0)));var d=0,u=lt;do{var g=u,h=W(g),m=h.top,f=h.bottom,v=h.left,b=h.right,_=h.width,w=h.height,y=void 0,x=void 0,E=g.scrollWidth,k=g.scrollHeight,S=z(g),D=g.scrollLeft,C=g.scrollTop;g===c?(y=_<E&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),x=w<k&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(y=_<E&&("auto"===S.overflowX||"scroll"===S.overflowX),x=w<k&&("auto"===S.overflowY||"scroll"===S.overflowY));var T=y&&(Math.abs(b-o)<=s&&D+_<E)-(Math.abs(v-o)<=s&&!!D),P=x&&(Math.abs(f-r)<=s&&C+w<k)-(Math.abs(m-r)<=s&&!!C);if(!ht[d])for(var O=0;O<=d;O++)ht[O]||(ht[O]={});ht[d].vx==T&&ht[d].vy==P&&ht[d].el===g||(ht[d].el=g,ht[d].vx=T,ht[d].vy=P,clearInterval(ht[d].pid),0==T&&0==P||(p=!0,ht[d].pid=setInterval(function(){a&&0===this.layer&&tt.active._onTouchMove(ut);var t=ht[this.layer].vy?ht[this.layer].vy*l:0,n=ht[this.layer].vx?ht[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(tt.dragged.parentNode[ie],n,t,e,ut,ht[this.layer].el)||te(ht[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&u!==c&&(u=Z(u,!1)));mt=p}}),30),_t=function(e){var t=e.originalEvent,n=e.putSortable,a=e.dragEl,i=e.activeSortable,o=e.dispatchSortableEvent,r=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||i;r();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,p=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(p)&&(o("spill"),this.onSpill({dragEl:a,putSortable:n}))}};function wt(){}function yt(){}wt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var a=V(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:_t},S(wt,{pluginName:"revertOnSpill"}),yt.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:_t},S(yt,{pluginName:"removeOnSpill"}),tt.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?N(document,"dragover",this._handleAutoScroll):this.options.supportPointer?N(document,"pointermove",this._handleFallbackAutoScroll):t.touches?N(document,"touchmove",this._handleFallbackAutoScroll):N(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?I(document,"dragover",this._handleAutoScroll):(I(document,"pointermove",this._handleFallbackAutoScroll),I(document,"touchmove",this._handleFallbackAutoScroll),I(document,"mousemove",this._handleFallbackAutoScroll)),vt(),ft(),clearTimeout(F),F=void 0},nulling:function(){ut=ct=lt=mt=gt=pt=dt=null,ht.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,a=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(a,i);if(ut=e,t||this.options.forceAutoScrollFallback||T||C||O){bt(e,this.options,o,t);var r=Z(o,!0);!mt||gt&&a===pt&&i===dt||(gt&&vt(),gt=setInterval((function(){var o=Z(document.elementFromPoint(a,i),!0);o!==r&&(r=o,ft()),bt(e,n.options,o,t)}),10),pt=a,dt=i)}else{if(!this.options.bubbleScroll||Z(o,!0)===H())return void ft();bt(e,this.options,Z(o,!1),!1)}}},S(e,{pluginName:"scroll",initializeByDefault:!0})}),tt.mount(yt,wt);const xt=tt;let Et=null,kt=null,St=null;function Dt(e){const t=kt.parentNode.querySelector(".sharing-image-editor-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown generation error","sharing-image"))}function Ct(){kt.classList.add("preview-loader");const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="blob";const t=new window.FormData(St);t.set("action","sharing_image_show_preview"),function(){const e=kt.parentNode.querySelector(".sharing-image-editor-warning");null!==e&&e.classList.remove("warning-visible")}(),e.addEventListener("readystatechange",(()=>{2===e.readyState&&(e.responseType="json",200===e.status&&(e.responseType="blob"))})),e.addEventListener("load",(()=>{const t=e.response||{};if(kt.classList.remove("preview-blank","preview-loader"),200!==e.status)return Dt(t.data);let n=kt.querySelector("img");null===n&&(n=p.element("img",{append:kt})),n.src=window.URL.createObjectURL(t)})),e.addEventListener("error",(()=>{Dt(),kt.classList.remove("preview-blank","preview-loader")})),e.send(t)}function Tt(e,n,a){const i=[],o=p.control({classes:["sharing-image-editor-control","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[x]",value:a.x,placeholder:"0"},dataset:{dimension:"x"},label:wp.i18n.__("X","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[y]",value:a.y,placeholder:"0"},dataset:{dimension:"y"},label:wp.i18n.__("Y","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[width]",value:a.width},dataset:{dimension:"width"},label:wp.i18n.__("Width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[height]",value:a.height},dataset:{dimension:"height"},label:wp.i18n.__("Height","sharing-image")}],append:e});!function(e,n,a){const i=p.control({classes:["sharing-image-editor-control","control-pulled"],append:e});p.element("button",{classes:["sharing-image-editor-more"],text:wp.i18n.__("Utilize image as the poster background.","sharing-image"),attributes:{type:"button"},append:i}).addEventListener("click",(()=>{const e={};return n.querySelectorAll("input").forEach((t=>{e[t.dataset.dimension]=t})),e.x.value=0,e.y.value=0,e.width.value=t.dataget(St,"editor","width"),e.height.value=t.dataget(St,"editor","height"),s(),void Ct()}))}(e,o),Ot(e,n,a),i[i.length]=p.control({classes:["sharing-image-editor-control"],label:wp.i18n.__("Image resizing principle","sharing-image"),fields:[{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"center"},label:wp.i18n.__("Center image while preserving the aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"top"},label:wp.i18n.__("Top-aligned image while preserving the aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"bottom"},label:wp.i18n.__("Bottom-aligned image while preserving aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"ignore"},label:wp.i18n.__("Resize while ignoring the aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"crop"},label:wp.i18n.__("Center-crop the image","sharing-image"),checked:a.resize||"center"}],append:e});const r=[];o.querySelectorAll("input").forEach((e=>{["width","height"].includes(e.dataset.dimension)&&r.push(e)}));const s=()=>{let e=!1;r.forEach((t=>{t.value.length<1&&(e=!0)})),i.forEach((t=>{t.classList.toggle("control-disabled",e)}))};s(),r.forEach((e=>{e.addEventListener("input",s)}))}function Pt(e,t){const n=e.querySelector("h2 > span");if(null===n)return;const a={},i=": ";e.querySelectorAll("[data-caption]").forEach((e=>{a[e.dataset.caption]=e,e.addEventListener("keyup",(()=>{n.textContent=e.value?i+e.value:""}))})),n.textContent=i+a.content.value,t.checked&&(n.textContent=i+a.title.value),n.textContent===i&&(n.textContent="")}function Ot(e,t,n){p.control({classes:["sharing-image-editor-control","control-extend","control-pulled","control-upnext"],label:wp.i18n.__("Relative boundaries","sharing-image"),fields:[{group:"select",classes:["sharing-image-editor-control-select"],options:{absolute:wp.i18n.__("No Relative Positioning","sharing-image"),vertically:wp.i18n.__("Vertical Only","sharing-image"),horizontally:wp.i18n.__("Horizontal Only","sharing-image"),both:wp.i18n.__("Both Directions Alignment","sharing-image")},attributes:{name:t+"[boundary]"},selected:n.boundary}],help:wp.i18n.__("Using offset from previous layer.","sharing-image"),append:e})}function Lt(e,t){const n=[];n.push(wp.i18n.__("Write text on the current image.","sharing-image")),n.push(wp.i18n.__("If the font does not fit within your limits, its size will decrease.","sharing-image")),n.push(wp.i18n.__("Avoid using large font sizes for long text as it affects performance.","sharing-image")),n.push(wp.i18n.__("You can use negative values for position and dimensions.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-text"],label:wp.i18n.__("Text","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"text"},append:a}),p.control({classes:["sharing-image-editor-control","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[x]",value:e.x,placeholder:"10"},label:wp.i18n.__("X","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[y]",value:e.y,placeholder:"10"},label:wp.i18n.__("Y","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[width]",value:e.width,placeholder:"1000"},label:wp.i18n.__("Width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[height]",value:e.height},label:wp.i18n.__("Height","sharing-image")}],append:a}),Ot(a,t,e),function(e,t,n){const a=p.control({classes:["sharing-image-editor-control"],append:e}),i=p.checkbox({classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[dynamic]",value:"dynamic"},label:wp.i18n.__("Dynamic field. Filled in on the post editing screen.","sharing-image"),checked:n.dynamic},a),o=[];o[o.length]=p.control({classes:["sharing-image-editor-control","control-extend","control-hidden"],help:wp.i18n.__("Only visible on the admin side.","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:t+"[title]",value:n.title},dataset:{caption:"title"},label:wp.i18n.__("Field name","sharing-image")}],append:e}),o[o.length]=p.control({classes:["sharing-image-editor-control","control-extend","control-hidden"],help:wp.i18n.__("This field is for demonstration only, to preview the editor’s appearance.","sharing-image"),fields:[{group:"textarea",classes:["sharing-image-editor-control-textarea"],content:n.sample||"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",attributes:{name:t+"[sample]",rows:2},label:wp.i18n.__("Text sample","sharing-image")}],append:e});const r=p.control({classes:["sharing-image-editor-control","control-hidden"],label:wp.i18n.__("Preset text field","sharing-image"),fields:[{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"none"},dataset:{persistent:!0},label:wp.i18n.__("Fill in manually","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"title"},dataset:{persistent:!0},label:wp.i18n.__("Take from post title","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"excerpt"},dataset:{persistent:!0},label:wp.i18n.__("Use post excerpt text","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"categories"},dataset:{persistent:!0},label:wp.i18n.__("Use post categories","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"tags"},dataset:{persistent:!0},label:wp.i18n.__("Use post tags","sharing-image"),checked:n.preset||"none"}],append:e});o[o.length]=r,o[o.length]=p.control({classes:["sharing-image-editor-control","control-extend"],help:wp.i18n.__("You can use non-breaking spaces to adjust your string position.","sharing-image"),fields:[{group:"textarea",classes:["sharing-image-editor-control-textarea"],content:n.content,attributes:{name:t+"[content]",rows:2},dataset:{caption:"content"},label:wp.i18n.__("Content","sharing-image")}],append:e});const s=()=>{o.forEach((e=>{e.classList.toggle("control-hidden")}))};i.checked&&s(),i.addEventListener("change",(()=>{s(),Pt(e,i)})),Pt(e,i)}(a,t,e),function(e,t,n){const a=[];a[a.length]=function(e,t,n){const a=p.control({classes:["sharing-image-editor-control","control-upload","control-hidden"],append:e}),i=p.select({classes:["sharing-image-editor-control-select"],options:Et.fonts,attributes:{name:t+"[fontname]"},label:wp.i18n.__("Font family","sharing-image"),selected:n.fontname},a),o=p.media({name:t+"[fontfile]",classes:["sharing-image-editor-control-media"],value:n.fontfile,link:Et.links.uploads,labels:{button:wp.i18n.__("Upload custom font","sharing-image"),heading:wp.i18n.__("Upload custom font","sharing-image"),details:wp.i18n.__("Font attachment","sharing-image"),remove:wp.i18n.__("Remove font","sharing-image")},remove:!0,mime:["font/ttf","font/otf"],append:a});p.element("small",{text:wp.i18n.__("Custom fonts can only be in .ttf or .otf format.","sharing-image"),append:a}),n.fontfile&&(i.disabled=!0);const r=o.querySelector("input");return r.addEventListener("change",(()=>{i.disabled=!1,r.value&&(i.disabled=!0)})),a}(e,t,n),a[a.length]=p.control({classes:["sharing-image-editor-control","control-hidden"],fields:[{group:"input",classes:["sharing-image-editor-control-color"],attributes:{type:"color",name:t+"[color]",value:n.color||"#ffffff"},label:wp.i18n.__("Text color","sharing-image")}],append:e}),a[a.length]=p.control({classes:["sharing-image-editor-control","control-series","control-hidden"],fields:[{group:"select",classes:["sharing-image-editor-control-select"],options:{left:wp.i18n.__("Left","sharing-image"),center:wp.i18n.__("Center","sharing-image"),right:wp.i18n.__("Right","sharing-image")},attributes:{name:t+"[horizontal]"},label:wp.i18n.__("Horizontal alignment","sharing-image"),selected:n.horizontal},{group:"select",classes:["sharing-image-editor-control-select"],options:{top:wp.i18n.__("Top","sharing-image"),center:wp.i18n.__("Center","sharing-image"),bottom:wp.i18n.__("Bottom","sharing-image")},attributes:{name:t+"[vertical]"},label:wp.i18n.__("Vertical alignment","sharing-image"),selected:n.vertical}],append:e});const i=p.control({classes:["sharing-image-editor-control"],append:e}),o=p.element("button",{classes:["sharing-image-editor-more"],text:wp.i18n.__("More options","sharing-image"),attributes:{type:"button"},append:i});o.addEventListener("click",(()=>{a.forEach((e=>{e.classList.remove("control-hidden")})),e.removeChild(i)})),Object.keys(n).length>0&&o.click()}(a,t,e),p.control({classes:["sharing-image-editor-control","control-series"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[fontsize]",min:10,max:200,step:1,value:e.fontsize||"48"},label:wp.i18n.__("Font size","sharing-image")},{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[lineheight]",min:0,max:4,step:.125,value:e.lineheight||"1.5"},label:wp.i18n.__("Line height","sharing-image")}],append:a}),p.element("input",{attributes:{type:"hidden",name:t+"[separator]",value:", "},append:a}),a}function At(e,n,a={}){let i=null;const o=a.uniqid||t.uniqid(),r=Et.name+`[layers][${o}]`;switch(n){case"text":i=Lt(a,r);break;case"image":i=function(e,t){const n=[];n.push(wp.i18n.__("Use JPG, GIF, or PNG image formats.","sharing-image")),n.push(wp.i18n.__("Leave the width and height fields blank to use the original image size.","sharing-image")),n.push(wp.i18n.__("Sizes are calculated proportionally if not specified.","sharing-image")),n.push(wp.i18n.__("You can use negative values for position and dimensions.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-image"],label:wp.i18n.__("Image","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"image"},append:a}),p.control({classes:["sharing-image-editor-control","control-extend"],help:wp.i18n.__("Only visible on the admin side.","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:t+"[title]",value:e.title},dataset:{caption:"title"},label:wp.i18n.__("Field name","sharing-image")}],append:a}),function(e,t,n){const a=p.control({classes:["sharing-image-editor-control","control-gapped"],append:e}),i=p.checkbox({classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[dynamic]",value:"dynamic"},label:wp.i18n.__("Dynamic image. Can be updated on the post editing screen.","sharing-image"),checked:n.dynamic},a);p.media({name:t+"[attachment]",classes:["sharing-image-editor-control-media"],value:n.attachment,link:Et.links.uploads,labels:{button:wp.i18n.__("Select an image","sharing-image"),heading:wp.i18n.__("Select layer image","sharing-image"),details:wp.i18n.__("Attachment details","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},append:a,image:!0,remove:!0,help:wp.i18n.__("This field is for demonstration only, to preview the editor’s appearance.","sharing-image"),mime:["image/png","image/jpeg","image/gif","image/webp"]});const o=[],r=p.control({classes:["sharing-image-editor-control"],label:wp.i18n.__("Preset image field","sharing-image"),fields:[{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"none"},dataset:{persistent:!0},label:wp.i18n.__("Manual selection","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"featured"},dataset:{persistent:!0},label:wp.i18n.__("Use Post Featured Image","sharing-image"),checked:n.preset||"featured"}],append:e});o[o.length]=r;const s=()=>{o.forEach((e=>{e.classList.toggle("control-hidden")})),a.classList.add("control-unhelp"),i.checked&&a.classList.remove("control-unhelp")};i.checked||s(),i.addEventListener("change",(()=>{s()}))}(a,t,e),Tt(a,t,e),a}(a,r);break;case"filter":i=function(e,t){const n=[];n.push(wp.i18n.__("Filters are applied sequentially to the entire editor image.","sharing-image")),n.push(wp.i18n.__("If you want to control their order, create multiple layers.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-text"],label:wp.i18n.__("Filter","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"filter"},append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"checkbox",classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[grayscale]",value:"grayscale"},label:wp.i18n.__("Converts the image into a grayscale version","sharing-image"),checked:e.grayscale}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"checkbox",classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[blur]",value:"blur"},label:wp.i18n.__("Blur image by Gaussian effect","sharing-image"),checked:e.blur}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[contrast]",min:-50,max:50,step:5,value:e.contrast||"0"},label:wp.i18n.__("Contrast","sharing-image")}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[brightness]",min:-50,max:50,step:5,value:e.brightness||"0"},label:wp.i18n.__("Brightness","sharing-image")}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[blackout]",min:0,max:100,step:5,value:e.blackout||"0"},label:wp.i18n.__("Blackout","sharing-image")}],append:a}),a}(a,r);break;case"rectangle":i=function(e,t){const n=[];n.push(wp.i18n.__("Draw a colored rectangle on the current image.","sharing-image")),n.push(wp.i18n.__("You can get a filled or outlined figure with custom color and opacity.","sharing-image")),n.push(wp.i18n.__("Use a small height to draw the line.","sharing-image")),n.push(wp.i18n.__("You can use negative values for position and dimensions.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-text"],label:wp.i18n.__("Rectangle","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"rectangle"},append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-color"],attributes:{type:"color",name:t+"[color]",value:e.color||"#ffffff"},label:wp.i18n.__("Rectangle color","sharing-image")}],append:a}),p.control({classes:["sharing-image-editor-control","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[x]"||0,value:e.x},label:wp.i18n.__("X","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[y]"||0,value:e.y},label:wp.i18n.__("Y","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[width]",value:e.width},label:wp.i18n.__("Width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[height]",value:e.height},label:wp.i18n.__("Height","sharing-image")}],append:a}),Ot(a,t,e),function(e,t,n){const a=p.control({classes:["sharing-image-editor-control"],append:e}),i=p.checkbox({classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[outline]",value:"outline"},label:wp.i18n.__("Outline rectangle.","sharing-image"),checked:n.outline},a),o=p.control({classes:["sharing-image-editor-control","control-hidden"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[thickness]",min:0,max:50,step:1,value:n.thickness||"0"},label:wp.i18n.__("Border width","sharing-image")}],append:e});n.outline&&o.classList.remove("control-hidden"),i.addEventListener("change",(()=>{o.classList.add("control-hidden"),i.checked&&o.classList.remove("control-hidden")}))}(a,t,e),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[opacity]",min:0,max:100,step:5,value:e.opacity||"0"},label:wp.i18n.__("Opacity","sharing-image")}],append:a}),a}(a,r);break;default:return null}return e.appendChild(i),function(e,t){const n=p.control({classes:["sharing-image-editor-control","control-footer"],append:t});p.element("button",{classes:["sharing-image-editor-delete"],text:wp.i18n.__("Delete layer","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{e.removeChild(t),St.classList.contains("editor-suspend")||Ct()}))}(e,i),function(e,t,n){const a=e.querySelector("h2"),i=p.element("button",{classes:["sharing-image-editor-collapse"],attributes:{type:"button",title:wp.i18n.__("Collapse layer","sharing-image")},prepend:a});let o=1===t.collapsed;o&&e.classList.add("layer-collapsed");const r=p.element("input",{attributes:{type:"hidden",name:n+"[collapsed]",value:Number(o)},append:e});i.addEventListener("click",(t=>{t.preventDefault(),o=!o,e.classList.toggle("layer-collapsed",o),i.setAttribute("title",wp.i18n.__("Collapse layer","sharing-image")),o&&i.setAttribute("title",wp.i18n.__("Expand layer","sharing-image")),r.value=Number(o)}))}(i,a,r),function(e,t){p.element("button",{classes:["sharing-image-editor-order"],attributes:{type:"button",title:wp.i18n.__("Change layer position","sharing-image")},append:t}),xt.create(e,{handle:".sharing-image-editor-order",onUpdate:()=>{St.classList.contains("editor-suspend")||Ct()}})}(e,i),i}const Mt=function(e,t,n,a={}){Et=t,St=function(e,t){Et.name="sharing_image_editor";const n=p.element("form",{classes:["sharing-image-editor"],attributes:{action:Et.links.action,method:"POST"},append:e});return Et.config.suspend&&n.classList.add("editor-suspend"),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_save_editor"},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_index",value:t},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:Et.nonce},append:n}),n.addEventListener("submit",(e=>{e.preventDefault(),function(){const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="json",kt.classList.add("preview-loader");const t=new window.FormData(St);t.set("action","sharing_image_save_preview"),e.addEventListener("load",(()=>{const t=e.response||{};if(!t.data)return Dt();if(!t.success)return kt.classList.remove("preview-loader"),Dt(t.data);const n=kt.querySelector("input");null!==n&&(n.value=t.data),St.submit()})),e.addEventListener("error",(()=>{kt.classList.remove("preview-loader"),Dt()})),e.send(t)}()})),n}(e,n),function(e){const t=p.element("div",{classes:["sharing-image-editor-monitor"],append:St}),n=p.element("div",{classes:["sharing-image-editor-viewport"],append:t});!function(e,t){kt=p.element("div",{classes:["sharing-image-editor-preview","preview-blank"],append:e}),t.preview&&(p.element("img",{attributes:{src:t.preview,alt:""},append:kt}),kt.classList.remove("preview-blank")),p.element("span",{classes:["sharing-image-editor-loader"],append:kt}),p.element("input",{attributes:{type:"hidden",name:Et.name+"[preview]",value:t.preview},append:kt})}(n,e),p.element("div",{classes:["sharing-image-editor-warning"],append:n});const a=p.element("div",{classes:["sharing-image-editor-manager"],append:n});!function(e,t){p.checkbox({classes:["sharing-image-editor-debug"],attributes:{name:Et.name+"[debug]",value:"debug"},label:wp.i18n.__("Show debug frames","sharing-image"),checked:t.debug},e).addEventListener("change",(()=>{Ct()}))}(a,e),function(e){p.element("button",{text:wp.i18n.__("Save changes","sharing-image"),classes:["button","button-primary"],attributes:{type:"submit"},append:e})}(a),function(e){p.element("button",{text:wp.i18n.__("Generate preview","sharing-image"),classes:["button"],attributes:{type:"button"},append:e}).addEventListener("click",(()=>{Ct()}))}(a)}(a),function(e){const t=p.element("div",{classes:["sharing-image-editor-fieldset"],append:St});p.control({classes:["sharing-image-editor-control","control-compact","control-extend"],help:wp.i18n.__("Used only in the admin panel","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:Et.name+"[title]",value:e.title},dataset:{persistent:!0,editor:"title"},label:wp.i18n.__("Template title","sharing-image")}],append:t}),p.control({classes:["sharing-image-editor-control"],label:wp.i18n.__("Fill color","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-color"],attributes:{name:Et.name+"[fill]",type:"color",value:e.fill},dataset:{editor:"fill"}}],append:t}),p.control({classes:["sharing-image-editor-control","control-compact","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:Et.name+"[width]",value:e.width||"1200",placeholder:"1200",maxlength:4},dataset:{editor:"width"},label:wp.i18n.__("Editor width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:Et.name+"[height]",value:e.height||"630",placeholder:"630",maxlength:4},dataset:{editor:"height"},label:wp.i18n.__("Editor height","sharing-image")}],append:t});const n=[];n.push(wp.i18n.__("You can add multiple layers on your editor.","sharing-image")),n.push(wp.i18n.__("Note that the stacking order of the layers is important.","sharing-image")),n.push(wp.i18n.__("You can change the order using the icon in the corner of each box.","sharing-image")),p.control({classes:["sharing-image-editor-control","control-reduced"],label:wp.i18n.__("Add layers","sharing-image"),description:n.join(" "),append:t}),function(e,t){const n=p.control({classes:["sharing-image-editor-control","control-select","control-compact"],fields:[{group:"select",classes:["sharing-image-editor-control-select"],options:{text:wp.i18n.__("Text","sharing-image"),image:wp.i18n.__("Image","sharing-image"),filter:wp.i18n.__("Filter","sharing-image"),rectangle:wp.i18n.__("Rectangle","sharing-image")}}],append:e});p.element("button",{classes:["button"],text:wp.i18n.__("Add new","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{const e=n.querySelector("select");null!==e&&At(a,e.value).scrollIntoView({behavior:"smooth"})}));const a=p.element("div",{classes:["sharing-image-editor-designer"],append:e});t.layers=t.layers||{};for(const e in t.layers){const n=t.layers[e];if(n.uniqid=e,n.hasOwnProperty("type")&&!At(a,n.type,n))return}}(t,e);const a=p.control({classes:["sharing-image-editor-control","control-footer"],append:t});!function(e){const t=new URL(document.location.href);t.searchParams.delete("template"),p.element("a",{classes:["button"],text:wp.i18n.__("← Back to Catalog","sharing-image"),attributes:{href:t.href},append:e})}(a),function(e){const t=new URL(document.location.href).searchParams.get("template"),n=new URL(Et.links.action);n.searchParams.set("action","sharing_image_delete_template"),n.searchParams.set("template",t),n.searchParams.set("nonce",Et.nonce),p.element("a",{classes:["sharing-image-editor-delete"],text:wp.i18n.__("Delete template","sharing-image"),attributes:{href:n.href},append:e}).addEventListener("click",(e=>{const t=wp.i18n.__("Are you sure you want to delete this template?","sharing-image");confirm(t)||e.preventDefault()}))}(a),t.addEventListener("change",(e=>{if(St.classList.contains("editor-suspend"))return;const t=e.target;t.hasAttribute("data-persistent")||t.hasAttribute("name")&&Ct()}))}(a)};let Nt=null;!function(){if(void 0===wp)return;let e=window.sharingImageSettings||{};e=t.defaults(e,["links","fonts","config","templates","license"]);const n=document.querySelector("#sharing-image-settings .sharing-image-content");if(null!==n)switch(n.classList.add("content-visible"),t.param("tab")){case"config":!function(e,t){!function(e,t){Nt=t,Nt.name="sharing_image_config";const n=e.querySelector(".sharing-image-config");if(null===n)return;const a=p.element("form",{classes:["sharing-image-config-options"],attributes:{action:Nt.links.action,method:"POST"},append:n}),i=Nt.config||{},o=Nt.templates||[];!function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Poster image format","sharing-image"),help:wp.i18n.__("The higher the value, the less compression. Availible for JPEG only.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{jpg:wp.i18n.__("JPEG","sharing-image"),png:wp.i18n.__("PNG","sharing-image"),gif:wp.i18n.__("GIF","sharing-image")},attributes:{name:Nt.name+"[format]"},selected:t.format||"jpg"},{group:"input",classes:["sharing-image-config-control-range"],attributes:{type:"range",name:Nt.name+"[quality]",min:10,max:100,step:5,value:t.quality||"90",disabled:"disabled"},label:wp.i18n.__("Image quality","sharing-image")}],append:e}),a=n.querySelector("select"),i=n.querySelector("input");"jpg"===a.value&&(i.disabled=!1),a.addEventListener("change",(()=>{i.disabled=!0,"jpg"===a.value&&(i.disabled=!1)}))}(a,i),function(e,t,n){const a={};a[""]=wp.i18n.__("Disable auto generation","sharing-image");for(const e in n)a[e]=n[e].title||wp.i18n.__("Untitled","sharing-image");let i=t.autogenerate;void 0===i&&(i=""),p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Auto generate poster","sharing-image"),help:wp.i18n.__("This template will be applied automatically when the post is saved.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:a,attributes:{name:Nt.name+"[autogenerate]"},selected:String(i)}],append:e})}(a,i,o),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Hide post widget","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[nowidget]",value:"nowidget"},label:wp.i18n.__("Hide the widget on the post editor page","sharing-image"),checked:t.nowidget}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Header Meta Tags","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{snippets:wp.i18n.__("Display Meta Tags with consideration for SEO plugins","sharing-image"),custom:wp.i18n.__("Always display Meta Tags on all pages","sharing-image"),hidden:wp.i18n.__("Hide Sharing Image Meta Tags","sharing-image")},attributes:{name:Nt.name+"[meta]"},selected:t.meta||"snippets"}],append:e});if(0===Nt.snippets.length)return n;p.element("h4",{text:wp.i18n.__("Detected SEO plugins","sharing-image"),append:n});const a=p.element("ul",{classes:["sharing-image-config-control-list"],append:n});Nt.snippets.forEach((e=>{const t=p.element("li",{append:a});p.element("a",{attributes:{href:e.link,target:"_blank",rel:"noopener"},text:e.title,append:t})}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Poster attachment","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[attachment]",value:"attachment"},label:wp.i18n.__("Save the generated poster as an attachment in the media library","sharing-image"),checked:t.attachment}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Upload directory","sharing-image"),append:e}),a=p.element("div",{classes:["sharing-image-config-control-fieldset"],append:n});p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"default"},label:wp.i18n.__("Use default uploads directory","sharing-image"),checked:t.uploads||"default"},a),p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"custom"},label:wp.i18n.__("Select custom storage for posters","sharing-image"),checked:t.uploads||"default"},a);const i=p.input({classes:["sharing-image-config-control-input"],attributes:{name:Nt.name+"[storage]",value:t.storage||Nt.links.storage,disabled:"disabled"}},n);p.element("small",{text:wp.i18n.__("Use a relative path from the site root. The directory should be writable.","sharing-image"),append:n}),n.querySelectorAll("input").forEach((e=>{"radio"===e.type&&(e.checked&&"custom"===e.value&&(i.disabled=!1),e.addEventListener("change",(()=>{i.disabled=!0,"custom"===e.value&&(i.disabled=!1)})))}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Live-reload","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[suspend]",value:"suspend"},label:wp.i18n.__("Disable live reload on the template editor screen.","sharing-image"),checked:t.suspend}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Default poster","sharing-image"),append:e});p.media({name:Nt.name+"[default]",classes:["sharing-image-config-control-media"],value:t.default,link:Nt.links.uploads,labels:{button:wp.i18n.__("Upload image","sharing-image"),heading:wp.i18n.__("Select default poster","sharing-image"),details:wp.i18n.__("Attachment details","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},image:!0,remove:!0,append:n});const a=[];a.push(wp.i18n.__("The default poster is used on pages where none is generated.","sharing-image")),a.push(wp.i18n.__("Best image size: 1200×630 pixels.","sharing-image")),p.element("small",{text:a.join(" "),append:n})}(a,i),function(e,t){p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_save_config"},append:e}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:Nt.nonce},append:e}),p.element("input",{attributes:{type:"hidden",name:Nt.name+"[demo]",value:t.demo||""},append:e}),p.element("button",{text:wp.i18n.__("Save changes","sharing-image"),classes:["button","button-primary"],attributes:{type:"submit"},append:e})}(a,i)}(e,t)}(n,e);break;case"tools":!function(e,t){!function(e,t){d=t;const n=e.querySelector(".sharing-image-tools");null!==n&&(function(e){const t=d.templates||[],n=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Clone template","sharing-image"),append:e}),a=p.element("p",{classes:["sharing-image-tools-warning"],text:wp.i18n.__("To initiate cloning, enable Premium and have at least one template.","sharing-image")}),i=d.license||{};if(0===t.length||!i.premium&&!i.develop)return n.appendChild(a);const o={};for(const e in t)o[e]=t[e].title||wp.i18n.__("Untitled","sharing-image");const r=p.element("form",{classes:["sharing-image-tools-control-cloning"],attributes:{action:d.links.action,method:"POST"},append:n}),s=p.select({classes:["sharing-image-tools-control-duplicator"],options:o,attributes:{name:"sharing_image_source"}},r);p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Create a copy","sharing-image"),append:s.parentNode}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_clone_template"},append:r}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:r})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Export templates","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_export_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["button","button-primary"],text:wp.i18n.__("Download backup file","sharing-image"),attributes:{href:a.href},append:n}),p.element("small",{text:wp.i18n.__("Save a local copy of all template settings for later use.","sharing-image"),append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Import templates","sharing-image"),append:e}),n=p.element("form",{classes:["sharing-image-tools-control-uploader"],attributes:{action:d.links.action,method:"POST",enctype:"multipart/form-data"},append:t});p.element("input",{classes:["sharing-image-tools-control-file"],attributes:{type:"file",name:"sharing_image_file",accept:"application/json",required:"required"},append:n}),p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Import templates","sharing-image"),append:n}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_import_templates"},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Clearing settings","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_clear_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["sharing-image-tools-delete","button"],text:wp.i18n.__("Remove posters","sharing-image"),attributes:{href:a.href},append:n}).addEventListener("click",(e=>{const t=wp.i18n.__("Are you sure you want to clear plugin data?","sharing-image");confirm(t)||e.preventDefault()})),p.element("small",{text:wp.i18n.__("This action clears post meta options but does not delete server images.","sharing-image"),append:n})}(n))}(e,t)}(n,e);break;case"premium":!function(e,t){!function(e,t){h=t,m=e.querySelector(".sharing-image-premium"),null!==m&&(p.element("div",{classes:["sharing-image-premium-warning"],append:m}),w())}(e,t)}(n,e);break;default:!function(e,n){let a=null;n.templates=n.templates||[],t.param("template")&&(a=t.param("template"));const i=n.templates[a];void 0!==i?Mt(e,n,a,i):null===a?function(e,t){u=t;const n=p.element("div",{classes:["sharing-image-catalog"],append:e});for(const e in t.templates)g(n,t.templates[e],e);!function(e,t){const n=new URL(document.location.href);n.searchParams.set("template",t);const a=p.element("a",{classes:["sharing-image-catalog-new"],attributes:{href:n.href},append:e}),i=p.element("h2",{append:a});if(p.element("strong",{text:wp.i18n.__("Add new template","sharing-image"),append:i}),0===u.templates.length)return;const o=u.license||{};o.premium||o.develop||(p.element("span",{text:wp.i18n.__("(Availible for Premium only)","sharing-image"),append:i}),u.links.premium&&(a.href=u.links.premium))}(n,t.index)}(e,n):Mt(e,n,a)}(n,e)}}()})();
     1(()=>{"use strict";let e=e=>crypto.getRandomValues(new Uint8Array(e));const t={param:function(e){return new URL(document.location.href).searchParams.get(e)},attachment:function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()},defaults:function(e,t){return t.forEach((t=>{void 0===e[t]&&(e[t]={})})),e},uniqid:function(){return((t,n=21)=>((e,t,n)=>{let a=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*a*t/e.length);return(o=t)=>{let r="";for(;;){let t=n(i),s=i;for(;s--;)if(r+=e[t[s]&a]||"",r.length===o)return r}}})(t,n,e))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",12)()},dataget:function(e,t,n){const a=e.querySelector(`[data-${t}="${n}"]`);if(a)return a.value}},n=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},a=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("input",{attributes:{type:"text"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if("range"===i.type){const e=p.element("em",{text:i.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});i.addEventListener("change",(()=>{e.textContent=i.value})),i.addEventListener("input",(()=>{e.textContent=i.value})),e.addEventListener("click",(()=>{i.type="text"===i.type?"range":"text"}))}return i},i=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"checkbox"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return i},o=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"radio"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return e.hasOwnProperty("help")&&n("small",{text:e.help,append:a}),i},r=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("select",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}const o=e.options||{};for(const t in o){const a=n("option",{text:o[t],attributes:{value:t},append:i});if(e.hasOwnProperty("selected")){const t=e.selected;t&&t===a.value&&a.setAttribute("selected","selected")}}return i},s=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("textarea",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("content")){const t=e.content;void 0!==t&&(i.innerHTML=t)}return i},l=function(e){const t=n("div",{classes:e.classes||[]});return e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")&&n("h3",{text:e.label,append:t}),e.hasOwnProperty("description")&&n("p",{text:e.description,append:t}),e.hasOwnProperty("fields")&&e.fields.forEach((e=>{switch(e.group){case"input":a(e,t);break;case"textarea":s(e,t);break;case"radio":o(e,t);break;case"select":r(e,t);break;case"checkbox":i(e,t)}})),e.hasOwnProperty("help")&&n("small",{text:e.help,append:t}),t};function c(e,t){let a=e.querySelector("figure");if(a&&e.removeChild(a),!wp.media)return;if(a=n("figure",{prepend:e}),e.querySelector("h4")&&e.insertBefore(a,e.querySelector("h4").nextSibling),!t)return;let i=a.querySelector("img");i&&a.removeChild(i),i=n("img",{append:a}),wp.media.attachment(t).fetch().then((e=>{i.src=e.sizes?.thumbnail?.url||e.url}))}const p={element:n,control:l,layer:function(e){const t=n("div",{classes:e.classes||[]});e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")||(e.label="");const a=n("h2",{text:e.label,append:t});return n("span",{append:a}),e.hasOwnProperty("description")&&n("h5",{text:e.description,append:t}),t},checkbox:i,media:function(e){const a=l({classes:e.classes||[]});if(e.hasOwnProperty("append")&&e.append.appendChild(a),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(a,e.prepend.firstChild),e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}e.labels=e.labels||{};const i=n("input",{attributes:{type:"hidden",name:e.name},append:a}),o=n("button",{classes:["button"],text:e.labels.button,attributes:{type:"button"},append:a}),r=n("a",{classes:["hidden"],text:e.labels.details,attributes:{target:"_blank"}});e.hasOwnProperty("link")&&a.appendChild(r),e.hasOwnProperty("help")&&n("small",{text:e.help,append:a});const s=t=>{i.setAttribute("value",t),i.dispatchEvent(new Event("change",{bubbles:!0}));let n=null;e.hasOwnProperty("link")&&(n=new URL(e.link),n.searchParams.set("item",t),r.setAttribute("href",n.href)),e.remove&&(o.textContent=e.labels.remove),e.image&&c(a,t),r.classList.remove("hidden")},p=()=>{i.setAttribute("value",""),i.dispatchEvent(new Event("change",{bubbles:!0})),o.textContent=e.labels.button,e.image&&c(a,0),r.classList.add("hidden")};return e.image&&c(a,0),e.value&&s(e.value),o.addEventListener("click",(()=>{if(e.remove&&i.value)return p();const n={title:e.labels.heading};e.hasOwnProperty("mime")&&(n.library={},n.library.type=e.mime),t.attachment(n,(e=>{s(e)}))})),a.addEventListener("set_attachment",(e=>{e.detail&&s(e.detail)})),a.addEventListener("remove_attachment",(()=>{p()})),a},input:a,textarea:s,radio:o,select:r};let d=null;let u=null;function g(e,t,n){const a=p.element("div",{classes:["sharing-image-catalog-card"],append:e}),i=p.element("figure",{classes:["sharing-image-catalog-preview"],append:a});t.preview&&p.element("img",{attributes:{src:t.preview,alt:""},append:i});const o=p.element("footer",{classes:["sharing-image-catalog-footer"],append:a});p.element("h2",{text:t.title||wp.i18n.__("Untitled","sharing-image"),append:o});const r=new URL(document.location.href);r.searchParams.set("template",n),p.element("a",{classes:["button"],text:wp.i18n.__("Edit template","sharing-image"),attributes:{href:r.href},append:o})}let h=null,m=null;function f(e,t){const n=[];switch(void 0===t&&(t=wp.i18n.__("Verification unsuccessful.","sharing-image")),n.push(t),e){case"LIMIT_EXCEEDED":n.push(wp.i18n.__("The number of licenses for this key has been exceeded.","sharing-image"));break;case"KEY_NOT_FOUND":n.push(wp.i18n.__("The Premium key is invalid or expired.","sharing-image"));break;case"SERVER_ERROR":n.push(wp.i18n.__("Unable to receive a response from the verification server.","sharing-image"))}return n.join(" ")}function v(e){const t=m.querySelector(".sharing-image-premium-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown request error.","sharing-image"))}function b(){const e=m.querySelector(".sharing-image-premium-warning");null!==e&&e.classList.remove("warning-visible")}function _(e,t){m.classList.add("premium-enabled"),t.develop?v(wp.i18n.__("Using the plugin with a development license is prohibited in production.","sharing-image")):(t.key&&function(e,t){const n=p.element("div",{classes:["sharing-image-premium-permit"],append:e});p.element("button",{classes:["sharing-image-premium-show","button"],text:wp.i18n.__("Show License key","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{n.classList.toggle("permit-visible")})),p.element("strong",{text:t,append:n})}(e,t.key),function(e){const t=p.element("div",{classes:["sharing-image-premium-revoke"],append:e}),n=[];n.push(wp.i18n.__("Disabling premium mode will not remove the license for this domain.","sharing-image")),n.push(wp.i18n.__("Your current key will also be saved in the plugin settings.","sharing-image")),n.push(wp.i18n.__("Use key management tool to delete the license for the site.","sharing-image")),p.element("p",{text:n.join(" "),append:t}),p.element("button",{classes:["button"],text:wp.i18n.__("Disable Premium","sharing-image"),attributes:{type:"submit"},append:t}),p.element("span",{classes:["spinner"],append:t}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_revoke_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(n.data):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e))}function w(){let e=m.querySelector(".sharing-image-premium-access");null!==e&&m.removeChild(e),e=p.element("form",{classes:["sharing-image-premium-access"],attributes:{action:"",method:"POST"},append:m}),m.classList.remove("premium-enabled"),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:h.nonce},append:e});const t=h.license||{};return t.premium||t.develop?_(e,t):function(e,t){t.error&&v(f(t.error)),p.element("strong",{text:wp.i18n.__("Do you already have a key? Enter it here","sharing-image"),append:e});const n=p.element("div",{classes:["sharing-image-premium-verify"],append:e});p.element("input",{label:wp.i18n.__("Your Premium key","sharing-image"),attributes:{type:"text",name:"sharing_image_key",value:t.key},append:n}),p.element("button",{classes:["button"],text:wp.i18n.__("Submit","sharing-image"),attributes:{type:"submit"},append:n}),p.element("span",{classes:["spinner"],append:n}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_verify_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(f(n.code,n.data)):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e,t)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},S.apply(this,arguments)}function D(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var t()}))}(a)};let Nt=null;!function(){if(void 0===wp)return;let e=window.sharingImageSettings||{};e=t.defaults(e,["links","fonts","config","templates","license"]);const n=document.querySelector("#sharing-image-settings .sharing-image-content");if(null!==n)switch(n.classList.add("content-visible"),t.param("tab")){case"config":!function(e,t){!function(e,t){Nt=t,Nt.name="sharing_image_config";const n=e.querySelector(".sharing-image-config");if(null===n)return;const a=p.element("form",{classes:["sharing-image-config-options"],attributes:{action:Nt.links.action,method:"POST"},append:n}),i=Nt.config||{},o=Nt.templates||[];!function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Poster image format","sharing-image"),help:wp.i18n.__("The higher the value, the less compression. Availible for JPEG only.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{jpg:wp.i18n.__("JPEG","sharing-image"),png:wp.i18n.__("PNG","sharing-image"),gif:wp.i18n.__("GIF","sharing-image")},attributes:{name:Nt.name+"[format]"},selected:t.format||"jpg"},{group:"input",classes:["sharing-image-config-control-range"],attributes:{type:"range",name:Nt.name+"[quality]",min:10,max:100,step:5,value:t.quality||"90",disabled:"disabled"},label:wp.i18n.__("Image quality","sharing-image")}],append:e}),a=n.querySelector("select"),i=n.querySelector("input");"jpg"===a.value&&(i.disabled=!1),a.addEventListener("change",(()=>{i.disabled=!0,"jpg"===a.value&&(i.disabled=!1)}))}(a,i),function(e,t,n){const a={};a[""]=wp.i18n.__("Disable auto generation","sharing-image");for(const e in n)a[e]=n[e].title||wp.i18n.__("Untitled","sharing-image");let i=t.autogenerate;void 0===i&&(i=""),p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Auto generate poster","sharing-image"),help:wp.i18n.__("This template will be applied automatically when the post is saved.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:a,attributes:{name:Nt.name+"[autogenerate]"},selected:String(i)}],append:e})}(a,i,o),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Hide post widget","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[nowidget]",value:"nowidget"},label:wp.i18n.__("Hide the widget on the post editor page","sharing-image"),checked:t.nowidget}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Header Meta Tags","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{snippets:wp.i18n.__("Display Meta Tags with consideration for SEO plugins","sharing-image"),custom:wp.i18n.__("Always display Meta Tags on all pages","sharing-image"),hidden:wp.i18n.__("Hide Sharing Image Meta Tags","sharing-image")},attributes:{name:Nt.name+"[meta]"},selected:t.meta||"snippets"}],append:e});if(0===Nt.snippets.length)return n;p.element("h4",{text:wp.i18n.__("Detected SEO plugins","sharing-image"),append:n});const a=p.element("ul",{classes:["sharing-image-config-control-list"],append:n});Nt.snippets.forEach((e=>{const t=p.element("li",{append:a});p.element("a",{attributes:{href:e.link,target:"_blank",rel:"noopener"},text:e.title,append:t})}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Poster attachment","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[attachment]",value:"attachment"},label:wp.i18n.__("Save the generated poster as an attachment in the media library","sharing-image"),checked:t.attachment}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Upload directory","sharing-image"),append:e}),a=p.element("div",{classes:["sharing-image-config-control-fieldset"],append:n});p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"default"},label:wp.i18n.__("Use default uploads directory","sharing-image"),checked:t.uploads||"default"},a),p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"custom"},label:wp.i18n.__("Select custom storage for posters","sharing-image"),checked:t.uploads||"default"},a);const i=p.input({classes:["sharing-image-config-control-input"],attributes:{name:Nt.name+"[storage]",value:t.storage||Nt.links.storage,disabled:"disabled"}},n);p.element("small",{text:wp.i18n.__("Use a relative path from the site root. The directory should be writable.","sharing-image"),append:n}),n.querySelectorAll("input").forEach((e=>{"radio"===e.type&&(e.checked&&"custom"===e.value&&(i.disabled=!1),e.addEventListener("change",(()=>{i.disabled=!0,"custom"===e.value&&(i.disabled=!1)})))}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Live-reload","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[suspend]",value:"suspend"},label:wp.i18n.__("Disable live reload on the template editor screen.","sharing-image"),checked:t.suspend}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Default poster","sharing-image"),append:e});p.media({name:Nt.name+"[default]",classes:["sharing-image-config-control-media"],value:t.default,link:Nt.links.uploads,labels:{button:wp.i18n.__("Upload image","sharing-image"),heading:wp.i18n.__("Select default poster","sharing-image"),details:wp.i18n.__("Attachment details","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},image:!0,remove:!0,append:n});const a=[];a.push(wp.i18n.__("The default poster is used on pages where none is generated.","sharing-image")),a.push(wp.i18n.__("Best image size: 1200×630 pixels.","sharing-image")),p.element("small",{text:a.join(" "),append:n})}(a,i),function(e,t){p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_save_config"},append:e}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:Nt.nonce},append:e}),p.element("input",{attributes:{type:"hidden",name:Nt.name+"[demo]",value:t.demo||""},append:e}),p.element("button",{text:wp.i18n.__("Save changes","sharing-image"),classes:["button","button-primary"],attributes:{type:"submit"},append:e})}(a,i)}(e,t)}(n,e);break;case"tools":!function(e,t){!function(e,t){d=t;const n=e.querySelector(".sharing-image-tools");null!==n&&(function(e){const t=d.templates||[],n=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Clone template","sharing-image"),append:e}),a=p.element("p",{classes:["sharing-image-tools-warning"],text:wp.i18n.__("To initiate cloning, enable Premium and have at least one template.","sharing-image")}),i=d.license||{};if(0===t.length||!i.premium&&!i.develop)return n.appendChild(a);const o={};for(const e in t)o[e]=t[e].title||wp.i18n.__("Untitled","sharing-image");const r=p.element("form",{classes:["sharing-image-tools-control-cloning"],attributes:{action:d.links.action,method:"POST"},append:n}),s=p.select({classes:["sharing-image-tools-control-duplicator"],options:o,attributes:{name:"sharing_image_source"}},r);p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Create a copy","sharing-image"),append:s.parentNode}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_clone_template"},append:r}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:r})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Export templates","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_export_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["button","button-primary"],text:wp.i18n.__("Download backup file","sharing-image"),attributes:{href:a.href},append:n}),p.element("small",{text:wp.i18n.__("Save a local copy of all template settings for later use.","sharing-image"),append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Import templates","sharing-image"),append:e}),n=p.element("form",{classes:["sharing-image-tools-control-uploader"],attributes:{action:d.links.action,method:"POST",enctype:"multipart/form-data"},append:t});p.element("input",{classes:["sharing-image-tools-control-file"],attributes:{type:"file",name:"sharing_image_file",accept:"application/json",required:"required"},append:n}),p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Import templates","sharing-image"),append:n}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_import_templates"},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Clearing settings","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_clear_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["sharing-image-tools-delete","button"],text:wp.i18n.__("Remove posters","sharing-image"),attributes:{href:a.href},append:n}).addEventListener("click",(e=>{const t=wp.i18n.__("Are you sure you want to clear plugin data?","sharing-image");confirm(t)||e.preventDefault()})),p.element("small",{text:wp.i18n.__("This action clears post meta options but does not delete server images.","sharing-image"),append:n})}(n))}(e,t)}(n,e);break;case"premium":!function(e,t){!function(e,t){h=t,m=e.querySelector(".sharing-image-premium"),null!==m&&(p.element("div",{classes:["sharing-image-premium-warning"],append:m}),w())}(e,t)}(n,e);break;default:!function(e,n){let a=null;n.templates=n.templates||[],t.param("template")&&(a=t.param("template"));const i=n.templates[a];void 0!==i?Mt(e,n,a,i):null===a?function(e,t){u=t;const n=p.element("div",{classes:["sharing-image-catalog"],append:e});for(const e in t.templates)g(n,t.templates[e],e);!function(e,t){const n=new URL(document.location.href);n.searchParams.set("template",t);const a=p.element("a",{classes:["sharing-image-catalog-new"],attributes:{href:n.href},append:e}),i=p.element("h2",{append:a});if(p.element("strong",{text:wp.i18n.__("Add new template","sharing-image"),append:i}),0===u.templates.length)return;const o=u.license||{};o.premium||o.develop||(p.element("span",{text:wp.i18n.__("(Availible for Premium only)","sharing-image"),append:i}),u.links.premium&&(a.href=u.links.premium))}(n,t.index)}(e,n):Mt(e,n,a)}(n,e)}}()})();
  • sharing-image/tags/3.2/assets/widget/index.asset.php

    r3108262 r3113737  
    1 <?php return array('dependencies' => array(), 'version' => '09c1a1a4fd3ac8bd8113');
     1<?php return array('dependencies' => array(), 'version' => '');
  • sharing-image/tags/3.2/assets/widget/index.js

    r3108262 r3113737  
    1 (()=>{"use strict";const e=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},t=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("input",{attributes:{type:"text"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if("range"===s.type){const e=d.element("em",{text:s.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});s.addEventListener("change",(()=>{e.textContent=s.value})),s.addEventListener("input",(()=>{e.textContent=s.value})),e.addEventListener("click",(()=>{s.type="text"===s.type?"range":"text"}))}return s},n=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"checkbox"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return s},a=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"radio"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return t.hasOwnProperty("help")&&e("small",{text:t.help,append:a}),s},s=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("select",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}const i=t.options||{};for(const n in i){const a=e("option",{text:i[n],attributes:{value:n},append:s});if(t.hasOwnProperty("selected")){const e=t.selected;e&&e===a.value&&a.setAttribute("selected","selected")}}return s},i=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("textarea",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("content")){const e=t.content;void 0!==e&&(s.innerHTML=e)}return s},r=function(r){const l=e("div",{classes:r.classes||[]});return r.hasOwnProperty("append")&&r.append.appendChild(l),r.hasOwnProperty("prepend")&&r.prepend.insertBefore(l,r.prepend.firstChild),r.hasOwnProperty("label")&&e("h3",{text:r.label,append:l}),r.hasOwnProperty("description")&&e("p",{text:r.description,append:l}),r.hasOwnProperty("fields")&&r.fields.forEach((e=>{switch(e.group){case"input":t(e,l);break;case"textarea":i(e,l);break;case"radio":a(e,l);break;case"select":s(e,l);break;case"checkbox":n(e,l)}})),r.hasOwnProperty("help")&&e("small",{text:r.help,append:l}),l};const l=function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()};function o(t,n){let a=t.querySelector("figure");if(a&&t.removeChild(a),!wp.media)return;if(a=e("figure",{prepend:t}),t.querySelector("h4")&&t.insertBefore(a,t.querySelector("h4").nextSibling),!n)return;let s=a.querySelector("img");s&&a.removeChild(s),s=e("img",{append:a}),wp.media.attachment(n).fetch().then((e=>{s.src=e.sizes?.thumbnail?.url||e.url}))}const d={element:e,control:r,layer:function(t){const n=e("div",{classes:t.classes||[]});t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")||(t.label="");const a=e("h2",{text:t.label,append:n});return e("span",{append:a}),t.hasOwnProperty("description")&&e("h5",{text:t.description,append:n}),n},checkbox:n,media:function(t){const n=r({classes:t.classes||[]});if(t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")){const a=e("h4",{text:t.label});null!==t.label&&n.appendChild(a)}t.labels=t.labels||{};const a=e("input",{attributes:{type:"hidden",name:t.name},append:n}),s=e("button",{classes:["button"],text:t.labels.button,attributes:{type:"button"},append:n}),i=e("a",{classes:["hidden"],text:t.labels.details,attributes:{target:"_blank"}});t.hasOwnProperty("link")&&n.appendChild(i),t.hasOwnProperty("help")&&e("small",{text:t.help,append:n});const d=e=>{a.setAttribute("value",e),a.dispatchEvent(new Event("change",{bubbles:!0}));let r=null;t.hasOwnProperty("link")&&(r=new URL(t.link),r.searchParams.set("item",e),i.setAttribute("href",r.href)),t.remove&&(s.textContent=t.labels.remove),t.image&&o(n,e),i.classList.remove("hidden")},c=()=>{a.setAttribute("value",""),a.dispatchEvent(new Event("change",{bubbles:!0})),s.textContent=t.labels.button,t.image&&o(n,0),i.classList.add("hidden")};return t.image&&o(n,0),t.value&&d(t.value),s.addEventListener("click",(()=>{if(t.remove&&a.value)return c();const e={title:t.labels.heading};t.hasOwnProperty("mime")&&(e.library={},e.library.type=t.mime),l(e,(e=>{d(e)}))})),n.addEventListener("set_attachment",(e=>{e.detail&&d(e.detail)})),n.addEventListener("remove_attachment",(()=>{c()})),n},input:t,textarea:i,radio:a,select:s};let c=null,p=null;function u(e){const t=p.querySelector(".sharing-image-widget-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown generation error","sharing-image"))}function m(e,t,n){const a=document.getElementById(t);if(null===a)return;const s=()=>{"manual"!==n.source.mode&&(e.value=a.value)};a.addEventListener("input",s),e.addEventListener("input",(()=>{a.removeEventListener("input",s)})),s()}function h(e,t,n,a){const s=d.textarea({classes:["sharing-image-widget-text"],label:t.title||null,attributes:{name:c.name.fieldset+`[${n}]`}},e);s.value=a.fieldset[n]||"","post"===c.context&&("title"===t.preset&&m(s,"title",a),"excerpt"===t.preset&&m(s,"excerpt",a),"categories"===t.preset&&function(e,t){const n=document.getElementById("categorychecklist");if(!n)return;const a=c.separator||", ",s=()=>{const s=[];"manual"!==t.source.mode&&(n.querySelectorAll("input:checked").forEach((e=>{e.parentNode?.textContent&&s.push(e.parentNode.textContent.trim())})),e.value=s.join(a))};s(),n.addEventListener("change",s)}(s,a),"tags"===t.preset&&function(e,t){const n=document.querySelector("#post_tag .tagchecklist");if(!n||!MutationObserver)return;const a=c.separator||", ",s=()=>{const n=document.getElementById("tax-input-post_tag");if(!n)return;if("manual"===t.source.mode)return;const s=n.value.split(",");e.value=s.join(a)};s(),new MutationObserver(s).observe(n,{childList:!0})}(s,a))}function g(e,t,n,a){const s=d.media({name:c.name.fieldset+`[${n}]`,classes:["sharing-image-widget-image"],label:t.title||null,value:a.fieldset[n]||"",labels:{button:wp.i18n.__("Set layer image","sharing-image"),heading:wp.i18n.__("Select image","sharing-image"),details:wp.i18n.__("Attachment","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},mime:["image/png","image/jpeg","image/gif","image/webp"],image:!0,remove:!0,append:e});"post"===c.context&&"featured"===t.preset&&function(e,t){const n=wp.media?.featuredImage?.frame();n&&n.on("select",(()=>{if("manual"===t.source.mode)return;const a=n.state().get("selection").first().toJSON();a.id&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:a.id}))}));const a=document.getElementById("postimagediv");if(!a)return;if(a.addEventListener("click",(n=>{"manual"!==t.source.mode&&"remove-post-thumbnail"===n.target.id&&e.dispatchEvent(new CustomEvent("remove_attachment"))})),"manual"===t.source.mode)return;const s=a.querySelector("#_thumbnail_id");if(!s)return;const i=parseInt(s.value);i>0&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:i}))}(s,a)}function b(e){const t=d.element("div",{classes:["sharing-image-widget-manager"],append:e});!function(e){d.element("button",{classes:["sharing-image-widget-generate","button"],text:wp.i18n.__("Generate","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{!function(){const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="json",p.classList.add("widget-loader");const t=new window.FormData;t.set("action","sharing_image_generate"),p.querySelectorAll("[name]").forEach((e=>{t.append(e.name,e.value)})),function(){const e=p.querySelector(".sharing-image-widget-warning");null!==e&&e.classList.remove("warning-visible")}();const n=p.querySelector(".sharing-image-widget-poster");e.addEventListener("load",(()=>{const t=e.response||{};if(p.classList.remove("widget-loader","widget-auto"),!t.data)return u();if(!t.success)return u(t.data);c.meta.source=t.data;for(const e in t.data)n.querySelectorAll("input").forEach((n=>{c.name.source+"["+e+"]"===n.name&&(n.value=t.data[e])}));let a=n.querySelector("img");null===a&&(a=d.element("img",{append:n})),a.src=t.data.poster,"auto"===t.data.mode&&p.classList.add("widget-auto"),p.classList.add("widget-visible")})),e.addEventListener("error",(()=>{u(),p.classList.remove("widget-loader")})),e.send(t)}()}))}(t),function(e){d.element("button",{classes:["sharing-image-widget-delete","button","button-delete"],text:wp.i18n.__("Remove","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{const e=p.querySelector(".sharing-image-widget-poster img");if(null===e)return;const t=e.parentNode;t.removeChild(e),t.querySelectorAll("input").forEach((e=>{e.value="",e.name===c.name.source+"[mode]"&&(e.value="manual")})),p.classList.remove("widget-visible")}))}(t),d.element("span",{classes:["sharing-image-widget-spinner","spinner"],append:t})}void 0!==wp&&(c=window.sharingImageWidget||{},p=document.querySelector(".sharing-image-widget"),p&&function(){for(;p.firstChild;)p.removeChild(p.lastChild);c.context&&p.classList.add(`widget-${c.context}`);const e=c.meta||{};!function(e){const t=d.element("div",{classes:["sharing-image-widget-poster"],append:p});d.element("span",{classes:["sharing-image-widget-mode"],attributes:{title:wp.i18n.__("Poster was generated automatically and will update on post saving.","sharing-image")},append:t}),"auto"===e.source.mode&&p.classList.add("widget-auto"),e.source.poster&&(d.element("img",{attributes:{src:e.source.poster,alt:""},append:t}),p.classList.add("widget-visible")),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[poster]",value:e.source.poster||""},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[width]",value:e.source.width},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[height]",value:e.source.height},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[mode]",value:e.source.mode},append:t})}(e);const t=function(e){if(Object.keys(c.templates).length<1)return;const t=d.element("div",{classes:["sharing-image-widget-designer"]});let n=e.source.template||null;c.templates[n]||(n=Object.keys(c.templates)[0]),function(e,t){const n={};for(const e in c.templates)n[e]=c.templates[e]?.title||wp.i18n.__("Untitled","sharing-image");const a=d.select({classes:["sharing-image-widget-template"],options:n,attributes:{name:c.name.source+"[template]"},selected:String(t)},e);a.addEventListener("change",(()=>{const t=e.querySelectorAll(".sharing-image-widget-fieldset");for(let e=0;e<t.length;e++){const n=t[e];n.classList.remove("fieldset-visible"),n.dataset.index===a.value&&n.classList.add("fieldset-visible")}}))}(t,n);for(const a in c.templates){const s=c.templates[a],i=d.element("div",{classes:["sharing-image-widget-fieldset"],dataset:{index:a},append:t});a===n&&i.classList.add("fieldset-visible");const r=s.layers||{};for(const t in r){const n=r[t];if(n.dynamic)switch(n.type){case"text":h(i,n,t,e);break;case"image":g(i,n,t,e)}}}return p.appendChild(t),t}(e);d.element("div",{classes:["sharing-image-widget-warning"],append:t}),b(t),d.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:c.nonce},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_screen",value:c.screen},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_context",value:c.context},append:p}),function(e){e.poster&&(e.width&&e.height||u(wp.i18n.__("Image sizes are not set. Regenerate the poster.","sharing-image")))}(e)}())})();
     1(()=>{"use strict";const e=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},t=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("input",{attributes:{type:"text"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if("range"===s.type){const e=d.element("em",{text:s.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});s.addEventListener("change",(()=>{e.textContent=s.value})),s.addEventListener("input",(()=>{e.textContent=s.value})),e.addEventListener("click",(()=>{s.type="text"===s.type?"range":"text"}))}return s},n=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"checkbox"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return s},a=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"radio"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return t.hasOwnProperty("help")&&e("small",{text:t.help,append:a}),s},s=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("select",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}const i=t.options||{};for(const n in i){const a=e("option",{text:i[n],attributes:{value:n},append:s});if(t.hasOwnProperty("selected")){const e=t.selected;e&&e===a.value&&a.setAttribute("selected","selected")}}return s},i=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("textarea",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("content")){const e=t.content;void 0!==e&&(s.innerHTML=e)}return s},r=function(r){const l=e("div",{classes:r.classes||[]});return r.hasOwnProperty("append")&&r.append.appendChild(l),r.hasOwnProperty("prepend")&&r.prepend.insertBefore(l,r.prepend.firstChild),r.hasOwnProperty("label")&&e("h3",{text:r.label,append:l}),r.hasOwnProperty("description")&&e("p",{text:r.description,append:l}),r.hasOwnProperty("fields")&&r.fields.forEach((e=>{switch(e.group){case"input":t(e,l);break;case"textarea":i(e,l);break;case"radio":a(e,l);break;case"select":s(e,l);break;case"checkbox":n(e,l)}})),r.hasOwnProperty("help")&&e("small",{text:r.help,append:l}),l};const l=function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()};function o(t,n){let a=t.querySelector("figure");if(a&&t.removeChild(a),!wp.media)return;if(a=e("figure",{prepend:t}),t.querySelector("h4")&&t.insertBefore(a,t.querySelector("h4").nextSibling),!n)return;let s=a.querySelector("img");s&&a.removeChild(s),s=e("img",{append:a}),wp.media.attachment(n).fetch().then((e=>{s.src=e.sizes?.thumbnail?.url||e.url}))}const d={element:e,control:r,layer:function(t){const n=e("div",{classes:t.classes||[]});t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")||(t.label="");const a=e("h2",{text:t.label,append:n});return e("span",{append:a}),t.hasOwnProperty("description")&&e("h5",{text:t.description,append:n}),n},checkbox:n,media:function(t){const n=r({classes:t.classes||[]});if(t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")){const a=e("h4",{text:t.label});null!==t.label&&n.appendChild(a)}t.labels=t.labels||{};const a=e("input",{attributes:{type:"hidden",name:t.name},append:n}),s=e("button",{classes:["button"],text:t.labels.button,attributes:{type:"button"},append:n}),i=e("a",{classes:["hidden"],text:t.labels.details,attributes:{target:"_blank"}});t.hasOwnProperty("link")&&n.appendChild(i),t.hasOwnProperty("help")&&e("small",{text:t.help,append:n});const d=e=>{a.setAttribute("value",e),a.dispatchEvent(new Event("change",{bubbles:!0}));let r=null;t.hasOwnProperty("link")&&(r=new URL(t.link),r.searchParams.set("item",e),i.setAttribute("href",r.href)),t.remove&&(s.textContent=t.labels.remove),t.image&&o(n,e),i.classList.remove("hidden")},c=()=>{a.setAttribute("value",""),a.dispatchEvent(new Event("change",{bubbles:!0})),s.textContent=t.labels.button,t.image&&o(n,0),i.classList.add("hidden")};return t.image&&o(n,0),t.value&&d(t.value),s.addEventListener("click",(()=>{if(t.remove&&a.value)return c();const e={title:t.labels.heading};t.hasOwnProperty("mime")&&(e.library={},e.library.type=t.mime),l(e,(e=>{d(e)}))})),n.addEventListener("set_attachment",(e=>{e.detail&&d(e.detail)})),n.addEventListener("remove_attachment",(()=>{c()})),n},input:t,textarea:i,radio:a,select:s};let c=null,p=null;function u(e){const t=p.querySelector(".sharing-image-widget-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown generation error","sharing-image"))}function m(e,t,n){const a=document.getElementById(t);if(null===a)return;const s=()=>{"manual"!==n.source.mode&&(e.value=a.value)};a.addEventListener("input",s),e.addEventListener("input",(()=>{a.removeEventListener("input",s)})),s()}function h(e,t,n,a){const s=d.textarea({classes:["sharing-image-widget-text"],label:t.title||null,attributes:{name:c.name.fieldset+`[${n}]`}},e);s.value=a.fieldset[n]||"","post"===c.context&&("title"===t.preset&&m(s,"title",a),"excerpt"===t.preset&&m(s,"excerpt",a),"categories"===t.preset&&function(e,t){const n=document.getElementById("categorychecklist");if(!n)return;const a=c.separator||", ",s=()=>{const s=[];"manual"!==t.source.mode&&(n.querySelectorAll("input:checked").forEach((e=>{e.parentNode?.textContent&&s.push(e.parentNode.textContent.trim())})),e.value=s.join(a))};s(),n.addEventListener("change",s)}(s,a),"tags"===t.preset&&function(e,t){const n=document.querySelector("#post_tag .tagchecklist");if(!n||!MutationObserver)return;const a=c.separator||", ",s=()=>{const n=document.getElementById("tax-input-post_tag");if(!n)return;if("manual"===t.source.mode)return;const s=n.value.split(",");e.value=s.join(a)};s(),new MutationObserver(s).observe(n,{childList:!0})}(s,a))}function g(e,t,n,a){const s=d.media({name:c.name.fieldset+`[${n}]`,classes:["sharing-image-widget-image"],label:t.title||null,value:a.fieldset[n]||"",labels:{button:wp.i18n.__("Set layer image","sharing-image"),heading:wp.i18n.__("Select image","sharing-image"),details:wp.i18n.__("Attachment","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},mime:["image/png","image/jpeg","image/gif","image/webp"],image:!0,remove:!0,append:e});"post"===c.context&&"featured"===t.preset&&function(e,t){const n=wp.media?.featuredImage?.frame();n&&n.on("select",(()=>{if("manual"===t.source.mode)return;const a=n.state().get("selection").first().toJSON();a.id&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:a.id}))}));const a=document.getElementById("postimagediv");if(!a)return;if(a.addEventListener("click",(n=>{"manual"!==t.source.mode&&"remove-post-thumbnail"===n.target.id&&e.dispatchEvent(new CustomEvent("remove_attachment"))})),"manual"===t.source.mode)return;const s=a.querySelector("#_thumbnail_id");if(!s)return;const i=parseInt(s.value);i>0&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:i}))}(s,a)}function b(e){const t=d.element("div",{classes:["sharing-image-widget-manager"],append:e});!function(e){d.element("button",{classes:["sharing-image-widget-generate","button"],text:wp.i18n.__("Generate","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{!function(){const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="json",p.classList.add("widget-loader");const t=new window.FormData;t.set("action","sharing_image_generate"),p.querySelectorAll("[name]").forEach((e=>{t.append(e.name,e.value)})),function(){const e=p.querySelector(".sharing-image-widget-warning");null!==e&&e.classList.remove("warning-visible")}();const n=p.querySelector(".sharing-image-widget-poster");e.addEventListener("load",(()=>{const t=e.response||{};if(p.classList.remove("widget-loader","widget-auto"),!t.data)return u();if(!t.success)return u(t.data);c.meta.source=t.data;for(const e in t.data)n.querySelectorAll("input").forEach((n=>{c.name.source+"["+e+"]"===n.name&&(n.value=t.data[e])}));let a=n.querySelector("img");null===a&&(a=d.element("img",{append:n})),a.src=t.data.poster,"auto"===t.data.mode&&p.classList.add("widget-auto"),p.classList.add("widget-visible")})),e.addEventListener("error",(()=>{u(),p.classList.remove("widget-loader")})),e.send(t)}()}))}(t),function(e){d.element("button",{classes:["sharing-image-widget-delete","button","button-delete"],text:wp.i18n.__("Remove","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{const e=p.querySelector(".sharing-image-widget-poster img");if(null===e)return;const t=e.parentNode;t.removeChild(e),t.querySelectorAll("input").forEach((e=>{e.value="",e.name===c.name.source+"[mode]"&&(e.value="manual")})),p.classList.remove("widget-visible")}))}(t),d.element("span",{classes:["sharing-image-widget-spinner","spinner"],append:t})}void 0!==wp&&(c=window.sharingImageWidget||{},p=document.querySelector(".sharing-image-widget"),p&&function(){for(;p.firstChild;)p.removeChild(p.lastChild);c.context&&p.classList.add(`widget-${c.context}`);const e=c.meta||{};!function(e){const t=d.element("div",{classes:["sharing-image-widget-poster"],append:p});d.element("span",{classes:["sharing-image-widget-mode"],attributes:{title:wp.i18n.__("Poster was generated automatically and will update on post saving.","sharing-image")},append:t}),"auto"===e.source.mode&&p.classList.add("widget-auto"),e.source.poster&&(d.element("img",{attributes:{src:e.source.poster,alt:""},append:t}),p.classList.add("widget-visible")),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[poster]",value:e.source.poster||""},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[width]",value:e.source.width},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[height]",value:e.source.height},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[mode]",value:e.source.mode},append:t})}(e);const t=function(e){if(Object.keys(c.templates).length<1)return;const t=d.element("div",{classes:["sharing-image-widget-designer"]});let n=e.source.template||null;c.templates[n]||(n=Object.keys(c.templates)[0]),function(e,t){const n={};for(const e in c.templates)n[e]=c.templates[e]?.title||wp.i18n.__("Untitled","sharing-image");const a=d.select({classes:["sharing-image-widget-template"],options:n,attributes:{name:c.name.source+"[template]"},selected:String(t)},e);a.addEventListener("change",(()=>{const t=e.querySelectorAll(".sharing-image-widget-fieldset");for(let e=0;e<t.length;e++){const n=t[e];n.classList.remove("fieldset-visible"),n.dataset.index===a.value&&n.classList.add("fieldset-visible")}}))}(t,n);for(const a in c.templates){const s=c.templates[a],i=d.element("div",{classes:["sharing-image-widget-fieldset"],dataset:{index:a},append:t});a===n&&i.classList.add("fieldset-visible");const r=s.layers||{};for(const t in r){const n=r[t];if(n.dynamic)switch(n.type){case"text":h(i,n,t,e);break;case"image":g(i,n,t,e)}}}return p.appendChild(t),t}(e);d.element("div",{classes:["sharing-image-widget-warning"],append:t}),b(t),d.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:c.nonce},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_screen",value:c.screen},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_context",value:c.context},append:p}),function(e){e.poster&&(e.width&&e.height||u(wp.i18n.__("Image sizes are not set. Regenerate the poster.","sharing-image")))}(e)}())})();
  • sharing-image/tags/3.2/classes/class-generator.php

    r3109241 r3113737  
    338338
    339339        // Prepare common layer args.
    340         $args = self::prepare_args( $layer, array( 'x', 'y' ) );
     340        $args = self::prepare_args( $layer, array( 'x', 'y' ) );
    341341
    342342        // Create new editor  instance by attachment id.
     
    536536     */
    537537    private static function update_layer_dimensions( $layer, $poster ) {
    538         if ( ! isset( $layer['width'], $layer['height'] ) ) {
    539             return $layer;
     538        if ( ! isset( $layer['width'] ) ) {
     539            $layer['width'] = 0;
     540        }
     541
     542        if ( ! isset( $layer['height'] ) ) {
     543            $layer['height'] = 0;
    540544        }
    541545
    542546        $width = absint( $poster->width() );
    543547
    544         if ( $layer['width'] < 0 ) {
     548        if ( $layer['width'] < 0 ) {
    545549            $layer['width'] = $width + $layer['width'] - $layer['x'];
    546550        }
     
    548552        $height = absint( $poster->height() );
    549553
    550         if ( $layer['height'] < 0 ) {
     554        if ( $layer['height'] < 0 ) {
    551555            $layer['height'] = $height + $layer['height'] - $layer['y'];
    552556        }
  • sharing-image/tags/3.2/classes/class-templates.php

    r3108262 r3113737  
    230230
    231231    /**
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
    232253     * Check unique template index.
    233254     *
     
    490511        }
    491512
     513
     514
     515
     516
     517
     518
     519
     520
     521
     522
    492523        $sizes = array( 'x', 'y', 'width', 'height' );
    493524
     
    534565        }
    535566
     567
     568
     569
     570
     571
     572
     573
     574
     575
     576
    536577        $sizes = array( 'x', 'y', 'width', 'height' );
    537578
     
    657698
    658699        if ( isset( $layer['opacity'] ) ) {
    659             $opacity = (float) $layer['opacity'];
    660 
    661             if ( $opacity >= 0 && $opacity <= 100 ) {
     700            $opacity = ;
     701
     702            if ( $opacity <= 100 ) {
    662703                $sanitized['opacity'] = $opacity;
    663704            }
  • sharing-image/tags/3.2/classes/class-widget.php

    r3109241 r3113737  
    5656
    5757        // Try to autogenerate poster if it is needed.
    58         add_action( 'wp_after_insert_post', array( __CLASS__, 'autogenerate_poster' ), 20, 3 );
     58        add_action( 'wp_after_insert_post', array( __CLASS__, 'autogenerate_poster' ), 20, );
    5959    }
    6060
     
    590590     * @param int    $post_id Updated post_id.
    591591     * @param object $post Updated post object.
    592      * @param bool   $update Whether this is an existing post being updated.
    593      */
    594     public static function autogenerate_poster( $post_id, $post, $update ) {
     592     */
     593    public static function autogenerate_poster( $post_id, $post ) {
    595594        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
    596595            return;
    597596        }
    598597
    599         if ( ! $update ) {
    600             return;
    601         }
    602 
    603598        if ( wp_is_post_revision( $post_id ) ) {
    604599            return;
     
    609604        }
    610605
    611         if ( 'trash' === $post->post_status ) {
     606        if ( 'trash' === $post->post_status ) {
    612607            return;
    613608        }
     
    625620        $index = Config::get_autogenerate_index();
    626621
    627         if ( empty( $index ) ) {
     622        if ( ( $index ) ) {
    628623            return;
    629624        }
     
    650645        $result = self::generate_poster( $fieldset, $index, $post_id, 'post', true );
    651646
     647
     648
     649
     650
    652651        $result['template'] = $index;
    653652
     
    661660         */
    662661        $result = apply_filters( 'sharing_image_autogenerated_poster', $result, $post_id );
    663 
    664         if ( is_wp_error( $result ) ) {
    665             return;
    666         }
    667662
    668663        update_post_meta( $post_id, self::META_SOURCE, $result );
     
    733728    private static function create_script_object( $context, $screen_id ) {
    734729        $object = array(
    735             'nonce'     => wp_create_nonce( self::WIDGET_NONCE ),
    736             'context'   => $context,
    737             'screen'    => $screen_id,
    738 
    739             'name'      => array(
     730            'nonce'     => wp_create_nonce( self::WIDGET_NONCE ),
     731            'context'   => $context,
     732            'screen'    => $screen_id,
     733
     734            'name'      => array(
    740735                'source'   => self::META_SOURCE,
    741736                'fieldset' => self::META_FIELDSET,
    742737            ),
    743             'links'     => array(
     738            'links'     => array(
    744739                'uploads' => esc_url( admin_url( 'upload.php' ) ),
    745740            ),
    746             'templates' => Templates::get_templates(),
     741            'templates'    => Templates::get_templates(),
     742            'autogenerate' => Config::get_autogenerate_index(),
    747743        );
    748744
  • sharing-image/tags/3.2/readme.txt

    r3109241 r3113737  
    55Requires at least: 5.3
    66Tested up to: 6.5
    7 Stable tag: 3.1
     7Stable tag: 3.
    88Requires PHP: 5.5
    99License: GPLv2 or later
     
    3030
    3131== Changelog ==
     32
     33
     34
     35
     36
     37
    3238
    3339= 3.1 =
  • sharing-image/tags/3.2/sharing-image.php

    r3109241 r3113737  
    33 * Plugin Name:       Sharing Image
    44 * Description:       Create sharing image for Facebook, VK.com, Telegram and other social networks
    5  * Version:           3.1
     5 * Version:           3.
    66 * Requires at least: 5.3
    77 * Requires PHP:      5.6
     
    2525 * Plugin version.
    2626 */
    27 define( 'SHARING_IMAGE_VERSION', '3.1' );
     27define( 'SHARING_IMAGE_VERSION', '3.' );
    2828
    2929/**
  • sharing-image/tags/3.2/vendor/antonlukin/poster-editor/README.md

    r3108262 r3113737  
    6565Paste a given image source over the current image with an optional position.
    6666First param can be binary data or path to file or another class instance.
    67 Options is an array of x/y relative offset coords from top left corner. By default image will be centered.
     67Options is an array of x/y relative offset coords from top left corner and opacity from 0 to 100, where 0 is no transparency.
     68By default image will be centered.
    6869
    6970### canvas
     
    219220- **color**: Color of text. Can be rgb-array or '#ffffff' format.
    220221- **lineheight**: Line height of text.
    221 - **opacity**: Text opacity from 0 to 100.
     222- **opacity**: Text opacity from 0 to 100.
    222223- **horizontal**: Horizontal alignment. Can be left/right/center/justify.
    223224- **vertical**: Vertical alginment. Can be top/center/bottom/justify.
     
    261262        'lineheight' => 1.75,
    262263        'color'      => '#ffffff',
    263         'opacity'    => 1,
     264        'opacity'    => ,
    264265        'debug'      => true,
    265266    )
     
    290291        'lineheight' => 1.5,
    291292        'color'      => '#ffffff',
    292         'opacity'    => 1,
     293        'opacity'    => ,
    293294        'debug'      => true,
    294295    )
  • sharing-image/tags/3.2/vendor/antonlukin/poster-editor/composer.json

    r3108262 r3113737  
    11{
    22    "name": "antonlukin/poster-editor",
    3     "version": "5.13",
     3    "version": "5.1",
    44    "description": "Wrapper for PHP's GD Library for easy image manipulation",
    55    "keywords": ["php", "image", "text", "gd"],
  • sharing-image/tags/3.2/vendor/antonlukin/poster-editor/src/PosterEditor.php

    r3108262 r3113737  
    2424  * @author   Anton Lukin <anton@lukin.me>
    2525  * @license  MIT License (http://www.opensource.org/licenses/mit-license.php)
    26   * @version  Release: 5.13
     26  * @version  Release: 5.1
    2727  * @link     https://github.com/antonlukin/poster-editor
    2828  */
     
    126126     *
    127127     * @param string $data     Binary data or path to file or another class instance.
    128      * @param array  $options  List of x/y relative offset coords from top left corner. Default: centered.
     128     * @param array  $options  List of x/y relative offset coords from top left corner. Default: centered.
    129129     * @param array  $boundary Optional. Actual dimensions of the drawn image.
    130130     *
     
    136136            'x' => null,
    137137            'y' => null,
     138
    138139        );
    139140
     
    155156        list($width, $height, $type, $source) = $image;
    156157
     158
     159
     160
    157161        $options = $this->calcPosition($options, $width, $height);
    158162
    159         imagecopyresampled($this->resource, $source, $options['x'], $options['y'], 0, 0, $width, $height, $width, $height);
     163        $this->copyMergeAlpha($this->resource, $source, $options['x'], $options['y'], 0, 0, $width, $height, $opacity);
     164
    160165        imagedestroy($source);
    161166
     
    183188        $defaults = array(
    184189            'color'   => array(0, 0, 0),
    185             'opacity' => 100,
     190            'opacity' => 0,
    186191        );
    187192
     
    745750            'color'      => array(0, 0, 0),
    746751            'lineheight' => 1.5,
    747             'opacity'    => 1,
     752            'opacity'    => ,
    748753            'horizontal' => 'left',
    749754            'vertical'   => 'top',
     
    801806            $boundary['width'] = max($width, $boundary['width']);
    802807            $boundary['height'] = $boundary['height'] + $height;
     808
     809
     810
     811
     812
     813
     814
    803815        }
    804816
     
    12431255    protected function copyResampled($source, $dx, $dy, $sx, $sy, $dw, $dh, $sw, $sh)
    12441256    {
    1245         $this->canvas($dw, $dh);
     1257        $this->canvas($dw, $dh);
    12461258
    12471259        imagecopyresampled($this->resource, $source, $dx, $dy, $sx, $sy, $dw, $dh, $sw, $sh);
     
    12491261
    12501262        return $this;
     1263
     1264
     1265
     1266
     1267
     1268
     1269
     1270
     1271
     1272
     1273
     1274
     1275
     1276
     1277
     1278
     1279
     1280
     1281
     1282
     1283
     1284
     1285
     1286
    12511287    }
    12521288
  • sharing-image/tags/3.2/vendor/composer/installed.json

    r3108262 r3113737  
    33        {
    44            "name": "antonlukin/poster-editor",
    5             "version": "5.13",
    6             "version_normalized": "5.13.0.0",
     5            "version": "5.1",
     6            "version_normalized": "5.1.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/antonlukin/poster-editor.git",
    10                 "reference": "4555b454db9afb7bbb126970120a0e3f9569d3db"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/antonlukin/poster-editor/zipball/4555b454db9afb7bbb126970120a0e3f9569d3db",
    15                 "reference": "4555b454db9afb7bbb126970120a0e3f9569d3db",
     10                "reference": ""
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/antonlukin/poster-editor/zipball/",
     15                "reference": "",
    1616                "shasum": ""
    1717            },
     
    2626                "ext-gd": "to use GD library based image processing."
    2727            },
    28             "time": "2024-03-31T11:11:38+00:00",
     28            "time": "2024-08+00:00",
    2929            "type": "library",
    3030            "installation-source": "dist",
     
    5454            "support": {
    5555                "issues": "https://github.com/antonlukin/poster-editor/issues",
    56                 "source": "https://github.com/antonlukin/poster-editor/tree/v5.13"
     56                "source": "https://github.com/antonlukin/poster-editor/tree/v5.1"
    5757            },
    5858            "install-path": "../antonlukin/poster-editor"
     
    401401                "type": "git",
    402402                "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
    403                 "reference": "29488feb64b723674fe463e691a4f83682c2dd5e"
    404             },
    405             "dist": {
    406                 "type": "zip",
    407                 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/29488feb64b723674fe463e691a4f83682c2dd5e",
    408                 "reference": "29488feb64b723674fe463e691a4f83682c2dd5e",
     403                "reference": ""
     404            },
     405            "dist": {
     406                "type": "zip",
     407                "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/",
     408                "reference": "",
    409409                "shasum": ""
    410410            },
     
    430430                "ext-mbstring": "For improved results"
    431431            },
    432             "time": "2024-04-25T09:28:10+00:00",
     432            "time": "2024-0+00:00",
    433433            "default-branch": true,
    434434            "type": "phpcodesniffer-standard",
  • sharing-image/tags/3.2/vendor/composer/installed.php

    r3108262 r3113737  
    44        'pretty_version' => 'dev-develop',
    55        'version' => 'dev-develop',
    6         'reference' => 'faa3a36c2852c7932dd682e776b2427d38d3f1b7',
     6        'reference' => 'f',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'antonlukin/poster-editor' => array(
    14             'pretty_version' => '5.13',
    15             'version' => '5.13.0.0',
    16             'reference' => '4555b454db9afb7bbb126970120a0e3f9569d3db',
     14            'pretty_version' => '5.1',
     15            'version' => '5.1.0.0',
     16            'reference' => '',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../antonlukin/poster-editor',
     
    2323            'pretty_version' => 'dev-develop',
    2424            'version' => 'dev-develop',
    25             'reference' => 'faa3a36c2852c7932dd682e776b2427d38d3f1b7',
     25            'reference' => 'f',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../../',
     
    6868            'pretty_version' => 'dev-develop',
    6969            'version' => 'dev-develop',
    70             'reference' => '29488feb64b723674fe463e691a4f83682c2dd5e',
     70            'reference' => '',
    7171            'type' => 'phpcodesniffer-standard',
    7272            'install_path' => __DIR__ . '/../wp-coding-standards/wpcs',
  • sharing-image/trunk/assets/settings/index.asset.php

    r3109241 r3113737  
    1 <?php return array('dependencies' => array(), 'version' => 'a30cb6a378f6631afb19');
     1<?php return array('dependencies' => array(), 'version' => '');
  • sharing-image/trunk/assets/settings/index.css

    r3108262 r3113737  
    22.sharing-image-catalog{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-gap:20px;max-width:100%;padding:20px;position:relative;width:1100px}.sharing-image-catalog .sharing-image-catalog-card{background:#fff;border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.125);display:block;overflow:hidden;position:relative}.sharing-image-catalog .sharing-image-catalog-new{border:2px dashed rgba(0,0,0,.125);border-radius:4px;color:#666;display:block;padding-top:calc(52.5% + 44px);position:relative;text-decoration:none}.sharing-image-catalog .sharing-image-catalog-new h2{align-items:center;color:inherit;display:flex;flex-flow:column nowrap;font-size:15px;font-weight:400;justify-content:center;left:50%;margin:-10px 0 0;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%)}.sharing-image-catalog .sharing-image-catalog-new h2 span{display:block;font-size:11px;font-style:italic;font-weight:400;margin-top:8px;text-align:center}.sharing-image-catalog .sharing-image-catalog-new h2:before{content:"+";display:block;font-size:80px;font-weight:400;line-height:1;opacity:.25}.sharing-image-catalog .sharing-image-catalog-new:hover{background-color:#3582c4;border:2px solid #2a679c;color:#eee}@media screen and (max-width:782px){.sharing-image-catalog .sharing-image-catalog-new{padding-top:calc(52.5% + 54px)}}.sharing-image-catalog .sharing-image-catalog-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);display:block;margin:0;padding:52.5% 0 0;position:relative}.sharing-image-catalog .sharing-image-catalog-preview img{display:block;height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;width:100%}.sharing-image-catalog .sharing-image-catalog-footer{align-items:center;display:flex;height:48px;padding:0 15px;position:relative}.sharing-image-catalog .sharing-image-catalog-footer h2{flex:1 1 auto;font-size:15px;margin-right:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sharing-image-catalog .sharing-image-catalog-footer .button{margin-bottom:0}@media screen and (max-width:782px){.sharing-image-catalog .sharing-image-catalog-footer{height:54px}.sharing-image-catalog{width:75%}}@media screen and (max-width:600px){.sharing-image-catalog{grid-template-columns:1fr;width:100%}}
    33.sharing-image-premium{display:block;max-width:100%;padding:20px;width:700px}.sharing-image-premium h2{margin:12px 0}.sharing-image-premium ul{list-style-type:disc;margin-left:40px}.sharing-image-premium p{margin:12px 0 0}.sharing-image-premium p:first-child{margin-top:0}.sharing-image-premium>*{margin:24px 0}.sharing-image-premium .sharing-image-premium-benefits{display:block}.sharing-image-premium .sharing-image-premium-gratitude,.sharing-image-premium.premium-enabled .sharing-image-premium-benefits{display:none}.sharing-image-premium.premium-enabled .sharing-image-premium-gratitude{display:block}.sharing-image-premium .sharing-image-premium-contacts{border-top:1px solid #ccc;display:block;padding-top:24px}.sharing-image-premium .sharing-image-premium-access,.sharing-image-premium .sharing-image-premium-access strong{display:block}.sharing-image-premium .sharing-image-premium-access.access-loader .spinner{visibility:visible}.sharing-image-premium .sharing-image-premium-verify{align-items:center;display:flex;margin-top:8px}.sharing-image-premium .sharing-image-premium-verify input{flex:1 1 auto;max-width:320px}.sharing-image-premium .sharing-image-premium-verify button{margin-bottom:0;margin-left:8px}.sharing-image-premium .sharing-image-premium-verify .spinner{margin:0 0 0 8px}.sharing-image-premium .sharing-image-premium-revoke{align-items:center;display:flex;flex-flow:row wrap;margin:24px 0}.sharing-image-premium .sharing-image-premium-revoke p{margin:0 0 16px;width:100%}.sharing-image-premium .sharing-image-premium-revoke button{border-color:#b32d2e;color:#b32d2e}.sharing-image-premium .sharing-image-premium-revoke .spinner{margin:0 0 0 8px}.sharing-image-premium .sharing-image-premium-permit{align-items:center;display:flex;margin:24px 0}.sharing-image-premium .sharing-image-premium-permit strong{display:none;margin-left:16px}.sharing-image-premium .sharing-image-premium-permit.permit-visible strong{display:block}.sharing-image-premium .sharing-image-premium-warning{color:#b32d2e;display:none;position:relative}.sharing-image-premium .sharing-image-premium-warning.warning-visible{display:block}
    4 .sharing-image-editor{display:flex;flex-flow:row nowrap;max-width:100%;padding:20px;position:relative;width:1100px}.sharing-image-editor .sharing-image-editor-fieldset{display:block;flex:1 1 auto;margin-bottom:24px;margin-right:48px;min-width:0}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-fieldset{flex:0 1 640px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control{align-items:flex-start;display:flex;flex-flow:column nowrap;margin-bottom:24px;position:relative}.sharing-image-editor .sharing-image-editor-control p{margin:0 0 5px}.sharing-image-editor .sharing-image-editor-control p:last-child{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control h3,.sharing-image-editor .sharing-image-editor-control h4{cursor:default;display:block;font-size:13px;font-weight:600;margin:0 0 5px;width:100%}.sharing-image-editor .sharing-image-editor-control small{cursor:default;display:block;font-size:10px;line-height:1.5;margin-top:6px;width:100%}.sharing-image-editor .sharing-image-editor-control.control-hidden{display:none}.sharing-image-editor .sharing-image-editor-control.control-compact{max-width:100%;width:300px}.sharing-image-editor .sharing-image-editor-control.control-unhelp small{display:none}.sharing-image-editor .sharing-image-editor-control.control-reduced{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-right:54px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:last-child{margin-right:0}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{width:calc(50% - 7px)}.sharing-image-editor .sharing-image-editor-control.control-sizes>:first-child{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-bottom:14px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-select{align-items:center;flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-select>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-select>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-footer{align-items:center;border-top:1px solid #dcdcde;flex-flow:row nowrap;margin-bottom:0;padding-top:20px}.sharing-image-editor .sharing-image-editor-control.control-footer>*{margin-right:28px}.sharing-image-editor .sharing-image-editor-control.control-footer>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-right:54px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-series>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-bottom:24px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-upload{align-items:flex-end;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-upload>:first-child{flex:1 1 auto;margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-upload>:nth-child(2){margin-top:8px}.sharing-image-editor .sharing-image-editor-control.control-extend>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-pulled{margin-top:-10px}.sharing-image-editor .sharing-image-editor-control.control-disabled{opacity:.5}.sharing-image-editor .sharing-image-editor-control.control-disabled>*{pointer-events:none}.sharing-image-editor .sharing-image-editor-control.control-gapped>:first-child{margin-bottom:20px}.sharing-image-editor .sharing-image-editor-designer{display:block;margin-top:-10px;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-more{background:transparent;border:none;border-bottom:1px dashed;color:#3582c4;cursor:pointer;display:block;margin:0;padding:0;transition:border .25s}.sharing-image-editor .sharing-image-editor-more:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-more:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-delete{background:transparent;border:none;border-bottom:1px solid;color:#b32d2e;cursor:pointer;display:block;margin:0;padding:0;text-decoration:none;transition:border .25s}.sharing-image-editor .sharing-image-editor-delete:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-delete:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-collapse{background:transparent;border:none;color:#aaa;cursor:pointer;display:block;font-size:14px;line-height:1;margin-right:8px;padding:3px 0 0;transition:color .25s}.sharing-image-editor .sharing-image-editor-collapse:before{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.sharing-image-editor .sharing-image-editor-collapse:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-collapse:hover:after{color:#787c82}.sharing-image-editor .sharing-image-editor-collapse:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-order{background:transparent;border:none;color:#aaa;cursor:move;display:block;font-size:16px;padding:4px 4px 2px;position:absolute;right:8px;top:12px;transition:color .25s}.sharing-image-editor .sharing-image-editor-order:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-order:hover{color:#787c82}.sharing-image-editor .sharing-image-editor-order:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-layer{animation:fade-in 1s forwards;background-color:#fff;border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.05);display:block;margin:0 0 16px;opacity:0;padding:14px 10px;position:relative}.sharing-image-editor .sharing-image-editor-layer h2{align-items:center;display:flex;font-size:16px;font-weight:600;margin:-14px -10px 0;padding:14px 40px 14px 10px;position:relative;width:calc(100% + 20px)}.sharing-image-editor .sharing-image-editor-layer h2 span{color:#888;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.sharing-image-editor .sharing-image-editor-layer h5{display:block;font-size:13px;font-weight:400;margin:0 10px 24px 0}.sharing-image-editor .sharing-image-editor-layer:first-child .control-upnext{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed{padding-bottom:0}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>*{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>h2{display:flex}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>.sharing-image-editor-order{display:block}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed .sharing-image-editor-collapse:after{content:""}.sharing-image-editor .sharing-image-editor-monitor{display:block;flex:0 0 480px;max-width:100%;order:2}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 0 400px}}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 1 640px}}.sharing-image-editor .sharing-image-editor-viewport{display:block;position:sticky;top:52px;width:100%}.sharing-image-editor .sharing-image-editor-loader{background-color:rgba(0,0,0,.75);display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-loader:after{animation:rotate 1.2s linear infinite;border-color:#999 transparent;border-radius:50%;border-style:solid;border-width:6px;content:" ";display:block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px}.sharing-image-editor .sharing-image-editor-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);border-radius:3px;box-shadow:0 0 3px 0 #777;display:block;overflow:hidden;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-preview img{display:block;height:auto;max-height:400px;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:100%}.sharing-image-editor .sharing-image-editor-preview.preview-blank{padding-top:52.5%}.sharing-image-editor .sharing-image-editor-preview.preview-loader .sharing-image-editor-loader{display:block}.sharing-image-editor .sharing-image-editor-warning{background:#fff;border:1px solid #c3c4c7;border-left:4px solid #b32d2e;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.125);display:none;margin:12px 0 -6px;padding:8px 12px;position:relative}.sharing-image-editor .sharing-image-editor-warning.warning-visible{display:block}.sharing-image-editor .sharing-image-editor-manager{align-items:center;display:flex;flex-flow:row wrap;margin-top:16px;width:100%}.sharing-image-editor .sharing-image-editor-manager button{margin-right:14px}.sharing-image-editor .sharing-image-editor-manager button:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-debug{align-items:center;display:flex;margin:10px 0 10px auto;order:2}.sharing-image-editor .sharing-image-editor-debug input{margin:0 8px 0 0}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:12px;margin-top:0;order:0;width:100%}}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:24px;margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-input{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-radio input{margin-right:8px}.sharing-image-editor .sharing-image-editor-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control-radio small{margin:2px 0 0 33px}.sharing-image-editor .sharing-image-editor-control-radio{margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-editor .sharing-image-editor-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-editor .sharing-image-editor-control-textarea{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-textarea textarea{display:block;min-height:30px;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-range{display:block;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-editor .sharing-image-editor-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-editor .sharing-image-editor-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-editor .sharing-image-editor-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-editor .sharing-image-editor-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-control-media a{margin-left:14px}.sharing-image-editor .sharing-image-editor-control-media button{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control-media small{line-height:1.375;margin-top:10px}.sharing-image-editor .sharing-image-editor-control-color{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-color input[type=color]{cursor:pointer}@media screen and (max-width:1023px){.sharing-image-editor{flex-flow:row wrap}}
    5 .sharing-image-config{display:block;max-width:100%;padding:20px;width:700px}.sharing-image-config h2{margin:12px 0}.sharing-image-config>*{margin:24px 0}.sharing-image-config .sharing-image-config-control{display:grid;grid-template-columns:240px auto;margin:40px 0 24px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control small{line-height:1.375;margin-top:6px}.sharing-image-config .sharing-image-config-control h3{font-size:14px;grid-column:1;margin:6px 0 0}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3{margin-bottom:12px}}.sharing-image-config .sharing-image-config-control h4{margin:0}.sharing-image-config .sharing-image-config-control h3~*{grid-column:2;width:100%}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3~*{grid-column:auto}}.sharing-image-config .sharing-image-config-control.control-extra h3+*+*{margin-top:20px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control{grid-template-columns:1fr}}.sharing-image-config .sharing-image-config-control-fieldset{display:block;margin-bottom:10px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-fieldset a{display:block;margin-top:10px}.sharing-image-config .sharing-image-config-control-list{display:block;list-style-type:disc;margin:0;padding-left:20px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-list li{margin-top:10px}.sharing-image-config .sharing-image-config-control-input{display:block;position:relative}.sharing-image-config .sharing-image-config-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-radio input{margin-right:8px}.sharing-image-config .sharing-image-config-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control-radio small{margin:2px 0 0 33px}.sharing-image-config .sharing-image-config-control-radio{margin-top:10px}}.sharing-image-config .sharing-image-config-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-config .sharing-image-config-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-config .sharing-image-config-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-range{display:block;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-config .sharing-image-config-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-config .sharing-image-config-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-config .sharing-image-config-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-config .sharing-image-config-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-config .sharing-image-config-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-config .sharing-image-config-control-media a{margin-left:14px}.sharing-image-config .sharing-image-config-control-media button{margin-bottom:0}.sharing-image-config .sharing-image-config-control-media small{line-height:1.375;margin-top:10px}
     4.sharing-image-editor{display:flex;flex-flow:row nowrap;max-width:100%;padding:20px;position:relative;width:1100px}.sharing-image-editor .sharing-image-editor-fieldset{display:block;flex:1 1 auto;margin-bottom:24px;margin-right:48px;min-width:0}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-fieldset{flex:0 1 640px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control{align-items:flex-start;display:flex;flex-flow:column nowrap;margin-bottom:24px;position:relative}.sharing-image-editor .sharing-image-editor-control p{margin:0 0 5px}.sharing-image-editor .sharing-image-editor-control p:last-child{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control h3,.sharing-image-editor .sharing-image-editor-control h4{cursor:default;display:block;font-size:13px;font-weight:600;margin:0 0 5px;width:100%}.sharing-image-editor .sharing-image-editor-control small{cursor:default;display:block;font-size:10px;line-height:1.5;margin-top:6px;width:100%}.sharing-image-editor .sharing-image-editor-control.control-hidden{display:none}.sharing-image-editor .sharing-image-editor-control.control-compact{max-width:100%;width:300px}.sharing-image-editor .sharing-image-editor-control.control-unhelp small{display:none}.sharing-image-editor .sharing-image-editor-control.control-reduced{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-right:54px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:last-child{margin-right:0}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-sizes{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-sizes>*{width:calc(50% - 7px)}.sharing-image-editor .sharing-image-editor-control.control-sizes>:first-child{margin-bottom:14px}.sharing-image-editor .sharing-image-editor-control.control-sizes>:nth-child(2){margin-bottom:14px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-select{align-items:center;flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-select>*{margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-select>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-footer{align-items:center;border-top:1px solid #dcdcde;flex-flow:row nowrap;margin-bottom:0;padding-top:20px}.sharing-image-editor .sharing-image-editor-control.control-footer>*{margin-right:28px}.sharing-image-editor .sharing-image-editor-control.control-footer>:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row nowrap}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-right:54px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control.control-series{flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-series>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-series>:first-child{margin-bottom:24px;margin-right:0}}.sharing-image-editor .sharing-image-editor-control.control-upload{align-items:flex-end;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control.control-upload>:first-child{flex:1 1 auto;margin-right:14px}.sharing-image-editor .sharing-image-editor-control.control-upload>:nth-child(2){margin-top:8px}.sharing-image-editor .sharing-image-editor-control.control-extend>*{width:100%}.sharing-image-editor .sharing-image-editor-control.control-pulled{margin-top:-10px}.sharing-image-editor .sharing-image-editor-control.control-disabled{opacity:.5}.sharing-image-editor .sharing-image-editor-control.control-disabled>*{pointer-events:none}.sharing-image-editor .sharing-image-editor-control.control-gapped>:first-child{margin-bottom:20px}.sharing-image-editor .sharing-image-editor-designer{display:block;margin-top:-10px;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-more{background:transparent;border:none;border-bottom:1px dashed;color:#3582c4;cursor:pointer;display:block;margin:0;padding:0;transition:border .25s}.sharing-image-editor .sharing-image-editor-more:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-more:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-delete{background:transparent;border:none;border-bottom:1px solid;color:#b32d2e;cursor:pointer;display:block;margin:0;padding:0;text-decoration:none;transition:border .25s}.sharing-image-editor .sharing-image-editor-delete:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:1px solid transparent}.sharing-image-editor .sharing-image-editor-delete:hover{border-bottom-color:transparent}.sharing-image-editor .sharing-image-editor-collapse{background:transparent;border:none;color:#aaa;cursor:pointer;display:block;font-size:14px;line-height:1;margin-right:8px;padding:3px 0 0;transition:color .25s}.sharing-image-editor .sharing-image-editor-collapse:before{content:"";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.sharing-image-editor .sharing-image-editor-collapse:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-collapse:hover:after{color:#787c82}.sharing-image-editor .sharing-image-editor-collapse:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-order{background:transparent;border:none;color:#aaa;cursor:move;display:block;font-size:16px;padding:4px 4px 2px;position:absolute;right:8px;top:12px;transition:color .25s}.sharing-image-editor .sharing-image-editor-order:after{content:"";font-family:dashicons}.sharing-image-editor .sharing-image-editor-order:hover{color:#787c82}.sharing-image-editor .sharing-image-editor-order:focus{border-color:#007cba;color:#016087;outline:none}.sharing-image-editor .sharing-image-editor-layer{animation:fade-in 1s forwards;background-color:#fff;border:1px solid #ccd0d4;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.05);display:block;margin:0 0 16px;opacity:0;padding:14px 10px;position:relative}.sharing-image-editor .sharing-image-editor-layer h2{align-items:center;display:flex;font-size:16px;font-weight:600;margin:-14px -10px 0;padding:14px 40px 14px 10px;position:relative;width:calc(100% + 20px)}.sharing-image-editor .sharing-image-editor-layer h2 span{color:#888;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.sharing-image-editor .sharing-image-editor-layer h5{display:block;font-size:13px;font-weight:400;margin:0 10px 24px 0}.sharing-image-editor .sharing-image-editor-layer:first-child .control-upnext{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed{padding-bottom:0}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>*{display:none}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>h2{display:flex}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed>.sharing-image-editor-order{display:block}.sharing-image-editor .sharing-image-editor-layer.layer-collapsed .sharing-image-editor-collapse:after{content:""}.sharing-image-editor .sharing-image-editor-monitor{display:block;flex:0 0 480px;max-width:100%;order:2}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 0 400px}}@media screen and (max-width:1023px){.sharing-image-editor .sharing-image-editor-monitor{flex:0 1 640px}}.sharing-image-editor .sharing-image-editor-viewport{display:block;position:sticky;top:52px;width:100%}.sharing-image-editor .sharing-image-editor-loader{background-color:rgba(0,0,0,.75);display:none;height:100%;left:0;position:absolute;top:0;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-loader:after{animation:rotate 1.2s linear infinite;border-color:#999 transparent;border-radius:50%;border-style:solid;border-width:6px;content:" ";display:block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px}.sharing-image-editor .sharing-image-editor-preview{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYGWO8d+/efwYkoKioiMRjYGBC4WHhUK6A8T8QIJt8//59ZC493AAAQssKpBK4F5AAAAAASUVORK5CYII=);border-radius:3px;box-shadow:0 0 3px 0 #777;display:block;overflow:hidden;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-preview img{display:block;height:auto;max-height:400px;-o-object-fit:contain;object-fit:contain;-o-object-position:center;object-position:center;width:100%}.sharing-image-editor .sharing-image-editor-preview.preview-blank{padding-top:52.5%}.sharing-image-editor .sharing-image-editor-preview.preview-loader .sharing-image-editor-loader{display:block}.sharing-image-editor .sharing-image-editor-warning{background:#fff;border:1px solid #c3c4c7;border-left:4px solid #b32d2e;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.125);display:none;margin:12px 0 -6px;padding:8px 12px;position:relative}.sharing-image-editor .sharing-image-editor-warning.warning-visible{display:block}.sharing-image-editor .sharing-image-editor-manager{align-items:center;display:flex;flex-flow:row wrap;margin-top:16px;width:100%}.sharing-image-editor .sharing-image-editor-manager button{margin-right:14px}.sharing-image-editor .sharing-image-editor-manager button:last-child{margin-right:0}.sharing-image-editor .sharing-image-editor-debug{align-items:center;display:flex;margin:10px 0 10px auto;order:2}.sharing-image-editor .sharing-image-editor-debug input{margin:0 8px 0 0}@media screen and (max-width:1279px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:12px;margin-top:0;order:0;width:100%}}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-debug{margin-bottom:24px;margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-input{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-radio input{margin-right:8px}.sharing-image-editor .sharing-image-editor-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-editor .sharing-image-editor-control-radio small{margin:2px 0 0 33px}.sharing-image-editor .sharing-image-editor-control-radio{margin-top:10px}}.sharing-image-editor .sharing-image-editor-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-editor .sharing-image-editor-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-editor .sharing-image-editor-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-editor .sharing-image-editor-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-editor .sharing-image-editor-control-textarea{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-textarea textarea{display:block;min-height:30px;width:calc(100% - 2px)}.sharing-image-editor .sharing-image-editor-control-range{display:block;position:relative;width:100%}.sharing-image-editor .sharing-image-editor-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-editor .sharing-image-editor-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-editor .sharing-image-editor-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-editor .sharing-image-editor-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-editor .sharing-image-editor-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-editor .sharing-image-editor-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-editor .sharing-image-editor-control-media a{margin-left:14px}.sharing-image-editor .sharing-image-editor-control-media button{margin-bottom:0}.sharing-image-editor .sharing-image-editor-control-media small{line-height:1.375;margin-top:10px}.sharing-image-editor .sharing-image-editor-control-color{display:block;position:relative}.sharing-image-editor .sharing-image-editor-control-color input[type=color]{cursor:pointer}@media screen and (max-width:1023px){.sharing-image-editor{flex-flow:row wrap}}
     5.sharing-image-config{display:block;max-width:100%;padding:20px;width:700px}.sharing-image-config h2{margin:12px 0}.sharing-image-config>*{margin:24px 0}.sharing-image-config .sharing-image-config-control{display:grid;grid-template-columns:240px auto;margin:40px 0 24px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control small{line-height:1.375;margin-top:6px}.sharing-image-config .sharing-image-config-control h3{font-size:14px;grid-column:1;margin:6px 0 0}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3{margin-bottom:12px}}.sharing-image-config .sharing-image-config-control h4{margin:0}.sharing-image-config .sharing-image-config-control h3~*{grid-column:2;width:100%}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control h3~*{grid-column:auto}}.sharing-image-config .sharing-image-config-control.control-extra h3+*+*{margin-top:20px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control{grid-template-columns:1fr}}.sharing-image-config .sharing-image-config-control-fieldset{display:block;margin-bottom:10px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-fieldset a{display:block;margin-top:10px}.sharing-image-config .sharing-image-config-control-list{display:block;list-style-type:disc;margin:0;padding-left:20px;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-list li{margin-top:10px}.sharing-image-config .sharing-image-config-control-input{display:block;position:relative}.sharing-image-config .sharing-image-config-control-input input{display:block;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-radio{display:block;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-radio span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-radio input{margin-right:8px}.sharing-image-config .sharing-image-config-control-radio small{line-height:1.375;margin:2px 0 0 25px}@media screen and (max-width:782px){.sharing-image-config .sharing-image-config-control-radio small{margin:2px 0 0 33px}.sharing-image-config .sharing-image-config-control-radio{margin-top:10px}}.sharing-image-config .sharing-image-config-control-checkbox{align-items:center;display:flex;margin-top:5px;position:relative}.sharing-image-config .sharing-image-config-control-checkbox span{-webkit-user-select:none;-moz-user-select:none;user-select:none}.sharing-image-config .sharing-image-config-control-checkbox input[type=checkbox]{margin:0 8px 0 0}.sharing-image-config .sharing-image-config-control-select{display:block;flex:1 1 100%;position:relative}.sharing-image-config .sharing-image-config-control-select select{display:block;max-width:none;width:calc(100% - 2px)}.sharing-image-config .sharing-image-config-control-range{display:block;position:relative;width:100%}.sharing-image-config .sharing-image-config-control-range input{display:block;margin:8px 0;width:100%}.sharing-image-config .sharing-image-config-control-range em{color:#3582c4;cursor:pointer;display:block;font-size:10px;font-style:normal;position:absolute;right:2px;top:0}.sharing-image-config .sharing-image-config-control-media{align-items:center;display:flex;flex-flow:row wrap}.sharing-image-config .sharing-image-config-control-media figure{align-items:center;border-radius:2px;display:flex;height:30px;justify-content:center;margin:0 8px 0 0;overflow:hidden;position:relative;width:30px}.sharing-image-config .sharing-image-config-control-media figure:after{content:"";display:block;font-family:dashicons;font-size:2rem;line-height:1;opacity:.375}.sharing-image-config .sharing-image-config-control-media figure img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%;z-index:2}.sharing-image-config .sharing-image-config-control-media a{margin-left:14px}.sharing-image-config .sharing-image-config-control-media button{margin-bottom:0}.sharing-image-config .sharing-image-config-control-media small{line-height:1.375;margin-top:10px}
    66input[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent}input[type=range]:focus{outline:none}input[type=range]::-webkit-slider-runnable-track{background:#ddd;border:1px solid #b7b7b7;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#3582c4;border:0;border-radius:50%;cursor:pointer;height:16px;margin-top:-5.5px;width:16px}input[type=range]:focus::-webkit-slider-thumb{background:#2a679c}input[type=range]:hover::-webkit-slider-runnable-track{background:#d0d0d0}input[type=range]:disabled::-webkit-slider-thumb{background-color:#d0d0d0;cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{background-color:#eaeaea;border:1px solid #d0d0d0;cursor:default}input[type=range]::-moz-range-thumb{-moz-appearance:none;appearance:none;background:#3582c4;border:0;border-radius:50%;cursor:pointer;height:16px;margin-top:-5.5px;width:16px}input[type=range]::-moz-range-track{background:#ddd;border:1px solid #c4c4c4;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]::-moz-range-progress{background:#3582c4;border:1px solid #3582c4;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]:focus::-moz-range-thumb{background:#2a679c}input[type=range]:disabled::-moz-range-thumb{background-color:#d0d0d0;cursor:default}input[type=range]:disabled::-moz-range-progress,input[type=range]:disabled::-moz-range-track{background-color:#eaeaea;border:1px solid #d0d0d0;cursor:default}input[type=range]::-ms-track{background:#ddd;border:1px solid #c4c4c4;border-radius:4px;cursor:pointer;height:7px;width:100%}input[type=range]::-ms-thumb{appearance:none;background:#3582c4;border:0;border-radius:50%;cursor:pointer;height:16px;margin-top:-5.5px;width:16px}input[type=range]:focus::-ms-thumb{background:#2a679c}input[type=range]:disabled::-ms-thumb{background-color:#d0d0d0;cursor:default}input[type=range]:disabled::-ms-track{background-color:#eaeaea;border:1px solid #d0d0d0;cursor:default}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}#wpcontent{padding-left:0!important}.notice{margin:20px auto;max-width:calc(100% - 40px);width:1060px}.notice.update-nag{display:none}@media screen and (max-width:782px){.notice{margin:10px auto}}#sharing-image-settings{display:block;position:relative}#sharing-image-settings *{box-sizing:border-box}#sharing-image-settings .sharing-image-content{align-items:center;display:none;flex-flow:column wrap}#sharing-image-settings .sharing-image-content.content-visible{display:flex}#sharing-image-settings .sharing-image-error{color:#b32d2e;margin:40px auto 20px;max-width:660px;text-align:center}#sharing-image-settings .sharing-image-header{background:#fff;border-bottom:1px solid #ddd;border-top:1px solid #ddd;display:block;order:-2;width:100%}#sharing-image-settings .sharing-image-header h1{display:block;font-size:23px;font-weight:600;line-height:1.3;margin:0 0 16px;padding:16px 0 4px;position:relative;text-align:center}#sharing-image-settings .sharing-image-header .sharing-image-menu{display:flex;justify-content:center;margin:0 auto;overflow-x:auto;overflow-y:hidden}@media screen and (max-width:600px){#sharing-image-settings .sharing-image-header .sharing-image-menu{justify-content:flex-start}}#sharing-image-settings .sharing-image-header .sharing-image-tab{color:inherit;display:block;margin:0 10px;padding:8px 10px 15px;text-decoration:none;transition:box-shadow .5s ease-in-out}#sharing-image-settings .sharing-image-header .sharing-image-tab:focus-visible{outline:1px solid #787c82}#sharing-image-settings .sharing-image-header .sharing-image-tab:focus{box-shadow:none}#sharing-image-settings .sharing-image-header .sharing-image-tab.active{box-shadow:inset 0 -3px #3582c4;font-weight:600}
  • sharing-image/trunk/assets/settings/index.js

    r3109241 r3113737  
    1 (()=>{"use strict";let e=e=>crypto.getRandomValues(new Uint8Array(e));const t={param:function(e){return new URL(document.location.href).searchParams.get(e)},attachment:function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()},defaults:function(e,t){return t.forEach((t=>{void 0===e[t]&&(e[t]={})})),e},uniqid:function(){return((t,n=21)=>((e,t,n)=>{let a=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*a*t/e.length);return(o=t)=>{let r="";for(;;){let t=n(i),s=i;for(;s--;)if(r+=e[t[s]&a]||"",r.length===o)return r}}})(t,n,e))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",12)()},dataget:function(e,t,n){const a=e.querySelector(`[data-${t}="${n}"]`);if(a)return a.value}},n=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},a=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("input",{attributes:{type:"text"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if("range"===i.type){const e=p.element("em",{text:i.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});i.addEventListener("change",(()=>{e.textContent=i.value})),i.addEventListener("input",(()=>{e.textContent=i.value})),e.addEventListener("click",(()=>{i.type="text"===i.type?"range":"text"}))}return i},i=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"checkbox"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return i},o=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"radio"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return e.hasOwnProperty("help")&&n("small",{text:e.help,append:a}),i},r=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("select",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}const o=e.options||{};for(const t in o){const a=n("option",{text:o[t],attributes:{value:t},append:i});if(e.hasOwnProperty("selected")){const t=e.selected;t&&t===a.value&&a.setAttribute("selected","selected")}}return i},s=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("textarea",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("content")){const t=e.content;void 0!==t&&(i.innerHTML=t)}return i},l=function(e){const t=n("div",{classes:e.classes||[]});return e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")&&n("h3",{text:e.label,append:t}),e.hasOwnProperty("description")&&n("p",{text:e.description,append:t}),e.hasOwnProperty("fields")&&e.fields.forEach((e=>{switch(e.group){case"input":a(e,t);break;case"textarea":s(e,t);break;case"radio":o(e,t);break;case"select":r(e,t);break;case"checkbox":i(e,t)}})),e.hasOwnProperty("help")&&n("small",{text:e.help,append:t}),t};function c(e,t){let a=e.querySelector("figure");if(a&&e.removeChild(a),!wp.media)return;if(a=n("figure",{prepend:e}),e.querySelector("h4")&&e.insertBefore(a,e.querySelector("h4").nextSibling),!t)return;let i=a.querySelector("img");i&&a.removeChild(i),i=n("img",{append:a}),wp.media.attachment(t).fetch().then((e=>{i.src=e.sizes?.thumbnail?.url||e.url}))}const p={element:n,control:l,layer:function(e){const t=n("div",{classes:e.classes||[]});e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")||(e.label="");const a=n("h2",{text:e.label,append:t});return n("span",{append:a}),e.hasOwnProperty("description")&&n("h5",{text:e.description,append:t}),t},checkbox:i,media:function(e){const a=l({classes:e.classes||[]});if(e.hasOwnProperty("append")&&e.append.appendChild(a),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(a,e.prepend.firstChild),e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}e.labels=e.labels||{};const i=n("input",{attributes:{type:"hidden",name:e.name},append:a}),o=n("button",{classes:["button"],text:e.labels.button,attributes:{type:"button"},append:a}),r=n("a",{classes:["hidden"],text:e.labels.details,attributes:{target:"_blank"}});e.hasOwnProperty("link")&&a.appendChild(r),e.hasOwnProperty("help")&&n("small",{text:e.help,append:a});const s=t=>{i.setAttribute("value",t),i.dispatchEvent(new Event("change",{bubbles:!0}));let n=null;e.hasOwnProperty("link")&&(n=new URL(e.link),n.searchParams.set("item",t),r.setAttribute("href",n.href)),e.remove&&(o.textContent=e.labels.remove),e.image&&c(a,t),r.classList.remove("hidden")},p=()=>{i.setAttribute("value",""),i.dispatchEvent(new Event("change",{bubbles:!0})),o.textContent=e.labels.button,e.image&&c(a,0),r.classList.add("hidden")};return e.image&&c(a,0),e.value&&s(e.value),o.addEventListener("click",(()=>{if(e.remove&&i.value)return p();const n={title:e.labels.heading};e.hasOwnProperty("mime")&&(n.library={},n.library.type=e.mime),t.attachment(n,(e=>{s(e)}))})),a.addEventListener("set_attachment",(e=>{e.detail&&s(e.detail)})),a.addEventListener("remove_attachment",(()=>{p()})),a},input:a,textarea:s,radio:o,select:r};let d=null;let u=null;function g(e,t,n){const a=p.element("div",{classes:["sharing-image-catalog-card"],append:e}),i=p.element("figure",{classes:["sharing-image-catalog-preview"],append:a});t.preview&&p.element("img",{attributes:{src:t.preview,alt:""},append:i});const o=p.element("footer",{classes:["sharing-image-catalog-footer"],append:a});p.element("h2",{text:t.title||wp.i18n.__("Untitled","sharing-image"),append:o});const r=new URL(document.location.href);r.searchParams.set("template",n),p.element("a",{classes:["button"],text:wp.i18n.__("Edit template","sharing-image"),attributes:{href:r.href},append:o})}let h=null,m=null;function f(e,t){const n=[];switch(void 0===t&&(t=wp.i18n.__("Verification unsuccessful.","sharing-image")),n.push(t),e){case"LIMIT_EXCEEDED":n.push(wp.i18n.__("The number of licenses for this key has been exceeded.","sharing-image"));break;case"KEY_NOT_FOUND":n.push(wp.i18n.__("The Premium key is invalid or expired.","sharing-image"));break;case"SERVER_ERROR":n.push(wp.i18n.__("Unable to receive a response from the verification server.","sharing-image"))}return n.join(" ")}function v(e){const t=m.querySelector(".sharing-image-premium-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown request error.","sharing-image"))}function b(){const e=m.querySelector(".sharing-image-premium-warning");null!==e&&e.classList.remove("warning-visible")}function _(e,t){m.classList.add("premium-enabled"),t.develop?v(wp.i18n.__("Using the plugin with a development license is prohibited in production.","sharing-image")):(t.key&&function(e,t){const n=p.element("div",{classes:["sharing-image-premium-permit"],append:e});p.element("button",{classes:["sharing-image-premium-show","button"],text:wp.i18n.__("Show License key","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{n.classList.toggle("permit-visible")})),p.element("strong",{text:t,append:n})}(e,t.key),function(e){const t=p.element("div",{classes:["sharing-image-premium-revoke"],append:e}),n=[];n.push(wp.i18n.__("Disabling premium mode will not remove the license for this domain.","sharing-image")),n.push(wp.i18n.__("Your current key will also be saved in the plugin settings.","sharing-image")),n.push(wp.i18n.__("Use key management tool to delete the license for the site.","sharing-image")),p.element("p",{text:n.join(" "),append:t}),p.element("button",{classes:["button"],text:wp.i18n.__("Disable Premium","sharing-image"),attributes:{type:"submit"},append:t}),p.element("span",{classes:["spinner"],append:t}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_revoke_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(n.data):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e))}function w(){let e=m.querySelector(".sharing-image-premium-access");null!==e&&m.removeChild(e),e=p.element("form",{classes:["sharing-image-premium-access"],attributes:{action:"",method:"POST"},append:m}),m.classList.remove("premium-enabled"),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:h.nonce},append:e});const t=h.license||{};return t.premium||t.develop?_(e,t):function(e,t){t.error&&v(f(t.error)),p.element("strong",{text:wp.i18n.__("Do you already have a key? Enter it here","sharing-image"),append:e});const n=p.element("div",{classes:["sharing-image-premium-verify"],append:e});p.element("input",{label:wp.i18n.__("Your Premium key","sharing-image"),attributes:{type:"text",name:"sharing_image_key",value:t.key},append:n}),p.element("button",{classes:["button"],text:wp.i18n.__("Submit","sharing-image"),attributes:{type:"submit"},append:n}),p.element("span",{classes:["spinner"],append:n}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_verify_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(f(n.code,n.data)):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e,t)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},S.apply(this,arguments)}function D(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var C=D(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),T=D(/Edge/i),P=D(/firefox/i),O=D(/safari/i)&&!D(/chrome/i)&&!D(/android/i),L=D(/iP(ad|od|hone)/i),A=D(/chrome/i)&&D(/android/i),M={capture:!1,passive:!1};function N(e,t,n){e.addEventListener(t,n,!C&&M)}function I(e,t,n){e.removeEventListener(t,n,!C&&M)}function R(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Y(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function j(e,t,n,a){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&R(e,t):R(e,t))||a&&e===n)return e;if(e===n)break}while(e=Y(e))}return null}var F,X=/\s+/g;function q(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(X," ").replace(" "+t+" "," ");e.className=(a+(n?" "+t:"")).replace(X," ")}}function z(e,t,n){var a=e&&e.style;if(a){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in a||-1!==t.indexOf("webkit")||(t="-webkit-"+t),a[t]=n+("string"==typeof n?"":"px")}}function B(e,t){var n="";if("string"==typeof e)n=e;else do{var a=z(e,"transform");a&&"none"!==a&&(n=a+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function U(e,t,n){if(e){var a=e.getElementsByTagName(t),i=0,o=a.length;if(n)for(;i<o;i++)n(a[i],i);return a}return[]}function H(){return document.scrollingElement||document.documentElement}function W(e,t,n,a,i){if(e.getBoundingClientRect||e===window){var o,r,s,l,c,p,d;if(e!==window&&e.parentNode&&e!==H()?(r=(o=e.getBoundingClientRect()).top,s=o.left,l=o.bottom,c=o.right,p=o.height,d=o.width):(r=0,s=0,l=window.innerHeight,c=window.innerWidth,p=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!C))do{if(i&&i.getBoundingClientRect&&("none"!==z(i,"transform")||n&&"static"!==z(i,"position"))){var u=i.getBoundingClientRect();r-=u.top+parseInt(z(i,"border-top-width")),s-=u.left+parseInt(z(i,"border-left-width")),l=r+o.height,c=s+o.width;break}}while(i=i.parentNode);if(a&&e!==window){var g=B(i||e),h=g&&g.a,m=g&&g.d;g&&(l=(r/=m)+(p/=m),c=(s/=h)+(d/=h))}return{top:r,left:s,bottom:l,right:c,width:d,height:p}}}function G(e,t,n){for(var a=Z(e,!0),i=W(e)[t];a;){var o=W(a)[n];if(!("top"===n||"left"===n?i>=o:i<=o))return a;if(a===H())break;a=Z(a,!1)}return!1}function V(e,t,n,a){for(var i=0,o=0,r=e.children;o<r.length;){if("none"!==r[o].style.display&&r[o]!==tt.ghost&&(a||r[o]!==tt.dragged)&&j(r[o],n.draggable,e,!1)){if(i===t)return r[o];i++}o++}return null}function J(e,t){for(var n=e.lastElementChild;n&&(n===tt.ghost||"none"===z(n,"display")||t&&!R(n,t));)n=n.previousElementSibling;return n||null}function $(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===tt.clone||t&&!R(e,t)||n++;return n}function K(e){var t=0,n=0,a=H();if(e)do{var i=B(e),o=i.a,r=i.d;t+=e.scrollLeft*o,n+=e.scrollTop*r}while(e!==a&&(e=e.parentNode));return[t,n]}function Z(e,t){if(!e||!e.getBoundingClientRect)return H();var n=e,a=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=z(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return H();if(a||t)return n;a=!0}}}while(n=n.parentNode);return H()}function Q(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function ee(e,t){return function(){if(!F){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),F=setTimeout((function(){F=void 0}),t)}}}function te(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function ne(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function ae(e,t,n){var a={};return Array.from(e.children).forEach((function(i){var o,r,s,l;if(j(i,t.draggable,e,!1)&&!i.animated&&i!==n){var c=W(i);a.left=Math.min(null!==(o=a.left)&&void 0!==o?o:1/0,c.left),a.top=Math.min(null!==(r=a.top)&&void 0!==r?r:1/0,c.top),a.right=Math.max(null!==(s=a.right)&&void 0!==s?s:-1/0,c.right),a.bottom=Math.max(null!==(l=a.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}var ie="Sortable"+(new Date).getTime();var oe=[],re={initializeByDefault:!0},se={mount:function(e){for(var t in re)re.hasOwnProperty(t)&&!(t in e)&&(e[t]=re[t]);oe.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),oe.push(e)},pluginEvent:function(e,t,n){var a=this;this.eventCanceled=!1,n.cancel=function(){a.eventCanceled=!0};var i=e+"Global";oe.forEach((function(a){t[a.pluginName]&&(t[a.pluginName][i]&&t[a.pluginName][i](x({sortable:t},n)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](x({sortable:t},n)))}))},initializePlugins:function(e,t,n,a){for(var i in oe.forEach((function(a){var i=a.pluginName;if(e.options[i]||a.initializeByDefault){var o=new a(e,t,e.options);o.sortable=e,o.options=e.options,e[i]=o,S(n,o.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var o=this.modifyOption(e,i,e.options[i]);void 0!==o&&(e.options[i]=o)}},getEventProperties:function(e,t){var n={};return oe.forEach((function(a){"function"==typeof a.eventProperties&&S(n,a.eventProperties.call(t[a.pluginName],e))})),n},modifyOption:function(e,t,n){var a;return oe.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(a=i.optionListeners[t].call(e[i.pluginName],n))})),a}};var le=["evt"],ce=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=n.evt,i=function(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,le);se.pluginEvent.bind(tt)(e,t,x({dragEl:de,parentEl:ue,ghostEl:ge,rootEl:he,nextEl:me,lastDownEl:fe,cloneEl:ve,cloneHidden:be,dragStarted:Le,putSortable:ke,activeSortable:tt.active,originalEvent:a,oldIndex:_e,oldDraggableIndex:ye,newIndex:we,newDraggableIndex:xe,hideGhostForTarget:Ke,unhideGhostForTarget:Ze,cloneNowHidden:function(){be=!0},cloneNowShown:function(){be=!1},dispatchSortableEvent:function(e){pe({sortable:t,name:e,originalEvent:a})}},i))};function pe(e){!function(e){var t=e.sortable,n=e.rootEl,a=e.name,i=e.targetEl,o=e.cloneEl,r=e.toEl,s=e.fromEl,l=e.oldIndex,c=e.newIndex,p=e.oldDraggableIndex,d=e.newDraggableIndex,u=e.originalEvent,g=e.putSortable,h=e.extraEventProperties;if(t=t||n&&n[ie]){var m,f=t.options,v="on"+a.charAt(0).toUpperCase()+a.substr(1);!window.CustomEvent||C||T?(m=document.createEvent("Event")).initEvent(a,!0,!0):m=new CustomEvent(a,{bubbles:!0,cancelable:!0}),m.to=r||n,m.from=s||n,m.item=i||n,m.clone=o,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=p,m.newDraggableIndex=d,m.originalEvent=u,m.pullMode=g?g.lastPutMode:void 0;var b=x(x({},h),se.getEventProperties(a,t));for(var _ in b)m[_]=b[_];n&&n.dispatchEvent(m),f[v]&&f[v].call(t,m)}}(x({putSortable:ke,cloneEl:ve,targetEl:de,rootEl:he,oldIndex:_e,oldDraggableIndex:ye,newIndex:we,newDraggableIndex:xe},e))}var de,ue,ge,he,me,fe,ve,be,_e,we,ye,xe,Ee,ke,Se,De,Ce,Te,Pe,Oe,Le,Ae,Me,Ne,Ie,Re=!1,Ye=!1,je=[],Fe=!1,Xe=!1,qe=[],ze=!1,Be=[],Ue="undefined"!=typeof document,He=L,We=T||C?"cssFloat":"float",Ge=Ue&&!A&&!L&&"draggable"in document.createElement("div"),Ve=function(){if(Ue){if(C)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Je=function(e,t){var n=z(e),a=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=V(e,0,t),o=V(e,1,t),r=i&&z(i),s=o&&z(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+W(i).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+W(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&r.float&&"none"!==r.float){var p="left"===r.float?"left":"right";return!o||"both"!==s.clear&&s.clear!==p?"horizontal":"vertical"}return i&&("block"===r.display||"flex"===r.display||"table"===r.display||"grid"===r.display||l>=a&&"none"===n[We]||o&&"none"===n[We]&&l+c>a)?"vertical":"horizontal"},$e=function(e){function t(e,n){return function(a,i,o,r){var s=a.options.group.name&&i.options.group.name&&a.options.group.name===i.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(a,i,o,r),n)(a,i,o,r);var l=(n?a:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},a=e.group;a&&"object"==E(a)||(a={name:a}),n.name=a.name,n.checkPull=t(a.pull,!0),n.checkPut=t(a.put),n.revertClone=a.revertClone,e.group=n},Ke=function(){!Ve&&ge&&z(ge,"display","none")},Ze=function(){!Ve&&ge&&z(ge,"display","")};Ue&&!A&&document.addEventListener("click",(function(e){if(Ye)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ye=!1,!1}),!0);var Qe=function(e){if(de){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,je.some((function(e){var t=e[ie].options.emptyInsertThreshold;if(t&&!J(e)){var n=W(e),a=i>=n.left-t&&i<=n.right+t,s=o>=n.top-t&&o<=n.bottom+t;return a&&s?r=e:void 0}})),r);if(t){var n={};for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[ie]._onDragOver(n)}}var i,o,r},et=function(e){de&&de.parentNode[ie]._isOutsideThisEl(e.target)};function tt(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=S({},t),e[ie]=this;var n,a,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Je(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==tt.supportPointer&&"PointerEvent"in window&&!O,emptyInsertThreshold:5};for(var o in se.initializePlugins(this,e,i),i)!(o in t)&&(t[o]=i[o]);for(var r in $e(t),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&Ge,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?N(e,"pointerdown",this._onTapStart):(N(e,"mousedown",this._onTapStart),N(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(N(e,"dragover",this),N(e,"dragenter",this)),je.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),S(this,(a=[],{captureAnimationState:function(){a=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==z(e,"display")&&e!==tt.ghost){a.push({target:e,rect:W(e)});var t=x({},a[a.length-1].rect);if(e.thisAnimationDuration){var n=B(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){a.push(e)},removeAnimationState:function(e){a.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var a in t)if(t.hasOwnProperty(a)&&t[a]===e[n][a])return Number(n);return-1}(a,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var i=!1,o=0;a.forEach((function(e){var n=0,a=e.target,r=a.fromRect,s=W(a),l=a.prevFromRect,c=a.prevToRect,p=e.rect,d=B(a,!0);d&&(s.top-=d.f,s.left-=d.e),a.toRect=s,a.thisAnimationDuration&&Q(l,s)&&!Q(r,s)&&(p.top-s.top)/(p.left-s.left)==(r.top-s.top)/(r.left-s.left)&&(n=function(e,t,n,a){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*a.animation}(p,l,c,t.options)),Q(s,r)||(a.prevFromRect=r,a.prevToRect=s,n||(n=t.options.animation),t.animate(a,p,s,n)),n&&(i=!0,o=Math.max(o,n),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout((function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null}),n),a.thisAnimationDuration=n)})),clearTimeout(n),i?n=setTimeout((function(){"function"==typeof e&&e()}),o):"function"==typeof e&&e(),a=[]},animate:function(e,t,n,a){if(a){z(e,"transition",""),z(e,"transform","");var i=B(this.el),o=i&&i.a,r=i&&i.d,s=(t.left-n.left)/(o||1),l=(t.top-n.top)/(r||1);e.animatingX=!!s,e.animatingY=!!l,z(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),z(e,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),z(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){z(e,"transition",""),z(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),a)}}}))}function nt(e,t,n,a,i,o,r,s){var l,c,p=e[ie],d=p.options.onMove;return!window.CustomEvent||C||T?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=a,l.related=i||t,l.relatedRect=o||W(t),l.willInsertAfter=s,l.originalEvent=r,e.dispatchEvent(l),d&&(c=d.call(p,l,r)),c}function at(e){e.draggable=!1}function it(){ze=!1}function ot(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,a=0;n--;)a+=t.charCodeAt(n);return a.toString(36)}function rt(e){return setTimeout(e,0)}function st(e){return clearTimeout(e)}tt.prototype={constructor:tt,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ae=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,de):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,a=this.options,i=a.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=a.filter;if(function(e){Be.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var a=t[n];a.checked&&Be.push(a)}}(n),!de&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||a.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!O||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=j(s,a.draggable,n,!1))&&s.animated||fe===s)){if(_e=$(s),ye=$(s,a.draggable),"function"==typeof c){if(c.call(this,e,s,this))return pe({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),ce("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(a){if(a=j(l,a.trim(),n,!1))return pe({sortable:t,rootEl:a,name:"filter",targetEl:s,fromEl:n,toEl:n}),ce("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());a.handle&&!j(l,a.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var a,i=this,o=i.el,r=i.options,s=o.ownerDocument;if(n&&!de&&n.parentNode===o){var l=W(n);if(he=o,ue=(de=n).parentNode,me=de.nextSibling,fe=n,Ee=r.group,tt.dragged=de,Se={target:de,clientX:(t||e).clientX,clientY:(t||e).clientY},Pe=Se.clientX-l.left,Oe=Se.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,de.style["will-change"]="all",a=function(){ce("delayEnded",i,{evt:e}),tt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!P&&i.nativeDraggable&&(de.draggable=!0),i._triggerDragStart(e,t),pe({sortable:i,name:"choose",originalEvent:e}),q(de,r.chosenClass,!0))},r.ignore.split(",").forEach((function(e){U(de,e.trim(),at)})),N(s,"dragover",Qe),N(s,"mousemove",Qe),N(s,"touchmove",Qe),N(s,"mouseup",i._onDrop),N(s,"touchend",i._onDrop),N(s,"touchcancel",i._onDrop),P&&this.nativeDraggable&&(this.options.touchStartThreshold=4,de.draggable=!0),ce("delayStart",this,{evt:e}),!r.delay||r.delayOnTouchOnly&&!t||this.nativeDraggable&&(T||C))a();else{if(tt.eventCanceled)return void this._onDrop();N(s,"mouseup",i._disableDelayedDrag),N(s,"touchend",i._disableDelayedDrag),N(s,"touchcancel",i._disableDelayedDrag),N(s,"mousemove",i._delayedDragTouchMoveHandler),N(s,"touchmove",i._delayedDragTouchMoveHandler),r.supportPointer&&N(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,r.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){de&&at(de),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;I(e,"mouseup",this._disableDelayedDrag),I(e,"touchend",this._disableDelayedDrag),I(e,"touchcancel",this._disableDelayedDrag),I(e,"mousemove",this._delayedDragTouchMoveHandler),I(e,"touchmove",this._delayedDragTouchMoveHandler),I(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?N(document,"pointermove",this._onTouchMove):N(document,t?"touchmove":"mousemove",this._onTouchMove):(N(de,"dragend",this),N(he,"dragstart",this._onDragStart));try{document.selection?rt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(Re=!1,he&&de){ce("dragStarted",this,{evt:t}),this.nativeDraggable&&N(document,"dragover",et);var n=this.options;!e&&q(de,n.dragClass,!1),q(de,n.ghostClass,!0),tt.active=this,e&&this._appendGhost(),pe({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(De){this._lastX=De.clientX,this._lastY=De.clientY,Ke();for(var e=document.elementFromPoint(De.clientX,De.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(De.clientX,De.clientY))!==t;)t=e;if(de.parentNode[ie]._isOutsideThisEl(e),t)do{if(t[ie]&&t[ie]._onDragOver({clientX:De.clientX,clientY:De.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Ze()}},_onTouchMove:function(e){if(Se){var t=this.options,n=t.fallbackTolerance,a=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=ge&&B(ge,!0),r=ge&&o&&o.a,s=ge&&o&&o.d,l=He&&Ie&&K(Ie),c=(i.clientX-Se.clientX+a.x)/(r||1)+(l?l[0]-qe[0]:0)/(r||1),p=(i.clientY-Se.clientY+a.y)/(s||1)+(l?l[1]-qe[1]:0)/(s||1);if(!tt.active&&!Re){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ge){o?(o.e+=c-(Ce||0),o.f+=p-(Te||0)):o={a:1,b:0,c:0,d:1,e:c,f:p};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");z(ge,"webkitTransform",d),z(ge,"mozTransform",d),z(ge,"msTransform",d),z(ge,"transform",d),Ce=c,Te=p,De=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ge){var e=this.options.fallbackOnBody?document.body:he,t=W(de,!0,He,!0,e),n=this.options;if(He){for(Ie=e;"static"===z(Ie,"position")&&"none"===z(Ie,"transform")&&Ie!==document;)Ie=Ie.parentNode;Ie!==document.body&&Ie!==document.documentElement?(Ie===document&&(Ie=H()),t.top+=Ie.scrollTop,t.left+=Ie.scrollLeft):Ie=H(),qe=K(Ie)}q(ge=de.cloneNode(!0),n.ghostClass,!1),q(ge,n.fallbackClass,!0),q(ge,n.dragClass,!0),z(ge,"transition",""),z(ge,"transform",""),z(ge,"box-sizing","border-box"),z(ge,"margin",0),z(ge,"top",t.top),z(ge,"left",t.left),z(ge,"width",t.width),z(ge,"height",t.height),z(ge,"opacity","0.8"),z(ge,"position",He?"absolute":"fixed"),z(ge,"zIndex","100000"),z(ge,"pointerEvents","none"),tt.ghost=ge,e.appendChild(ge),z(ge,"transform-origin",Pe/parseInt(ge.style.width)*100+"% "+Oe/parseInt(ge.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,a=e.dataTransfer,i=n.options;ce("dragStart",this,{evt:e}),tt.eventCanceled?this._onDrop():(ce("setupClone",this),tt.eventCanceled||((ve=ne(de)).removeAttribute("id"),ve.draggable=!1,ve.style["will-change"]="",this._hideClone(),q(ve,this.options.chosenClass,!1),tt.clone=ve),n.cloneId=rt((function(){ce("clone",n),tt.eventCanceled||(n.options.removeCloneOnHide||he.insertBefore(ve,de),n._hideClone(),pe({sortable:n,name:"clone"}))})),!t&&q(de,i.dragClass,!0),t?(Ye=!0,n._loopId=setInterval(n._emulateDragOver,50)):(I(document,"mouseup",n._onDrop),I(document,"touchend",n._onDrop),I(document,"touchcancel",n._onDrop),a&&(a.effectAllowed="move",i.setData&&i.setData.call(n,a,de)),N(document,"drop",n),z(de,"transform","translateZ(0)")),Re=!0,n._dragStartId=rt(n._dragStarted.bind(n,t,e)),N(document,"selectstart",n),Le=!0,O&&z(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,a,i,o=this.el,r=e.target,s=this.options,l=s.group,c=tt.active,p=Ee===l,d=s.sort,u=ke||c,g=this,h=!1;if(!ze){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),r=j(r,s.draggable,o,!0),O("dragOver"),tt.eventCanceled)return h;if(de.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||g._ignoreWhileAnimating===r)return A(!1);if(Ye=!1,c&&!s.disabled&&(p?d||(a=ue!==he):ke===this||(this.lastPutMode=Ee.checkPull(this,c,de,e))&&l.checkPut(this,c,de,e))){if(i="vertical"===this._getDirection(e,r),t=W(de),O("dragOverValid"),tt.eventCanceled)return h;if(a)return ue=he,L(),this._hideClone(),O("revert"),tt.eventCanceled||(me?he.insertBefore(de,me):he.appendChild(de)),A(!0);var m=J(o,s.draggable);if(!m||function(e,t,n){var a=W(J(n.el,n.options.draggable)),i=ae(n.el,n.options,ge);return t?e.clientX>i.right+10||e.clientY>a.bottom&&e.clientX>a.left:e.clientY>i.bottom+10||e.clientX>a.right&&e.clientY>a.top}(e,i,this)&&!m.animated){if(m===de)return A(!1);if(m&&o===e.target&&(r=m),r&&(n=W(r)),!1!==nt(he,o,de,t,r,n,e,!!r))return L(),m&&m.nextSibling?o.insertBefore(de,m.nextSibling):o.appendChild(de),ue=o,M(),A(!0)}else if(m&&function(e,t,n){var a=W(V(n.el,0,n.options,!0)),i=ae(n.el,n.options,ge);return t?e.clientX<i.left-10||e.clientY<a.top&&e.clientX<a.right:e.clientY<i.top-10||e.clientY<a.bottom&&e.clientX<a.left}(e,i,this)){var f=V(o,0,s,!0);if(f===de)return A(!1);if(n=W(r=f),!1!==nt(he,o,de,t,r,n,e,!1))return L(),o.insertBefore(de,f),ue=o,M(),A(!0)}else if(r.parentNode===o){n=W(r);var v,b,_,w=de.parentNode!==o,y=!function(e,t,n){var a=n?e.left:e.top,i=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return a===r||i===s||a+o/2===r+l/2}(de.animated&&de.toRect||t,r.animated&&r.toRect||n,i),E=i?"top":"left",k=G(r,"top","top")||G(de,"top","top"),S=k?k.scrollTop:void 0;if(Ae!==r&&(b=n[E],Fe=!1,Xe=!y&&s.invertSwap||w),v=function(e,t,n,a,i,o,r,s){var l=a?e.clientY:e.clientX,c=a?n.height:n.width,p=a?n.top:n.left,d=a?n.bottom:n.right,u=!1;if(!r)if(s&&Ne<c*i){if(!Fe&&(1===Me?l>p+c*o/2:l<d-c*o/2)&&(Fe=!0),Fe)u=!0;else if(1===Me?l<p+Ne:l>d-Ne)return-Me}else if(l>p+c*(1-i)/2&&l<d-c*(1-i)/2)return function(e){return $(de)<$(e)?1:-1}(t);return(u=u||r)&&(l<p+c*o/2||l>d-c*o/2)?l>p+c/2?1:-1:0}(e,r,n,i,y?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Xe,Ae===r),0!==v){var D=$(de);do{D-=v,_=ue.children[D]}while(_&&("none"===z(_,"display")||_===ge))}if(0===v||_===r)return A(!1);Ae=r,Me=v;var C=r.nextElementSibling,T=!1,P=nt(he,o,de,t,r,n,e,T=1===v);if(!1!==P)return 1!==P&&-1!==P||(T=1===P),ze=!0,setTimeout(it,30),L(),T&&!C?o.appendChild(de):r.parentNode.insertBefore(de,T?C:r),k&&te(k,0,S-k.scrollTop),ue=de.parentNode,void 0===b||Xe||(Ne=Math.abs(b-W(r)[E])),M(),A(!0)}if(o.contains(de))return A(!1)}return!1}function O(s,l){ce(s,g,x({evt:e,isOwner:p,axis:i?"vertical":"horizontal",revert:a,dragRect:t,targetRect:n,canSort:d,fromSortable:u,target:r,completed:A,onMove:function(n,a){return nt(he,o,de,t,n,W(n),e,a)},changed:M},l))}function L(){O("dragOverAnimationCapture"),g.captureAnimationState(),g!==u&&u.captureAnimationState()}function A(t){return O("dragOverCompleted",{insertion:t}),t&&(p?c._hideClone():c._showClone(g),g!==u&&(q(de,ke?ke.options.ghostClass:c.options.ghostClass,!1),q(de,s.ghostClass,!0)),ke!==g&&g!==tt.active?ke=g:g===tt.active&&ke&&(ke=null),u===g&&(g._ignoreWhileAnimating=r),g.animateAll((function(){O("dragOverAnimationComplete"),g._ignoreWhileAnimating=null})),g!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(r===de&&!de.animated||r===o&&!r.animated)&&(Ae=null),s.dragoverBubble||e.rootEl||r===document||(de.parentNode[ie]._isOutsideThisEl(e.target),!t&&Qe(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),h=!0}function M(){we=$(de),xe=$(de,s.draggable),pe({sortable:g,name:"change",toEl:o,newIndex:we,newDraggableIndex:xe,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){I(document,"mousemove",this._onTouchMove),I(document,"touchmove",this._onTouchMove),I(document,"pointermove",this._onTouchMove),I(document,"dragover",Qe),I(document,"mousemove",Qe),I(document,"touchmove",Qe)},_offUpEvents:function(){var e=this.el.ownerDocument;I(e,"mouseup",this._onDrop),I(e,"touchend",this._onDrop),I(e,"pointerup",this._onDrop),I(e,"touchcancel",this._onDrop),I(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;we=$(de),xe=$(de,n.draggable),ce("drop",this,{evt:e}),ue=de&&de.parentNode,we=$(de),xe=$(de,n.draggable),tt.eventCanceled||(Re=!1,Xe=!1,Fe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),st(this.cloneId),st(this._dragStartId),this.nativeDraggable&&(I(document,"drop",this),I(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),O&&z(document.body,"user-select",""),z(de,"transform",""),e&&(Le&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ge&&ge.parentNode&&ge.parentNode.removeChild(ge),(he===ue||ke&&"clone"!==ke.lastPutMode)&&ve&&ve.parentNode&&ve.parentNode.removeChild(ve),de&&(this.nativeDraggable&&I(de,"dragend",this),at(de),de.style["will-change"]="",Le&&!Re&&q(de,ke?ke.options.ghostClass:this.options.ghostClass,!1),q(de,this.options.chosenClass,!1),pe({sortable:this,name:"unchoose",toEl:ue,newIndex:null,newDraggableIndex:null,originalEvent:e}),he!==ue?(we>=0&&(pe({rootEl:ue,name:"add",toEl:ue,fromEl:he,originalEvent:e}),pe({sortable:this,name:"remove",toEl:ue,originalEvent:e}),pe({rootEl:ue,name:"sort",toEl:ue,fromEl:he,originalEvent:e}),pe({sortable:this,name:"sort",toEl:ue,originalEvent:e})),ke&&ke.save()):we!==_e&&we>=0&&(pe({sortable:this,name:"update",toEl:ue,originalEvent:e}),pe({sortable:this,name:"sort",toEl:ue,originalEvent:e})),tt.active&&(null!=we&&-1!==we||(we=_e,xe=ye),pe({sortable:this,name:"end",toEl:ue,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){ce("nulling",this),he=de=ue=ge=me=ve=fe=be=Se=De=Le=we=xe=_e=ye=Ae=Me=ke=Ee=tt.dragged=tt.ghost=tt.clone=tt.active=null,Be.forEach((function(e){e.checked=!0})),Be.length=Ce=Te=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":de&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,a=0,i=n.length,o=this.options;a<i;a++)j(e=n[a],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||ot(e));return t},sort:function(e,t){var n={},a=this.el;this.toArray().forEach((function(e,t){var i=a.children[t];j(i,this.options.draggable,a,!1)&&(n[e]=i)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(a.removeChild(n[e]),a.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return j(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var a=se.modifyOption(this,e,t);n[e]=void 0!==a?a:t,"group"===e&&$e(n)},destroy:function(){ce("destroy",this);var e=this.el;e[ie]=null,I(e,"mousedown",this._onTapStart),I(e,"touchstart",this._onTapStart),I(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(I(e,"dragover",this),I(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),je.splice(je.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!be){if(ce("hideClone",this),tt.eventCanceled)return;z(ve,"display","none"),this.options.removeCloneOnHide&&ve.parentNode&&ve.parentNode.removeChild(ve),be=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(be){if(ce("showClone",this),tt.eventCanceled)return;de.parentNode!=he||this.options.group.revertClone?me?he.insertBefore(ve,me):he.appendChild(ve):he.insertBefore(ve,de),this.options.group.revertClone&&this.animate(de,ve),z(ve,"display",""),be=!1}}else this._hideClone()}},Ue&&N(document,"touchmove",(function(e){(tt.active||Re)&&e.cancelable&&e.preventDefault()})),tt.utils={on:N,off:I,css:z,find:U,is:function(e,t){return!!j(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:ee,closest:j,toggleClass:q,clone:ne,index:$,nextTick:rt,cancelNextTick:st,detectDirection:Je,getChild:V},tt.get=function(e){return e[ie]},tt.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(tt.utils=x(x({},tt.utils),e.utils)),se.mount(e)}))},tt.create=function(e,t){return new tt(e,t)},tt.version="1.15.2";var lt,ct,pt,dt,ut,gt,ht=[],mt=!1;function ft(){ht.forEach((function(e){clearInterval(e.pid)})),ht=[]}function vt(){clearInterval(gt)}var bt=ee((function(e,t,n,a){if(t.scroll){var i,o=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=H(),p=!1;ct!==n&&(ct=n,ft(),lt=t.scroll,i=t.scrollFn,!0===lt&&(lt=Z(n,!0)));var d=0,u=lt;do{var g=u,h=W(g),m=h.top,f=h.bottom,v=h.left,b=h.right,_=h.width,w=h.height,y=void 0,x=void 0,E=g.scrollWidth,k=g.scrollHeight,S=z(g),D=g.scrollLeft,C=g.scrollTop;g===c?(y=_<E&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),x=w<k&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(y=_<E&&("auto"===S.overflowX||"scroll"===S.overflowX),x=w<k&&("auto"===S.overflowY||"scroll"===S.overflowY));var T=y&&(Math.abs(b-o)<=s&&D+_<E)-(Math.abs(v-o)<=s&&!!D),P=x&&(Math.abs(f-r)<=s&&C+w<k)-(Math.abs(m-r)<=s&&!!C);if(!ht[d])for(var O=0;O<=d;O++)ht[O]||(ht[O]={});ht[d].vx==T&&ht[d].vy==P&&ht[d].el===g||(ht[d].el=g,ht[d].vx=T,ht[d].vy=P,clearInterval(ht[d].pid),0==T&&0==P||(p=!0,ht[d].pid=setInterval(function(){a&&0===this.layer&&tt.active._onTouchMove(ut);var t=ht[this.layer].vy?ht[this.layer].vy*l:0,n=ht[this.layer].vx?ht[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(tt.dragged.parentNode[ie],n,t,e,ut,ht[this.layer].el)||te(ht[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&u!==c&&(u=Z(u,!1)));mt=p}}),30),_t=function(e){var t=e.originalEvent,n=e.putSortable,a=e.dragEl,i=e.activeSortable,o=e.dispatchSortableEvent,r=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||i;r();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,p=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(p)&&(o("spill"),this.onSpill({dragEl:a,putSortable:n}))}};function wt(){}function yt(){}wt.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var a=V(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:_t},S(wt,{pluginName:"revertOnSpill"}),yt.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:_t},S(yt,{pluginName:"removeOnSpill"}),tt.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?N(document,"dragover",this._handleAutoScroll):this.options.supportPointer?N(document,"pointermove",this._handleFallbackAutoScroll):t.touches?N(document,"touchmove",this._handleFallbackAutoScroll):N(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?I(document,"dragover",this._handleAutoScroll):(I(document,"pointermove",this._handleFallbackAutoScroll),I(document,"touchmove",this._handleFallbackAutoScroll),I(document,"mousemove",this._handleFallbackAutoScroll)),vt(),ft(),clearTimeout(F),F=void 0},nulling:function(){ut=ct=lt=mt=gt=pt=dt=null,ht.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,a=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(a,i);if(ut=e,t||this.options.forceAutoScrollFallback||T||C||O){bt(e,this.options,o,t);var r=Z(o,!0);!mt||gt&&a===pt&&i===dt||(gt&&vt(),gt=setInterval((function(){var o=Z(document.elementFromPoint(a,i),!0);o!==r&&(r=o,ft()),bt(e,n.options,o,t)}),10),pt=a,dt=i)}else{if(!this.options.bubbleScroll||Z(o,!0)===H())return void ft();bt(e,this.options,Z(o,!1),!1)}}},S(e,{pluginName:"scroll",initializeByDefault:!0})}),tt.mount(yt,wt);const xt=tt;let Et=null,kt=null,St=null;function Dt(e){const t=kt.parentNode.querySelector(".sharing-image-editor-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown generation error","sharing-image"))}function Ct(){kt.classList.add("preview-loader");const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="blob";const t=new window.FormData(St);t.set("action","sharing_image_show_preview"),function(){const e=kt.parentNode.querySelector(".sharing-image-editor-warning");null!==e&&e.classList.remove("warning-visible")}(),e.addEventListener("readystatechange",(()=>{2===e.readyState&&(e.responseType="json",200===e.status&&(e.responseType="blob"))})),e.addEventListener("load",(()=>{const t=e.response||{};if(kt.classList.remove("preview-blank","preview-loader"),200!==e.status)return Dt(t.data);let n=kt.querySelector("img");null===n&&(n=p.element("img",{append:kt})),n.src=window.URL.createObjectURL(t)})),e.addEventListener("error",(()=>{Dt(),kt.classList.remove("preview-blank","preview-loader")})),e.send(t)}function Tt(e,n,a){const i=[],o=p.control({classes:["sharing-image-editor-control","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[x]",value:a.x,placeholder:"0"},dataset:{dimension:"x"},label:wp.i18n.__("X","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[y]",value:a.y,placeholder:"0"},dataset:{dimension:"y"},label:wp.i18n.__("Y","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[width]",value:a.width},dataset:{dimension:"width"},label:wp.i18n.__("Width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:n+"[height]",value:a.height},dataset:{dimension:"height"},label:wp.i18n.__("Height","sharing-image")}],append:e});!function(e,n,a){const i=p.control({classes:["sharing-image-editor-control","control-pulled"],append:e});p.element("button",{classes:["sharing-image-editor-more"],text:wp.i18n.__("Utilize image as the poster background.","sharing-image"),attributes:{type:"button"},append:i}).addEventListener("click",(()=>{const e={};return n.querySelectorAll("input").forEach((t=>{e[t.dataset.dimension]=t})),e.x.value=0,e.y.value=0,e.width.value=t.dataget(St,"editor","width"),e.height.value=t.dataget(St,"editor","height"),s(),void Ct()}))}(e,o),Ot(e,n,a),i[i.length]=p.control({classes:["sharing-image-editor-control"],label:wp.i18n.__("Image resizing principle","sharing-image"),fields:[{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"center"},label:wp.i18n.__("Center image while preserving the aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"top"},label:wp.i18n.__("Top-aligned image while preserving the aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"bottom"},label:wp.i18n.__("Bottom-aligned image while preserving aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"ignore"},label:wp.i18n.__("Resize while ignoring the aspect ratio","sharing-image"),checked:a.resize||"center"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:n+"[resize]",value:"crop"},label:wp.i18n.__("Center-crop the image","sharing-image"),checked:a.resize||"center"}],append:e});const r=[];o.querySelectorAll("input").forEach((e=>{["width","height"].includes(e.dataset.dimension)&&r.push(e)}));const s=()=>{let e=!1;r.forEach((t=>{t.value.length<1&&(e=!0)})),i.forEach((t=>{t.classList.toggle("control-disabled",e)}))};s(),r.forEach((e=>{e.addEventListener("input",s)}))}function Pt(e,t){const n=e.querySelector("h2 > span");if(null===n)return;const a={},i=": ";e.querySelectorAll("[data-caption]").forEach((e=>{a[e.dataset.caption]=e,e.addEventListener("keyup",(()=>{n.textContent=e.value?i+e.value:""}))})),n.textContent=i+a.content.value,t.checked&&(n.textContent=i+a.title.value),n.textContent===i&&(n.textContent="")}function Ot(e,t,n){p.control({classes:["sharing-image-editor-control","control-extend","control-pulled","control-upnext"],label:wp.i18n.__("Relative boundaries","sharing-image"),fields:[{group:"select",classes:["sharing-image-editor-control-select"],options:{absolute:wp.i18n.__("No Relative Positioning","sharing-image"),vertically:wp.i18n.__("Vertical Only","sharing-image"),horizontally:wp.i18n.__("Horizontal Only","sharing-image"),both:wp.i18n.__("Both Directions Alignment","sharing-image")},attributes:{name:t+"[boundary]"},selected:n.boundary}],help:wp.i18n.__("Using offset from previous layer.","sharing-image"),append:e})}function Lt(e,t){const n=[];n.push(wp.i18n.__("Write text on the current image.","sharing-image")),n.push(wp.i18n.__("If the font does not fit within your limits, its size will decrease.","sharing-image")),n.push(wp.i18n.__("Avoid using large font sizes for long text as it affects performance.","sharing-image")),n.push(wp.i18n.__("You can use negative values for position and dimensions.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-text"],label:wp.i18n.__("Text","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"text"},append:a}),p.control({classes:["sharing-image-editor-control","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[x]",value:e.x,placeholder:"10"},label:wp.i18n.__("X","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[y]",value:e.y,placeholder:"10"},label:wp.i18n.__("Y","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[width]",value:e.width,placeholder:"1000"},label:wp.i18n.__("Width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[height]",value:e.height},label:wp.i18n.__("Height","sharing-image")}],append:a}),Ot(a,t,e),function(e,t,n){const a=p.control({classes:["sharing-image-editor-control"],append:e}),i=p.checkbox({classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[dynamic]",value:"dynamic"},label:wp.i18n.__("Dynamic field. Filled in on the post editing screen.","sharing-image"),checked:n.dynamic},a),o=[];o[o.length]=p.control({classes:["sharing-image-editor-control","control-extend","control-hidden"],help:wp.i18n.__("Only visible on the admin side.","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:t+"[title]",value:n.title},dataset:{caption:"title"},label:wp.i18n.__("Field name","sharing-image")}],append:e}),o[o.length]=p.control({classes:["sharing-image-editor-control","control-extend","control-hidden"],help:wp.i18n.__("This field is for demonstration only, to preview the editor’s appearance.","sharing-image"),fields:[{group:"textarea",classes:["sharing-image-editor-control-textarea"],content:n.sample||"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",attributes:{name:t+"[sample]",rows:2},label:wp.i18n.__("Text sample","sharing-image")}],append:e});const r=p.control({classes:["sharing-image-editor-control","control-hidden"],label:wp.i18n.__("Preset text field","sharing-image"),fields:[{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"none"},dataset:{persistent:!0},label:wp.i18n.__("Fill in manually","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"title"},dataset:{persistent:!0},label:wp.i18n.__("Take from post title","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"excerpt"},dataset:{persistent:!0},label:wp.i18n.__("Use post excerpt text","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"categories"},dataset:{persistent:!0},label:wp.i18n.__("Use post categories","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"tags"},dataset:{persistent:!0},label:wp.i18n.__("Use post tags","sharing-image"),checked:n.preset||"none"}],append:e});o[o.length]=r,o[o.length]=p.control({classes:["sharing-image-editor-control","control-extend"],help:wp.i18n.__("You can use non-breaking spaces to adjust your string position.","sharing-image"),fields:[{group:"textarea",classes:["sharing-image-editor-control-textarea"],content:n.content,attributes:{name:t+"[content]",rows:2},dataset:{caption:"content"},label:wp.i18n.__("Content","sharing-image")}],append:e});const s=()=>{o.forEach((e=>{e.classList.toggle("control-hidden")}))};i.checked&&s(),i.addEventListener("change",(()=>{s(),Pt(e,i)})),Pt(e,i)}(a,t,e),function(e,t,n){const a=[];a[a.length]=function(e,t,n){const a=p.control({classes:["sharing-image-editor-control","control-upload","control-hidden"],append:e}),i=p.select({classes:["sharing-image-editor-control-select"],options:Et.fonts,attributes:{name:t+"[fontname]"},label:wp.i18n.__("Font family","sharing-image"),selected:n.fontname},a),o=p.media({name:t+"[fontfile]",classes:["sharing-image-editor-control-media"],value:n.fontfile,link:Et.links.uploads,labels:{button:wp.i18n.__("Upload custom font","sharing-image"),heading:wp.i18n.__("Upload custom font","sharing-image"),details:wp.i18n.__("Font attachment","sharing-image"),remove:wp.i18n.__("Remove font","sharing-image")},remove:!0,mime:["font/ttf","font/otf"],append:a});p.element("small",{text:wp.i18n.__("Custom fonts can only be in .ttf or .otf format.","sharing-image"),append:a}),n.fontfile&&(i.disabled=!0);const r=o.querySelector("input");return r.addEventListener("change",(()=>{i.disabled=!1,r.value&&(i.disabled=!0)})),a}(e,t,n),a[a.length]=p.control({classes:["sharing-image-editor-control","control-hidden"],fields:[{group:"input",classes:["sharing-image-editor-control-color"],attributes:{type:"color",name:t+"[color]",value:n.color||"#ffffff"},label:wp.i18n.__("Text color","sharing-image")}],append:e}),a[a.length]=p.control({classes:["sharing-image-editor-control","control-series","control-hidden"],fields:[{group:"select",classes:["sharing-image-editor-control-select"],options:{left:wp.i18n.__("Left","sharing-image"),center:wp.i18n.__("Center","sharing-image"),right:wp.i18n.__("Right","sharing-image")},attributes:{name:t+"[horizontal]"},label:wp.i18n.__("Horizontal alignment","sharing-image"),selected:n.horizontal},{group:"select",classes:["sharing-image-editor-control-select"],options:{top:wp.i18n.__("Top","sharing-image"),center:wp.i18n.__("Center","sharing-image"),bottom:wp.i18n.__("Bottom","sharing-image")},attributes:{name:t+"[vertical]"},label:wp.i18n.__("Vertical alignment","sharing-image"),selected:n.vertical}],append:e});const i=p.control({classes:["sharing-image-editor-control"],append:e}),o=p.element("button",{classes:["sharing-image-editor-more"],text:wp.i18n.__("More options","sharing-image"),attributes:{type:"button"},append:i});o.addEventListener("click",(()=>{a.forEach((e=>{e.classList.remove("control-hidden")})),e.removeChild(i)})),Object.keys(n).length>0&&o.click()}(a,t,e),p.control({classes:["sharing-image-editor-control","control-series"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[fontsize]",min:10,max:200,step:1,value:e.fontsize||"48"},label:wp.i18n.__("Font size","sharing-image")},{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[lineheight]",min:0,max:4,step:.125,value:e.lineheight||"1.5"},label:wp.i18n.__("Line height","sharing-image")}],append:a}),p.element("input",{attributes:{type:"hidden",name:t+"[separator]",value:", "},append:a}),a}function At(e,n,a={}){let i=null;const o=a.uniqid||t.uniqid(),r=Et.name+`[layers][${o}]`;switch(n){case"text":i=Lt(a,r);break;case"image":i=function(e,t){const n=[];n.push(wp.i18n.__("Use JPG, GIF, or PNG image formats.","sharing-image")),n.push(wp.i18n.__("Leave the width and height fields blank to use the original image size.","sharing-image")),n.push(wp.i18n.__("Sizes are calculated proportionally if not specified.","sharing-image")),n.push(wp.i18n.__("You can use negative values for position and dimensions.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-image"],label:wp.i18n.__("Image","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"image"},append:a}),p.control({classes:["sharing-image-editor-control","control-extend"],help:wp.i18n.__("Only visible on the admin side.","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:t+"[title]",value:e.title},dataset:{caption:"title"},label:wp.i18n.__("Field name","sharing-image")}],append:a}),function(e,t,n){const a=p.control({classes:["sharing-image-editor-control","control-gapped"],append:e}),i=p.checkbox({classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[dynamic]",value:"dynamic"},label:wp.i18n.__("Dynamic image. Can be updated on the post editing screen.","sharing-image"),checked:n.dynamic},a);p.media({name:t+"[attachment]",classes:["sharing-image-editor-control-media"],value:n.attachment,link:Et.links.uploads,labels:{button:wp.i18n.__("Select an image","sharing-image"),heading:wp.i18n.__("Select layer image","sharing-image"),details:wp.i18n.__("Attachment details","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},append:a,image:!0,remove:!0,help:wp.i18n.__("This field is for demonstration only, to preview the editor’s appearance.","sharing-image"),mime:["image/png","image/jpeg","image/gif","image/webp"]});const o=[],r=p.control({classes:["sharing-image-editor-control"],label:wp.i18n.__("Preset image field","sharing-image"),fields:[{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"none"},dataset:{persistent:!0},label:wp.i18n.__("Manual selection","sharing-image"),checked:n.preset||"none"},{group:"radio",classes:["sharing-image-editor-control-radio"],attributes:{name:t+"[preset]",value:"featured"},dataset:{persistent:!0},label:wp.i18n.__("Use Post Featured Image","sharing-image"),checked:n.preset||"featured"}],append:e});o[o.length]=r;const s=()=>{o.forEach((e=>{e.classList.toggle("control-hidden")})),a.classList.add("control-unhelp"),i.checked&&a.classList.remove("control-unhelp")};i.checked||s(),i.addEventListener("change",(()=>{s()}))}(a,t,e),Tt(a,t,e),a}(a,r);break;case"filter":i=function(e,t){const n=[];n.push(wp.i18n.__("Filters are applied sequentially to the entire editor image.","sharing-image")),n.push(wp.i18n.__("If you want to control their order, create multiple layers.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-text"],label:wp.i18n.__("Filter","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"filter"},append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"checkbox",classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[grayscale]",value:"grayscale"},label:wp.i18n.__("Converts the image into a grayscale version","sharing-image"),checked:e.grayscale}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"checkbox",classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[blur]",value:"blur"},label:wp.i18n.__("Blur image by Gaussian effect","sharing-image"),checked:e.blur}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[contrast]",min:-50,max:50,step:5,value:e.contrast||"0"},label:wp.i18n.__("Contrast","sharing-image")}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[brightness]",min:-50,max:50,step:5,value:e.brightness||"0"},label:wp.i18n.__("Brightness","sharing-image")}],append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[blackout]",min:0,max:100,step:5,value:e.blackout||"0"},label:wp.i18n.__("Blackout","sharing-image")}],append:a}),a}(a,r);break;case"rectangle":i=function(e,t){const n=[];n.push(wp.i18n.__("Draw a colored rectangle on the current image.","sharing-image")),n.push(wp.i18n.__("You can get a filled or outlined figure with custom color and opacity.","sharing-image")),n.push(wp.i18n.__("Use a small height to draw the line.","sharing-image")),n.push(wp.i18n.__("You can use negative values for position and dimensions.","sharing-image"));const a=p.layer({classes:["sharing-image-editor-layer","layer-text"],label:wp.i18n.__("Rectangle","sharing-image"),description:n.join(" ")});return p.element("input",{attributes:{type:"hidden",name:t+"[type]",value:"rectangle"},append:a}),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-color"],attributes:{type:"color",name:t+"[color]",value:e.color||"#ffffff"},label:wp.i18n.__("Rectangle color","sharing-image")}],append:a}),p.control({classes:["sharing-image-editor-control","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[x]"||0,value:e.x},label:wp.i18n.__("X","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[y]"||0,value:e.y},label:wp.i18n.__("Y","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[width]",value:e.width},label:wp.i18n.__("Width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{type:"text",name:t+"[height]",value:e.height},label:wp.i18n.__("Height","sharing-image")}],append:a}),Ot(a,t,e),function(e,t,n){const a=p.control({classes:["sharing-image-editor-control"],append:e}),i=p.checkbox({classes:["sharing-image-editor-control-checkbox"],attributes:{name:t+"[outline]",value:"outline"},label:wp.i18n.__("Outline rectangle.","sharing-image"),checked:n.outline},a),o=p.control({classes:["sharing-image-editor-control","control-hidden"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[thickness]",min:0,max:50,step:1,value:n.thickness||"0"},label:wp.i18n.__("Border width","sharing-image")}],append:e});n.outline&&o.classList.remove("control-hidden"),i.addEventListener("change",(()=>{o.classList.add("control-hidden"),i.checked&&o.classList.remove("control-hidden")}))}(a,t,e),p.control({classes:["sharing-image-editor-control"],fields:[{group:"input",classes:["sharing-image-editor-control-range"],attributes:{type:"range",name:t+"[opacity]",min:0,max:100,step:5,value:e.opacity||"0"},label:wp.i18n.__("Opacity","sharing-image")}],append:a}),a}(a,r);break;default:return null}return e.appendChild(i),function(e,t){const n=p.control({classes:["sharing-image-editor-control","control-footer"],append:t});p.element("button",{classes:["sharing-image-editor-delete"],text:wp.i18n.__("Delete layer","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{e.removeChild(t),St.classList.contains("editor-suspend")||Ct()}))}(e,i),function(e,t,n){const a=e.querySelector("h2"),i=p.element("button",{classes:["sharing-image-editor-collapse"],attributes:{type:"button",title:wp.i18n.__("Collapse layer","sharing-image")},prepend:a});let o=1===t.collapsed;o&&e.classList.add("layer-collapsed");const r=p.element("input",{attributes:{type:"hidden",name:n+"[collapsed]",value:Number(o)},append:e});i.addEventListener("click",(t=>{t.preventDefault(),o=!o,e.classList.toggle("layer-collapsed",o),i.setAttribute("title",wp.i18n.__("Collapse layer","sharing-image")),o&&i.setAttribute("title",wp.i18n.__("Expand layer","sharing-image")),r.value=Number(o)}))}(i,a,r),function(e,t){p.element("button",{classes:["sharing-image-editor-order"],attributes:{type:"button",title:wp.i18n.__("Change layer position","sharing-image")},append:t}),xt.create(e,{handle:".sharing-image-editor-order",onUpdate:()=>{St.classList.contains("editor-suspend")||Ct()}})}(e,i),i}const Mt=function(e,t,n,a={}){Et=t,St=function(e,t){Et.name="sharing_image_editor";const n=p.element("form",{classes:["sharing-image-editor"],attributes:{action:Et.links.action,method:"POST"},append:e});return Et.config.suspend&&n.classList.add("editor-suspend"),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_save_editor"},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_index",value:t},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:Et.nonce},append:n}),n.addEventListener("submit",(e=>{e.preventDefault(),function(){const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="json",kt.classList.add("preview-loader");const t=new window.FormData(St);t.set("action","sharing_image_save_preview"),e.addEventListener("load",(()=>{const t=e.response||{};if(!t.data)return Dt();if(!t.success)return kt.classList.remove("preview-loader"),Dt(t.data);const n=kt.querySelector("input");null!==n&&(n.value=t.data),St.submit()})),e.addEventListener("error",(()=>{kt.classList.remove("preview-loader"),Dt()})),e.send(t)}()})),n}(e,n),function(e){const t=p.element("div",{classes:["sharing-image-editor-monitor"],append:St}),n=p.element("div",{classes:["sharing-image-editor-viewport"],append:t});!function(e,t){kt=p.element("div",{classes:["sharing-image-editor-preview","preview-blank"],append:e}),t.preview&&(p.element("img",{attributes:{src:t.preview,alt:""},append:kt}),kt.classList.remove("preview-blank")),p.element("span",{classes:["sharing-image-editor-loader"],append:kt}),p.element("input",{attributes:{type:"hidden",name:Et.name+"[preview]",value:t.preview},append:kt})}(n,e),p.element("div",{classes:["sharing-image-editor-warning"],append:n});const a=p.element("div",{classes:["sharing-image-editor-manager"],append:n});!function(e,t){p.checkbox({classes:["sharing-image-editor-debug"],attributes:{name:Et.name+"[debug]",value:"debug"},label:wp.i18n.__("Show debug frames","sharing-image"),checked:t.debug},e).addEventListener("change",(()=>{Ct()}))}(a,e),function(e){p.element("button",{text:wp.i18n.__("Save changes","sharing-image"),classes:["button","button-primary"],attributes:{type:"submit"},append:e})}(a),function(e){p.element("button",{text:wp.i18n.__("Generate preview","sharing-image"),classes:["button"],attributes:{type:"button"},append:e}).addEventListener("click",(()=>{Ct()}))}(a)}(a),function(e){const t=p.element("div",{classes:["sharing-image-editor-fieldset"],append:St});p.control({classes:["sharing-image-editor-control","control-compact","control-extend"],help:wp.i18n.__("Used only in the admin panel","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:Et.name+"[title]",value:e.title},dataset:{persistent:!0,editor:"title"},label:wp.i18n.__("Template title","sharing-image")}],append:t}),p.control({classes:["sharing-image-editor-control"],label:wp.i18n.__("Fill color","sharing-image"),fields:[{group:"input",classes:["sharing-image-editor-control-color"],attributes:{name:Et.name+"[fill]",type:"color",value:e.fill},dataset:{editor:"fill"}}],append:t}),p.control({classes:["sharing-image-editor-control","control-compact","control-sizes"],fields:[{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:Et.name+"[width]",value:e.width||"1200",placeholder:"1200",maxlength:4},dataset:{editor:"width"},label:wp.i18n.__("Editor width","sharing-image")},{group:"input",classes:["sharing-image-editor-control-input"],attributes:{name:Et.name+"[height]",value:e.height||"630",placeholder:"630",maxlength:4},dataset:{editor:"height"},label:wp.i18n.__("Editor height","sharing-image")}],append:t});const n=[];n.push(wp.i18n.__("You can add multiple layers on your editor.","sharing-image")),n.push(wp.i18n.__("Note that the stacking order of the layers is important.","sharing-image")),n.push(wp.i18n.__("You can change the order using the icon in the corner of each box.","sharing-image")),p.control({classes:["sharing-image-editor-control","control-reduced"],label:wp.i18n.__("Add layers","sharing-image"),description:n.join(" "),append:t}),function(e,t){const n=p.control({classes:["sharing-image-editor-control","control-select","control-compact"],fields:[{group:"select",classes:["sharing-image-editor-control-select"],options:{text:wp.i18n.__("Text","sharing-image"),image:wp.i18n.__("Image","sharing-image"),filter:wp.i18n.__("Filter","sharing-image"),rectangle:wp.i18n.__("Rectangle","sharing-image")}}],append:e});p.element("button",{classes:["button"],text:wp.i18n.__("Add new","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{const e=n.querySelector("select");null!==e&&At(a,e.value).scrollIntoView({behavior:"smooth"})}));const a=p.element("div",{classes:["sharing-image-editor-designer"],append:e});t.layers=t.layers||{};for(const e in t.layers){const n=t.layers[e];if(n.uniqid=e,n.hasOwnProperty("type")&&!At(a,n.type,n))return}}(t,e);const a=p.control({classes:["sharing-image-editor-control","control-footer"],append:t});!function(e){const t=new URL(document.location.href);t.searchParams.delete("template"),p.element("a",{classes:["button"],text:wp.i18n.__("← Back to Catalog","sharing-image"),attributes:{href:t.href},append:e})}(a),function(e){const t=new URL(document.location.href).searchParams.get("template"),n=new URL(Et.links.action);n.searchParams.set("action","sharing_image_delete_template"),n.searchParams.set("template",t),n.searchParams.set("nonce",Et.nonce),p.element("a",{classes:["sharing-image-editor-delete"],text:wp.i18n.__("Delete template","sharing-image"),attributes:{href:n.href},append:e}).addEventListener("click",(e=>{const t=wp.i18n.__("Are you sure you want to delete this template?","sharing-image");confirm(t)||e.preventDefault()}))}(a),t.addEventListener("change",(e=>{if(St.classList.contains("editor-suspend"))return;const t=e.target;t.hasAttribute("data-persistent")||t.hasAttribute("name")&&Ct()}))}(a)};let Nt=null;!function(){if(void 0===wp)return;let e=window.sharingImageSettings||{};e=t.defaults(e,["links","fonts","config","templates","license"]);const n=document.querySelector("#sharing-image-settings .sharing-image-content");if(null!==n)switch(n.classList.add("content-visible"),t.param("tab")){case"config":!function(e,t){!function(e,t){Nt=t,Nt.name="sharing_image_config";const n=e.querySelector(".sharing-image-config");if(null===n)return;const a=p.element("form",{classes:["sharing-image-config-options"],attributes:{action:Nt.links.action,method:"POST"},append:n}),i=Nt.config||{},o=Nt.templates||[];!function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Poster image format","sharing-image"),help:wp.i18n.__("The higher the value, the less compression. Availible for JPEG only.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{jpg:wp.i18n.__("JPEG","sharing-image"),png:wp.i18n.__("PNG","sharing-image"),gif:wp.i18n.__("GIF","sharing-image")},attributes:{name:Nt.name+"[format]"},selected:t.format||"jpg"},{group:"input",classes:["sharing-image-config-control-range"],attributes:{type:"range",name:Nt.name+"[quality]",min:10,max:100,step:5,value:t.quality||"90",disabled:"disabled"},label:wp.i18n.__("Image quality","sharing-image")}],append:e}),a=n.querySelector("select"),i=n.querySelector("input");"jpg"===a.value&&(i.disabled=!1),a.addEventListener("change",(()=>{i.disabled=!0,"jpg"===a.value&&(i.disabled=!1)}))}(a,i),function(e,t,n){const a={};a[""]=wp.i18n.__("Disable auto generation","sharing-image");for(const e in n)a[e]=n[e].title||wp.i18n.__("Untitled","sharing-image");let i=t.autogenerate;void 0===i&&(i=""),p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Auto generate poster","sharing-image"),help:wp.i18n.__("This template will be applied automatically when the post is saved.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:a,attributes:{name:Nt.name+"[autogenerate]"},selected:String(i)}],append:e})}(a,i,o),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Hide post widget","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[nowidget]",value:"nowidget"},label:wp.i18n.__("Hide the widget on the post editor page","sharing-image"),checked:t.nowidget}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Header Meta Tags","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{snippets:wp.i18n.__("Display Meta Tags with consideration for SEO plugins","sharing-image"),custom:wp.i18n.__("Always display Meta Tags on all pages","sharing-image"),hidden:wp.i18n.__("Hide Sharing Image Meta Tags","sharing-image")},attributes:{name:Nt.name+"[meta]"},selected:t.meta||"snippets"}],append:e});if(0===Nt.snippets.length)return n;p.element("h4",{text:wp.i18n.__("Detected SEO plugins","sharing-image"),append:n});const a=p.element("ul",{classes:["sharing-image-config-control-list"],append:n});Nt.snippets.forEach((e=>{const t=p.element("li",{append:a});p.element("a",{attributes:{href:e.link,target:"_blank",rel:"noopener"},text:e.title,append:t})}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Poster attachment","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[attachment]",value:"attachment"},label:wp.i18n.__("Save the generated poster as an attachment in the media library","sharing-image"),checked:t.attachment}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Upload directory","sharing-image"),append:e}),a=p.element("div",{classes:["sharing-image-config-control-fieldset"],append:n});p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"default"},label:wp.i18n.__("Use default uploads directory","sharing-image"),checked:t.uploads||"default"},a),p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"custom"},label:wp.i18n.__("Select custom storage for posters","sharing-image"),checked:t.uploads||"default"},a);const i=p.input({classes:["sharing-image-config-control-input"],attributes:{name:Nt.name+"[storage]",value:t.storage||Nt.links.storage,disabled:"disabled"}},n);p.element("small",{text:wp.i18n.__("Use a relative path from the site root. The directory should be writable.","sharing-image"),append:n}),n.querySelectorAll("input").forEach((e=>{"radio"===e.type&&(e.checked&&"custom"===e.value&&(i.disabled=!1),e.addEventListener("change",(()=>{i.disabled=!0,"custom"===e.value&&(i.disabled=!1)})))}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Live-reload","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[suspend]",value:"suspend"},label:wp.i18n.__("Disable live reload on the template editor screen.","sharing-image"),checked:t.suspend}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Default poster","sharing-image"),append:e});p.media({name:Nt.name+"[default]",classes:["sharing-image-config-control-media"],value:t.default,link:Nt.links.uploads,labels:{button:wp.i18n.__("Upload image","sharing-image"),heading:wp.i18n.__("Select default poster","sharing-image"),details:wp.i18n.__("Attachment details","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},image:!0,remove:!0,append:n});const a=[];a.push(wp.i18n.__("The default poster is used on pages where none is generated.","sharing-image")),a.push(wp.i18n.__("Best image size: 1200×630 pixels.","sharing-image")),p.element("small",{text:a.join(" "),append:n})}(a,i),function(e,t){p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_save_config"},append:e}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:Nt.nonce},append:e}),p.element("input",{attributes:{type:"hidden",name:Nt.name+"[demo]",value:t.demo||""},append:e}),p.element("button",{text:wp.i18n.__("Save changes","sharing-image"),classes:["button","button-primary"],attributes:{type:"submit"},append:e})}(a,i)}(e,t)}(n,e);break;case"tools":!function(e,t){!function(e,t){d=t;const n=e.querySelector(".sharing-image-tools");null!==n&&(function(e){const t=d.templates||[],n=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Clone template","sharing-image"),append:e}),a=p.element("p",{classes:["sharing-image-tools-warning"],text:wp.i18n.__("To initiate cloning, enable Premium and have at least one template.","sharing-image")}),i=d.license||{};if(0===t.length||!i.premium&&!i.develop)return n.appendChild(a);const o={};for(const e in t)o[e]=t[e].title||wp.i18n.__("Untitled","sharing-image");const r=p.element("form",{classes:["sharing-image-tools-control-cloning"],attributes:{action:d.links.action,method:"POST"},append:n}),s=p.select({classes:["sharing-image-tools-control-duplicator"],options:o,attributes:{name:"sharing_image_source"}},r);p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Create a copy","sharing-image"),append:s.parentNode}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_clone_template"},append:r}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:r})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Export templates","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_export_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["button","button-primary"],text:wp.i18n.__("Download backup file","sharing-image"),attributes:{href:a.href},append:n}),p.element("small",{text:wp.i18n.__("Save a local copy of all template settings for later use.","sharing-image"),append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Import templates","sharing-image"),append:e}),n=p.element("form",{classes:["sharing-image-tools-control-uploader"],attributes:{action:d.links.action,method:"POST",enctype:"multipart/form-data"},append:t});p.element("input",{classes:["sharing-image-tools-control-file"],attributes:{type:"file",name:"sharing_image_file",accept:"application/json",required:"required"},append:n}),p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Import templates","sharing-image"),append:n}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_import_templates"},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Clearing settings","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_clear_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["sharing-image-tools-delete","button"],text:wp.i18n.__("Remove posters","sharing-image"),attributes:{href:a.href},append:n}).addEventListener("click",(e=>{const t=wp.i18n.__("Are you sure you want to clear plugin data?","sharing-image");confirm(t)||e.preventDefault()})),p.element("small",{text:wp.i18n.__("This action clears post meta options but does not delete server images.","sharing-image"),append:n})}(n))}(e,t)}(n,e);break;case"premium":!function(e,t){!function(e,t){h=t,m=e.querySelector(".sharing-image-premium"),null!==m&&(p.element("div",{classes:["sharing-image-premium-warning"],append:m}),w())}(e,t)}(n,e);break;default:!function(e,n){let a=null;n.templates=n.templates||[],t.param("template")&&(a=t.param("template"));const i=n.templates[a];void 0!==i?Mt(e,n,a,i):null===a?function(e,t){u=t;const n=p.element("div",{classes:["sharing-image-catalog"],append:e});for(const e in t.templates)g(n,t.templates[e],e);!function(e,t){const n=new URL(document.location.href);n.searchParams.set("template",t);const a=p.element("a",{classes:["sharing-image-catalog-new"],attributes:{href:n.href},append:e}),i=p.element("h2",{append:a});if(p.element("strong",{text:wp.i18n.__("Add new template","sharing-image"),append:i}),0===u.templates.length)return;const o=u.license||{};o.premium||o.develop||(p.element("span",{text:wp.i18n.__("(Availible for Premium only)","sharing-image"),append:i}),u.links.premium&&(a.href=u.links.premium))}(n,t.index)}(e,n):Mt(e,n,a)}(n,e)}}()})();
     1(()=>{"use strict";let e=e=>crypto.getRandomValues(new Uint8Array(e));const t={param:function(e){return new URL(document.location.href).searchParams.get(e)},attachment:function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()},defaults:function(e,t){return t.forEach((t=>{void 0===e[t]&&(e[t]={})})),e},uniqid:function(){return((t,n=21)=>((e,t,n)=>{let a=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*a*t/e.length);return(o=t)=>{let r="";for(;;){let t=n(i),s=i;for(;s--;)if(r+=e[t[s]&a]||"",r.length===o)return r}}})(t,n,e))("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",12)()},dataget:function(e,t,n){const a=e.querySelector(`[data-${t}="${n}"]`);if(a)return a.value}},n=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},a=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("input",{attributes:{type:"text"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if("range"===i.type){const e=p.element("em",{text:i.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});i.addEventListener("change",(()=>{e.textContent=i.value})),i.addEventListener("input",(()=>{e.textContent=i.value})),e.addEventListener("click",(()=>{i.type="text"===i.type?"range":"text"}))}return i},i=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"checkbox"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return i},o=function(e,t){const a=n("label",{classes:e.classes||[],append:t}),i=n("input",{attributes:{type:"radio"},dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("checked")){const t=e.checked;t&&t===i.value&&i.setAttribute("checked","checked")}if(e.hasOwnProperty("label")){const t=n("span",{text:e.label});null!==e.label&&a.appendChild(t)}return e.hasOwnProperty("help")&&n("small",{text:e.help,append:a}),i},r=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("select",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}const o=e.options||{};for(const t in o){const a=n("option",{text:o[t],attributes:{value:t},append:i});if(e.hasOwnProperty("selected")){const t=e.selected;t&&t===a.value&&a.setAttribute("selected","selected")}}return i},s=function(e,t){const a=n("div",{classes:e.classes||[],append:t});if(e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}const i=n("textarea",{dataset:e.dataset||{},append:a});if(e.hasOwnProperty("attributes"))for(const t in e.attributes){const n=e.attributes[t];void 0!==n&&i.setAttribute(t,n)}if(e.hasOwnProperty("content")){const t=e.content;void 0!==t&&(i.innerHTML=t)}return i},l=function(e){const t=n("div",{classes:e.classes||[]});return e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")&&n("h3",{text:e.label,append:t}),e.hasOwnProperty("description")&&n("p",{text:e.description,append:t}),e.hasOwnProperty("fields")&&e.fields.forEach((e=>{switch(e.group){case"input":a(e,t);break;case"textarea":s(e,t);break;case"radio":o(e,t);break;case"select":r(e,t);break;case"checkbox":i(e,t)}})),e.hasOwnProperty("help")&&n("small",{text:e.help,append:t}),t};function c(e,t){let a=e.querySelector("figure");if(a&&e.removeChild(a),!wp.media)return;if(a=n("figure",{prepend:e}),e.querySelector("h4")&&e.insertBefore(a,e.querySelector("h4").nextSibling),!t)return;let i=a.querySelector("img");i&&a.removeChild(i),i=n("img",{append:a}),wp.media.attachment(t).fetch().then((e=>{i.src=e.sizes?.thumbnail?.url||e.url}))}const p={element:n,control:l,layer:function(e){const t=n("div",{classes:e.classes||[]});e.hasOwnProperty("append")&&e.append.appendChild(t),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(t,e.prepend.firstChild),e.hasOwnProperty("label")||(e.label="");const a=n("h2",{text:e.label,append:t});return n("span",{append:a}),e.hasOwnProperty("description")&&n("h5",{text:e.description,append:t}),t},checkbox:i,media:function(e){const a=l({classes:e.classes||[]});if(e.hasOwnProperty("append")&&e.append.appendChild(a),e.hasOwnProperty("prepend")&&e.prepend.insertBefore(a,e.prepend.firstChild),e.hasOwnProperty("label")){const t=n("h4",{text:e.label});null!==e.label&&a.appendChild(t)}e.labels=e.labels||{};const i=n("input",{attributes:{type:"hidden",name:e.name},append:a}),o=n("button",{classes:["button"],text:e.labels.button,attributes:{type:"button"},append:a}),r=n("a",{classes:["hidden"],text:e.labels.details,attributes:{target:"_blank"}});e.hasOwnProperty("link")&&a.appendChild(r),e.hasOwnProperty("help")&&n("small",{text:e.help,append:a});const s=t=>{i.setAttribute("value",t),i.dispatchEvent(new Event("change",{bubbles:!0}));let n=null;e.hasOwnProperty("link")&&(n=new URL(e.link),n.searchParams.set("item",t),r.setAttribute("href",n.href)),e.remove&&(o.textContent=e.labels.remove),e.image&&c(a,t),r.classList.remove("hidden")},p=()=>{i.setAttribute("value",""),i.dispatchEvent(new Event("change",{bubbles:!0})),o.textContent=e.labels.button,e.image&&c(a,0),r.classList.add("hidden")};return e.image&&c(a,0),e.value&&s(e.value),o.addEventListener("click",(()=>{if(e.remove&&i.value)return p();const n={title:e.labels.heading};e.hasOwnProperty("mime")&&(n.library={},n.library.type=e.mime),t.attachment(n,(e=>{s(e)}))})),a.addEventListener("set_attachment",(e=>{e.detail&&s(e.detail)})),a.addEventListener("remove_attachment",(()=>{p()})),a},input:a,textarea:s,radio:o,select:r};let d=null;let u=null;function g(e,t,n){const a=p.element("div",{classes:["sharing-image-catalog-card"],append:e}),i=p.element("figure",{classes:["sharing-image-catalog-preview"],append:a});t.preview&&p.element("img",{attributes:{src:t.preview,alt:""},append:i});const o=p.element("footer",{classes:["sharing-image-catalog-footer"],append:a});p.element("h2",{text:t.title||wp.i18n.__("Untitled","sharing-image"),append:o});const r=new URL(document.location.href);r.searchParams.set("template",n),p.element("a",{classes:["button"],text:wp.i18n.__("Edit template","sharing-image"),attributes:{href:r.href},append:o})}let h=null,m=null;function f(e,t){const n=[];switch(void 0===t&&(t=wp.i18n.__("Verification unsuccessful.","sharing-image")),n.push(t),e){case"LIMIT_EXCEEDED":n.push(wp.i18n.__("The number of licenses for this key has been exceeded.","sharing-image"));break;case"KEY_NOT_FOUND":n.push(wp.i18n.__("The Premium key is invalid or expired.","sharing-image"));break;case"SERVER_ERROR":n.push(wp.i18n.__("Unable to receive a response from the verification server.","sharing-image"))}return n.join(" ")}function v(e){const t=m.querySelector(".sharing-image-premium-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown request error.","sharing-image"))}function b(){const e=m.querySelector(".sharing-image-premium-warning");null!==e&&e.classList.remove("warning-visible")}function _(e,t){m.classList.add("premium-enabled"),t.develop?v(wp.i18n.__("Using the plugin with a development license is prohibited in production.","sharing-image")):(t.key&&function(e,t){const n=p.element("div",{classes:["sharing-image-premium-permit"],append:e});p.element("button",{classes:["sharing-image-premium-show","button"],text:wp.i18n.__("Show License key","sharing-image"),attributes:{type:"button"},append:n}).addEventListener("click",(()=>{n.classList.toggle("permit-visible")})),p.element("strong",{text:t,append:n})}(e,t.key),function(e){const t=p.element("div",{classes:["sharing-image-premium-revoke"],append:e}),n=[];n.push(wp.i18n.__("Disabling premium mode will not remove the license for this domain.","sharing-image")),n.push(wp.i18n.__("Your current key will also be saved in the plugin settings.","sharing-image")),n.push(wp.i18n.__("Use key management tool to delete the license for the site.","sharing-image")),p.element("p",{text:n.join(" "),append:t}),p.element("button",{classes:["button"],text:wp.i18n.__("Disable Premium","sharing-image"),attributes:{type:"submit"},append:t}),p.element("span",{classes:["spinner"],append:t}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_revoke_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(n.data):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e))}function w(){let e=m.querySelector(".sharing-image-premium-access");null!==e&&m.removeChild(e),e=p.element("form",{classes:["sharing-image-premium-access"],attributes:{action:"",method:"POST"},append:m}),m.classList.remove("premium-enabled"),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:h.nonce},append:e});const t=h.license||{};return t.premium||t.develop?_(e,t):function(e,t){t.error&&v(f(t.error)),p.element("strong",{text:wp.i18n.__("Do you already have a key? Enter it here","sharing-image"),append:e});const n=p.element("div",{classes:["sharing-image-premium-verify"],append:e});p.element("input",{label:wp.i18n.__("Your Premium key","sharing-image"),attributes:{type:"text",name:"sharing_image_key",value:t.key},append:n}),p.element("button",{classes:["button"],text:wp.i18n.__("Submit","sharing-image"),attributes:{type:"submit"},append:n}),p.element("span",{classes:["spinner"],append:n}),e.addEventListener("submit",(t=>{t.preventDefault(),function(e){e.classList.add("access-loader");const t=new XMLHttpRequest;t.open("POST",ajaxurl),t.responseType="json";const n=new window.FormData(e);n.set("action","sharing_image_verify_premium"),b(),t.addEventListener("load",(()=>{const n=t.response||{};return e.classList.remove("access-loader"),n.data?n.success?(h.license=n.data,void w()):v(f(n.code,n.data)):v()})),t.addEventListener("error",(()=>{v(),e.classList.remove("access-loader")})),t.send(n)}(e)}))}(e,t)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(){return S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},S.apply(this,arguments)}function D(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var t()}))}(a)};let Nt=null;!function(){if(void 0===wp)return;let e=window.sharingImageSettings||{};e=t.defaults(e,["links","fonts","config","templates","license"]);const n=document.querySelector("#sharing-image-settings .sharing-image-content");if(null!==n)switch(n.classList.add("content-visible"),t.param("tab")){case"config":!function(e,t){!function(e,t){Nt=t,Nt.name="sharing_image_config";const n=e.querySelector(".sharing-image-config");if(null===n)return;const a=p.element("form",{classes:["sharing-image-config-options"],attributes:{action:Nt.links.action,method:"POST"},append:n}),i=Nt.config||{},o=Nt.templates||[];!function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Poster image format","sharing-image"),help:wp.i18n.__("The higher the value, the less compression. Availible for JPEG only.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{jpg:wp.i18n.__("JPEG","sharing-image"),png:wp.i18n.__("PNG","sharing-image"),gif:wp.i18n.__("GIF","sharing-image")},attributes:{name:Nt.name+"[format]"},selected:t.format||"jpg"},{group:"input",classes:["sharing-image-config-control-range"],attributes:{type:"range",name:Nt.name+"[quality]",min:10,max:100,step:5,value:t.quality||"90",disabled:"disabled"},label:wp.i18n.__("Image quality","sharing-image")}],append:e}),a=n.querySelector("select"),i=n.querySelector("input");"jpg"===a.value&&(i.disabled=!1),a.addEventListener("change",(()=>{i.disabled=!0,"jpg"===a.value&&(i.disabled=!1)}))}(a,i),function(e,t,n){const a={};a[""]=wp.i18n.__("Disable auto generation","sharing-image");for(const e in n)a[e]=n[e].title||wp.i18n.__("Untitled","sharing-image");let i=t.autogenerate;void 0===i&&(i=""),p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Auto generate poster","sharing-image"),help:wp.i18n.__("This template will be applied automatically when the post is saved.","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:a,attributes:{name:Nt.name+"[autogenerate]"},selected:String(i)}],append:e})}(a,i,o),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Hide post widget","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[nowidget]",value:"nowidget"},label:wp.i18n.__("Hide the widget on the post editor page","sharing-image"),checked:t.nowidget}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control","control-extra"],label:wp.i18n.__("Header Meta Tags","sharing-image"),fields:[{group:"select",classes:["sharing-image-config-control-select"],options:{snippets:wp.i18n.__("Display Meta Tags with consideration for SEO plugins","sharing-image"),custom:wp.i18n.__("Always display Meta Tags on all pages","sharing-image"),hidden:wp.i18n.__("Hide Sharing Image Meta Tags","sharing-image")},attributes:{name:Nt.name+"[meta]"},selected:t.meta||"snippets"}],append:e});if(0===Nt.snippets.length)return n;p.element("h4",{text:wp.i18n.__("Detected SEO plugins","sharing-image"),append:n});const a=p.element("ul",{classes:["sharing-image-config-control-list"],append:n});Nt.snippets.forEach((e=>{const t=p.element("li",{append:a});p.element("a",{attributes:{href:e.link,target:"_blank",rel:"noopener"},text:e.title,append:t})}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Poster attachment","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[attachment]",value:"attachment"},label:wp.i18n.__("Save the generated poster as an attachment in the media library","sharing-image"),checked:t.attachment}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Upload directory","sharing-image"),append:e}),a=p.element("div",{classes:["sharing-image-config-control-fieldset"],append:n});p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"default"},label:wp.i18n.__("Use default uploads directory","sharing-image"),checked:t.uploads||"default"},a),p.radio({classes:["sharing-image-config-control-radio"],attributes:{name:Nt.name+"[uploads]",value:"custom"},label:wp.i18n.__("Select custom storage for posters","sharing-image"),checked:t.uploads||"default"},a);const i=p.input({classes:["sharing-image-config-control-input"],attributes:{name:Nt.name+"[storage]",value:t.storage||Nt.links.storage,disabled:"disabled"}},n);p.element("small",{text:wp.i18n.__("Use a relative path from the site root. The directory should be writable.","sharing-image"),append:n}),n.querySelectorAll("input").forEach((e=>{"radio"===e.type&&(e.checked&&"custom"===e.value&&(i.disabled=!1),e.addEventListener("change",(()=>{i.disabled=!0,"custom"===e.value&&(i.disabled=!1)})))}))}(a,i),function(e,t){p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Live-reload","sharing-image"),fields:[{group:"checkbox",classes:["sharing-image-config-control-checkbox"],attributes:{name:Nt.name+"[suspend]",value:"suspend"},label:wp.i18n.__("Disable live reload on the template editor screen.","sharing-image"),checked:t.suspend}],append:e})}(a,i),function(e,t){const n=p.control({classes:["sharing-image-config-control"],label:wp.i18n.__("Default poster","sharing-image"),append:e});p.media({name:Nt.name+"[default]",classes:["sharing-image-config-control-media"],value:t.default,link:Nt.links.uploads,labels:{button:wp.i18n.__("Upload image","sharing-image"),heading:wp.i18n.__("Select default poster","sharing-image"),details:wp.i18n.__("Attachment details","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},image:!0,remove:!0,append:n});const a=[];a.push(wp.i18n.__("The default poster is used on pages where none is generated.","sharing-image")),a.push(wp.i18n.__("Best image size: 1200×630 pixels.","sharing-image")),p.element("small",{text:a.join(" "),append:n})}(a,i),function(e,t){p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_save_config"},append:e}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:Nt.nonce},append:e}),p.element("input",{attributes:{type:"hidden",name:Nt.name+"[demo]",value:t.demo||""},append:e}),p.element("button",{text:wp.i18n.__("Save changes","sharing-image"),classes:["button","button-primary"],attributes:{type:"submit"},append:e})}(a,i)}(e,t)}(n,e);break;case"tools":!function(e,t){!function(e,t){d=t;const n=e.querySelector(".sharing-image-tools");null!==n&&(function(e){const t=d.templates||[],n=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Clone template","sharing-image"),append:e}),a=p.element("p",{classes:["sharing-image-tools-warning"],text:wp.i18n.__("To initiate cloning, enable Premium and have at least one template.","sharing-image")}),i=d.license||{};if(0===t.length||!i.premium&&!i.develop)return n.appendChild(a);const o={};for(const e in t)o[e]=t[e].title||wp.i18n.__("Untitled","sharing-image");const r=p.element("form",{classes:["sharing-image-tools-control-cloning"],attributes:{action:d.links.action,method:"POST"},append:n}),s=p.select({classes:["sharing-image-tools-control-duplicator"],options:o,attributes:{name:"sharing_image_source"}},r);p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Create a copy","sharing-image"),append:s.parentNode}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_clone_template"},append:r}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:r})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Export templates","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_export_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["button","button-primary"],text:wp.i18n.__("Download backup file","sharing-image"),attributes:{href:a.href},append:n}),p.element("small",{text:wp.i18n.__("Save a local copy of all template settings for later use.","sharing-image"),append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control","control-section"],label:wp.i18n.__("Import templates","sharing-image"),append:e}),n=p.element("form",{classes:["sharing-image-tools-control-uploader"],attributes:{action:d.links.action,method:"POST",enctype:"multipart/form-data"},append:t});p.element("input",{classes:["sharing-image-tools-control-file"],attributes:{type:"file",name:"sharing_image_file",accept:"application/json",required:"required"},append:n}),p.element("button",{classes:["button","button-primary"],attributes:{type:"submit"},text:wp.i18n.__("Import templates","sharing-image"),append:n}),p.element("input",{attributes:{type:"hidden",name:"action",value:"sharing_image_import_templates"},append:n}),p.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:d.nonce},append:n})}(n),function(e){const t=p.control({classes:["sharing-image-tools-control"],label:wp.i18n.__("Clearing settings","sharing-image"),append:e}),n=p.element("div",{classes:["sharing-image-tools-control-fieldset"],append:t}),a=new URL(d.links.action);a.searchParams.set("action","sharing_image_clear_templates"),a.searchParams.set("nonce",d.nonce),p.element("a",{classes:["sharing-image-tools-delete","button"],text:wp.i18n.__("Remove posters","sharing-image"),attributes:{href:a.href},append:n}).addEventListener("click",(e=>{const t=wp.i18n.__("Are you sure you want to clear plugin data?","sharing-image");confirm(t)||e.preventDefault()})),p.element("small",{text:wp.i18n.__("This action clears post meta options but does not delete server images.","sharing-image"),append:n})}(n))}(e,t)}(n,e);break;case"premium":!function(e,t){!function(e,t){h=t,m=e.querySelector(".sharing-image-premium"),null!==m&&(p.element("div",{classes:["sharing-image-premium-warning"],append:m}),w())}(e,t)}(n,e);break;default:!function(e,n){let a=null;n.templates=n.templates||[],t.param("template")&&(a=t.param("template"));const i=n.templates[a];void 0!==i?Mt(e,n,a,i):null===a?function(e,t){u=t;const n=p.element("div",{classes:["sharing-image-catalog"],append:e});for(const e in t.templates)g(n,t.templates[e],e);!function(e,t){const n=new URL(document.location.href);n.searchParams.set("template",t);const a=p.element("a",{classes:["sharing-image-catalog-new"],attributes:{href:n.href},append:e}),i=p.element("h2",{append:a});if(p.element("strong",{text:wp.i18n.__("Add new template","sharing-image"),append:i}),0===u.templates.length)return;const o=u.license||{};o.premium||o.develop||(p.element("span",{text:wp.i18n.__("(Availible for Premium only)","sharing-image"),append:i}),u.links.premium&&(a.href=u.links.premium))}(n,t.index)}(e,n):Mt(e,n,a)}(n,e)}}()})();
  • sharing-image/trunk/assets/widget/index.asset.php

    r3108262 r3113737  
    1 <?php return array('dependencies' => array(), 'version' => '09c1a1a4fd3ac8bd8113');
     1<?php return array('dependencies' => array(), 'version' => '');
  • sharing-image/trunk/assets/widget/index.js

    r3108262 r3113737  
    1 (()=>{"use strict";const e=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},t=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("input",{attributes:{type:"text"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if("range"===s.type){const e=d.element("em",{text:s.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});s.addEventListener("change",(()=>{e.textContent=s.value})),s.addEventListener("input",(()=>{e.textContent=s.value})),e.addEventListener("click",(()=>{s.type="text"===s.type?"range":"text"}))}return s},n=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"checkbox"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return s},a=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"radio"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return t.hasOwnProperty("help")&&e("small",{text:t.help,append:a}),s},s=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("select",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}const i=t.options||{};for(const n in i){const a=e("option",{text:i[n],attributes:{value:n},append:s});if(t.hasOwnProperty("selected")){const e=t.selected;e&&e===a.value&&a.setAttribute("selected","selected")}}return s},i=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("textarea",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("content")){const e=t.content;void 0!==e&&(s.innerHTML=e)}return s},r=function(r){const l=e("div",{classes:r.classes||[]});return r.hasOwnProperty("append")&&r.append.appendChild(l),r.hasOwnProperty("prepend")&&r.prepend.insertBefore(l,r.prepend.firstChild),r.hasOwnProperty("label")&&e("h3",{text:r.label,append:l}),r.hasOwnProperty("description")&&e("p",{text:r.description,append:l}),r.hasOwnProperty("fields")&&r.fields.forEach((e=>{switch(e.group){case"input":t(e,l);break;case"textarea":i(e,l);break;case"radio":a(e,l);break;case"select":s(e,l);break;case"checkbox":n(e,l)}})),r.hasOwnProperty("help")&&e("small",{text:r.help,append:l}),l};const l=function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()};function o(t,n){let a=t.querySelector("figure");if(a&&t.removeChild(a),!wp.media)return;if(a=e("figure",{prepend:t}),t.querySelector("h4")&&t.insertBefore(a,t.querySelector("h4").nextSibling),!n)return;let s=a.querySelector("img");s&&a.removeChild(s),s=e("img",{append:a}),wp.media.attachment(n).fetch().then((e=>{s.src=e.sizes?.thumbnail?.url||e.url}))}const d={element:e,control:r,layer:function(t){const n=e("div",{classes:t.classes||[]});t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")||(t.label="");const a=e("h2",{text:t.label,append:n});return e("span",{append:a}),t.hasOwnProperty("description")&&e("h5",{text:t.description,append:n}),n},checkbox:n,media:function(t){const n=r({classes:t.classes||[]});if(t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")){const a=e("h4",{text:t.label});null!==t.label&&n.appendChild(a)}t.labels=t.labels||{};const a=e("input",{attributes:{type:"hidden",name:t.name},append:n}),s=e("button",{classes:["button"],text:t.labels.button,attributes:{type:"button"},append:n}),i=e("a",{classes:["hidden"],text:t.labels.details,attributes:{target:"_blank"}});t.hasOwnProperty("link")&&n.appendChild(i),t.hasOwnProperty("help")&&e("small",{text:t.help,append:n});const d=e=>{a.setAttribute("value",e),a.dispatchEvent(new Event("change",{bubbles:!0}));let r=null;t.hasOwnProperty("link")&&(r=new URL(t.link),r.searchParams.set("item",e),i.setAttribute("href",r.href)),t.remove&&(s.textContent=t.labels.remove),t.image&&o(n,e),i.classList.remove("hidden")},c=()=>{a.setAttribute("value",""),a.dispatchEvent(new Event("change",{bubbles:!0})),s.textContent=t.labels.button,t.image&&o(n,0),i.classList.add("hidden")};return t.image&&o(n,0),t.value&&d(t.value),s.addEventListener("click",(()=>{if(t.remove&&a.value)return c();const e={title:t.labels.heading};t.hasOwnProperty("mime")&&(e.library={},e.library.type=t.mime),l(e,(e=>{d(e)}))})),n.addEventListener("set_attachment",(e=>{e.detail&&d(e.detail)})),n.addEventListener("remove_attachment",(()=>{c()})),n},input:t,textarea:i,radio:a,select:s};let c=null,p=null;function u(e){const t=p.querySelector(".sharing-image-widget-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown generation error","sharing-image"))}function m(e,t,n){const a=document.getElementById(t);if(null===a)return;const s=()=>{"manual"!==n.source.mode&&(e.value=a.value)};a.addEventListener("input",s),e.addEventListener("input",(()=>{a.removeEventListener("input",s)})),s()}function h(e,t,n,a){const s=d.textarea({classes:["sharing-image-widget-text"],label:t.title||null,attributes:{name:c.name.fieldset+`[${n}]`}},e);s.value=a.fieldset[n]||"","post"===c.context&&("title"===t.preset&&m(s,"title",a),"excerpt"===t.preset&&m(s,"excerpt",a),"categories"===t.preset&&function(e,t){const n=document.getElementById("categorychecklist");if(!n)return;const a=c.separator||", ",s=()=>{const s=[];"manual"!==t.source.mode&&(n.querySelectorAll("input:checked").forEach((e=>{e.parentNode?.textContent&&s.push(e.parentNode.textContent.trim())})),e.value=s.join(a))};s(),n.addEventListener("change",s)}(s,a),"tags"===t.preset&&function(e,t){const n=document.querySelector("#post_tag .tagchecklist");if(!n||!MutationObserver)return;const a=c.separator||", ",s=()=>{const n=document.getElementById("tax-input-post_tag");if(!n)return;if("manual"===t.source.mode)return;const s=n.value.split(",");e.value=s.join(a)};s(),new MutationObserver(s).observe(n,{childList:!0})}(s,a))}function g(e,t,n,a){const s=d.media({name:c.name.fieldset+`[${n}]`,classes:["sharing-image-widget-image"],label:t.title||null,value:a.fieldset[n]||"",labels:{button:wp.i18n.__("Set layer image","sharing-image"),heading:wp.i18n.__("Select image","sharing-image"),details:wp.i18n.__("Attachment","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},mime:["image/png","image/jpeg","image/gif","image/webp"],image:!0,remove:!0,append:e});"post"===c.context&&"featured"===t.preset&&function(e,t){const n=wp.media?.featuredImage?.frame();n&&n.on("select",(()=>{if("manual"===t.source.mode)return;const a=n.state().get("selection").first().toJSON();a.id&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:a.id}))}));const a=document.getElementById("postimagediv");if(!a)return;if(a.addEventListener("click",(n=>{"manual"!==t.source.mode&&"remove-post-thumbnail"===n.target.id&&e.dispatchEvent(new CustomEvent("remove_attachment"))})),"manual"===t.source.mode)return;const s=a.querySelector("#_thumbnail_id");if(!s)return;const i=parseInt(s.value);i>0&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:i}))}(s,a)}function b(e){const t=d.element("div",{classes:["sharing-image-widget-manager"],append:e});!function(e){d.element("button",{classes:["sharing-image-widget-generate","button"],text:wp.i18n.__("Generate","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{!function(){const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="json",p.classList.add("widget-loader");const t=new window.FormData;t.set("action","sharing_image_generate"),p.querySelectorAll("[name]").forEach((e=>{t.append(e.name,e.value)})),function(){const e=p.querySelector(".sharing-image-widget-warning");null!==e&&e.classList.remove("warning-visible")}();const n=p.querySelector(".sharing-image-widget-poster");e.addEventListener("load",(()=>{const t=e.response||{};if(p.classList.remove("widget-loader","widget-auto"),!t.data)return u();if(!t.success)return u(t.data);c.meta.source=t.data;for(const e in t.data)n.querySelectorAll("input").forEach((n=>{c.name.source+"["+e+"]"===n.name&&(n.value=t.data[e])}));let a=n.querySelector("img");null===a&&(a=d.element("img",{append:n})),a.src=t.data.poster,"auto"===t.data.mode&&p.classList.add("widget-auto"),p.classList.add("widget-visible")})),e.addEventListener("error",(()=>{u(),p.classList.remove("widget-loader")})),e.send(t)}()}))}(t),function(e){d.element("button",{classes:["sharing-image-widget-delete","button","button-delete"],text:wp.i18n.__("Remove","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{const e=p.querySelector(".sharing-image-widget-poster img");if(null===e)return;const t=e.parentNode;t.removeChild(e),t.querySelectorAll("input").forEach((e=>{e.value="",e.name===c.name.source+"[mode]"&&(e.value="manual")})),p.classList.remove("widget-visible")}))}(t),d.element("span",{classes:["sharing-image-widget-spinner","spinner"],append:t})}void 0!==wp&&(c=window.sharingImageWidget||{},p=document.querySelector(".sharing-image-widget"),p&&function(){for(;p.firstChild;)p.removeChild(p.lastChild);c.context&&p.classList.add(`widget-${c.context}`);const e=c.meta||{};!function(e){const t=d.element("div",{classes:["sharing-image-widget-poster"],append:p});d.element("span",{classes:["sharing-image-widget-mode"],attributes:{title:wp.i18n.__("Poster was generated automatically and will update on post saving.","sharing-image")},append:t}),"auto"===e.source.mode&&p.classList.add("widget-auto"),e.source.poster&&(d.element("img",{attributes:{src:e.source.poster,alt:""},append:t}),p.classList.add("widget-visible")),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[poster]",value:e.source.poster||""},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[width]",value:e.source.width},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[height]",value:e.source.height},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[mode]",value:e.source.mode},append:t})}(e);const t=function(e){if(Object.keys(c.templates).length<1)return;const t=d.element("div",{classes:["sharing-image-widget-designer"]});let n=e.source.template||null;c.templates[n]||(n=Object.keys(c.templates)[0]),function(e,t){const n={};for(const e in c.templates)n[e]=c.templates[e]?.title||wp.i18n.__("Untitled","sharing-image");const a=d.select({classes:["sharing-image-widget-template"],options:n,attributes:{name:c.name.source+"[template]"},selected:String(t)},e);a.addEventListener("change",(()=>{const t=e.querySelectorAll(".sharing-image-widget-fieldset");for(let e=0;e<t.length;e++){const n=t[e];n.classList.remove("fieldset-visible"),n.dataset.index===a.value&&n.classList.add("fieldset-visible")}}))}(t,n);for(const a in c.templates){const s=c.templates[a],i=d.element("div",{classes:["sharing-image-widget-fieldset"],dataset:{index:a},append:t});a===n&&i.classList.add("fieldset-visible");const r=s.layers||{};for(const t in r){const n=r[t];if(n.dynamic)switch(n.type){case"text":h(i,n,t,e);break;case"image":g(i,n,t,e)}}}return p.appendChild(t),t}(e);d.element("div",{classes:["sharing-image-widget-warning"],append:t}),b(t),d.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:c.nonce},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_screen",value:c.screen},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_context",value:c.context},append:p}),function(e){e.poster&&(e.width&&e.height||u(wp.i18n.__("Image sizes are not set. Regenerate the poster.","sharing-image")))}(e)}())})();
     1(()=>{"use strict";const e=function(e,t={}){const n=document.createElement(e);if(t.hasOwnProperty("classes")&&t.classes.forEach((e=>{n.classList.add(e)})),t.hasOwnProperty("text")&&(n.textContent=t.text),t.hasOwnProperty("html")&&(n.innerHTML=t.html),t.hasOwnProperty("attributes"))for(const e in t.attributes){const a=t.attributes[e];void 0!==a&&n.setAttribute(e,a)}if(t.hasOwnProperty("dataset"))for(const e in t.dataset)n.setAttribute("data-"+e,t.dataset[e]);return t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),n},t=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("input",{attributes:{type:"text"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if("range"===s.type){const e=d.element("em",{text:s.value,attributes:{title:wp.i18n.__("Click to change the input view.","sharing-image")},append:a});s.addEventListener("change",(()=>{e.textContent=s.value})),s.addEventListener("input",(()=>{e.textContent=s.value})),e.addEventListener("click",(()=>{s.type="text"===s.type?"range":"text"}))}return s},n=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"checkbox"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return s},a=function(t,n){const a=e("label",{classes:t.classes||[],append:n}),s=e("input",{attributes:{type:"radio"},dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("checked")){const e=t.checked;e&&e===s.value&&s.setAttribute("checked","checked")}if(t.hasOwnProperty("label")){const n=e("span",{text:t.label});null!==t.label&&a.appendChild(n)}return t.hasOwnProperty("help")&&e("small",{text:t.help,append:a}),s},s=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("select",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}const i=t.options||{};for(const n in i){const a=e("option",{text:i[n],attributes:{value:n},append:s});if(t.hasOwnProperty("selected")){const e=t.selected;e&&e===a.value&&a.setAttribute("selected","selected")}}return s},i=function(t,n){const a=e("div",{classes:t.classes||[],append:n});if(t.hasOwnProperty("label")){const n=e("h4",{text:t.label});null!==t.label&&a.appendChild(n)}const s=e("textarea",{dataset:t.dataset||{},append:a});if(t.hasOwnProperty("attributes"))for(const e in t.attributes){const n=t.attributes[e];void 0!==n&&s.setAttribute(e,n)}if(t.hasOwnProperty("content")){const e=t.content;void 0!==e&&(s.innerHTML=e)}return s},r=function(r){const l=e("div",{classes:r.classes||[]});return r.hasOwnProperty("append")&&r.append.appendChild(l),r.hasOwnProperty("prepend")&&r.prepend.insertBefore(l,r.prepend.firstChild),r.hasOwnProperty("label")&&e("h3",{text:r.label,append:l}),r.hasOwnProperty("description")&&e("p",{text:r.description,append:l}),r.hasOwnProperty("fields")&&r.fields.forEach((e=>{switch(e.group){case"input":t(e,l);break;case"textarea":i(e,l);break;case"radio":a(e,l);break;case"select":s(e,l);break;case"checkbox":n(e,l)}})),r.hasOwnProperty("help")&&e("small",{text:r.help,append:l}),l};const l=function(e,t){if(e.hasOwnProperty("multiple")||(e.multiple=!1),!wp.media)return;const n=wp.media(e);n.on("select",(()=>{const e=n.state().get("selection").first().toJSON();e.id&&t(e.id)})),n.open()};function o(t,n){let a=t.querySelector("figure");if(a&&t.removeChild(a),!wp.media)return;if(a=e("figure",{prepend:t}),t.querySelector("h4")&&t.insertBefore(a,t.querySelector("h4").nextSibling),!n)return;let s=a.querySelector("img");s&&a.removeChild(s),s=e("img",{append:a}),wp.media.attachment(n).fetch().then((e=>{s.src=e.sizes?.thumbnail?.url||e.url}))}const d={element:e,control:r,layer:function(t){const n=e("div",{classes:t.classes||[]});t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")||(t.label="");const a=e("h2",{text:t.label,append:n});return e("span",{append:a}),t.hasOwnProperty("description")&&e("h5",{text:t.description,append:n}),n},checkbox:n,media:function(t){const n=r({classes:t.classes||[]});if(t.hasOwnProperty("append")&&t.append.appendChild(n),t.hasOwnProperty("prepend")&&t.prepend.insertBefore(n,t.prepend.firstChild),t.hasOwnProperty("label")){const a=e("h4",{text:t.label});null!==t.label&&n.appendChild(a)}t.labels=t.labels||{};const a=e("input",{attributes:{type:"hidden",name:t.name},append:n}),s=e("button",{classes:["button"],text:t.labels.button,attributes:{type:"button"},append:n}),i=e("a",{classes:["hidden"],text:t.labels.details,attributes:{target:"_blank"}});t.hasOwnProperty("link")&&n.appendChild(i),t.hasOwnProperty("help")&&e("small",{text:t.help,append:n});const d=e=>{a.setAttribute("value",e),a.dispatchEvent(new Event("change",{bubbles:!0}));let r=null;t.hasOwnProperty("link")&&(r=new URL(t.link),r.searchParams.set("item",e),i.setAttribute("href",r.href)),t.remove&&(s.textContent=t.labels.remove),t.image&&o(n,e),i.classList.remove("hidden")},c=()=>{a.setAttribute("value",""),a.dispatchEvent(new Event("change",{bubbles:!0})),s.textContent=t.labels.button,t.image&&o(n,0),i.classList.add("hidden")};return t.image&&o(n,0),t.value&&d(t.value),s.addEventListener("click",(()=>{if(t.remove&&a.value)return c();const e={title:t.labels.heading};t.hasOwnProperty("mime")&&(e.library={},e.library.type=t.mime),l(e,(e=>{d(e)}))})),n.addEventListener("set_attachment",(e=>{e.detail&&d(e.detail)})),n.addEventListener("remove_attachment",(()=>{c()})),n},input:t,textarea:i,radio:a,select:s};let c=null,p=null;function u(e){const t=p.querySelector(".sharing-image-widget-warning");null!==t&&(t.classList.add("warning-visible"),t.textContent=e||wp.i18n.__("Unknown generation error","sharing-image"))}function m(e,t,n){const a=document.getElementById(t);if(null===a)return;const s=()=>{"manual"!==n.source.mode&&(e.value=a.value)};a.addEventListener("input",s),e.addEventListener("input",(()=>{a.removeEventListener("input",s)})),s()}function h(e,t,n,a){const s=d.textarea({classes:["sharing-image-widget-text"],label:t.title||null,attributes:{name:c.name.fieldset+`[${n}]`}},e);s.value=a.fieldset[n]||"","post"===c.context&&("title"===t.preset&&m(s,"title",a),"excerpt"===t.preset&&m(s,"excerpt",a),"categories"===t.preset&&function(e,t){const n=document.getElementById("categorychecklist");if(!n)return;const a=c.separator||", ",s=()=>{const s=[];"manual"!==t.source.mode&&(n.querySelectorAll("input:checked").forEach((e=>{e.parentNode?.textContent&&s.push(e.parentNode.textContent.trim())})),e.value=s.join(a))};s(),n.addEventListener("change",s)}(s,a),"tags"===t.preset&&function(e,t){const n=document.querySelector("#post_tag .tagchecklist");if(!n||!MutationObserver)return;const a=c.separator||", ",s=()=>{const n=document.getElementById("tax-input-post_tag");if(!n)return;if("manual"===t.source.mode)return;const s=n.value.split(",");e.value=s.join(a)};s(),new MutationObserver(s).observe(n,{childList:!0})}(s,a))}function g(e,t,n,a){const s=d.media({name:c.name.fieldset+`[${n}]`,classes:["sharing-image-widget-image"],label:t.title||null,value:a.fieldset[n]||"",labels:{button:wp.i18n.__("Set layer image","sharing-image"),heading:wp.i18n.__("Select image","sharing-image"),details:wp.i18n.__("Attachment","sharing-image"),remove:wp.i18n.__("Remove image","sharing-image")},mime:["image/png","image/jpeg","image/gif","image/webp"],image:!0,remove:!0,append:e});"post"===c.context&&"featured"===t.preset&&function(e,t){const n=wp.media?.featuredImage?.frame();n&&n.on("select",(()=>{if("manual"===t.source.mode)return;const a=n.state().get("selection").first().toJSON();a.id&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:a.id}))}));const a=document.getElementById("postimagediv");if(!a)return;if(a.addEventListener("click",(n=>{"manual"!==t.source.mode&&"remove-post-thumbnail"===n.target.id&&e.dispatchEvent(new CustomEvent("remove_attachment"))})),"manual"===t.source.mode)return;const s=a.querySelector("#_thumbnail_id");if(!s)return;const i=parseInt(s.value);i>0&&e.dispatchEvent(new CustomEvent("set_attachment",{detail:i}))}(s,a)}function b(e){const t=d.element("div",{classes:["sharing-image-widget-manager"],append:e});!function(e){d.element("button",{classes:["sharing-image-widget-generate","button"],text:wp.i18n.__("Generate","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{!function(){const e=new XMLHttpRequest;e.open("POST",ajaxurl),e.responseType="json",p.classList.add("widget-loader");const t=new window.FormData;t.set("action","sharing_image_generate"),p.querySelectorAll("[name]").forEach((e=>{t.append(e.name,e.value)})),function(){const e=p.querySelector(".sharing-image-widget-warning");null!==e&&e.classList.remove("warning-visible")}();const n=p.querySelector(".sharing-image-widget-poster");e.addEventListener("load",(()=>{const t=e.response||{};if(p.classList.remove("widget-loader","widget-auto"),!t.data)return u();if(!t.success)return u(t.data);c.meta.source=t.data;for(const e in t.data)n.querySelectorAll("input").forEach((n=>{c.name.source+"["+e+"]"===n.name&&(n.value=t.data[e])}));let a=n.querySelector("img");null===a&&(a=d.element("img",{append:n})),a.src=t.data.poster,"auto"===t.data.mode&&p.classList.add("widget-auto"),p.classList.add("widget-visible")})),e.addEventListener("error",(()=>{u(),p.classList.remove("widget-loader")})),e.send(t)}()}))}(t),function(e){d.element("button",{classes:["sharing-image-widget-delete","button","button-delete"],text:wp.i18n.__("Remove","sharing-image"),attributes:{type:"button"},append:e}).addEventListener("click",(()=>{const e=p.querySelector(".sharing-image-widget-poster img");if(null===e)return;const t=e.parentNode;t.removeChild(e),t.querySelectorAll("input").forEach((e=>{e.value="",e.name===c.name.source+"[mode]"&&(e.value="manual")})),p.classList.remove("widget-visible")}))}(t),d.element("span",{classes:["sharing-image-widget-spinner","spinner"],append:t})}void 0!==wp&&(c=window.sharingImageWidget||{},p=document.querySelector(".sharing-image-widget"),p&&function(){for(;p.firstChild;)p.removeChild(p.lastChild);c.context&&p.classList.add(`widget-${c.context}`);const e=c.meta||{};!function(e){const t=d.element("div",{classes:["sharing-image-widget-poster"],append:p});d.element("span",{classes:["sharing-image-widget-mode"],attributes:{title:wp.i18n.__("Poster was generated automatically and will update on post saving.","sharing-image")},append:t}),"auto"===e.source.mode&&p.classList.add("widget-auto"),e.source.poster&&(d.element("img",{attributes:{src:e.source.poster,alt:""},append:t}),p.classList.add("widget-visible")),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[poster]",value:e.source.poster||""},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[width]",value:e.source.width},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[height]",value:e.source.height},append:t}),d.element("input",{attributes:{type:"hidden",name:c.name.source+"[mode]",value:e.source.mode},append:t})}(e);const t=function(e){if(Object.keys(c.templates).length<1)return;const t=d.element("div",{classes:["sharing-image-widget-designer"]});let n=e.source.template||null;c.templates[n]||(n=Object.keys(c.templates)[0]),function(e,t){const n={};for(const e in c.templates)n[e]=c.templates[e]?.title||wp.i18n.__("Untitled","sharing-image");const a=d.select({classes:["sharing-image-widget-template"],options:n,attributes:{name:c.name.source+"[template]"},selected:String(t)},e);a.addEventListener("change",(()=>{const t=e.querySelectorAll(".sharing-image-widget-fieldset");for(let e=0;e<t.length;e++){const n=t[e];n.classList.remove("fieldset-visible"),n.dataset.index===a.value&&n.classList.add("fieldset-visible")}}))}(t,n);for(const a in c.templates){const s=c.templates[a],i=d.element("div",{classes:["sharing-image-widget-fieldset"],dataset:{index:a},append:t});a===n&&i.classList.add("fieldset-visible");const r=s.layers||{};for(const t in r){const n=r[t];if(n.dynamic)switch(n.type){case"text":h(i,n,t,e);break;case"image":g(i,n,t,e)}}}return p.appendChild(t),t}(e);d.element("div",{classes:["sharing-image-widget-warning"],append:t}),b(t),d.element("input",{attributes:{type:"hidden",name:"sharing_image_nonce",value:c.nonce},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_screen",value:c.screen},append:p}),d.element("input",{attributes:{type:"hidden",name:"sharing_image_context",value:c.context},append:p}),function(e){e.poster&&(e.width&&e.height||u(wp.i18n.__("Image sizes are not set. Regenerate the poster.","sharing-image")))}(e)}())})();
  • sharing-image/trunk/classes/class-generator.php

    r3109241 r3113737  
    338338
    339339        // Prepare common layer args.
    340         $args = self::prepare_args( $layer, array( 'x', 'y' ) );
     340        $args = self::prepare_args( $layer, array( 'x', 'y' ) );
    341341
    342342        // Create new editor  instance by attachment id.
     
    536536     */
    537537    private static function update_layer_dimensions( $layer, $poster ) {
    538         if ( ! isset( $layer['width'], $layer['height'] ) ) {
    539             return $layer;
     538        if ( ! isset( $layer['width'] ) ) {
     539            $layer['width'] = 0;
     540        }
     541
     542        if ( ! isset( $layer['height'] ) ) {
     543            $layer['height'] = 0;
    540544        }
    541545
    542546        $width = absint( $poster->width() );
    543547
    544         if ( $layer['width'] < 0 ) {
     548        if ( $layer['width'] < 0 ) {
    545549            $layer['width'] = $width + $layer['width'] - $layer['x'];
    546550        }
     
    548552        $height = absint( $poster->height() );
    549553
    550         if ( $layer['height'] < 0 ) {
     554        if ( $layer['height'] < 0 ) {
    551555            $layer['height'] = $height + $layer['height'] - $layer['y'];
    552556        }
  • sharing-image/trunk/classes/class-templates.php

    r3108262 r3113737  
    230230
    231231    /**
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
    232253     * Check unique template index.
    233254     *
     
    490511        }
    491512
     513
     514
     515
     516
     517
     518
     519
     520
     521
     522
    492523        $sizes = array( 'x', 'y', 'width', 'height' );
    493524
     
    534565        }
    535566
     567
     568
     569
     570
     571
     572
     573
     574
     575
     576
    536577        $sizes = array( 'x', 'y', 'width', 'height' );
    537578
     
    657698
    658699        if ( isset( $layer['opacity'] ) ) {
    659             $opacity = (float) $layer['opacity'];
    660 
    661             if ( $opacity >= 0 && $opacity <= 100 ) {
     700            $opacity = ;
     701
     702            if ( $opacity <= 100 ) {
    662703                $sanitized['opacity'] = $opacity;
    663704            }
  • sharing-image/trunk/classes/class-widget.php

    r3109241 r3113737  
    5656
    5757        // Try to autogenerate poster if it is needed.
    58         add_action( 'wp_after_insert_post', array( __CLASS__, 'autogenerate_poster' ), 20, 3 );
     58        add_action( 'wp_after_insert_post', array( __CLASS__, 'autogenerate_poster' ), 20, );
    5959    }
    6060
     
    590590     * @param int    $post_id Updated post_id.
    591591     * @param object $post Updated post object.
    592      * @param bool   $update Whether this is an existing post being updated.
    593      */
    594     public static function autogenerate_poster( $post_id, $post, $update ) {
     592     */
     593    public static function autogenerate_poster( $post_id, $post ) {
    595594        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
    596595            return;
    597596        }
    598597
    599         if ( ! $update ) {
    600             return;
    601         }
    602 
    603598        if ( wp_is_post_revision( $post_id ) ) {
    604599            return;
     
    609604        }
    610605
    611         if ( 'trash' === $post->post_status ) {
     606        if ( 'trash' === $post->post_status ) {
    612607            return;
    613608        }
     
    625620        $index = Config::get_autogenerate_index();
    626621
    627         if ( empty( $index ) ) {
     622        if ( ( $index ) ) {
    628623            return;
    629624        }
     
    650645        $result = self::generate_poster( $fieldset, $index, $post_id, 'post', true );
    651646
     647
     648
     649
     650
    652651        $result['template'] = $index;
    653652
     
    661660         */
    662661        $result = apply_filters( 'sharing_image_autogenerated_poster', $result, $post_id );
    663 
    664         if ( is_wp_error( $result ) ) {
    665             return;
    666         }
    667662
    668663        update_post_meta( $post_id, self::META_SOURCE, $result );
     
    733728    private static function create_script_object( $context, $screen_id ) {
    734729        $object = array(
    735             'nonce'     => wp_create_nonce( self::WIDGET_NONCE ),
    736             'context'   => $context,
    737             'screen'    => $screen_id,
    738 
    739             'name'      => array(
     730            'nonce'     => wp_create_nonce( self::WIDGET_NONCE ),
     731            'context'   => $context,
     732            'screen'    => $screen_id,
     733
     734            'name'      => array(
    740735                'source'   => self::META_SOURCE,
    741736                'fieldset' => self::META_FIELDSET,
    742737            ),
    743             'links'     => array(
     738            'links'     => array(
    744739                'uploads' => esc_url( admin_url( 'upload.php' ) ),
    745740            ),
    746             'templates' => Templates::get_templates(),
     741            'templates'    => Templates::get_templates(),
     742            'autogenerate' => Config::get_autogenerate_index(),
    747743        );
    748744
  • sharing-image/trunk/readme.txt

    r3109241 r3113737  
    55Requires at least: 5.3
    66Tested up to: 6.5
    7 Stable tag: 3.1
     7Stable tag: 3.
    88Requires PHP: 5.5
    99License: GPLv2 or later
     
    3030
    3131== Changelog ==
     32
     33
     34
     35
     36
     37
    3238
    3339= 3.1 =
  • sharing-image/trunk/sharing-image.php

    r3109241 r3113737  
    33 * Plugin Name:       Sharing Image
    44 * Description:       Create sharing image for Facebook, VK.com, Telegram and other social networks
    5  * Version:           3.1
     5 * Version:           3.
    66 * Requires at least: 5.3
    77 * Requires PHP:      5.6
     
    2525 * Plugin version.
    2626 */
    27 define( 'SHARING_IMAGE_VERSION', '3.1' );
     27define( 'SHARING_IMAGE_VERSION', '3.' );
    2828
    2929/**
  • sharing-image/trunk/vendor/antonlukin/poster-editor/README.md

    r3108262 r3113737  
    6565Paste a given image source over the current image with an optional position.
    6666First param can be binary data or path to file or another class instance.
    67 Options is an array of x/y relative offset coords from top left corner. By default image will be centered.
     67Options is an array of x/y relative offset coords from top left corner and opacity from 0 to 100, where 0 is no transparency.
     68By default image will be centered.
    6869
    6970### canvas
     
    219220- **color**: Color of text. Can be rgb-array or '#ffffff' format.
    220221- **lineheight**: Line height of text.
    221 - **opacity**: Text opacity from 0 to 100.
     222- **opacity**: Text opacity from 0 to 100.
    222223- **horizontal**: Horizontal alignment. Can be left/right/center/justify.
    223224- **vertical**: Vertical alginment. Can be top/center/bottom/justify.
     
    261262        'lineheight' => 1.75,
    262263        'color'      => '#ffffff',
    263         'opacity'    => 1,
     264        'opacity'    => ,
    264265        'debug'      => true,
    265266    )
     
    290291        'lineheight' => 1.5,
    291292        'color'      => '#ffffff',
    292         'opacity'    => 1,
     293        'opacity'    => ,
    293294        'debug'      => true,
    294295    )
  • sharing-image/trunk/vendor/antonlukin/poster-editor/composer.json

    r3108262 r3113737  
    11{
    22    "name": "antonlukin/poster-editor",
    3     "version": "5.13",
     3    "version": "5.1",
    44    "description": "Wrapper for PHP's GD Library for easy image manipulation",
    55    "keywords": ["php", "image", "text", "gd"],
  • sharing-image/trunk/vendor/antonlukin/poster-editor/src/PosterEditor.php

    r3108262 r3113737  
    2424  * @author   Anton Lukin <anton@lukin.me>
    2525  * @license  MIT License (http://www.opensource.org/licenses/mit-license.php)
    26   * @version  Release: 5.13
     26  * @version  Release: 5.1
    2727  * @link     https://github.com/antonlukin/poster-editor
    2828  */
     
    126126     *
    127127     * @param string $data     Binary data or path to file or another class instance.
    128      * @param array  $options  List of x/y relative offset coords from top left corner. Default: centered.
     128     * @param array  $options  List of x/y relative offset coords from top left corner. Default: centered.
    129129     * @param array  $boundary Optional. Actual dimensions of the drawn image.
    130130     *
     
    136136            'x' => null,
    137137            'y' => null,
     138
    138139        );
    139140
     
    155156        list($width, $height, $type, $source) = $image;
    156157
     158
     159
     160
    157161        $options = $this->calcPosition($options, $width, $height);
    158162
    159         imagecopyresampled($this->resource, $source, $options['x'], $options['y'], 0, 0, $width, $height, $width, $height);
     163        $this->copyMergeAlpha($this->resource, $source, $options['x'], $options['y'], 0, 0, $width, $height, $opacity);
     164
    160165        imagedestroy($source);
    161166
     
    183188        $defaults = array(
    184189            'color'   => array(0, 0, 0),
    185             'opacity' => 100,
     190            'opacity' => 0,
    186191        );
    187192
     
    745750            'color'      => array(0, 0, 0),
    746751            'lineheight' => 1.5,
    747             'opacity'    => 1,
     752            'opacity'    => ,
    748753            'horizontal' => 'left',
    749754            'vertical'   => 'top',
     
    801806            $boundary['width'] = max($width, $boundary['width']);
    802807            $boundary['height'] = $boundary['height'] + $height;
     808
     809
     810
     811
     812
     813
     814
    803815        }
    804816
     
    12431255    protected function copyResampled($source, $dx, $dy, $sx, $sy, $dw, $dh, $sw, $sh)
    12441256    {
    1245         $this->canvas($dw, $dh);
     1257        $this->canvas($dw, $dh);
    12461258
    12471259        imagecopyresampled($this->resource, $source, $dx, $dy, $sx, $sy, $dw, $dh, $sw, $sh);
     
    12491261
    12501262        return $this;
     1263
     1264
     1265
     1266
     1267
     1268
     1269
     1270
     1271
     1272
     1273
     1274
     1275
     1276
     1277
     1278
     1279
     1280
     1281
     1282
     1283
     1284
     1285
     1286
    12511287    }
    12521288
  • sharing-image/trunk/vendor/composer/installed.json

    r3108262 r3113737  
    33        {
    44            "name": "antonlukin/poster-editor",
    5             "version": "5.13",
    6             "version_normalized": "5.13.0.0",
     5            "version": "5.1",
     6            "version_normalized": "5.1.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/antonlukin/poster-editor.git",
    10                 "reference": "4555b454db9afb7bbb126970120a0e3f9569d3db"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/antonlukin/poster-editor/zipball/4555b454db9afb7bbb126970120a0e3f9569d3db",
    15                 "reference": "4555b454db9afb7bbb126970120a0e3f9569d3db",
     10                "reference": ""
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/antonlukin/poster-editor/zipball/",
     15                "reference": "",
    1616                "shasum": ""
    1717            },
     
    2626                "ext-gd": "to use GD library based image processing."
    2727            },
    28             "time": "2024-03-31T11:11:38+00:00",
     28            "time": "2024-08+00:00",
    2929            "type": "library",
    3030            "installation-source": "dist",
     
    5454            "support": {
    5555                "issues": "https://github.com/antonlukin/poster-editor/issues",
    56                 "source": "https://github.com/antonlukin/poster-editor/tree/v5.13"
     56                "source": "https://github.com/antonlukin/poster-editor/tree/v5.1"
    5757            },
    5858            "install-path": "../antonlukin/poster-editor"
     
    401401                "type": "git",
    402402                "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
    403                 "reference": "29488feb64b723674fe463e691a4f83682c2dd5e"
    404             },
    405             "dist": {
    406                 "type": "zip",
    407                 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/29488feb64b723674fe463e691a4f83682c2dd5e",
    408                 "reference": "29488feb64b723674fe463e691a4f83682c2dd5e",
     403                "reference": ""
     404            },
     405            "dist": {
     406                "type": "zip",
     407                "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/",
     408                "reference": "",
    409409                "shasum": ""
    410410            },
     
    430430                "ext-mbstring": "For improved results"
    431431            },
    432             "time": "2024-04-25T09:28:10+00:00",
     432            "time": "2024-0+00:00",
    433433            "default-branch": true,
    434434            "type": "phpcodesniffer-standard",
  • sharing-image/trunk/vendor/composer/installed.php

    r3108262 r3113737  
    44        'pretty_version' => 'dev-develop',
    55        'version' => 'dev-develop',
    6         'reference' => 'faa3a36c2852c7932dd682e776b2427d38d3f1b7',
     6        'reference' => 'f',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'antonlukin/poster-editor' => array(
    14             'pretty_version' => '5.13',
    15             'version' => '5.13.0.0',
    16             'reference' => '4555b454db9afb7bbb126970120a0e3f9569d3db',
     14            'pretty_version' => '5.1',
     15            'version' => '5.1.0.0',
     16            'reference' => '',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../antonlukin/poster-editor',
     
    2323            'pretty_version' => 'dev-develop',
    2424            'version' => 'dev-develop',
    25             'reference' => 'faa3a36c2852c7932dd682e776b2427d38d3f1b7',
     25            'reference' => 'f',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../../',
     
    6868            'pretty_version' => 'dev-develop',
    6969            'version' => 'dev-develop',
    70             'reference' => '29488feb64b723674fe463e691a4f83682c2dd5e',
     70            'reference' => '',
    7171            'type' => 'phpcodesniffer-standard',
    7272            'install_path' => __DIR__ . '/../wp-coding-standards/wpcs',
Note: See TracChangeset for help on using the changeset viewer.