!function(a,b){varc={};wp.media.coerce=function(a,c){returnb.isUndefined(a[c])&&!b.isUndefined(this.defaults[c])?a[c]=this.defaults[c]:"true"===a[c]?a[c]=!0:"false"===a[c]&&(a[c]=!1),a[c]},wp.media.string={props:function(a,c){vard,e,f,g,h,i=wp.media.view.settings.defaultProps;returnh=function(a){return"image"!==a.type||a.alt||(a.alt=a.caption||a.title||"",a.alt=a.alt.replace(/<\/?[^>]+>/g,""),a.alt=a.alt.replace(/[\r\n]+/g," ")),a},a=a?b.clone(a):{},c&&c.type&&(a.type=c.type),"image"===a.type&&(a=b.defaults(a||{},{align:i.align||getUserSetting("align","none"),size:i.size||getUserSetting("imgsize","medium"),url:"",classes:[]})),c?(a.title=a.title||c.title,d=a.link||i.link||getUserSetting("urlbutton","file"),"file"===d||"embed"===d?e=c.url:"post"===d?e=c.link:"custom"===d&&(e=a.linkUrl),a.linkUrl=e||"","image"===c.type?(a.classes.push("wp-image-"+c.id),g=c.sizes,f=g&&g[a.size]?g[a.size]:c,b.extend(a,b.pick(c,"align","caption","alt"),{width:f.width,height:f.height,src:f.url,captionId:"attachment_"+c.id})):"video"===c.type||"audio"===c.type?b.extend(a,b.pick(c,"title","type","icon","mime")):(a.title=a.title||c.filename,a.rel=a.rel||"attachment wp-att-"+c.id),h(a)):h(a)},link:function(a,b){varc;returna=wp.media.string.props(a,b),c={tag:"a",content:a.title,attrs:{href:a.linkUrl}},a.rel&&(c.attrs.rel=a.rel),wp.html.string(c)},audio:function(a,b){returnwp.media.string._audioVideo("audio",a,b)},video:function(a,b){returnwp.media.string._audioVideo("video",a,b)},_audioVideo:function(a,c,d){vare,f,g;returnc=wp.media.string.props(c,d),"embed"!==c.link?wp.media.string.link(c):(e={},"video"===a&&(d.image&&(e.poster=d.image.src),d.width&&(e.width=d.width),d.height&&(e.height=d.height)),b.isEmpty(d.caption)?d.meta&&d.meta.title?(e.caption="“"+d.meta.title+"”",d.meta.album&&(e.caption+=" from "+d.meta.album),d.meta.artist&&(e.caption+=" by "+d.meta.artist)):e.caption=b.isEmpty(d.description)?d.title:d.description:e.caption=d.caption,g=d.filename.split(".").pop(),b.contains(wp.media.view.settings.embedExts,g)?(e[g]=d.url,f=wp.shortcode.string({tag:a,attrs:e})):wp.media.string.link(c))},image:function(a,c){vard,e,f,g,h={};returna=wp.media.string.props(a,c),e=a.classes||[],h.src=b.isUndefined(c)?a.url:c.url,b.extend(h,b.pick(a,"width","height","alt")),a.align&&!a.caption&&e.push("align"+a.align),a.size&&e.push("size-"+a.size),h["class"]=b.compact(e).join(" "),d={tag:"img",attrs:h,single:!0},a.linkUrl&&(d={tag:"a",attrs:{href:a.linkUrl},content:d}),g=wp.html.string(d),a.caption&&(f={},h.width&&(f.width=h.width),a.captionId&&(f.id=a.captionId),a.align&&(f.align="align"+a.align),g=wp.shortcode.string({tag:"caption",attrs:f,content:g+" "+a.caption})),g}},wp.media.collection=function(a){varc={};returnb.extend(a,{coerce:wp.media.coerce,attachments:function(a){vard,e,f,g,h=a.string(),i=c[h],j=this;returndeletec[h],i?i:(d=b.defaults(a.attrs.named,this.defaults),e=b.pick(d,"orderby","order"),e.type=this.type,e.perPage=-1,void0!==d.orderby&&(d._orderByField=d.orderby),"rand"===d.orderby&&(d._orderbyRandom=!0),(!d.orderby||/^menu_order(?: ID)?$/i.test(d.orderby))&&(e.orderby="menuOrder"),d.ids?(e.post__in=d.ids.split(","),e.orderby="post__in"):d.include&&(e.post__in=d.include.split(",")),d.exclude&&(e.post__not_in=d.exclude.split(",")),e.post__in||(e.uploadedTo=d.id),g=b.omit(d,"id","ids","include","exclude","orderby","order"),b.each(this.defaults,function(a,b){g[b]=j.coerce(g,b)}),f=wp.media.query(e),f[this.tag]=newBackbone.Model(g),f)},shortcode:function(a){vard,e,f=a.props.toJSON(),g=b.pick(f,"orderby","order"),h=this;returna.type&&(g.type=a.type,deletea.type),a[this.tag]&&b.extend(g,a[this.tag].toJSON()),g.ids=a.pluck("id"),f.uploadedTo&&(g.id=f.uploadedTo),deleteg.orderby,g._orderbyRandom?g.orderby="rand":g._orderByField&&"rand"!=g._orderByField&&(g.orderby=g._orderByField),deleteg._orderbyRandom,deleteg._orderByField,g.ids&&"post__in"===g.orderby&&deleteg.orderby,b.each(this.defaults,function(a,b){g[b]=h.coerce(g,b),a===g[b]&&deleteg[b]}),d=newwp.shortcode({tag:this.tag,attrs:g,type:"single"}),e=newwp.me